7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
1603 lines
64 KiB
PHP
1603 lines
64 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");
|
|
$pm_ms=get_set("pm_ms");
|
|
$sys_size_num=get_max_size_num();
|
|
$theme_path=get_theme_path();
|
|
|
|
//推演下单界面传值间隔符,默认下划线_,当和款号内有下划线冲突时,推荐替换成*
|
|
$jgf="_";
|
|
|
|
$is_sy=get_set("is_sy");
|
|
|
|
$readpic="pic";
|
|
|
|
$arr_size_merged=get_size_merged();
|
|
$num_size_total=count($arr_size_merged);
|
|
|
|
$bs_kh_dj=get_set("bs_kh_dj");
|
|
$json_data.="\"bs_kh_dj\":\"".$bs_kh_dj."\",";
|
|
|
|
//是否显示搭配属性文字
|
|
$is_xswz="n";
|
|
$json_data.="\"is_xswz\":\"".$is_xswz."\",";
|
|
|
|
$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.="\"pm_ms\":\"".$pm_ms."\",";
|
|
$json_data.="\"cldp\":\"".$cldp."\",";
|
|
$json_data.="\"cl_order_top\":\"".$cl_order_top."\",";
|
|
|
|
$json_data.="\"is_sy\":\"".$is_sy."\",";
|
|
$json_data.="\"username\":\"".$msg_login["username"]."\",";
|
|
|
|
$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 "update_jpty":
|
|
$q="update ".$table_pre."client set jpty='".$jpty."' where id='".$uid."'";
|
|
$db->query($q);
|
|
$json_data.="\"code\":101,";
|
|
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="";
|
|
/*if($s_title){
|
|
$sql_con.="title like '%".$s_title."%' and ";
|
|
$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="";
|
|
}
|
|
/*if($s_title){
|
|
$sql_con="where title like '%".$s_title."%' and ";
|
|
}*/
|
|
$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[$readpic];
|
|
//echo $msg1["kh"]."-";
|
|
if($msg1["dp"]){
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$msg1["dp"]."' 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"]."\",";
|
|
|
|
$xsdw=explode(",",$msg1["zd2"]);
|
|
|
|
$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[$readpic]."_".$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["dp"]."_".$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},";
|
|
}
|
|
/*$m_pj=get_db_msg("select * from ".$table_pre."client_pj where cid='".$uid."' and khid='".$msg["id"]."' limit 0,1");
|
|
$rc=$m_pj["race"]>0?$m_pj["race"]:0;
|
|
$tmp_race.="kh_".$msg["id"].":".$rc.",";
|
|
$tmp_dis=$rc>0?"":"none";
|
|
//取得评价
|
|
$td_pj="\"6|".$rc."|".$tmp_dis."\",";
|
|
//取得杯型
|
|
$arrBx=array();
|
|
$r2=$db->query("select * from ".$table_pre."size_bx where no='".$m1["kh"]."' order by bx");
|
|
$i1=0;
|
|
while($m2=$db->fetch_array($r2)){
|
|
$arrBx[$i1][]=$m2["bx"];
|
|
$arrBx[$i1][]=$m2["size"];
|
|
$i1++;
|
|
}
|
|
if(count($arrBx)==0){
|
|
$arrBx[0][0]="";
|
|
$arrBx[0][1]=$msg["size"];
|
|
}
|
|
if($msg["id"]>0){
|
|
if($msg["ka"]=="y"){
|
|
$c=get_set("ka_color");
|
|
}else{
|
|
$c=get_set_value_dote($style_title_color,$msg["kh_dj"]);
|
|
}
|
|
//图片获取规则
|
|
$pic=get_kh_color_picture($msg["no"],$t1,$flag_pad_offline);
|
|
$n1=deel_num(get_order_num_kh_color($msg["id"],$t1));
|
|
if(in_array($dkcs, $arr_dk)){
|
|
}else{
|
|
//$content_list.="".$msg["id"].",".$m1["ord"].",\"".get_kh_xh($msg,$t1)."\",\"".$msg["no"]."\",\"".$t1."\",\"".get_cate_title_no("color",$t1)."\",".deel_num(get_price_dp($uid,$msg["id"])).",\"".$pic."\",\"".str_replace("\"","'",out_good_pic_set($pic,$w2,$h2))."\",".$n1.",\"".$c."\",";
|
|
//$arr_dk[]=$dkcs;
|
|
}
|
|
$rnum++;
|
|
$count++;
|
|
|
|
//无规格
|
|
$tmp_pic=get_kh_color_picture($msg["no"],$t1,$flag_pad_offline);
|
|
$ks_bx_num.=count($arrBx).",";
|
|
//echo $n1."-".count($arr_color)."<br>";
|
|
if($na){
|
|
$num_arr.="[\"".count($arrBx)."\",".$msg["id"].",\"".$t1."\",\"10|".$tmp_pic."\",\"2|".deel_js_var("<span style=\"".$sty1."\">".$t1."-<br>".get_cate_title_no("color",$t1)."</span>")."\",";
|
|
|
|
|
|
}else{
|
|
$num_arr.="[\"".count($arrBx)."\",".$msg["id"].",\"".$t1."\",\"1|".$msg["no"]."<br>".get_cate_title_no("category",$msg["category"])."<br>".get_price_dp($uid,$msg["id"])."元".$price_zk."|".count($arr_color)."\",\"10|".$tmp_pic."\",\"2|".deel_js_var("<span style=\"".$sty1."\">".$t1."-<br>".get_cate_title_no("color",$t1)."</span>")."\",";
|
|
}
|
|
for($i1=0;$i1<count($arrBx);$i1++){
|
|
$arr_kh_size=explode(",",$arrBx[$i1][1]);
|
|
if($i1>0)
|
|
$num_arr.="[\"1\",".$msg["id"].",\"".$t1."\",";
|
|
//
|
|
$td_size1="";
|
|
$xj=0;
|
|
for($k=1;$k<=$num_size_total;$k++){
|
|
if(check_size_not($msg["no"],$t1,$arrBx[$j1][0],$k)=="y"){
|
|
$disable_color2=" disabled";
|
|
$bg_input_num="#cccccc";
|
|
}else{
|
|
$disable_color2=$disable_color;
|
|
$bg_input_num="#ffffff";
|
|
}
|
|
if(check_md($msg["no"],$t1,$arrBx[$i1][0],$k,$msg_login["dj"])=="n"){
|
|
$bg_input_num1=$bg_input_num;
|
|
}else{
|
|
$bg_input_num1="#00ff00";
|
|
$have_md="y";
|
|
}
|
|
//echo $k."-";
|
|
//print_r($arr_kh_size);
|
|
if(in_array($k,$arr_kh_size)){
|
|
$num1=get_order_num($msg["id"],$t1,$arrBx[$i1][0],$k);
|
|
$js_check_str.=$num1.",";
|
|
$xj+=$num1;
|
|
//合计尺码数量
|
|
$var_xj_size="xj_size_".$k;
|
|
$$var_xj_size+=$num1;
|
|
$tmp1=get_db_msg("select title from ".$table_pre."size where iid='".$msg["size_group"]."' and no='".strtolower($k)."'");
|
|
$td_size1.="\"3|".$tmp1["title"]."|".$msg1["kh"]."_".$msg["no"]."_".$t1."_".strtolower($k)."|".$bg_input_num1."|".$num1."|".$disable_color2."\",";
|
|
$num_arr_s.="{\"id\":\"".$msg1["kh"]."_".$msg["no"]."_".$t1."_".strtolower($k)."\"},";
|
|
}else{
|
|
$td_size1.="\"9| \",";
|
|
}
|
|
}
|
|
//if($have_ggk!="n")
|
|
//$num_arr.="\"7||\",";
|
|
if($have_ggk=="y")
|
|
$num_arr.="\"9| \",";
|
|
if($bx_sizegroup_id>0)
|
|
$num_arr.="\"4|".$arrBx[$i1][0]."\",";
|
|
$num_arr.=$td_size1."\"5|".$xj."|xj_".$msg["no"]."_".$t1."\",";
|
|
if($i1>0){
|
|
$num_arr.="],";
|
|
}else{
|
|
$num_arr.="],";
|
|
//$num_arr.=$td_pj."],";
|
|
}
|
|
$num_hang++;
|
|
$total+=$xj;
|
|
}
|
|
}*/
|
|
}
|
|
}
|
|
$tmpwz="";
|
|
foreach($xsdw as $a1=> $b1){
|
|
$tmpwz.=$b1;
|
|
}
|
|
$arr_dp.="{\"zsh\":\"".$dp_zsh."\",";
|
|
$arr_dp.="\"xszt\":\"".$msg1["zd1"]."\",";
|
|
$arr_dp.="\"xsdw\":\"".$tmpwz."\",";
|
|
$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."|";
|
|
}elseif($msg1["kh"]){
|
|
//echo "aaa";
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where ka<>'y' and no='".$msg1["kh"]."' and color='".$msg1["color"]."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
//echo "bbb";
|
|
$tmp_ps1="../attachments/ty/big/".$msg1[$readpic]."_".$msg1["kh"]."_".$msg1["color"].".png";
|
|
//echo $tmp_ps1;
|
|
if(is_file($tmp_ps1)){
|
|
//echo "ccc";
|
|
//$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,";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$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[$readpic].".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[$readpic].".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 "save": //保存订单
|
|
if($order_close=="y"){
|
|
$str="订单保存失败,原因是系统订单已经关闭!";
|
|
//break;
|
|
}
|
|
if($is_brand=="y"){
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
$str_brand="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$msg=get_db_msg("select brand from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$str_brand.="'".$msg["brand"]."',";
|
|
}
|
|
$str_brand=deel_end($str_brand);
|
|
|
|
$brand_jd=get_db_msg("select * from ".$table_pre."client_brand where cid='".$uid."' and brand in (".$str_brand.") and (is_checked='y' or is_dd_checked='y')");
|
|
$brand_qr=get_db_msg("select * from ".$table_pre."client_brand where cid='".$uid."' and brand in (".$str_brand.") and is_jd='y'");
|
|
if($brand_qr["id"]){
|
|
$str="订单保存失败,原因是本用户订单已经确认!";
|
|
//break;
|
|
}
|
|
if($brand_jd["id"]){
|
|
$str="订单保存失败,原因是本用户订单已经提交!";
|
|
//break;
|
|
}
|
|
//判断代理
|
|
$dl_uid=get_dl_id($msg_login["path"]);
|
|
if($dl_uid>0){
|
|
$brand_jd_dl=get_db_msg("select * from ".$table_pre."client_brand where cid='".$dl_uid."' and brand in (".$str_brand.") and (is_checked='y' or is_dd_checked='y')");
|
|
$brand_qr_dl=get_db_msg("select * from ".$table_pre."client_brand where cid='".$dl_uid."' and brand in (".$str_brand.") and is_jd='y'");
|
|
if($brand_jd_dl["id"]){
|
|
$str="订单保存失败,原因是您的代理已经提交!";
|
|
//break;
|
|
}
|
|
if($brand_qr_dl["id"]){
|
|
$str="订单保存失败,原因是您的代理订单已经确认!";
|
|
//break;
|
|
}
|
|
}
|
|
}else{
|
|
if($msg_login["is_checked"]=="y"){
|
|
$str="订单保存失败,原因是本用户订单已经确认!";
|
|
//break;
|
|
}
|
|
if($msg_login["is_jd"]=="y"){
|
|
$str="订单保存失败,原因是本用户订单已经提交!";
|
|
//break;
|
|
}
|
|
//判断代理
|
|
$dl_uid=get_dl_id($msg_login["path"]);
|
|
if($dl_uid>0){
|
|
$msg_dl=get_db_msg("select * from ".$table_pre."client where id='".$dl_uid."'");
|
|
if($msg_dl["is_jd"]=="y"){
|
|
$str="订单保存失败,原因是您的代理已经提交!";
|
|
//break;
|
|
}
|
|
if($msg_dl["is_checked"]=="y"){
|
|
$str="订单保存失败,原因是您的代理订单已经确认!";
|
|
//break;
|
|
}
|
|
}
|
|
}
|
|
//echo $str;
|
|
//alert_and_back($dph);
|
|
//exit;
|
|
$arr1=explode("|",$arr);
|
|
$arr_num=array();
|
|
foreach($arr1 as $n1 => $t1){
|
|
$tmp=explode("-",$t1);
|
|
$arr_num[$tmp[0]]=$tmp[1];
|
|
}
|
|
//print_r($arr_num);
|
|
//---------------判断订货规则
|
|
$k=0;
|
|
//for($i=0;$i<count($num_size_total);$i++){
|
|
/*$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
while($msg1=$db->fetch_array($res)){*/
|
|
//if($msg1["kh"]==$dph){
|
|
//$q1="select * from ".$table_pre."kh_dp where zsh='".$msg1["kh"]."' order by ord";
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $n1 => $t1){
|
|
$num1=0;
|
|
//echo $num_size_total;
|
|
|
|
for($j=1;$j<=$num_size_total;$j++){
|
|
//for($s1=1;$s1<=$sys_size_num;$s1++){
|
|
//$var1="num_".$m1["kh"]."_".$t1."_".$j;
|
|
$var1="num".$jgf."".$dph."".$jgf."".$m1["kh"]."".$jgf."".$t1."".$jgf."".$j;
|
|
//echo $var1;
|
|
$num1+=$arr_num[$var1];
|
|
//echo "<br>".$arr_num[$var1];
|
|
//}
|
|
//$k++;
|
|
}
|
|
$tmpck=check_dhgz_bdks($msg,$t1,$num1);
|
|
if($tmpck){
|
|
$str=$tmpck;
|
|
break;
|
|
}
|
|
//检查款号规则
|
|
$tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where uid='".$uid."' and iid='".$msg["id"]."' and color<>'".$t1."' and _key='".$_key."'");
|
|
$tmp_kh_num=$tmp["num"]+$num1;
|
|
$tmpck=check_dhgz_bdk($msg,$tmp_kh_num);
|
|
//echo $tmpck;
|
|
if($tmpck){
|
|
$str=$tmpck;
|
|
break;
|
|
}
|
|
$tmpck1=check_dhgz_qdl($msg,$t1,$tmp_kh_num);
|
|
if($tmpck1){
|
|
$str=$tmpck1;
|
|
break;
|
|
}
|
|
//check_dhgz_glk($msg["no"],$tmp_kh_num,$str_kh_num);
|
|
}
|
|
}
|
|
//}
|
|
//}
|
|
if(!$str){
|
|
$num_hang=0;
|
|
//取得选项
|
|
$arr_select_no=array();
|
|
$q1="select no from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'jgd' and no<>'sx' and no<>'zd1' and no<>'zd2' and no<>'zd3' order by ord";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$arr_select_no[]=$m1["no"];
|
|
}
|
|
$ks_list=0;
|
|
//for($i=0;$i<count($arr_ks_bx_num);$i++){
|
|
/*$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
while($msg1=$db->fetch_array($res)){*/
|
|
//if($msg1["kh"]==$dph){
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $n1 => $t1){
|
|
$arr_color_ka=explode(",",$msg["color_ka"]);
|
|
if(!in_array($t1,$arr_color_ka)){
|
|
$arr_size=explode(",",$msg["size"]);
|
|
$tmp_old1=get_db_msg("select sum(".get_size_sql("sum").") 'num',".get_size_sql("sum1")." from ".$table_pre."order where uid='".$uid."' and no='".$m1["kh"]."' and color='".$t1."' and _key='".$_key."'");
|
|
$log_hd_old_num=$tmp_old1["num"];
|
|
$tmp_old=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where uid='".$uid."' and no='".$m1["kh"]."' and _key='".$_key."'");
|
|
$log_hd_old_num_kh=$tmp_old["num"];
|
|
$tmp_total_num=0;
|
|
//for($j=0;$j<$arr_ks_bx_num[$i];$j++){
|
|
$c=0;
|
|
$is_change="n";
|
|
$sql_size1=$sql_size2=$sql_size3="";
|
|
for($s1=1;$s1<=$num_size_total;$s1++){
|
|
$var1="num".$jgf."".$dph."".$jgf."".$m1["kh"]."".$jgf."".$t1."".$jgf."".$s1;
|
|
$tmpa="num_".$s1;
|
|
if($tmp_old1[$tmpa]<>$arr_num[$var1]){
|
|
$is_change="y";
|
|
}
|
|
$c+=$arr_num[$var1];
|
|
$sql_size1.="num_".$s1."='".deel_num($arr_num[$var1])."',";
|
|
$sql_size2.=",'".deel_num($arr_num[$var1])."'";
|
|
$sql_size3.="num_".$s1.",";
|
|
|
|
}
|
|
$c1=0;
|
|
$cypm="";
|
|
for($s1=1;$s1<=count($arr_size);$s1++){
|
|
$var1="num".$num_hang."_".$s1;
|
|
$c1+=$$var1;
|
|
$cypm.=deel_num($$var1).":";
|
|
}
|
|
if($c1>0){
|
|
$cypm=substr($cypm,0,-1);
|
|
$tmpcypm=get_db_msg("select * from ".$table_pre."pm_count where uid='".$uid."' and gz='".$cypm."'");
|
|
$cyomnum=0;
|
|
if($tmpcypm["id"]){
|
|
$cyomnum=$tmpcypm["num"]+1;
|
|
$q="update ".$table_pre."pm_count set num=".$cyomnum.",add_date='".time()."' where id='".$tmpcypm["id"]."'";
|
|
}else{
|
|
$cyomnum++;
|
|
$q="insert into ".$table_pre."pm_count (uid,gz,num,add_date) values ('".$uid."','".$cypm."',".$cyomnum.",'".time()."')";
|
|
}
|
|
$db->query($q);
|
|
}
|
|
$varBx="bx_".$num_hang;
|
|
$check=get_db_msg("select id from ".$table_pre."order where _key='".$_key."' and uid='".$uid."' and no='".$m1["kh"]."' and color='".$t1."' and bx='".$$varBx."'");
|
|
$tmp_total_num+=$c;
|
|
if($check["id"]){
|
|
if($c>0){
|
|
if($is_change=="y"){
|
|
$q="update ".$table_pre."order set ".$sql_size1."add_date='".time()."' where id='".$check["id"]."'";
|
|
$db->query($q);
|
|
update_order_log($uid,"update ".$table_pre."order set ".$sql_size1."add_date='".time()."' where _key='".$_key."' and uid='".$uid."' and no='".$m1["kh"]."' and color='".$t1."' and bx='".$$varBx."'");
|
|
cache_order($uid,$msg["id"],$t1,$$varBx);
|
|
}
|
|
}else{
|
|
$q="delete from ".$table_pre."order where id='".$check["id"]."'";
|
|
update_order_log($uid,"delete from ".$table_pre."order where _key='".$_key."' and uid='".$uid."' and no='".$m1["kh"]."' and color='".$t1."' and bx='".$$varBx."'");
|
|
$db->query($q);
|
|
}
|
|
}else{
|
|
if($c>0){
|
|
//取得选项
|
|
$sql1=$sql2="";
|
|
for($i1=0;$i1<count($arr_select_no);$i1++){
|
|
$sql1.=$arr_select_no[$i1].",";
|
|
$sql2.="'".$msg[$arr_select_no[$i1]]."',";
|
|
}
|
|
$q="insert into ".$table_pre."order (uid,upath,iid,no,".$sql1."jgd,color,bx,is_sp,size_group_id,".$sql_size3."_key,sx,add_date) values ('".$uid."','".$upath."','".$msg["id"]."','".$msg["no"]."',".$sql2."'".get_jgd($msg["price"])."','".$t1."','".$$varBx."','".$msg["is_sp"]."','".$msg["size_group"]."'".$sql_size2.",'".$_key."','".get_sx($t1)."','".time()."')";
|
|
$db->query($q);
|
|
update_order_log($uid,"insert into ".$table_pre."order (uid,upath,iid,no,".$sql1."jgd,color,bx,is_sp,size_group_id,".$sql_size3."_key,sx,add_date) values ('".$uid."','".$upath."','".$msg["id"]."','".$msg["no"]."',".$sql2."'".get_jgd($msg["price"])."','".$t1."','".$$varBx."','".$msg["is_sp"]."','".$msg["size_group"]."'".$sql_size2.",'".$_key."','".get_sx($t1)."','".time()."')");
|
|
cache_order($uid,$msg["id"],$t1,$$varBx);
|
|
}
|
|
}
|
|
//echo $q;
|
|
$num_hang++;
|
|
//}
|
|
count_ph($uid,$msg["id"],$t1);
|
|
$khid=$msg["id"];
|
|
$log_hd_num=$tmp_total_num-$log_hd_old_num;
|
|
//
|
|
update_log_hd();
|
|
}
|
|
}
|
|
}
|
|
//}
|
|
//}
|
|
set_order_total($uid);
|
|
$json_data.="\"code\":101,";
|
|
}else{
|
|
$json_data.="\"code\":0,\"msg\":\"".$str."\",";
|
|
}
|
|
break;
|
|
case "show": //显示下单界面
|
|
//$str.="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"index\" width=\"100%\"><tr><td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#cccccc\"><tr><td height=\"30\" bgcolor=\"#f0f0f0\" align=\"center\"><b>单款信息</b></td><td height=\"30\" bgcolor=\"#f0f0f0\" align=\"center\"><b>单款图片</b></td><td bgcolor=\"#f0f0f0\" align=\"center\"><b>颜色</b></td>";
|
|
//$str.="<td bgcolor=\"#f0f0f0\" align=\"center\" colspan=\"".$num_size_total."\"><b>尺码</b></td><td bgcolor=\"#f0f0f0\" align=\"center\"><b>小计</b></tr>";
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
$num_arr=array();
|
|
$count=0;
|
|
|
|
$json_data.="\"zsh\":\"".$dph."\",";
|
|
$json_data.="\"num_size_total\":\"".$num_size_total."\",";
|
|
$num_arr="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
if($pm_ms=="m2"){
|
|
//默认匹配规则
|
|
$default_pm_id=0;
|
|
$default_pm="";
|
|
//取得所有适合我的配码
|
|
$pm_op="";
|
|
$pm_op_value=$default_pm_id;
|
|
$con1="((uid='0' and dlid=0 and qyid=0) or (uid='".$uid."')) and (khid='".$msg["id"]."' or khid='0')";
|
|
if($msg["pm_dj"]){
|
|
$con1.=" and pm_dj='".$msg["pm_dj"]."'";
|
|
}
|
|
$q="select id,title,gz from ".$table_pre."size_pm where ".$con1." order by uid desc,dlid desc,qyid desc,size_group_id desc,id desc";
|
|
$r=$db->query($q);
|
|
$i=0;
|
|
while($m=$db->fetch_array($r)){
|
|
$pm_op.="{\"gz\":\"".$m["gz"]."\",\"title\":\"".$m["title"]."\",\"id\":\"".$m["id"]."\"},";
|
|
if($i==0){
|
|
$default_pm_id=$m["id"];
|
|
$default_pm=$m["gz"];
|
|
}
|
|
$i++;
|
|
}
|
|
$pm_op=substr($pm_op,0,-1);
|
|
}
|
|
$arr_color=explode(",",$msg["color"]);
|
|
$arr_color_ka=explode(",",$msg["color_ka"]);
|
|
$ka="n";
|
|
if($msg["ka"]=="y"){
|
|
$ka="y";
|
|
}
|
|
$num_arr.="{\"ggs\":\"".count($arr_color)."\",\"khid\":\"".$msg["id"]."\",\"no\":\"".$msg["no"]."\",\"ka\":\"".$ka."\",\"category\":\"".get_cate_title_no("category",$msg["category"])."\",\"price\":".get_price_dp($uid,$msg["id"]).",";
|
|
if($pm_ms=="m2"){
|
|
$num_arr.="\"default_pm\":\"".$default_pm."\",";
|
|
$num_arr.="\"default_pm_id\":\"".$default_pm_id."\",";
|
|
$num_arr.="\"pms\":[".$pm_op."],";
|
|
}
|
|
$strarr="";
|
|
foreach($arr_color as $na => $t1){
|
|
$strarr.="{\"color\":\"".$t1."\",\"value\":[";
|
|
$ka_color="n";
|
|
if(in_array($t1, $arr_color_ka)){
|
|
$ka_color="y";
|
|
}
|
|
$arr1=array();
|
|
//$a=$t1;
|
|
$arrBx=array();
|
|
$r2=$db->query("select * from ".$table_pre."size_bx where no='".$m1["kh"]."' order by bx");
|
|
$i1=0;
|
|
while($m2=$db->fetch_array($r2)){
|
|
$arrBx[$i1][]=$m2["bx"];
|
|
$arrBx[$i1][]=$m2["size"];
|
|
$i1++;
|
|
}
|
|
if(count($arrBx)==0){
|
|
$arrBx[0][0]="";
|
|
$arrBx[0][1]=$msg["size"];
|
|
}
|
|
if($msg["id"]>0){
|
|
$tmp_pic=get_kh_color_picture($msg["no"],$t1,$flag_pad_offline);
|
|
$tmpwh=out_good_pic_set_arr($tmp_pic,$tmpl_m3_pic_width,$tmpl_m3_pic_height);
|
|
$strarr.="{\"no\":\"10\",\"pic\":\"".$tmp_pic."\",\"pic_w\":\"".$tmpwh[0]."\",\"pic_h\":\"".$tmpwh[1]."\"},";
|
|
$arr1[0]=count($arrBx);
|
|
$arr1[1]=$msg["id"];
|
|
//echo $msg["id"];
|
|
$arr1[2]=$t1;
|
|
$ct=3;
|
|
$arr1[$ct]=$ka;
|
|
$ct++;
|
|
if($na){
|
|
//$tmp=array(0=>"10",1=>$tmp_pic);
|
|
$arr1[$ct]="10|".$tmp_pic;
|
|
$ct++;
|
|
|
|
}else{
|
|
//$tmpaa=$msg["no"]."<br>".get_cate_title_no("category",$msg["category"])."<br>".get_price_dp($uid,$msg["id"])."元".$price_zk;
|
|
//$tmp=array(0=>"1",1=>$tmpaa,2=>count($arr_color));
|
|
$arr1[$ct]="1|".$msg["no"]."<br>".get_cate_title_no("category",$msg["category"])."<br>".get_price_dp($uid,$msg["id"])."元".$price_zk."|".count($arr_color);
|
|
$ct++;
|
|
|
|
//$tmp=array(0=>"10",1=>$tmp_pic);
|
|
$arr1[$ct]="10|".$tmp_pic;
|
|
$ct++;
|
|
|
|
}
|
|
//$tmpaa=deel_js_var("<span style=\"".$sty1."\">".$t1."-<br>".get_cate_title_no("color",$t1)."</span>");
|
|
//$tmp=array(0=>"2",1=>$tmpaa);
|
|
$bss="";
|
|
$bssys="color:black;";
|
|
$aa="";
|
|
$bgs="n";
|
|
if($t1==$m1["color"]){
|
|
$bss="(本杆款色)";
|
|
$bssys="color:red;";
|
|
$aa="<font size='4px'>★</font>";
|
|
$bgs="y";
|
|
}
|
|
//$arr1[$ct]="2|".deel_js_var("<span style='".$sty1.$bssys."'>".$aa.$t1."-<br>".get_cate_title_no("color",$t1).$bss."</span>")."|".$ka_color;
|
|
$strarr.="{\"no\":\"2\",\"bgs\":\"".$bgs."\",\"color\":\"".$t1."\",\"ka\":\"".$ka_color."\",\"colort\":\"".get_cate_title_no("color",$t1)."\"},";
|
|
$ct++;
|
|
for($i1=0;$i1<count($arrBx);$i1++){
|
|
$arr_kh_size=explode(",",$arrBx[$i1][1]);
|
|
if($i1>0){
|
|
echo $i1;
|
|
//$tmp=array(0=>"1",1=>$msg["id"],2=>$t1);
|
|
$arr1[$ct]=1;
|
|
$ct++;
|
|
$arr1[$ct]=$msg["id"];
|
|
$ct++;
|
|
$arr1[$ct]=$t1;
|
|
$ct++;
|
|
|
|
}
|
|
if($have_ggk=="y"){
|
|
//$tmp=array(0=>"9",1=>"");
|
|
//$arr1[$ct]="9| ";
|
|
$strarr.="{\"no\":\"9\",\"value\":\" \"},";
|
|
$ct++;
|
|
}
|
|
if($bx_sizegroup_id>0){
|
|
//$tmp=array(0=>"4",1=>$arrBx[$i1][0]);
|
|
//$arr1[$ct]="4|".$arrBx[$i1][0];
|
|
$strarr.="{\"no\":\"4\",\"value\":\"".$arrBx[$i1][0]."\"},";
|
|
$ct++;
|
|
}
|
|
$td_size1="";
|
|
$xj=0;
|
|
for($k1=1;$k1<=$num_size_total;$k1++){
|
|
if(check_size_not($msg["no"],$t1,$arrBx[$j1][0],$k1)=="y"){
|
|
$disable_color2=" disabled";
|
|
$bg_input_num="#cccccc";
|
|
}else{
|
|
$disable_color2=$disable_color;
|
|
$bg_input_num="#ffffff";
|
|
}
|
|
if(check_md($msg["no"],$t1,$arrBx[$i1][0],$k1,$msg_login["dj"])=="n"){
|
|
$bg_input_num1=$bg_input_num;
|
|
}else{
|
|
$bg_input_num1="#00ff00";
|
|
$have_md="y";
|
|
}
|
|
if($ka_color=="y"){
|
|
$disable_color2=" disabled";
|
|
}
|
|
if(in_array($k1,$arr_kh_size)){
|
|
$num1=get_order_num($msg["id"],$t1,$arrBx[$i1][0],$k1);
|
|
//$js_check_str.=$num1.",";
|
|
$xj+=$num1;
|
|
//合计尺码数量
|
|
//$var_xj_size="xj_size_".$k1;
|
|
//$$var_xj_size+=$num1;
|
|
$tmp1=get_db_msg("select title from ".$table_pre."size where iid='".$msg["size_group"]."' and no='".strtolower($k1)."'");
|
|
//$td_size1.="\"3|".$tmp1["title"]."|".$msg1["kh"]."_".$msg["no"]."_".$t1."_".strtolower($k1)."|".$bg_input_num1."|".$num1."|".$disable_color2."\",";
|
|
|
|
//$tmp=array(0=>"3",1=>$tmp1["title"],2=>"".$msg1["kh"]."_".$msg["no"]."_".$t1."_".strtolower($k1)."",3=>$bg_input_num1,4=>$num1,5=>$disable_color2);
|
|
//$arr1[$ct]="3|".$tmp1["title"]."|".$m1["title"]."_".$msg["no"]."_".$t1."_".strtolower($k1)."|".$bg_input_num1."|".$num1."|".$disable_color2;
|
|
$strarr.="{\"no\":\"3\",\"id\":\"num".$jgf."".$m1["zsh"]."".$jgf."".$msg["no"]."".$jgf."".$t1."".$jgf."".strtolower($k1)."\",\"size\":\"".$tmp1["title"]."\",\"bg\":\"".$bg_input_num1."\",\"disable\":\"".$disable_color2."\",\"value\":\"".$num1."\"},";
|
|
$ct++;
|
|
}else{
|
|
//$td_size1.="\"9| \",";
|
|
//$tmp=array(0=>"9",1=>"");
|
|
//$arr1[$ct]="9| ";
|
|
$strarr.="{\"no\":\"9\",\"value\":\" \"},";
|
|
$ct++;
|
|
}
|
|
}
|
|
//$tmp=array(0=>"5",1=>$xj,2=>"xj_".$msg["no"]."_".$t1."");
|
|
//$arr1[$ct]="5|".$xj."|xj_".$msg["no"]."_".$t1;
|
|
$strarr.="{\"no\":\"5\",\"value\":\"".$xj."\"},";
|
|
$ct++;
|
|
//$num_arr.=$td_size1."\"5|".$xj."|xj_".$msg["no"]."_".$t1."\",";
|
|
//$num_arr[$dph][$count]=$arr1;
|
|
$count++;
|
|
}
|
|
|
|
}
|
|
$strarr=substr($strarr,0,-1)."]},";
|
|
|
|
}
|
|
$strarr=substr($strarr,0,-1);
|
|
$num_arr.="\"dd\":[".$strarr."]},";
|
|
|
|
}
|
|
$num_arr=substr($num_arr,0,-1);
|
|
$json_data.="\"dks\":[".$num_arr."],";
|
|
//print_r($num_arr);
|
|
//$num_arr[$dph]=$arr1;
|
|
/*for($i=0;$i<count($num_arr[$dph]);$i++){
|
|
//print_r($num_arr[$dph][$i][2]);
|
|
if($num_arr[$dph][$i]){
|
|
$str.="<tr id=\"kh_".$num_arr[$dph][$i][1]."_".$num_arr[$dph][$i][2]."\" class=\"kh_normal\" >";
|
|
for($j=4;$j<count($num_arr[$dph][$i]);$j++){
|
|
if($num_arr[$dph][$i][$j]){
|
|
$arr_tmp=explode("|",$num_arr[$dph][$i][$j]);
|
|
//$arr_tmp=$num_arr[$dph][$i][$j].split("|");
|
|
if($arr_tmp[0]=="1"){
|
|
if($num_arr[$dph][$i][3]=="y"){
|
|
$str.="<td bgcolor=\"#f0f0f0\" height=\"60\" style=\"cursor:pointer;color:#0000ff;\" rowspan=\"".$arr_tmp[2]."\" align=\"center\"><input type=\"hidden\" name=\"khid_".$i."\" value=\"".$num_arr[$dph][$i][1]."\"><input type=\"hidden\" name=\"color_".$i."\" value=\"".$num_arr[$dph][$i][2]."\"><font color=\"red\">".$arr_tmp[1]."</font></td>";
|
|
}else{
|
|
$str.="<td bgcolor=\"#f0f0f0\" height=\"60\" style=\"cursor:pointer;color:#0000ff;\" rowspan=\"".$arr_tmp[2]."\" align=\"center\"><input type=\"hidden\" name=\"khid_".$i."\" value=\"".$num_arr[$dph][$i][1]."\"><input type=\"hidden\" name=\"color_".$i."\" value=\"".$num_arr[$dph][$i][2]."\">".$arr_tmp[1]."</td>";
|
|
}
|
|
}else if($arr_tmp[0]=="10"){
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"center\"><img src=\"".$arr_tmp[1]."\" width=\"60px;\"></td>";
|
|
}else if($arr_tmp[0]=="2"){
|
|
if($arr_tmp[2]=="y"){
|
|
$str.="<td bgcolor=\"#ffffff\" rowspan=\"".$num_arr[$dph][$i][0]."\" align=\"center\"><font color=\"red\">".$arr_tmp[1]."</font></td>";
|
|
}else{
|
|
$str.="<td bgcolor=\"#ffffff\" rowspan=\"".$num_arr[$dph][$i][0]."\" align=\"center\">".$arr_tmp[1]."</td>";
|
|
}
|
|
|
|
}else if($arr_tmp[0]=="3"){
|
|
|
|
$tmpa=explode("_",$arr_tmp[2]);
|
|
//$tmpa=$arr_tmp[2].split("_");
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"center\"><div align=\"center\">".$arr_tmp[1]."</div><input type=\"number\" id=\"num_".$arr_tmp[2]."\" name=\"num_".$arr_tmp[2]."\" value=\"".$arr_tmp[4]."\" style=\"width:".$input_width."px;font-size:14px;background-color:".$arr_tmp[3].";\" onchange=\"re_count1(this.name);this.value=this.value.replace(/\D/g,'0');\"".$arr_tmp[5]." /></td>";
|
|
|
|
}else if($arr_tmp[0]=="4"){
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"center\"><input type=\"hidden\" name=\"bx_".$i."\" value=\"".$arr_tmp[1]."\">".$arr_tmp[1]."</td>";
|
|
}else if($arr_tmp[0]=="5"){
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"right\"><div id=\"".$arr_tmp[2]."\" name=\"".$arr_tmp[2]."\" />".$arr_tmp[1]."</div></td>";
|
|
}else if($arr_tmp[0]=="7"){
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"center\"><input type=\"hidden\" name=\"bx_".$i."\" value=\"".$arr_tmp[1]."\">".$arr_tmp[2]."</td>";
|
|
}else{
|
|
$str.="<td bgcolor=\"#ffffff\" align=\"center\">".$arr_tmp[1]."</td>";
|
|
}
|
|
}
|
|
}
|
|
$str.="</tr>";
|
|
}
|
|
}
|
|
$str.="<tr><td height=\"50\" align=\"center\" valign=\"middle\" colspan=\"".($num_size_total+4)."\" bgcolor=\"#ffffff\"><input type=\"button\" value=\" 保存订单 \" name=\"save_dp\" id=\"save_dp\" onclick=\"save_order('".$dph."',".$k.",".$w.",".$h.")\" class=\"button1\" style=\"background:url(theme/default/images/button_bg.png) center center no-repeat;\"> <input type=\"button\" value=\" 关闭列表 \" name=\"closebtn\" id=\"closebtn\" onclick=\"display_orderlist()\" class=\"button1\" style=\"background:url(theme/default/images/button_bg.png) center center no-repeat;\"></td></tr>";
|
|
$str.="</table></div>";
|
|
$str.="</table>";*/
|
|
break;
|
|
case "update_ydcl": //更新陈列图
|
|
|
|
$msg_cl=get_db_msg("select * from ".$table_pre."kh_ty where zsh='".$s_zsh."'");
|
|
$ydclpic=$msg_cl[$readpic];
|
|
//$ydclpic_set=out_good_pic_set("../attachments/ty/big/".$msg_cl["pic"].".png",$tmpl_m3_cl_pic_width,$tmpl_m3_cl_pic_height);
|
|
//$str.="<div style=\"width:50%;padding:2px;\" id=\"div_ydcl\" ><div id=\"div_ydcl1\" style=\"position:relative;top:0px;display:block;float:left;\"> ";
|
|
//$str.="<div style=\"position:absolute;top:0;left:40px;z-index:1;\" ><img src=\"../attachments/ty/big/".$ydclpic.".png\" ".$ydclpic_set."></div>";
|
|
if($clxs=="h"){
|
|
$str.="<div style=\"width:50%;padding:2px;\" id=\"div_ydcl\" ><div id=\"div_ydcl1\" style=\"position:relative;top:0px;display:block;float:left;\"> ";
|
|
$str.="<div style=\"position:absolute;top:0;left:40px;z-index:1;\" ><img src=\"../attachments/ty/big/".$ydclpic.".png\" ".$ydclpic_set."></div>";
|
|
}else{
|
|
$str.="<div id=\"div_ydcl\" align=\"center\" ".$ydclpic_set." ><div id=\"div_ydcl1\" style=\"position:relative;top:0px;display:block;float:left;\"> ";
|
|
$str.="<div style=\"position:absolute;top:0;left:0px;z-index:1;\" ><img src=\"../attachments/ty/big/".$ydclpic.".png\" ".$ydclpic_set."></div>";
|
|
}
|
|
$ydclpic="../attachments/ty/big/".$msg_cl[$readpic].".png";
|
|
if(is_file($ydclpic)){
|
|
$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";
|
|
$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]).",";
|
|
}
|
|
|
|
//$clpic=get_kh_cl_big($ydclpic,$flag_pad_offline);
|
|
//$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]).",";
|
|
|
|
$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
$ydcl="";
|
|
$j=2;
|
|
while($msg1=$db->fetch_array($res)){
|
|
if($msg1["dp"]){
|
|
$q1="select * from ".$table_pre."kh_dp where title='".$msg1["dp"]."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $na => $t1){
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where no='".$m1["kh"]."' and color='".$t1."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
$tmp_ps1="../attachments/ty/big/".$msg1[$readpic]."_".$m1["kh"]."_".$t1.".png";
|
|
if(is_file($tmp_ps1)){
|
|
//echo $msg1["zsh"]."_".$m1["kh"]."_".$t1."<br>";
|
|
$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])."\"},";
|
|
if($clxs=="h"){
|
|
//$str.="<div style=\"position:absolute;top:0;left:40px;z-index:".$j.";\" ><img src=\"../attachments/ty/big/".$msg1["zsh"]."_".$msg1["wzh"]."_".$msg1["kh"]."_".$msg1["color"].".png\" ".$ydclpic_set."></div>";
|
|
$str.="<div style=\"position:absolute;top:0;left:40px;z-index:".$j.";\" ><img src=\"../attachments/ty/big/".$msg1[$readpic]."_".$m1["kh"]."_".$t1.".png\" ".$ydclpic_set."></div>";
|
|
}else{
|
|
$str.="<div style=\"position:absolute;top:0;left:0px;z-index:".$j.";\" ><img src=\"../attachments/ty/big/".$msg1[$readpic]."_".$m1["kh"]."_".$t1.".png\" ".$ydclpic_set."></div>";
|
|
//$str.="<div style=\"position:absolute;top:0;left:0px;z-index:".$j.";\" ><img src=\"../attachments/ty/big/".$msg1["zsh"]."_".$msg1["wzh"]."_".$msg1["kh"]."_".$msg1["color"].".png\" ".$ydclpic_set."></div>";
|
|
}
|
|
$j++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}elseif($msg1["kh"]){
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where ka<>'y' and no='".$msg1["kh"]."' and color='".$msg1["color"]."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
//echo "bbb";
|
|
$tmp_ps1="../attachments/ty/big/".$msg1[$readpic]."_".$msg1["kh"]."_".$msg1["color"].".png";
|
|
//echo $tmp_ps1;
|
|
if(is_file($tmp_ps1)){
|
|
//echo "ccc";
|
|
//$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,";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$json_data.="\"ydcl\":[".deel_end($ydcl)."],";
|
|
$str.="</div></div>";
|
|
break;
|
|
case "update_yddp": //更新搭配图
|
|
if($s_zsh){
|
|
$dph=$s_zsh;
|
|
}
|
|
$msg_dp=get_db_msg("select * from ".$table_pre."kh_dp where zsh='".$dph."'");
|
|
$yddppic="../attachments/yddp/".$msg_dp["pic"].".png";
|
|
if(is_file($yddppic)){
|
|
$tmppic=out_good_pic_set_arr($yddppic,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$json_data.="\"yddppic\":\"".$yddppic."\",";
|
|
$json_data.="\"yddppic_w\":".deel_num($tmppic[0]).",";
|
|
$json_data.="\"yddppic_h\":".deel_num($tmppic[1]).",";
|
|
}else{
|
|
$no_ydclpic=1;
|
|
$yddppic="images/no_pic_big.png";
|
|
$json_data.="\"yddppic\":\"".$yddppic."\",";
|
|
$tmppic=out_good_pic_set_arr($yddppic,$tmpl_m1_pic_width,$tmpl_m1_pic_height);
|
|
$json_data.="\"yddppic_w\":".deel_num($tmppic[0]).",";
|
|
$json_data.="\"yddppic_h\":".deel_num($tmppic[1]).",";
|
|
}
|
|
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
$yddp="";
|
|
$j=2;
|
|
while($m1=$db->fetch_array($r1)){
|
|
$str.="<div id=\"div_yddp_".$dph."\" style=\"position:relative;top:0px;float:left;\" > ";
|
|
$str.="<img src=\"../attachments/yddp/".$m1["pic"].".png\" width=\"".$w."\" height=\"".$h."\" style=\"position:absolute;top:0;left:0;z-index:1;\">";
|
|
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $na => $t1){
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where no='".$m1["kh"]."' and color='".$t1."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
$tmp_ps="../attachments/yddp/".$m1["title"]."_".$m1["kh"]."_".$t1.".png";
|
|
if(is_file($tmp_ps)){
|
|
$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])."\"},";
|
|
$str.="<img src=\"../attachments/yddp/".$m1["title"]."_".$m1["kh"]."_".$t1.".png\" width=\"".$w."\" height=\"".$h."\" style=\"position:absolute;top:0;left:0;z-index:".$j.";\">";
|
|
$j++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$json_data.="\"yddp\":[".deel_end($yddp)."],";
|
|
$str.="</div>";
|
|
break;
|
|
case "update_ydwz": //更新搭配文字
|
|
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$dph."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
while($m1=$db->fetch_array($r1)){
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where no='".$m1["kh"]."'");
|
|
$arr_color=explode(",",$msg["color"]);
|
|
foreach($arr_color as $na => $t1){
|
|
$tmp_kh_order=get_db_msg("select num from ".$table_pre."order where no='".$m1["kh"]."' and color='".$t1."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
$dhqk.="{\"wz\":\"".get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1)."\",\"num\":".deel_num($tmp_kh_order["num"])."},";
|
|
$str.="<font size='1'>".$m1["kh"]."-".get_cate_title_no("color",$t1).":".$tmp_kh_order["num"]."件<br></font>";
|
|
}else{
|
|
$dhqk.="{\"wz\":\"".get_cate_title_no("category",$msg["category"])."-".get_cate_title_no("color",$t1)."\",\"num\":0},";
|
|
$str.="<font size='1'>".$m1["kh"]."-".get_cate_title_no("color",$t1).":0件<br></font>";
|
|
}
|
|
}
|
|
}
|
|
$json_data.="\"dhqk\":[".deel_end($dhqk)."],";
|
|
//$str.="</div>";
|
|
break;
|
|
/*case "update_bzdhqk": //更新本组订货情况
|
|
|
|
$query="select * from ".$table_pre."kh_ty where zsh='".$s_zsh."' order by ord";
|
|
//echo $query."<br>";
|
|
$res=$db->query($query);
|
|
$bzks=$bzkss=$ydks=$ydkss=array();
|
|
$tmp_strjs=" and no in (";
|
|
while($msg1=$db->fetch_array($res)){
|
|
$q1="select * from ".$table_pre."kh_dp where zsh='".$msg1["kh"]."' order by ord";
|
|
//echo $q1."<br>";
|
|
$r1=$db->query($q1);
|
|
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"];
|
|
}
|
|
$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 no='".$m1["kh"]."' and color='".$t1."' and uid='".$uid."' and _key='".$_key."'");
|
|
if($tmp_kh_order["num"]){
|
|
$ydkss[$dkcs]=$dkcs;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$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"];
|
|
$ztdx="20px";
|
|
$str="<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>";
|
|
break;*/
|
|
case "ajax_is_tb":
|
|
//同步推演
|
|
$tmp_show=get_db_msg("select count(*) num from ".$table_pre."kh_ty where is_show='y'");
|
|
$str_is_tb="n";
|
|
if($tmp_show["num"]>0){
|
|
$str_is_tb="y";
|
|
}
|
|
$json_data.="\"is_tb\":\"".$str_is_tb."\",";
|
|
break;
|
|
case "ajax_ty":
|
|
//----------------------------------------------陈列模式
|
|
$sys_zycl="n";
|
|
if($sys_zycl=="y"){
|
|
$s_type=$s_type?$s_type:"1";
|
|
}
|
|
$json_data.="\"sys_zycl\":\"".$sys_zycl."\",";
|
|
$w2=$tmpl_m3_cl_pic_width;
|
|
$h2=$tmpl_m3_cl_pic_height;
|
|
$page_size=$tmpl_m1_page_size;
|
|
$page_size=$tmpl_m1_page_size;
|
|
|
|
//
|
|
|
|
$sql_con=" where zsh>0 and ";
|
|
//同步推演
|
|
$tmp_show=get_db_msg("select count(*) num from ".$table_pre."kh_ty where is_show='y'");
|
|
$str_is_tb="n";
|
|
if($tmp_show["num"]>0){
|
|
$sql_con.="is_show='y' and ";
|
|
$str_is_tb="y";
|
|
}
|
|
|
|
if($sql_con)
|
|
$sql_con=substr($sql_con,0,-4);
|
|
//$sql_order=str_replace("!"," desc",$order);
|
|
$json_data.="\"is_tb\":\"".$str_is_tb."\",";
|
|
$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";
|
|
//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[$readpic]);
|
|
if(($msg_login["path"]."-".$msg_login["id"])==$msg["upath"])
|
|
$is_my_cl="y";
|
|
else
|
|
$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."],";
|
|
$json_data.="\"total_page\":1,";
|
|
$json_data.="\"page\":1,";
|
|
break;
|
|
default:
|
|
//----------------------------------------------陈列模式
|
|
$sys_zycl="n";
|
|
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_keyword){
|
|
$sql_con.="dp like '%".$s_keyword."%' and ";
|
|
$s_zsh="";
|
|
}
|
|
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 ";
|
|
}
|
|
//同步推演
|
|
$tmp_show=get_db_msg("select count(*) num from ".$table_pre."kh_ty where is_show='y'");
|
|
$str_is_tb="n";
|
|
if($tmp_show["num"]>0){
|
|
$sql_con.="is_show='y' and ";
|
|
$str_is_tb="y";
|
|
$end=99;
|
|
}
|
|
|
|
if($sql_con)
|
|
$sql_con=substr($sql_con,0,-4);
|
|
//$sql_order=str_replace("!"," desc",$order);
|
|
$json_data.="\"is_tb\":\"".$str_is_tb."\",";
|
|
$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[$readpic]);
|
|
if(($msg_login["path"]."-".$msg_login["id"])==$msg["upath"])
|
|
$is_my_cl="y";
|
|
else
|
|
$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);
|
|
if($str_is_tb=="y"){
|
|
$total_page=1;
|
|
$page=1;
|
|
}
|
|
$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;
|
|
?>
|