l_city`)", $callBackParam["search_simple"] ). ') )'; //$q=db_query("select categoryID, `name`,`title`,`cat_h1` from ".CATEGORIES_TABLE." where (".make_serch_string( "LOWER(`name`)", $tmp ).") OR (".make_serch_string( "LOWER(`title`)", $tmp ).") or (".make_serch_string( "LOWER(`cat_h1`)", $tmp ).") order by name") // special symbol prepare $order_by_clause = "order by ".CONF_DEFAULT_SORT_ORDER.""; $sqlQuery = "select p.productID, p.categoryID, p.default_picture, p.enabled, p.pictures, p.UID, p.maps_sort, p.tpl_city as n2, IF(tplID>0, REPLACE(tp.name,'{city}',p.tpl_city),p.name) name, IF(tplID>0,tp.Price, p.Price) Price, IF(tplID>0,tp.folder_pictures,tp.folder_pictures) folder_pictures, IF(tplID>0,tp.product_code,p.product_code) product_code, IF(tplID>0,REPLACE(tp.title,'{city}',p.tpl_city),p.title) title from ".PRODUCTS_TABLE. " as p left join ".PRODUCTS_TPL_TABLE." as tp USING(tplID) $where_clause order by p.tpl_city "; //echo '$sqlQuery='.$sqlQuery; exit; $q = db_query( $sqlQuery ); $result = array(); $i = 0; while( $row = db_fetch_row($q) ) { if($row["folder_pictures"]){ $row["brif_picture"] = explode(",", $row["pictures"]); $row["brif_picture"] = $row["brif_picture"][0]; $row["pic_path"] = "/data/pictures_tpl/".$row["folder_pictures"]."/80/"; }else{ $row["pic_path"] = "/data/pictures/lmenu/"; } $row["PriceWithUnit"] = show_price($row["Price"]); $row["list_priceWithUnit"] = isset($row["list_price"]) ? show_price($row["list_price"]):"";//papush // you save (value) if(isset($row["list_price"])) $row["SavePrice"] = show_price($row["list_price"]-$row["Price"]); else $row["SavePrice"] = 0; // you save (%) //_setPictures( $row ); $row["maps_sort"] = (int)$row["maps_sort"]; //if ($row["n2"]!="")$row["name"] = $row["name"].' ��� '.$row["n2"]; $row["strlen"]=strlen($row["name"]); if($row["folder_pictures"]){ $row["brief_pictures"] = explode(",", $row["pictures"]); $row["brief_picture"] = "pictures_tpl/".$row["folder_pictures"]."/380/".$row["brief_pictures"][0]; }else{ $row["brief_picture"] = "pictures/main_pic/".$row["big_picture"]; } $result[] = $row; $i++; } $products_count = COUNT($row); $count_row = $i; $arr_columns_prod=array('name','title'); $result=sortresults($result,$arr_columns_prod); return $result; } ?>