This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/admin/module/ajax_autocomplete.php
T
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

279 lines
8.9 KiB
PHP

<?php
//-------------------------------自动完成获取数据
header("Content-type: text/html; charset=utf-8");
if(THIS_IN!="edt_admin")
exit("错误的访问!");
$msg_login_user=get_db_msg("select * from ".$table_pre."user where id='".$uid."'");
//---------priv
$json_data="{";
$json_data.="\"uid\":".$uid.",";
switch($_a){
case "kh" :
//
$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."<br>";
$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."<br>";
$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."<br>";
$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."<br>";
$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."<br>";
$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;$i<count($arr_color);$i++){
$str_tmp.="{\"id\":\"".$msg["no"].",".$arr_color[$i]."\",\"t1\":\"".$msg["no"].",".$arr_color[$i]."-".get_cate_title_no("color",$arr_color[$i])."\"},";
}
}
}
$json_data.="\"data\":[".deel_end($str_tmp)."],";
break;
case "dp_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."%') ";
$str_tmp="";
$query="select id,username,title from ".$table_pre."client where id>0 ".$sql_con." order by ".$order_by;
//echo $query."<br>";
$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."<br>";
$res=$db->query($query);
$count=0;
$data=array();
$str_tmp="";
$i=0;
while($msg=$db->fetch_array($res)){
$str_zd="";
for($k=0;$k<count($arr_select1);$k++){
$str_zd.="-".get_cate_title_no($arr_select1[$k],$msg[$arr_select1[$k]]);
}
$str_tmp.="{\"id\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\",\"title\":\"".$msg["no"].$str_zd."\"},";
$i++;
}
$json_data.="\"data\":[".deel_end($str_tmp)."],";
break;
case "size_group" :
//
$query="select id,title from ".$table_pre."keyword where cate='size' order by ord";
//echo $query."<br>";
$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."<br>";
$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;
?>