18 lines
658 B
PHP
Executable File
18 lines
658 B
PHP
Executable File
<?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:
|
|
}
|