21 lines
728 B
PHP
Executable File
21 lines
728 B
PHP
Executable File
<?php
|
|
ini_set('display_errors', 0 );
|
|
$txt=$_POST['txt'];
|
|
$sql='SELECT `id`, `txt`, `tip` FROM `pages` WHERE `txt` LIKE "%' . $txt . '%" OR `artikul` LIKE "%' . $txt . '%" ORDER BY `tip`';
|
|
$massiv=$db->free_sql($sql);
|
|
function getTip($tip){
|
|
$arr['page']='Страница';
|
|
$arr['category']='Раздел';
|
|
$arr['tovar']='Товар';
|
|
$arr['tovar_cat']='Категория товара';
|
|
return $arr[$tip];
|
|
}
|
|
$count=count($massiv);
|
|
for ($i=0; $i<$count; $i++){
|
|
unset($a);
|
|
$a['page_id']=$massiv[$i]['id'];
|
|
$massiv[$i]['img']=$db->get_val('img', $a, 'fileName');
|
|
$massiv[$i]['tip']=getTip($massiv[$i]['tip']);
|
|
}
|
|
$smarty->assign('list', $massiv);//получаем дочерние категории
|
|
?>
|