'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 "single":
$msg_err="";
$msg_cc=get_db_msg("select * from ".$table_pre."kh_cc where zsh='".$zsh."'");
/*if(!$msg_cc["id"]){
//echo_wrong("数据不存在!");
$msg_err="数据不存在!";
}
if($msg_err){
$json_data.="\"error\":\"".$msg_err."\",";
}else{*/
$s_title=trim($s_title);
if($s_title){
$msg_dp=get_db_msg("select * from ".$table_pre."kh_cc where title like '%".$s_title."%' order by zsh,ord limit 0,1");
$m1=get_db_msg("select count(distinct zsh) 'num' from ".$table_pre."kh_cc where title like '%".$s_title."%'");
$q1="select * from ".$table_pre."kh_cc where title like '%".$s_title."%' group by zsh order by zsh";
//
$tmp=get_db_msg("select min(zsh) 'zsh' from ".$table_pre."kh_cc where title like '%".$s_title."%'");
$zsh=$tmp["zsh"];
}else{
if($zsh){
$msg_dp=get_db_msg("select * from ".$table_pre."kh_cc where zsh='".$zsh."' order by ord");
}else{
$tmp=get_db_msg("select min(zsh) 'zsh' from ".$table_pre."kh_cc");
$zsh=$tmp["zsh"];
$msg_dp=get_db_msg("select * from ".$table_pre."kh_cc where zsh='".$zsh."' order by ord");
}
$m1=get_db_msg("select count(distinct zsh) 'num' from ".$table_pre."kh_cc where zsh='".$zsh."'");
$q1="select * from ".$table_pre."kh_cc where zsh='".$zsh."' group by zsh order by zsh";
}
//if(!$msg_dp["id"])
//echo_wrong("记录不存在!");
$str_title="";
if($m1["num"]>1){
$r2=$db->query($q1);
while($m2=$db->fetch_array($r2)){
//$str_title.="".$m2["zsh"]."#".$m2["title"]." ";
$msg_err.=$m2["zsh"]."#".$m2["title"]."|";
$str_title.="{\"zsh\":\"".$m2["zsh"]."\",\"title\":\"".$m2["zsh"]."#".$m2["title"]."\"},";
}
if($msg_err){
$str_title=deel_end($str_title);
$msg_err="存在以下符合条件的多个款:".$msg_err;
}
//echo_wrong("
找到以下符合条件的多项,请选择: ".$str_title."
");
}
if(!$msg_dp["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,";
$json_data.="\"sys_ck_input\":\"".$sys_ck_input."\",";
//橱窗选项
$q="select * from ".$table_pre."kh_cc group by zsh order by zsh";
$r=$db->query($q);
$op_cc="";
$select_dz="";
$tmp="";
while($m=$db->fetch_array($r)){
$op_cc.="";
$tmp.="{\"no\":\"".$m["zsh"]."\",\"title\":\"".$m["title"]."\"},";
}
$tmp=deel_end($tmp);
$select_dz="{\"no\":\"cc\",\"title\":\"橱窗\",\"value\":\"".$zsh."\",\"op\":[".$tmp."]},";
$select_dz=deel_end($select_dz);
$json_data.="\"select_cc\":[".$select_dz."],";
//
$dis="";
if($msg_login["is_jd"]=="y" || $msg_login["is_checked"]=="y")
$dis=" disabled";
$json_data.="\"btn_dis\":\"".$dis."\",";
$json_data.="\"zsh\":\"".$zsh."\",";
//取得内容
$content="
";
$content.="
批量
";
$content.="
";
$content.="
图片
款号信息
尺码明细
";
$q="select * from ".$table_pre."kh_cc where zsh='".$zsh."' order by ord";
$r=$db->query($q);
$str_js_arr="";
while($m=$db->fetch_array($r)){
//验证款号,颜色是否存在
$m_kh=get_db_msg("select * from ".$table_pre."kh where no='".$m["kh"]."' and ka<>'y'");
$msg_pj=get_db_msg("select * from ".$table_pre."client_pj where khid='".$m_kh["id"]."' and cid='".$uid."'");
if($msg_pj["id"]>0){
$pj_remark=dhtmlchars($msg_pj["remark"]);
$race=$msg_pj["race"];
}else{
$pj_remark="";
$race=0;
}
$arr_color=explode(",",$m_kh["color"]);
$arr_color_ka=explode(",",$m_kh["color_ka"]);
if(in_array($m["color"],$arr_color,true) && !in_array($m["color"],$arr_color_ka,true)){
//款号颜色存在,且没有被设置删除
$arr_size=explode(",",$m["size"]);
$arr_size_check=explode(",",$m_kh["size"]);
$tmp1="";
$str_size="