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/ipad/module/dhgz.php
T
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

301 lines
15 KiB
PHP

<?php
//-------------------------------订单明细
header("Content-type: text/html; charset=utf-8");
$json_data="{";
if(THIS_IN!="edt_ipad")
exit("错误的访问!");
$msg_client=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
//
$msg_login=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$p=$msg_login["path"]."-".$msg_login["id"];
$face=$msg_client["face"];
$sys_size_num=get_max_size_num();
$is_spk=get_set("is_spk");
//订货规则
$arr_gz=$arr_gz1=array();
$q="select * from ".$table_pre."keyword where (cate='dhgz') and no<>'zgdl' and no<>'dhbs' and no<>'qdl' and no<>'glk' and no<>'zxs' and flag_ka='y' order by ord";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$check=get_db_msg("select count(*) 'num' from ".$table_pre."gz where cate='".$m["no"]."' and (dj='' or dj='".$msg_login["dj"]."')");
if($check["num"]>0){
$arr_gz[$m["no"]]=$m["title"];
$arr_gz1[$i]=$m["no"];
$i++;
}
}
$my_gz_type=$my_gz_type?$my_gz_type:$arr_gz1[0];
$json_data.="\"gz\":\"".$my_gz_type."\",";
//tab
$content_tab="";
$strgz="";
$i=0;
foreach($arr_gz as $k => $v){
$strgz.="{\"xh\":\"".$i."\",\"k\":\"".$k."\",\"v\":\"".$v."\"},";
$i++;
$s=($my_gz_type==$k)?"y":"";
$content_tab.="?_m=".$_m."&_a=".$_a."&s_tab=".$s_tab."&my_gz_type=".$k."|".$v."|".$s.",";
}
$json_data.="\"arr_gz\":[".deel_end($strgz)."],";
if($content_tab)
$content_tab=substr($content_tab,0,-1);
//取得客户等级
$client_dj=trim($msg_login["dj"]);
$con_dj=$client_dj?" and (dj='".$client_dj."' or dj='')":" and dj=''";
$strhead=$strbody="";
if($my_gz_type=="bdk"){
//必订款
$strhead.="{\"v\":\"款号\"},{\"v\":\"必订数量\"},{\"v\":\"实际数量\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>款号</strong></th>";
//$content.="<th align=\"center\" class=\"thead\"><strong>必订数量</strong></th><th align=\"center\" class=\"thead\"><strong>实际数量</strong></th>";
//$content.="</tr></thead>";
$q1="select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." order by kh";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"#f5f5f5":"white";
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
//取得实际数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where no='".$m1["kh"]."' and uid='".$uid."' and _key='".$_key."'");
if($tmp["num"]<$m1["num"])
$bg_hilight=" style='color:#ffffff;background-color:#ff0000;'";
else
$bg_hilight="";
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"khid\":\"".$m_kh["id"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".$m_kh["no"]."\"},{\"s\":\"\",\"v\":\"".$m1["num"]."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".add_0($tmp["num"])."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m_kh["no"]."</a></td><td>".$m1["num"]."</td><td".$bg_hilight.">".add_0($tmp["num"])."</td></tr>";
$count++;
}
}else if($my_gz_type=="bdks"){
//必订款色
$strhead.="{\"v\":\"款号\"},{\"v\":\"颜色\"},{\"v\":\"必订数量\"},{\"v\":\"实际数量\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>款号</strong></th><th align=\"center\" class=\"thead\"><strong>颜色</strong></th>";
//$content.="<th align=\"center\" class=\"thead\"><strong>必订数量</strong></th><th align=\"center\" class=\"thead\"><strong>实际数量</strong></th>";
//$content.="</tr></thead>";
$q1="select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." order by kh,color";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"#f5f5f5":"white";
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
//取得实际数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where no='".$m1["kh"]."' and color='".$m1["color"]."' and uid='".$uid."' and _key='".$_key."'");
if($tmp["num"]<$m1["num"])
$bg_hilight=" style='color:#ffffff;background-color:#ff0000;'";
else
$bg_hilight="";
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"khid\":\"".$m_kh["id"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".$m_kh["no"]."\"},{\"s\":\"\",\"v\":\"".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."\"},{\"s\":\"\",\"v\":\"".$m1["num"]."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".add_0($tmp["num"])."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m_kh["no"]."</a></td><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."</a></td><td>".$m1["num"]."</td><td".$bg_hilight.">".add_0($tmp["num"])."</td></tr>";
$count++;
}
}else if($my_gz_type=="bdgg"){
//必订规格
$strhead.="{\"v\":\"款号\"},{\"v\":\"颜色\"},{\"v\":\"".d_translate("gg")."\"},{\"v\":\"必订数量\"},{\"v\":\"实际数量\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>款号</strong></th><th align=\"center\" class=\"thead\"><strong>颜色</strong></th><th align=\"center\" class=\"thead\"><strong>".d_translate("gg")."</strong></th><th align=\"center\" class=\"thead\"><strong>必订数量</strong></th><th align=\"center\" class=\"thead\"><strong>实际数量</strong></th>";
//$content.="</tr></thead>";
$q1="select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." order by kh,color,bc";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"#f5f5f5":"white";
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
//取得实际数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where no='".$m1["kh"]."' and color='".$m1["color"]."' and bx='".$m1["bc"]."' and uid='".$uid."' and _key='".$_key."'");
if($tmp["num"]<$m1["num"])
$bg_hilight=" style='color:#ffffff;background-color:#ff0000;'";
else
$bg_hilight="";
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"khid\":\"".$m_kh["id"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".$m_kh["no"]."\"},{\"s\":\"\",\"v\":\"".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."\"},{\"s\":\"\",\"v\":\"".get_gg_title($m1["bc"])."\"},{\"s\":\"\",\"v\":\"".$m1["num"]."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".add_0($tmp["num"])."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m_kh["no"]."</a></td><td>".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."</td><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".get_gg_title($m1["bc"])."</a></td><td>".$m1["num"]."</td><td".$bg_hilight.">".add_0($tmp["num"])."</td></tr>";
$count++;
}
}else if($my_gz_type=="bds"){
//必订色
$strhead.="{\"v\":\"波段\"},{\"v\":\"颜色\"},{\"v\":\"必订数量\"},{\"v\":\"实际数量\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>波段</strong></th><th align=\"center\" class=\"thead\"><strong>颜色</strong></th>";
//$content.="<th align=\"center\" class=\"thead\"><strong>必订数量</strong></th><th align=\"center\" class=\"thead\"><strong>实际数量</strong></th>";
//$content.="</tr></thead>";
$q1="select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." order by kh,color";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"#f5f5f5":"white";
$bg=($count%2)?"#a8a8a8":"#c8c8c8";
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
//取得实际数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where bc='".$m1["bc"]."' and color='".$m1["color"]."' and uid='".$uid."' and _key='".$_key."'");
if($tmp["num"]<$m1["num"])
$bg_hilight=" style='color:#ffffff;background-color:#ff0000;'";
else
$bg_hilight="";
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"bc\":\"".$m1["bc"]."\",";
$strbody.="\"color\":\"".$m1["color"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".get_cate_title_no("bc",$m1["bc"])."\"},{\"s\":\"\",\"v\":\"".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."\"},{\"s\":\"\",\"v\":\"".$m1["num"]."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".add_0($tmp["num"])."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&s_bc=".$m1["bc"]."\">".get_cate_title_no("bc",$m1["bc"])."</a></td><td><a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&s_bc=".$m1["bc"]."&s_color=".$m1["color"]."\">".$m1["color"]."-".get_cate_title_no("color",$m1["color"])."</a></td><td>".add_0($m1["num"])."</td><td".$bg_hilight.">".add_0($tmp["num"])."</td></tr>";
$count++;
}
}else if($my_gz_type=="byxdk"){
//不予下单款
$strhead.="{\"v\":\"款号\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>款号</strong></th>";
//$content.="</tr></thead>";
$q1="select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." order by kh";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"#f5f5f5":"white";
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
//取得实际数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where no='".$m1["kh"]."' and uid='".$uid."' and _key='".$_key."'");
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"khid\":\"".$m_kh["id"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".$m_kh["no"]."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m_kh["no"]."</a></td></tr>";
$count++;
}
}else if($my_gz_type=="jebl"){
//金额比例
$strhead.="{\"v\":\"".get_cate_title_no("arr_select","kh_dj")."\"},{\"v\":\"要求占比\"},{\"v\":\"实际占比\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>".get_cate_title_no("arr_select","kh_dj")."</strong></th><th align=\"center\" class=\"thead\"><strong>要求占比</strong></th><th align=\"center\" class=\"thead\"><strong>实际占比</strong></th>";
//订单总金额
if($is_spk=="y"){
$total_money=$msg_login["order_money1"];
$con_sp=" and is_sp='y'";
}else{
$total_money=$msg_login["order_money"];
$con_sp="";
}
$q1="select * from ".$table_pre."keyword where cate='kh_dj' order by no";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$m2=get_db_msg("select * from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." and kh='".$m1["no"]."'");
$sty1=($count%2)?"#f5f5f5":"white";
$bg=($count%2)?"#a8a8a8":"#c8c8c8";
//取得实际金额
$q2="select sum((".get_size_sql("sum").")*price) 'je' from ".$table_pre."order where kh_dj='".$m1["no"]."' and uid='".$uid."' and _key='".$_key."'".$con_sp;
$tmp=get_db_msg($q2);
if($m2["id"]>0){
$c1=$m2["color"].deel_num($m2["num"])."%";
if($total_money>0){
$bl=($tmp["je"]/$total_money)*100;
}else{
$bl=0;
}
$gs=$bl.$m2["color"].$m2["num"];
eval("\$r=$gs;");
$bg1=($r==false)?"#ff0000":$bg;
}else{
$c1="&nbsp;";
$bg1=$bg;
}
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"kh_dj\":\"".$m1["no"]."\",";
$tmpb.="{\"s\":\"\",\"v\":\"".$m1["title"]."\"},{\"s\":\"\",\"v\":\"".$c1."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".deel_bfb1($tmp["je"],$total_money)."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td><a href=\"".$_SERVER[PHP_SELF]."?_m=".$_m."&s_kh_dj=".$m1["no"]."\">".$m1["title"]."</a></td><td>".$c1."</td><td>".deel_bfb1($tmp["je"],$total_money)."</td></tr>";
$count++;
}
$content.="</tr></thead>";
}else if($my_gz_type=="bdkshi"){
//必订款式
$strhead.="{\"v\":\"款号\"},{\"v\":\"必订款数\"},{\"v\":\"实际款数\"},";
//$content="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"table_bb\"><thead><tr>";
//$content.="<th align=\"center\" class=\"thead\"><strong>款号</strong></th>";
//$content.="<th align=\"center\" class=\"thead\"><strong>必订款数</strong></th><th align=\"center\" class=\"thead\"><strong>实际款数</strong></th>";
//$content.="</tr></thead>";
$q1="select bc,num from ".$table_pre."gz where cate='".$my_gz_type."'".$con_dj." group by bc";
$r1=$db->query($q1);
$count=0;
while($m1=$db->fetch_array($r1)){
$sty1=($count%2)?"td2":"td1";
//取得款号
$str_kh="";
$q2="select * from ".$table_pre."gz where cate='".$my_gz_type."' and bc='".$m1["bc"]."' order by kh";
$r2=$db->query($q2);
$sj_ydkss=0;
$tmpbb="";
while($m2=$db->fetch_array($r2)){
$m_kh=get_db_msg("select id,no from ".$table_pre."kh where no='".$m2["kh"]."'");
if($m_kh["id"]>0){
//$str_kh.="<a href=\"".$_SERVER[PHP_SELF]."?_m=order_single&id=".$m_kh["id"]."&rurl=".urlencode($rurl)."\" title=\"".$m_kh["no"]."的订单\">".$m2["kh"]."</a>, ";
$tmpbb.="{\"khid\":\"".$m_kh["id"]."\",\"kh\":\"".$m2["kh"]."\"},";
}
$c=get_db_msg("select id from ".$table_pre."order where no='".$m2["kh"]."' and uid='".$uid."' and _key='".$_key."'");
if($c["id"]>0)
$sj_ydkss++;
}
if($str_kh)
$str_kh=substr($str_kh,0,-1);
//取得实际数量
if($sj_ydkss<$m1["num"])
$bg_hilight=" style='color:#ffffff;background-color:#ff0000;'";
else
$bg_hilight="";
$tmpb="";
$strbody.="{";
$strbody.="\"sty\":\"".$sty1."\",";
$strbody.="\"kh\":[".deel_end($tmpbb)."],";
$tmpb.="{\"s\":\"\",\"v\":\"".$m1["num"]."\"},{\"s\":\"".$bg_hilight."\",\"v\":\"".add_0($sj_ydkss)."\"}";
$strbody.="\"body\":[".$tmpb."]";
$strbody.="},";
//$content.="<tr class=\"".$sty1."\"><td>".$str_kh."</td><td>".$m1["num"]."</td><td".$bg_hilight.">".add_0($sj_ydkss)."</td></tr>";
$count++;
}
}
$json_data.="\"head\":[".deel_end($strhead)."],";
$json_data.="\"body\":[".deel_end($strbody)."],";
//$content.="</table>";
$json_data=substr($json_data,0,-1)."}";
echo $json_data;
?>