init
This commit is contained in:
31
modules/Home/customSearch.php
Normal file
31
modules/Home/customSearch.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
$db=$GLOBALS['db'];
|
||||
|
||||
if($_REQUEST['query']!=""){
|
||||
|
||||
$result['fields']=[];
|
||||
if($_REQUEST['type']=='EcmProducts'){
|
||||
$query="select id,code,name from ecmproducts where deleted=0 and code like '".$_REQUEST['query']."%' limit 10";
|
||||
|
||||
$zap = $db->query($query);
|
||||
|
||||
while($dane=$db->fetchByAssoc($zap)){
|
||||
$result['fields'][]=$dane;
|
||||
}
|
||||
}
|
||||
|
||||
if($_REQUEST['type']=='EcmActions'){
|
||||
$query="select id,name from ecmactions where deleted=0 and name like '%".$_REQUEST['query']."%' limit 10";
|
||||
|
||||
$zap = $db->query($query);
|
||||
|
||||
while($dane=$db->fetchByAssoc($zap)){
|
||||
$result['fields'][]=$dane;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo json_encode($result);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user