0){ //--------------------修改 //删除图片 $tmp=get_db_msg("select pic from ".$table_pre."kh_dp where zsh='".$zsh."' limit 0,1"); if($tmp["pic"]){ del_file("../attachments/dp/".$order_session."/big/".$tmp["pic"].".jpg"); del_file("../attachments/dp/".$order_session."/mini/".$tmp["pic"].".jpg"); } //删除图片库 $db->query("delete from ".$table_pre."pic where pic_mod='zydp' and pic_name='".$tmp["pic"].".jpg'"); //删除数据 $db->query("delete from ".$table_pre."kh_dp where zsh='".$zsh."'"); }else{ //--------------------新增 //取得zsh $tmp=get_db_msg("select max(zsh) 'zsh' from ".$table_pre."kh_dp"); $zsh=$tmp["zsh"]+1; } //----------------------------------------图片处理 $mt_pic="../attachments/zydp/".$sys_zydp_pic_path_mt; $mt_zz_pic=get_zydp_mt_zz(); $target_img=Imagecreatefrompng($mt_pic); $arr_yc=explode(",",$str_yc); $arr_pic_my=array(); for($i=0;$i$v){ $source[$k]['source']=Imagecreatefrompng($v); $source[$k]['size']=getimagesize($v); } for($i=0;$i"; $db->query($q); } $json_data.="\"cate\":\"saveback\","; break; case "copy": //----------------------------------------复制 $upath=$msg_login["path"]."-".$msg_login["id"]; $m_old=get_db_msg("select * from ".$table_pre."kh_dp where zsh='".$zsh."' limit 0,1"); //取得new_zsh $tmp=get_db_msg("select max(zsh) 'zsh' from ".$table_pre."kh_dp"); $new_zsh=$tmp["zsh"]+1; //图片处理 $tmp=get_db_msg("select max(title) 'title' from ".$table_pre."kh_dp where upath='".$upath."'"); $new_dph=deel_multi_num($tmp["title"]+1,3); $pic=$msg_login["username"]."_".$new_zsh."_".get_rand(4); $old_pic="../attachments/dp/".$order_session."/big/".$m_old["pic"].".jpg"; $dest_big_name="../attachments/dp/".$order_session."/big/".$pic.".jpg"; $dest_mini_name="../attachments/dp/".$order_session."/mini/".$pic.".jpg"; make_mini_picture($old_pic,$dest_big_name,800); make_mini_picture($old_pic,$dest_mini_name,200); //图片插入数据库 put_pic_to_mysql("zydp","big",$pic.".jpg",$dest_big_name); put_pic_to_mysql("zydp","mini",$pic.".jpg",$dest_mini_name); // $q="select * from ".$table_pre."kh_dp where zsh='".$zsh."'"; $r=$db->query($q); while($m=$db->fetch_array($r)){ $q1="insert into ".$table_pre."kh_dp (zsh,title,pic,kh,color,gz,ord,remark,zd1,zd2,zd3,zd4,zd5,upath,pic_my) values ('".$new_zsh."','".$new_dph."','".$pic."','".$m["kh"]."','".$m["color"]."','".$m["remark"]."','".$m["ord"]."','".$m["remark"]."','".$m["zd1"]."','".$m["zd2"]."','".$m["zd3"]."','".$m["zd4"]."','".$m["zd5"]."','".$upath."','".$m["kh"]."_".$m["color"]."')"; //echo $q1."
"; $db->query($q1); } $url=$_SERVER[PHP_SELF]."?_m=dp_my&zsh=".$new_zsh."&rurl=".urlencode($rurl); $json_data.="\"cate\":\"copyok\","; break; case "del": //----------------------------------------删除 $m_old=get_db_msg("select * from ".$table_pre."kh_dp where zsh='".$zsh."' limit 0,1"); //删除图片 del_file("../attachments/dp/".$order_session."/big/".$m_old["pic"].".jpg"); del_file("../attachments/dp/".$order_session."/mini/".$m_old["pic"].".jpg"); //删除图片库 $db->query("delete from ".$table_pre."pic where pic_mod='zydp' and pic_name='".$m_old["pic"].".jpg'"); //删除数据 $db->query("delete from ".$table_pre."kh_dp where zsh='".$zsh."'"); // $json_data.="\"cate\":\"delok\","; break; case "kh_list": $sql_con=""; $page_size=12; $offset=$offset?$offset:0; $url_var="s_no=".$s_no."&s_xh=".$s_xh."&s_is_ordered=".$s_is_ordered; if(is_array($sys_zydp_select)){ for($i=0;$i"; //计算上下组 $m1=get_db_msg($query); $total_num=$m1["num"]; if($offset>0) $url_pre_page="?_m=zydp&_a=kh_list&offset=".($offset-8)."&".$url_var; else $url_pre_page="javascript:alert('没有了')"; if($offset<$total_num-$page_size) $url_next_page="?_m=zydp&_a=kh_list&offset=".($offset+8)."&".$url_var; else $url_next_page="javascript:alert('没有了')"; if($s_is_ordered=="y"){ $q="select a.kh 'kh',a.color 'color',a.pic 'pic',b.dress_level 'dress_level' from ".$table_pre."kh_dp_pic a,".$table_pre."kh b,".$table_pre."order o".$t1." where o.uid='".$uid."' and o._key='".$_key."' and o.iid=b.id and o.color=a.color and a.kh=b.no ".$sql_con." order by b.xh,a.color limit ".$offset.",".$page_size; }else{ $q="select a.kh 'kh',a.color 'color',a.pic 'pic',b.dress_level 'dress_level' from ".$table_pre."kh_dp_pic a,".$table_pre."kh b".$t1." where a.kh=b.no ".$sql_con." order by b.xh,a.color limit ".$offset.",".$page_size; } $r=$db->query($q); $content="
"; if($total_num>0){ for($i=0;$i<$page_size/4;$i++){ $content.=""; $line1=""; for($j=0;$j<4;$j++){ $m=$db->fetch_array($r); $pic=get_zydp_pic(trim($m["pic"]),"mini"); $content.=""; }else{ $content.=" "; $line1.=""; } $content.=""; } $content.="".$line1.""; } }else{ $content.=""; } $content.="
"; if(trim($m["pic"])){ $content.=out_good_pic($pic,110,110); //取得已订件数 $tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where uid='".$uid."' and _key='".$_key."' and no='".$m["kh"]."' and color='".$m["color"]."' and ka<>'y'"); if($tmp["num"]>0) $yd=",".$tmp["num"]."件"; else $yd=""; $line1.="".$m["kh"].",".$m["color"].get_cate_title_no("color",$m["color"]).$yd." 
暂无记录!
"; echo $content; exit; break; default: $json_data.="\"mt_pic\":\"".$sys_zydp_pic_path_mt."\","; $json_data.="\"pic_path_big\":\"".$sys_zydp_pic_path_big."\","; $json_data.="\"pic_path_mini\":\"".$sys_zydp_pic_path_mini."\","; $json_data.="\"str_sp_dress_level\":\"".$sys_zydp_sp_dress_level."\","; $json_data.="\"tmpl_dp_my_pic_width\":\"".$tmpl_dp_my_pic_width."\","; $json_data.="\"tmpl_dp_my_pic_height\":\"".$tmpl_dp_my_pic_height."\","; //款号筛选条件 if(is_array($sys_zydp_select)){ $select_dz=""; for($i=0;$iquery("select no,title from ".$table_pre."keyword where cate='".$sys_zydp_select[$i]."' order by no"); while($m=$db->fetch_array($r)){ $strtmp.="{\"no\":\"".$m["no"]."\",\"title\":\"".$m["title"]."\"},"; } $strtmp=deel_end($strtmp); $select_dz.="{\"no\":\"".$v1."\",\"title\":\"".get_cate_title_no("arr_select",$sys_zydp_select[$i])."\",\"value\":\"".$$v1."\",\"op\":[".$strtmp."]},"; } $select_dz=deel_end($select_dz); $json_data.="\"select_dz\":[".$select_dz."],"; }else{ $json_data.="\"select_dz\":[],"; } if($zsh){ //修改 $msg_dp=get_db_msg("select * from ".$table_pre."kh_dp where zsh='".$zsh."' limit 0,1"); $dph=$msg_dp["title"]; //取得已穿的款色数组 $q="select * from ".$table_pre."kh_dp where zsh='".$zsh."' order by ord desc"; $r=$db->query($q); $str_yc=""; $list=1; while($m=$db->fetch_array($r)){ //取得dress_level $tmp=get_db_msg("select dress_level from ".$table_pre."kh where no='".$m["kh"]."'"); $str_yc.=$list."|".$tmp["dress_level"]."|".$m["pic_my"]."|".out_good_pic_set(get_zydp_pic(trim($m["pic_my"]),"mini"),$tmpl_dp_my_pic_width,$tmpl_dp_my_pic_height)."|".$m["kh"]."&".$m["color"].","; $list++; } if($str_yc) $str_yc=substr($str_yc,0,-1); $remark=trim(str_replace("\r\n","\\n",$msg_dp["remark"])); }else{ //新增 $tmp=get_db_msg("select max(title) 'title' from ".$table_pre."kh_dp where upath='".$msg_login["path"]."-".$msg_login["id"]."'"); $zsh=0; $dph=deel_multi_num($tmp["title"]+1,3); $str_yc=""; $remark=""; } //自定义 $num_dp_zd=0; if(is_array($sys_dp_zd)){ $num=count($sys_dp_zd); $num_dp_zd=($num<5)?$num:5; } $str_arr_select=""; for($i=0;$i<$num_dp_zd;$i++){ $v1="zd".($i+1); $r=$db->query("select zd".($i+1)." from ".$table_pre."kh_dp where zd".($i+1)."<>'' group by zd".($i+1)." order by zd".($i+1)); $strtmp2=""; while($m=$db->fetch_array($r)){ $strtmp2.="{\"no\":\"".$m["zd".($i+1)]."\",\"title\":\"".$m["zd".($i+1)]."\"},"; } $strtmp2=deel_end($strtmp2); $str_arr_select.="{\"no\":\"".$v1."\",\"title\":\"".$sys_dp_zd[$i]."\",\"value\":\"".$msg_dp[$v1]."\",\"op\":[".$strtmp2."]},"; } $str_arr_select=deel_end($str_arr_select); $json_data.="\"select_zdy\":[".$str_arr_select."],"; $json_data.="\"dph\":\"".$dph."\","; $json_data.="\"zsh\":\"".$zsh."\","; $json_data.="\"str_yc\":\"".$str_yc."\","; $json_data.="\"remark\":\"".$remark."\","; $json_data.="\"cate\":\"other\","; break; } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>