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

380 lines
12 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();
$is_sy=get_set("is_sy");
$bs_kh_dj=get_set("bs_kh_dj");
$json_data.="\"bs_kh_dj\":\"".$bs_kh_dj."\",";
$tmpl_m3_lie=6;
$tmpl_m3_pic_width=100;
$tmpl_m3_pic_height=100;
$tmpl_m3_cl_pic_width=400;
$tmpl_m3_cl_pic_height=300;
$json_data.="\"sys_ver_hy\":\"".$sys_ver_hy."\",";
//沙盘订货滑动条上限
$json_data.="\"slider_max\":30,";
//$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.="\"username\":\"".$msg_login["username"]."\",";
$json_data.="\"is_sy\":\"".$is_sy."\",";
$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";
//
//--------------交单按钮
$jd_password=get_set("jd_password");
if($is_brand<>"y"){
$tmp=$msg_login;
$is_jd=$msg_login["is_jd"];
$is_checked=$msg_login["is_checked"];
}else{
$tmp=get_db_msg("select is_jd from ".$table_pre."client_brand where cid='".$uid."'".$con_brand." order by is_jd limit 0,1");
$is_jd=$tmp["is_jd"];
$tmp=get_db_msg("select is_checked from ".$table_pre."client_brand where cid='".$uid."'".$con_brand." order by is_checked limit 0,1");
$is_checked=$tmp["is_checked"];
}
if($show_jd=="y"){
if($is_jd=="y")
$jd_button="已交单|";
if($is_checked=="y")
$jd_button="已确认|";
if($is_brand=="y"){
$jd_button="交单|go_url('".$_SERVER[PHP_SELF]."?_m=".$_m."&_a=o&s_tab=wcl')";
}else{
if($is_jd!="y" && $is_checked!="y")
$jd_button="交单|do_jd('".$jd_password."','".$_SERVER[PHP_SELF]."?_m=".$_m."&_a=jd".$link_var_brand."')";
}
}else{
$jd_button="|";
}
//计算订货规则按钮
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."gz where dj='' or dj='".$msg_login["dj"]."'");
if($tmp["num"]>0)
$menu_dhgz="订货规则";
else
$menu_dhgz="";
switch($_a){
case "wdjh":
//定制条件
$query="select * from ".$table_pre."client_shsj where uid='".$uid."' order by ord";
//echo $query."<br>";
$res=$db->query($query);
$strarr="";
$pcsl=0;
while($msg=$db->fetch_array($res)){
$strarr.="{\"id\":".$msg["id"].",\"color_number\":\"".$msg["kss"]."\",\"date\":\"".$msg["add_date"]."\",\"ord\":\"".$msg["ord"]."\"},";
$pcsl++;
}
$json_data.="\"plan\":[".deel_end($strarr)."],";
$json_data.="\"pcsl\":\"".$pcsl."\",";
break;
case "wdjh_save":
$arr=explode("|",deel_end($data));
$tmptime="";
$errmsg="";
foreach($arr as $k => $v){
$tmp=explode("_",$v);
if($tmptime==""){
$tmptime=$tmp[1];
}else{
$cp=strtotime($tmptime)-strtotime($tmp[1]);
if($cp>0){
$errmsg="每个计划时间必须比前一个要晚!";
}
$tmptime=$tmp[1];
}
}
if($errmsg){
$json_data.="\"code\":100,";
$json_data.="\"msg\":\"".$errmsg."\",";
}else{
$ct=1;
//$q="delete from ".$table_pre."client_shsj where uid='".$uid."'";
//$db->query($q);
$ord=1;
foreach($arr as $k => $v){
$tmp=explode("_",$v);
if($tmp[0] && $tmp[0]!="undefined"){
$q="update ".$table_pre."client_shsj set add_date='".$tmp[1]."',kss='".$tmp[2]."',ord='".$ord."' where id='".$tmp[0]."'";
//echo $q;
$db->query($q);
}else{
$q="insert into ".$table_pre."client_shsj (uid,add_date,kss,ord) values ('".$uid."','".$tmp[1]."','".$tmp[2]."','".$ord."')";
//echo $q;
$db->query($q);
}
$ord++;
}
$json_data.="\"code\":101,";
}
break;
case "wdjh_del":
$q="delete from ".$table_pre."client_shsj where id='".$id."'";
$db->query($q);
$q="delete from ".$table_pre."kh_sp where uid='".$uid."' and sszq='".$id."'";
$db->query($q);
$json_data.="\"code\":101,";
break;
default:
//----------------------------------------------沙盘模式
$w2=188;
$h2=250;
//
/*$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_cl ".$sql_con;
$res=$db->query($query);
$msg=$db->fetch_array($res);
$total=$msg["total"];*/
//定制条件
$query="select * from ".$table_pre."client_shsj where uid='".$uid."' order by id";
//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.="\"cplbs\":[";
$data_str="";
$content_list="[";
while($msg=$db->fetch_array($res)){
$q="SELECT a.* FROM ".$table_pre."order a INNER JOIN ".$table_pre."kh_sp b on a.uid=b.uid and a.iid=b.iid WHERE a.uid='".$uid."' and FIND_IN_SET(".$msg["id"].",b.allzq)>0";
//echo $query."<br>";
$r=$db->query($q);
$str_k="";
$arrkss=array();
$strc="";
$js=0;
while($m=$db->fetch_array($r)){
//图片获取规则
$pic=get_kh_color_picture($m["no"],$m["color"],$flag_pad_offline);
$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);
$str_k.="{\"khid\":".$m["iid"].",\"kh\":\"".$m["no"]."\",\"js\":\"".$m["num"]."\",\"color\":\"".$m["color"]."\",\"colort\":\"".get_cate_title_no("color",$m["color"])."\",\"pic\":\"".$pic."\",\"pic_w\":".$ck[0].",\"pic_h\":".$ck[1]."},";
$strc=$m["no"]."-".$m["color"];
$arrkss[$strc]=$strc;
$js+=$m["num"];
//
//$rnum++;
}
//$date=date('Y年m月d日',$msg["add_date"]);
$data_str.="{\"kss\":\"".$msg["kss"]."\",\"ydkss\":\"".count($arrkss)."\",\"ydjs\":\"".$js."\",\"date\":\"".$msg["add_date"]."\",\"list\":[".deel_end($str_k)."]},";
}
$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."]},";
}
$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_cl 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_cl_zd[$i]."\",\"value\":\"".$$v1."\",\"op\":[".$tmp."]},";
$op.="],";
$str_arr_select.=$op;
}
$select_dz=deel_end($select_dz);
$json_data.="\"select_dz\":[".$select_dz."],";
break;
}
}
$json_data=substr($json_data,0,-1)."}";
echo $json_data;
?>