core/api/modules/lk-new-tovar/ajax.php

18 lines
658 B
PHP
Raw Normal View History

2022-12-11 13:55:49 +05:00
<?php
if ( !$_SESSION['user_id'] ) die ( 'Кыш' );
require_once MYDIR . '/api/php/db.php';
require_once MYDIR . '/api/php/clean.php';
switch( @$_POST['act'] ) {
/* ----------------------------------------------------------------------
02.11.2022
Поиск товара по штрих коду, артикулу, названию
---------------------------------------------------------------------- */
case 'find':
$res = DB::getAll('SELECT * FROM `tovar` WHERE `artikul` LIKE "%' . Clean::str( $_POST['find'] ) . '%" OR `txt` LIKE "%' . Clean::str( $_POST['find'] ) . '%"');
echo $db->to_j($res);
break;
default:
}