0 ".$sql_con." order by no"; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "kh1" : // $sql_con=""; if($q){ $sql_con.=" and no like '%".$q."%'"; } $query="select id,no from ".$table_pre."kh where id>0 ".$sql_con." order by no"; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; $str_tmp.="{\"id\":\"\",\"no\":\"所有款\"},"; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "client" : // $order_by=$order?$order:"username"; $sql_con=""; if($s_path) $sql_con.=" and (path='".$s_path."' or path like '".$s_path."-%')"; if($s_face) $sql_con.=" and face='".$s_face."'"; if($q) $sql_con.=" and (username like '%".$q."%' or title like '%".$q."%') "; $query="select id,username,title from ".$table_pre."client where id>0 ".$sql_con." order by ".$order_by; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"username\":\"".$msg["username"]."\",\"title\":\"".$msg["title"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "client2" : // $order_by=$order?$order:"username"; $sql_con=""; if($s_path) $sql_con.=" and (path='".$s_path."' or path like '".$s_path."-%')"; //if($s_face) $sql_con.=" and (face='3' or face='4')"; if($q) $sql_con.=" and (username like '%".$q."%' or title like '%".$q."%') "; $query="select id,username,title from ".$table_pre."client where id>0 ".$sql_con." order by ".$order_by; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"username\":\"".$msg["username"]."\",\"title\":\"".$msg["title"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "kh_color" : // $sql_con=""; if($q){ $sql_con.=" where a.no like '%".$q."%' or color like '%".$q."%' or b.title like '%".$q."%' "; } $query="select a.id,a.no,b.no 'color',b.title from web_kh as a left join web_keyword as b on concat(',',a.color,',') like concat('%,',b.no,',%') and b.cate='color'".$sql_con; //echo $query."
"; $res=$db->query($query); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."|".$msg["color"]."\",\"t1\":\"".$msg["no"]."|".$msg["title"]."|".$msg["color"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "kh_color2" : // $sql_con=""; if($q){ $sql_con.=" and no like '%".$q."%' "; } $query="select xh,no,color,color_ka from ".$table_pre."kh where ka<>'y' ".$sql_con; //echo $query; $res=$db->query($query); $str_tmp=""; while($msg=$db->fetch_array($res)){ $arr_color=explode(",",$msg["color"]); if(count($arr_color)==1){ $str_tmp.="{\"id\":\"".$msg["no"].",".$arr_color[0]."\",\"t1\":\"".$msg["no"].",".$arr_color[0]."-".get_cate_title_no("color",$arr_color[0])."\"},"; }else if(count($arr_color)>1){ $str_tmp.="{\"id\":\"".$msg["no"]."\",\"t1\":\"".$msg["no"]."\"},"; for($i=0;$i0 ".$sql_con." order by ".$order_by; //echo $query."
"; $res=$db->query($query); $i=0; $str_tmp.="{\"id\":\"all\",\"username\":\"_all_\",\"title\":\"全国\"},"; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"username\":\"".$msg["username"]."\",\"title\":\"".$msg["title"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "paths": $sql_con=""; if($q) $sql_con.=" and (username like '%".$q."%' or title like '%".$q."%') "; $str_tmp=""; $str_tmp.="{\"t\":\"-所有路径-\",\"p\":\"\"},"; $q="select id,path,deep,title,username from ".$table_pre."client where (face=3 or face=9) ".$sql_con." order by concat(path,'-',id),ord"; $r=$db->query($q); $i=0; while($m=$db->fetch_array($r)){ $str_tmp.="{\"t\":\"".indent($m["deep"]).$m["title"]."(".$m["username"].")\",\"p\":\"".$m["path"]."-".$m["id"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "paths2": $sql_con=""; if($q) $sql_con.=" and (username like '%".$q."%' or title like '%".$q."%') "; $str_tmp=""; $str_tmp.="{\"t\":\"总部\",\"p\":\"0\"},"; $q="select id,path,deep,title,username from ".$table_pre."client where (face=3 or face=9) ".$sql_con." order by concat(path,'-',id),ord"; $r=$db->query($q); $i=0; while($m=$db->fetch_array($r)){ $str_tmp.="{\"t\":\"".indent($m["deep"]).$m["title"]."(".$m["username"].")\",\"p\":\"".$m["path"]."-".$m["id"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "kh_zk": //取得启用的选项 $q2="select no from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and ord<10 order by ord"; $r2=$db->query($q2); $arr_select1=array(); while($m2=$db->fetch_array($r2)){ $arr_select1[]=$m2["no"]; } // $sql_con=""; if($q){ $sql_con.=" and no like '%".$q."%'"; } $query="select * from ".$table_pre."kh where id>0 ".$sql_con." order by no"; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_zd=""; for($k=0;$k"; $res=$db->query($query); $str_tmp=""; $i=0; $str_tmp.="{\"id\":\"all\",\"title\":\"所有尺码组\"},"; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"title\":\"".$msg["title"]."\"},"; $i++; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "gg" : // $sql_con=""; if($q){ $sql_con.=" where iid in (select id from web_kh where no like '%".$q."%')"; } $json_data.="\"q\":\"".$q."\","; $query="select * from ".$table_pre."kh_gg ".$sql_con." order by iid,color,gg"; //echo $query; $res=$db->query($query); $str_tmp=""; while($msg=$db->fetch_array($res)){ $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$msg["iid"]."'"); $str_tmp.="{\"id\":\"".$msg["no"]."\",\"t1\":\"".$m_kh["no"]."|".$msg["color"]."-".get_cate_title_no("color",$msg["color"])."|".get_gg_title($msg["gg"])."\"},"; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; case "kh_gg" : // $sql_con=""; $query="select id,no from ".$table_pre."kh where id>0 ".$sql_con." order by no"; //echo $query."
"; $res=$db->query($query); $count=0; $data=array(); $str_tmp=""; $i=0; while($msg=$db->fetch_array($res)){ $str_tmp.="{\"id\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\"},"; $i++; } $query="select * from ".$table_pre."kh_gg order by iid,color,gg"; //echo $query; $res=$db->query($query); //$str_tmp=""; while($msg=$db->fetch_array($res)){ $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$msg["iid"]."'"); $str_tmp.="{\"id\":\"".$msg["no"]."\",\"no\":\"".$m_kh["no"]."|".$msg["color"]."-".get_cate_title_no("color",$msg["color"])."|".get_gg_title($msg["gg"])."\"},"; } $json_data.="\"data\":[".deel_end($str_tmp)."],"; break; } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>