7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
788 lines
27 KiB
PHP
788 lines
27 KiB
PHP
<?php
|
|
//-------------------------------推演师
|
|
/*
|
|
店铺和区经角色
|
|
*/
|
|
header("Content-type: text/html; charset=utf-8");
|
|
$json_data="{";
|
|
if(THIS_IN!="edt_ipad")
|
|
exit("错误的访问!");
|
|
|
|
$uid=check_cookie_jxs();
|
|
//系统变量
|
|
$sys_close=get_set("sys_close");
|
|
$sys_close_image=get_set("sys_close_image");
|
|
$is_session=get_set("is_session");
|
|
$zb_type=get_set("zb_type");
|
|
$is_spk=get_set("is_spk");
|
|
$zbxf=get_set("zbxf");
|
|
$zbxf_type=get_set("zbxf_type");
|
|
$sys_ms=get_set("sys_ms");
|
|
$is_msg=get_set("is_msg");
|
|
$is_ewm=get_set("is_ewm");
|
|
$is_window="y";
|
|
$zk_type=get_set("zk_type");
|
|
$is_hd_log=get_set("is_hd_log");
|
|
$xh_ms=get_set("xh_ms");
|
|
$order_session=get_set("order_session");
|
|
$sys_size_num=get_max_size_num();
|
|
$theme_path=get_theme_path();
|
|
|
|
$arr_size_merged=get_size_merged();
|
|
$num_size_total=count($arr_size_merged);
|
|
|
|
|
|
|
|
$tmpl_m1_pic_width=188;
|
|
$tmpl_m1_pic_height=250;
|
|
$tmpl_m3_lie=6;
|
|
$tmpl_m3_pic_width=90;
|
|
$tmpl_m3_pic_height=120;
|
|
$tmpl_m3_cl_pic_width=400;
|
|
$tmpl_m3_cl_pic_height=300;
|
|
|
|
//$db=_mysql_connect();
|
|
$msg_login=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
|
|
if($msg_login["available"]!="y"){
|
|
$json_data.="\"error\":\"用户已被禁用\",\"code\":0,\"msg\":\"\",\"count\":0,\"data\":[],";
|
|
}else{
|
|
$json_data.="\"face\":\"".$msg_login["face"]."\",";
|
|
$json_data.="\"uid\":\"".$msg_login["id"]."\",";
|
|
$json_data.="\"jpty\":\"".$msg_login["jpty"]."\",";
|
|
|
|
$json_data.="\"clxs\":\"".$clxs."\",";
|
|
$json_data.="\"cldp\":\"".$cldp."\",";
|
|
$json_data.="\"cl_order_top\":\"".$cl_order_top."\",";
|
|
|
|
$s_key=$s_key?$s_key:$_key;
|
|
$rurl=$rurl?$rurl:get_this_url();
|
|
$check_md=get_db_msg("select count(*) 'num' from ".$table_pre."kh_md");
|
|
$zb_client_show=get_set("zb_client_show");
|
|
if($zb_client_show=="y")
|
|
$arr_zb_type=explode(",",$zb_type);
|
|
else
|
|
$arr_zb_type=array();
|
|
$is_brand=is_brand();
|
|
$show_jd=get_set("show_jd");
|
|
$is_dkds=get_set("is_dkds");
|
|
$is_multi_price=get_set("is_multi_price");
|
|
$order_close=get_set("order_close");
|
|
$search_type=get_set("search_type");
|
|
|
|
|
|
$json_data.="\"show_jd\":\"".$show_jd."\",";
|
|
$json_data.="\"is_dkds\":\"".$is_dkds."\",";
|
|
$json_data.="\"is_brand\":\"".$is_brand."\",";
|
|
$json_data.="\"is_multi_price\":\"".$is_multi_price."\",";
|
|
|
|
|
|
if($is_brand=="y")
|
|
$link_var_brand="&s_brand=".$s_brand;
|
|
else
|
|
$link_var_brand="";
|
|
$title_brand=$con_brand="";
|
|
if($s_brand){
|
|
$arr_s_brand=explode(",",$s_brand);
|
|
for($i=0;$i<count($arr_s_brand);$i++){
|
|
$con_brand.="brand='".$arr_s_brand[$i]."' or ";
|
|
$title_brand.=get_cate_title_no("brand",$arr_s_brand[$i]).",";
|
|
}
|
|
if($title_brand)
|
|
$title_brand=substr($title_brand,0,-1);
|
|
if($con_brand)
|
|
$con_brand=" and (".substr($con_brand,0,-3).")";
|
|
}
|
|
//取得选项
|
|
$arr_select_no=array();
|
|
$arr_select_title=array();
|
|
$q="select no,title from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and flag_bd='n' and no<>'sx' and no<>'zd1' and no<>'zd2' and no<>'zd3' order by ord";
|
|
$r=$db->query($q);
|
|
while($m=$db->fetch_array($r)){
|
|
$arr_select_no[]=$m["no"];
|
|
$arr_select_title[]=$m["title"];
|
|
}
|
|
//文胸
|
|
if($bx_sizegroup_title){
|
|
$tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$bx_sizegroup_title."' limit 0,1");
|
|
$bx_sizegroup_id=$tmp["id"];
|
|
}else{
|
|
$bx_sizegroup_id=0;
|
|
}
|
|
//童装
|
|
if($child_sizegroup_title){
|
|
$tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$child_sizegroup_title."' limit 0,1");
|
|
$child_sizegroup_id=$tmp["id"];
|
|
}else{
|
|
$child_sizegroup_id=0;
|
|
}
|
|
$con_spk=($is_spk=="y")?" and is_sp<>'y'":"";
|
|
$flag_spk=($is_spk=="y")?"1":"";
|
|
//------------------------------------包含定制模块,店铺界面,顶部已订数和完成率的显示
|
|
//include_once $path_dz."/dp/wcl.php";
|
|
//
|
|
//--------------交单按钮
|
|
|
|
|
|
switch($_a){
|
|
case "get_data":
|
|
$arr_dpph=array();
|
|
$dhkh="";
|
|
$dlkhjs="";
|
|
$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
$res=$db->query($query);
|
|
while($msg1=$db->fetch_array($res)){
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$msg1["kh"]."' order by ord";
|
|
$r1=$db->query($q1);
|
|
$dpjs=0;
|
|
|
|
while($m1=$db->fetch_array($r1)){
|
|
|
|
$tmp_kh_order1=get_db_msg("select sum(num) num from ".$table_pre."order where ka<>'y' and no='".$m1["kh"]."' and _key='".$_key."'");
|
|
$dpjs+=$tmp_kh_order1["num"];
|
|
if($msg1["kh"]==$dph){
|
|
$kh=get_db_msg("select * from web_kh where no='".$m1["kh"]."'");
|
|
$dhkh.="'".$m1["kh"]."',";
|
|
$dlkhjs.=get_cate_title_no("category",$kh["category"])."-".$m1["kh"]."-".$tmp_kh_order1["num"]."|";
|
|
}
|
|
}
|
|
|
|
$arr_dpph[$msg1["kh"]]=$dpjs;
|
|
}
|
|
$dhkh=deel_end($dhkh);
|
|
$dlkhjs=deel_end($dlkhjs);
|
|
$tmpc=get_db_msg("select count(DISTINCT uid) dps,sum(num) num from web_order where no in (".$dhkh.") and ka<>'y'");
|
|
arsort($arr_dpph);
|
|
$ct=1;
|
|
$dpph=0;
|
|
foreach($arr_dpph as $k => $v){
|
|
if($k==$dph){
|
|
$dpph=$ct;
|
|
}
|
|
$ct++;
|
|
}
|
|
$json_data.="\"dph\":\"".$dph."\",";
|
|
$json_data.="\"tph\":\"".$dpph."\",";
|
|
$json_data.="\"khs\":\"".$tmpc["dps"]."\",";
|
|
$json_data.="\"js\":\"".$tmpc["num"]."\",";
|
|
$json_data.="\"dlkhjs\":\"".$dlkhjs."\",";
|
|
break;
|
|
case "single":
|
|
$w2=$tmpl_m3_pic_width;
|
|
$h2=$tmpl_m3_pic_height;
|
|
$cl_lie=$tmpl_m3_lie;
|
|
$s_con=$s_con?$s_con:$s_con_default;
|
|
$rurl=$rurl?$rurl:get_this_url();
|
|
$json_data.="\"w2\":\"".$w2."\",";
|
|
$json_data.="\"h2\":\"".$h2."\",";
|
|
$json_data.="\"cl_lie\":\"".$cl_lie."\",";
|
|
//$json_data.="\"rurl\":\"".$rurl."\",";
|
|
if($zsh){
|
|
$s_zsh=$zsh;
|
|
}
|
|
$msg_err="";
|
|
$kl=strlen($s_title);
|
|
if($kl<=3 && $s_title && is_numeric($s_title)){
|
|
$sql_con="where xh='".$s_title."'";
|
|
}
|
|
if($kl>=3){
|
|
if(is_numeric($s_title)){
|
|
$sql_con="where xh='".$s_title."' or no like '%".$s_title."%'";
|
|
}else{
|
|
$sql_con="where no like '%".$s_title."%'";
|
|
}
|
|
}
|
|
if($s_title){
|
|
$msg=get_db_msg("select * from ".$table_pre."kh ".$sql_con);
|
|
$m1=get_db_msg("select count(*) 'num' from ".$table_pre."kh ".$sql_con);
|
|
$json_data.="\"khid\":\"".$msg["id"]."\",";
|
|
$json_data.="\"s_title\":\"".$s_title."\",";
|
|
$id=$msg["id"];
|
|
$str_title="";
|
|
if($m1["num"]>1){
|
|
$q2="select * from ".$table_pre."kh ".$sql_con;
|
|
$r2=$db->query($q2);
|
|
while($m2=$db->fetch_array($r2)){
|
|
$str_title.="{\"khid\":\"".$m2["id"]."\",\"title\":\"".$m2["xh"]."#".$m2["no"]."\"},";
|
|
}
|
|
if($msg_err){
|
|
$str_title=deel_end($str_title);
|
|
$msg_err="存在以下符合条件的多个款:".$msg_err;
|
|
}
|
|
}
|
|
//
|
|
if(!$id){
|
|
$msg_err="记录不存在";
|
|
}
|
|
}
|
|
if($msg_err){
|
|
if($str_title){
|
|
$json_data.="\"code\":101,";
|
|
$json_data.="\"msg\":[".$str_title."],";
|
|
}else{
|
|
$json_data.="\"code\":102,";
|
|
$json_data.="\"msg\":\"".$msg_err."\",";
|
|
}
|
|
}else{
|
|
$json_data.="\"code\":100,";
|
|
$tmp=get_db_msg("select min(zsh) 'zsh' from ".$table_pre."kh_ty");
|
|
$default_zsh=$tmp["zsh"];
|
|
$s_zsh=$s_zsh?$s_zsh:$default_zsh;
|
|
$msg_cl=get_db_msg("select * from ".$table_pre."kh_ty where zsh='".$s_zsh."'");
|
|
if($s_zsh){
|
|
$sql_con.=" where zsh='".$s_zsh."' and ";
|
|
$s_no="";
|
|
}
|
|
$sql_con=substr($sql_con,0,-4);
|
|
//取得总设计款数
|
|
/*$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."kh where ka<>'y'");
|
|
$total_ks=$tmp["num"];
|
|
//取得已订总款数
|
|
if($msg_login["face"]=="4"){
|
|
$tmp=get_db_msg("select count(distinct(iid)) 'num' from ".$table_pre."order where uid='".$uid."' and _key='".$_key."'");
|
|
}
|
|
if($msg_login["face"]=="2"){
|
|
$tmp=get_db_msg("select count(distinct(iid)) 'num' from ".$table_pre."order where ka<>'y' and _key='".$_key."' ".get_qj_ucon_all_dpid($msg_login["charge_uid"],""));
|
|
}
|
|
$total_yd_ks=$tmp["num"];*/
|
|
|
|
|
|
$json_data.="\"zsh\":\"".$s_zsh."\",";
|
|
|
|
//定制条件
|
|
$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
$style_title_color=get_set("style_title_color");
|
|
$ka_color=get_set("ka_color");
|
|
$pic_background=get_set("pic_background");
|
|
$pic_background=$pic_background?$pic_background:"#ffffff";
|
|
$content_set="[\"".$pic_background."\"]";
|
|
|
|
$json_data.="\"content_set\":\"".$pic_background."\",";
|
|
$json_data.="\"style_title_color\":\"".$style_title_color."\",";
|
|
$json_data.="\"ka_color\":\"".$ka_color."\",";
|
|
$count=0;
|
|
$rnum=0;
|
|
$zks=$ydjs=$ydks=0;
|
|
//$content_list="[";
|
|
$num_arr="";
|
|
|
|
$num_arr1="";
|
|
$num_arr2="";
|
|
$ydcl="";
|
|
|
|
$yddp1="";
|
|
|
|
$all_w=0;
|
|
$arr_dk=$bzks=$bzkss=$ydks=$ydkss=array();
|
|
$tmp_strjs=" and no in (";
|
|
$arr_dp="";
|
|
while($msg1=$db->fetch_array($res)){
|
|
$num_arr_s="";
|
|
$clp=$msg1["pic"];
|
|
//echo $msg1["kh"]."-";
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$msg1["kh"]."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
//$yddp=substr($yddp,0,-1);
|
|
$yddp1.=$msg1["kh"]."|";
|
|
$num_arr.="\"".$msg1["kh"]."\":[";
|
|
$num_arr1.="\"".$msg1["kh"]."\",";
|
|
$num_arr2.="\"".$msg1["zd1"]."\",";
|
|
|
|
$dp_pic=$dp_zsh="";
|
|
$yddp="";
|
|
$dhqk="";
|
|
|
|
while($m1=$db->fetch_array($r1)){
|
|
|
|
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$bzks[$m1["kh"]]=$m1["kh"];
|
|
$tmp_strjs.="'".$m1["kh"]."',";
|
|
$tmp_kh_order1=get_db_msg("select sum(num) num from ".$table_pre."order where ka<>'y' and no='".$m1["kh"]."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order1["num"]){
|
|
$ydks[$m1["kh"]]=$m1["kh"];
|
|
}
|
|
$dp_pic=$m1["pic"];
|
|
$dp_zsh=$m1["zsh"];
|
|
|
|
//echo $dp_pic;
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $na => $t1){
|
|
$dkcs=$m1["kh"]."_".$t1;
|
|
$bzkss[$dkcs]=$dkcs;
|
|
|
|
|
|
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where ka<>'y' and no='".$m1["kh"]."' and color='".$t1."' and uid='".$uid."' and _key='".$_key."'");
|
|
|
|
if($tmp_kh_order["num"]){
|
|
$ydkss[$dkcs]=$dkcs;
|
|
$tmp_ps1="../attachments/ty/big/".$msg1["zsh"]."_".$m1["kh"]."_".$t1.".png";
|
|
//echo $tmp_ps1;
|
|
if(is_file($tmp_ps1)){
|
|
//$ydcl.=$msg1["zsh"]."_".$m1["kh"]."_".$t1.",";
|
|
$tmpwh=out_good_pic_set_arr($tmp_ps1,$tmpl_m3_cl_pic_width,$tmpl_m3_cl_pic_height);
|
|
$ydcl.="{\"pic\":\"".$tmp_ps1."\",\"pic_w\":\"".deel_num($tmpwh[0])."\",\"pic_h\":\"".deel_num($tmpwh[1])."\"},";
|
|
}else{
|
|
//$ydcl.="nopic,";
|
|
}
|
|
$tmp_ps="../attachments/yddp/".$msg1["kh"]."_".$m1["kh"]."_".$t1.".png";
|
|
if(is_file($tmp_ps)){
|
|
//$yddp.=$msg1["kh"]."_".$m1["kh"]."_".$t1.",";
|
|
$tmpwh=out_good_pic_set_arr($tmp_ps,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$yddp.="{\"pic\":\"".$tmp_ps."\",\"pic_w\":\"".deel_num($tmpwh[0])."\",\"pic_h\":\"".deel_num($tmpwh[1])."\"},";
|
|
}else{
|
|
//$yddp.="nopic,";
|
|
}
|
|
//$dhqk.=get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1).":".$tmp_kh_order["num"]."件<br> ";
|
|
$dhqk.="{\"wz\":\"".get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1)."\",\"num\":".deel_num($tmp_kh_order["num"])."},";
|
|
}else{
|
|
//$yddp.="nopic,";
|
|
//$dhqk.=get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1).":0件<br> ";
|
|
$dhqk.="{\"wz\":\"".get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1)."\",\"num\":0},";
|
|
}
|
|
}
|
|
}
|
|
$arr_dp.="{\"zsh\":\"".$dp_zsh."\",";
|
|
$arr_dp.="\"xszt\":\"".$msg1["zd1"]."\",";
|
|
$arr_dp.="\"title\":\"".$msg1["kh"]."\",";
|
|
$tmpdppic=get_kh_dp_mini($dp_pic,$flag_pad_offline);
|
|
$tmpwh=out_good_pic_set_arr($tmpdppic,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$arr_dp.="\"pic\":\"".$tmpdppic."\",";
|
|
$arr_dp.="\"pic_w\":\"".deel_num($tmpwh[0])."\",";
|
|
$arr_dp.="\"pic_h\":\"".deel_num($tmpwh[1])."\",";
|
|
$picdp="../attachments/yddp/".$dp_pic.".png";
|
|
if(is_file($picdp)){
|
|
$tmppic=out_good_pic_set_arr($picdp,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$arr_dp.="\"yddppic\":\"".$picdp."\",";
|
|
$arr_dp.="\"yddppic_w\":".deel_num($tmppic[0]).",";
|
|
$arr_dp.="\"yddppic_h\":".deel_num($tmppic[1]).",";
|
|
}else{
|
|
$picdp="images/no_pic.png";
|
|
$tmppic=out_good_pic_set_arr($picdp,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$arr_dp.="\"yddppic\":\"".$picdp."\",";
|
|
$arr_dp.="\"yddppic_w\":".deel_num($tmppic[0]).",";
|
|
$arr_dp.="\"yddppic_h\":".deel_num($tmppic[1]).",";
|
|
}
|
|
$arr_dp.="\"yddp\":[".deel_end($yddp)."],";
|
|
//$arr_dp.="\"dhqk\":\"".$dhqk."\",";
|
|
$arr_dp.="\"dhqk\":[".deel_end($dhqk)."]},";
|
|
$yddp=substr($yddp,0,-1);
|
|
$yddp.="|";
|
|
//$dhqk=substr($dhqk,0,-1);
|
|
$dhqk.="|";
|
|
//echo htmlspecialchars($dhqk);
|
|
$yddppic.=get_kh_dp_mini($dp_pic,$flag_pad_offline)."|";
|
|
$yddppic1.=$dp_pic."|";
|
|
|
|
$picdp1=get_kh_dp_mini($dp_pic,$flag_pad_offline);
|
|
if(is_file($picdp1)){
|
|
$wh=GetImageSize($picdp1);
|
|
}else{
|
|
$pic1=str_replace("content://com.muchuang.edt/","../",$picdp1).".jpg";
|
|
if(is_file($pic1))
|
|
$wh=GetImageSize($pic1);
|
|
}
|
|
$num_arr.=deel_end($num_arr_s)."],";
|
|
$tmp="";
|
|
if(($tmpl_m2_dp_pic_width>0 && $tmpl_m2_dp_pic_width<$wh[0]) || ($tmpl_m2_dp_pic_height>0 && $tmpl_m2_dp_pic_height<$wh[1])){
|
|
if(($wh[0]/$tmpl_m2_dp_pic_width)>($wh[1]/$tmpl_m2_dp_pic_height)){
|
|
$tmp=" width=".$tmpl_m2_dp_pic_width." height=".round($wh[1]*$tmpl_m2_dp_pic_width/$wh[0]);
|
|
$yddppic_set_h.=round($wh[1]*$tmpl_m2_dp_pic_width/$wh[0]);
|
|
$yddppic_set_w.=$tmpl_m2_dp_pic_width;
|
|
$all_w+=$tmpl_m2_dp_pic_width;
|
|
}else{
|
|
$tmp=" width=".round($wh[0]*$tmpl_m2_dp_pic_height/$wh[1])." height=".$tmpl_m2_dp_pic_height;
|
|
$yddppic_set_h.=$tmpl_m2_dp_pic_height;
|
|
$yddppic_set_w.=round($wh[0]*$tmpl_m2_dp_pic_height/$wh[1]);
|
|
$all_w+=round($wh[0]*$tmpl_m2_dp_pic_height/$wh[1]);
|
|
}
|
|
}else{
|
|
$tmp=" width=".$wh[0]." height=".$wh[1];
|
|
$yddppic_set_h.=$wh[1];
|
|
$yddppic_set_w.=$wh[0];
|
|
$all_w+=$wh[0];
|
|
}
|
|
#$yddppic_set.=out_good_pic_set("../attachments/yddp/".$dp_pic.".png",$tmpl_m2_dp_pic_width,$tmpl_m2_dp_pic_height);
|
|
#$yddppic_set.="|";
|
|
$yddppic_set_h.="|";
|
|
$yddppic_set_w.="|";
|
|
$yddpzsh.=$dp_zsh."|";
|
|
}
|
|
|
|
$json_data.="\"ydcl\":[".deel_end($ydcl)."],";
|
|
$json_data.="\"dps\":[".deel_end($arr_dp)."],";
|
|
|
|
if( $tmp_strjs!=" and no in ("){
|
|
$tmp_strjs=substr($tmp_strjs,0,-1);
|
|
$tmp_strjs.=")";
|
|
$tmp_ydjs=get_db_msg("select sum(num) num from ".$table_pre."order where ka<>'y' ".$tmp_strjs." and uid='".$uid."' and _key='".$_key."'");
|
|
$ydjs=$tmp_ydjs["num"];
|
|
}else{
|
|
$ydjs=0;
|
|
}
|
|
$ztdx="20px";
|
|
$bzdhqk="<table><tr><td><font style='font-size:".$ztdx."'>本组款数:</font></td><td><font style='font-size:".$ztdx."'>(".count($bzks).")</font></td><td><font style='font-size:".$ztdx."'>已订款数: </font></td><td><font style='font-size:".$ztdx."'>(".count($ydks).")</font></td><td></td><td></td></tr><tr><td><font style='font-size:".$ztdx."'>本组款色数:</font></td><td><font style='font-size:".$ztdx."'>(".count($bzkss).")</font></td><td><font style='font-size:".$ztdx."'>已订款色数:</font></td><td><font style='font-size:".$ztdx."'>(".count($ydkss).")</font></td><td><font style='font-size:".$ztdx."'>已订件数:</font></td><td><font style='font-size:".$ztdx."'>(".$ydjs.")</font></td><td></tr></table>";
|
|
|
|
$num_arr.="}";
|
|
//echo $num_arr;
|
|
$num_arr1=substr($num_arr1,0,-1);
|
|
$num_arr1.="]";
|
|
$num_arr2=substr($num_arr2,0,-1);
|
|
$num_arr2.="]";
|
|
//print_r($num_arr);
|
|
$yddp=substr($yddp,0,-1);
|
|
$dhqk=substr($dhqk,0,-1);
|
|
//echo htmlspecialchars($dhqk);
|
|
//print_r( $dhqk);
|
|
$yddppic=substr($yddppic,0,-1);
|
|
$yddppic_set_h=substr($yddppic_set_h,0,-1);
|
|
$yddppic_set_w=substr($yddppic_set_w,0,-1);
|
|
$yddpzsh=substr($yddpzsh,0,-1);
|
|
|
|
$clpic=get_kh_ty_big($clp);
|
|
$tmppic=out_good_pic_set_arr($clpic,$tmpl_m3_cl_pic_width,$tmpl_m3_cl_pic_height);
|
|
$json_data.="\"pic\":\"".$clpic."\",";
|
|
$json_data.="\"pic_w\":".deel_num($tmppic[0]).",";
|
|
$json_data.="\"pic_h\":".deel_num($tmppic[1]).",";
|
|
|
|
$q1="select * from ".$table_pre."pm_count where uid='".$uid."' order by num desc limit 0,3";
|
|
$r1=$db->query($q1);
|
|
$str_cypm="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$str_cypm.="{\"gz\":\"".$m1["gz"]."\"},";
|
|
}
|
|
$str_cypm=deel_end($str_cypm);
|
|
$json_data.="\"cypm\":[".$str_cypm."],";
|
|
|
|
|
|
$no_ydclpic=0;
|
|
if(is_file("../attachments/ty/big/".$msg_cl["pic"].".png")){
|
|
if($ydcl){
|
|
$ydcl=substr($ydcl,0,-1);
|
|
}
|
|
#$ydclw=$tmpl_m3_cl_pic_width;
|
|
#$ydclh=$tmpl_m3_cl_pic_height;
|
|
$ydclpic="../attachments/ty/big/".$msg_cl["pic"].".png";
|
|
$tmppic=out_good_pic_set_arr($ydclpic,$tmpl_m3_cl_pic_width,$tmpl_m3_cl_pic_height);
|
|
$json_data.="\"ydclpic\":\"".$ydclpic."\",";
|
|
$json_data.="\"ydclpic_w\":".deel_num($tmppic[0]).",";
|
|
$json_data.="\"ydclpic_h\":".deel_num($tmppic[1]).",";
|
|
}else{
|
|
$no_ydclpic=1;
|
|
$ydclpic="images/no_pic_big.png";
|
|
$json_data.="\"ydclpic\":\"".$ydclpic."\",";
|
|
$json_data.="\"ydclpic_w\":\"0\",";
|
|
$json_data.="\"ydclpic_h\":\"0\",";
|
|
}
|
|
$json_data.="\"no_ydclpic\":\"".$no_ydclpic."\",";
|
|
$content_list.="]";
|
|
//上一组、下一组
|
|
$pre_xh=get_db_msg("select zsh from ".$table_pre."kh_ty where zsh<'".$s_zsh."' order by zsh desc limit 0,1");
|
|
$next_xh=get_db_msg("select zsh from ".$table_pre."kh_ty where zsh>'".$s_zsh."' order by zsh limit 0,1");
|
|
//$str_sxk="[\"".$pre_xh["zsh"]."\",\"".$next_xh["zsh"]."\"]";
|
|
$json_data.="\"prev\":\"".$pre_xh["zsh"]."\",";
|
|
$json_data.="\"next\":\"".$next_xh["zsh"]."\",";
|
|
}
|
|
break;
|
|
case "khdlbb":
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$dph."' order by ord";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$dhkh.="'".$m1["kh"]."',";
|
|
}
|
|
$dhkh=deel_end($dhkh);
|
|
$q1="select uid,sum(num) num from ".$table_pre."order where no in (".$dhkh.") group by uid";
|
|
$r1=$db->query($q1);
|
|
$arr_uid=array();
|
|
while($m1=$db->fetch_array($r1)){
|
|
$arr_uid[$m1["uid"]]=$m1["num"];
|
|
}
|
|
|
|
$q1="select * from ".$table_pre."client where face='4' ";
|
|
$r1=$db->query($q1);
|
|
$ct1=$ct2=1;
|
|
while($m1=$db->fetch_array($r1)){
|
|
if($arr_uid[$m1["id"]]>0){
|
|
$tbyd.="<tr>";
|
|
$tbyd.="<td>".$ct1."</td>";
|
|
$tbyd.="<td>".$m1["title"]."</td>";
|
|
$tbyd.="<td>".$arr_uid[$m1["id"]]."</td>";
|
|
$tbyd.="</tr>";
|
|
$ct1++;
|
|
}else{
|
|
$tbwd.="<tr>";
|
|
$tbwd.="<td>".$ct2."</td>";
|
|
$tbwd.="<td>".$m1["title"]."</td>";
|
|
$qyid=get_qy_id($m1["path"]);
|
|
$qy=get_db_msg("select title from web_client where id='".$qyid."'");
|
|
$tbwd.="<td>".$qy["title"]."</td>";
|
|
$tbwd.="</tr>";
|
|
$ct2++;
|
|
}
|
|
}
|
|
$tbyd="<table width='100%' class='layui-table'><thead><tr><td>序号</td><td>客户</td><td>件数</td></tr></thead><tbody>".$tbyd."</tbody></table>";
|
|
$tbwd="<table width='100%' class='layui-table'><thead><tr><td>序号</td><td>客户</td><td>所属区域</td></tr></thead><tbody>".$tbwd."</tbody></table>";
|
|
$json_data.="\"tbyd\":\"".$tbyd."\",";
|
|
$json_data.="\"tbwd\":\"".$tbwd."\",";
|
|
break;
|
|
case "dpphbb":
|
|
$arr_dpph=$arr_dpty=array();
|
|
$con="";
|
|
if($tyh){
|
|
$con="where zsh='".$tyh."'";
|
|
}
|
|
$query="select * from ".$table_pre."kh_ty ".$con." order by ord";
|
|
$res=$db->query($query);
|
|
while($msg1=$db->fetch_array($res)){
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$msg1["kh"]."' order by ord";
|
|
$r1=$db->query($q1);
|
|
$dpjs=0;
|
|
|
|
while($m1=$db->fetch_array($r1)){
|
|
|
|
$tmp_kh_order1=get_db_msg("select sum(num) num from ".$table_pre."order where ka<>'y' and no='".$m1["kh"]."' and _key='".$_key."'");
|
|
$dpjs+=$tmp_kh_order1["num"];
|
|
if($msg1["kh"]==$dph){
|
|
$kh=get_db_msg("select * from web_kh where no='".$m1["kh"]."'");
|
|
$dhkh.="'".$m1["kh"]."',";
|
|
$dlkhjs.=get_cate_title_no("category",$kh["category"])."-".$m1["kh"]."-".$tmp_kh_order1["num"]."|";
|
|
}
|
|
}
|
|
$arr_dpph[$msg1["kh"]]=$dpjs;
|
|
if($arr_dpty[$msg1["kh"]]){
|
|
$arr_dpty[$msg1["kh"]]=$arr_dpty[$msg1["kh"]]."<br>".$msg1["title"];
|
|
}else{
|
|
$arr_dpty[$msg1["kh"]]=$msg1["title"];
|
|
}
|
|
}
|
|
arsort($arr_dpph);
|
|
$tb="<table width='100%' class='layui-table'><thead><tr><td>推演号</td><td>搭配号</td><td>件数</td></tr></thead><tbody>";
|
|
foreach($arr_dpph as $k => $v){
|
|
$tb.="<tr>";
|
|
$tb.="<td>".$arr_dpty[$k]."</td>";
|
|
$tb.="<td>".$k."</td>";
|
|
$tb.="<td>".$v."</td>";
|
|
$tb.="</tr>";
|
|
}
|
|
$tb.="</tbody></table>";
|
|
$json_data.="\"tb\":\"".$tb."\",";
|
|
break;
|
|
case "dkzl":
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$dph."' order by ord";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$dhkh.="'".$m1["kh"]."',";
|
|
}
|
|
$dhkh=deel_end($dhkh);
|
|
$q1="select no,color,sum(num) num from ".$table_pre."order where no in (".$dhkh.") group by no,color order by no,color";
|
|
$r1=$db->query($q1);
|
|
$arr_data=array();
|
|
while($m1=$db->fetch_array($r1)){
|
|
$ks=$m1["no"]."-".$m1["color"];
|
|
$arr_data[$ks]=$m1["num"];
|
|
}
|
|
$ct=1;
|
|
foreach ($arr_data as $n => $t){
|
|
$ks=explode("-",$n);
|
|
$tbyd.="<tr>";
|
|
$tbyd.="<td>".$ct."</td>";
|
|
$tbyd.="<td>".$ks[0]."</td>";
|
|
$tbyd.="<td>".get_cate_title_no("color",$ks[1])."</td>";
|
|
$tbyd.="<td>".$t."</td>";
|
|
$tbyd.="</tr>";
|
|
$ct++;
|
|
}
|
|
$tbyd="<table width='100%' class='layui-table'><thead><tr><td>序号</td><td>款号</td><td>颜色</td><td>件数</td></tr></thead><tbody>".$tbyd."</tbody></table>";
|
|
$json_data.="\"tbyd\":\"".$tbyd."\",";
|
|
break;
|
|
default:
|
|
//----------------------------------------------陈列模式
|
|
if($sys_zycl=="y"){
|
|
$s_type=$s_type?$s_type:"1";
|
|
}
|
|
$json_data.="\"sys_zycl\":\"".$sys_zycl."\",";
|
|
//require THIS_FILE_ROOT."/include/page_js.class.php";
|
|
$w2=$tmpl_m3_cl_pic_width;
|
|
$h2=$tmpl_m3_cl_pic_height;
|
|
$page_size=$tmpl_m1_page_size;
|
|
$page_size=$tmpl_m1_page_size;
|
|
|
|
$page=$page>0?$page:1;
|
|
$limit=$limit>0?$limit:6;
|
|
$start=($page-1)*$limit;
|
|
$end=$limit;
|
|
|
|
//
|
|
|
|
$sql_con=" where zsh>0 and ";
|
|
if($s_type){
|
|
$sql_con.=get_sql_client_type($s_type);
|
|
}
|
|
/*if($s_no){
|
|
$sql_con.="kh like '%".$s_no."%' and ";
|
|
$s_zsh="";
|
|
}*/
|
|
$kl=strlen($s_keyword);
|
|
if($kl<=3 && $s_keyword && is_numeric($s_keyword)){
|
|
if($xh_ms=="2"){
|
|
$tmp=get_db_msg("select kh as no from web_kh_xh where xh='".$s_keyword."'");
|
|
}else{
|
|
$tmp=get_db_msg("select no from web_kh where xh='".$s_keyword."'");
|
|
}
|
|
$sql_con.=" kh='".$tmp["no"]."' and";
|
|
for($i=0;$i<$num_dp_zd;$i++){
|
|
$v1="s_zd".($i+1);
|
|
$$v="";
|
|
}
|
|
$s_zsh="";
|
|
$s_title="";
|
|
}
|
|
if($kl>=3){
|
|
if(is_numeric($s_keyword)){
|
|
if($xh_ms=="2"){
|
|
$tmp=get_db_msg("select kh as no from web_kh_xh where xh='".$s_keyword."'");
|
|
}else{
|
|
$tmp=get_db_msg("select no from web_kh where xh='".$s_keyword."'");
|
|
}
|
|
$sql_con.=" (kh='".$tmp["no"]."' or kh like '%".$s_keyword."%') and";
|
|
}else{
|
|
$sql_con.=" (kh like '%".$s_keyword."%') and";
|
|
}
|
|
for($i=0;$i<$num_dp_zd;$i++){
|
|
$v1="s_zd".($i+1);
|
|
$$v="";
|
|
}
|
|
$s_zsh="";
|
|
$s_title="";
|
|
}
|
|
if($s_title){
|
|
$sql_con.="title like '%".$s_title."%' and ";
|
|
$s_keyword="";
|
|
$s_zsh="";
|
|
}
|
|
for($i=0;$i<$num_cl_zd;$i++){
|
|
$v1="s_zd".($i+1);
|
|
if($$v1)
|
|
$sql_con.="zd".($i+1)."='".$$v1."' and ";
|
|
}
|
|
if($sql_con)
|
|
$sql_con=substr($sql_con,0,-4);
|
|
//$sql_order=str_replace("!"," desc",$order);
|
|
|
|
$json_data.="\"s_keyword\":\"".$s_keyword."\",";
|
|
$json_data.="\"s_zsh\":\"".$s_zsh."\",";
|
|
$json_data.="\"s_title\":\"".$s_title."\",";
|
|
|
|
|
|
$query="select count(distinct zsh) 'total' from ".$table_pre."kh_ty ".$sql_con;
|
|
$res=$db->query($query);
|
|
$msg=$db->fetch_array($res);
|
|
$total=$msg["total"];
|
|
|
|
|
|
//定制条件
|
|
$query="select * from ".$table_pre."kh_ty ".$sql_con." group by zsh order by zsh limit ".$start.",".$end;
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
$count=0;
|
|
$rnum=0;
|
|
$style_title_color=get_set("style_title_color");
|
|
$ka_color=get_set("ka_color");
|
|
$pic_background=get_set("pic_background");
|
|
$pic_background=$pic_background?$pic_background:"#ffffff";
|
|
$content_set="[\"".$pic_background."\"]";
|
|
|
|
$json_data.="\"style_title_color\":\"".$style_title_color."\",";
|
|
$json_data.="\"ka_color\":\"".$ka_color."\",";
|
|
$json_data.="\"content_set\":\"".$pic_background."\",";
|
|
|
|
$json_data.="\"count\":".$total.",\"content_list\":[";
|
|
$data_str="";
|
|
|
|
$content_list="[";
|
|
for($count=0;$count<$end;$count++){
|
|
$msg=$db->fetch_array($res);
|
|
if($msg["id"]>0){
|
|
//图片获取规则
|
|
$pic=get_kh_ty_mini($msg["pic"]);
|
|
$is_my_cl="n";
|
|
$content_list.=$msg["zsh"].",\"".$pic."\",\"".str_replace("\"","'",out_good_pic_set($pic,$w2,$h2))."\",\"".$msg["title"]."\",\"".$is_my_cl."\",";
|
|
$ck=out_good_pic_set_arr($pic,$w2,$h2);
|
|
$data_str.="{\"zsh\":".$msg["zsh"].",\"title\":\"".$msg["title"]."\",\"is_my_cl\":\"".$is_my_cl."\",\"pic\":\"".$pic."\",\"pic_w\":".deel_num($ck[0]).",\"pic_h\":".deel_num($ck[1])."},";
|
|
//
|
|
$rnum++;
|
|
}
|
|
}
|
|
$json_data.=substr($data_str,0,-1)."],";
|
|
$content_list.="]";
|
|
|
|
//自定义筛选条件
|
|
$str_arr_zy="";
|
|
$select_dz="";
|
|
if($sys_zycl=="y"){
|
|
$tmp1=explode(",",$sys_zycl_client_type);
|
|
foreach($tmp1 as $k1 => $v1){
|
|
$tmp2=explode("|",$v1);
|
|
$str_arr_zy.="{\"no\":\"".$tmp2[0]."\",\"title\":\"".$tmp2[1]."\"},";
|
|
/*foreach($tmp2 as $k2 => $v2){
|
|
$str_arr_zy.="{\"no\":\"".$k2."\",\"title\":\"".$v2."\"},";
|
|
}*/
|
|
}
|
|
$str_arr_zy=deel_end($str_arr_zy);
|
|
$select_dz.="{\"no\":\"s_type\",\"title\":\"陈列类型\",\"value\":\"".$s_type."\",\"op\":[".$str_arr_zy."]},";
|
|
}
|
|
$num_cl_zd=0;
|
|
if(is_array($sys_cl_zd)){
|
|
$num=count($sys_cl_zd);
|
|
$num_cl_zd=($num<5)?$num:5;
|
|
}
|
|
$str_arr_select="";
|
|
|
|
for($i=0;$i<$num_cl_zd;$i++){
|
|
$v1="s_zd".($i+1);
|
|
$str_arr_select.="\"".$v1."\",\"".$sys_cl_zd[$i]."\",\"".$$v1."\",";
|
|
$r=$db->query("select zd".($i+1)." from ".$table_pre."kh_ty group by zd".($i+1)." order by zd".($i+1));
|
|
$op="[";
|
|
$tmp="";
|
|
while($m=$db->fetch_array($r)){
|
|
$op.="\"".$m["zd".($i+1)]."|".$m["zd".($i+1)]."\",";
|
|
$tmp.="{\"no\":\"".$m["zd".($i+1)]."\",\"title\":\"".$m["zd".($i+1)]."\"},";
|
|
}
|
|
$tmp=deel_end($tmp);
|
|
$select_dz.="{\"no\":\"".$v1."\",\"title\":\"".$sys_dp_zd[$i]."\",\"value\":\"".$$v1."\",\"op\":[".$tmp."]},";
|
|
$op.="],";
|
|
$str_arr_select.=$op;
|
|
}
|
|
$select_dz=deel_end($select_dz);
|
|
$json_data.="\"select_dz\":[".$select_dz."],";
|
|
|
|
$total_page=ceil($total/$limit);
|
|
$json_data.="\"total_page\":".$total_page.",";
|
|
$json_data.="\"page\":".$page.",";
|
|
break;
|
|
}
|
|
}
|
|
function get_kh_ty_mini($clh){
|
|
global $order_session;
|
|
$s_dir=$order_session?$order_session."/":"";
|
|
$pic="../attachments/ty/mini/".$clh.".jpg";
|
|
if(!is_file($pic)){
|
|
$pic="images/no_pic.png";
|
|
}
|
|
return $pic;
|
|
}
|
|
function get_kh_ty_big($clh){
|
|
global $order_session;
|
|
$s_dir=$order_session?$order_session."/":"";
|
|
$pic="../attachments/ty/big/".$clh.".jpg";
|
|
if(!is_file($pic)){
|
|
$pic="images/no_pic_big.png";
|
|
}
|
|
return $pic;
|
|
}
|
|
$json_data=substr($json_data,0,-1)."}";
|
|
echo $json_data;
|
|
?>
|