chore: 添加多个图片和资源文件

添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
This commit is contained in:
2025-06-15 13:04:37 +08:00
parent 1e61dc3970
commit 7e47ce238b
13220 changed files with 1377028 additions and 0 deletions
+677
View File
@@ -0,0 +1,677 @@
<?php
//-------------------------------自由陈列-界面
header("Content-type: text/html; charset=utf-8");
$json_data="{";
if(THIS_IN!="edt_ipad")
exit("错误的访问!");
$uid=check_cookie_jxs();
$msg_login=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$upath=$msg_login["path"]."-".$uid;
$tmpl_cl_my_pic_width="110";
$tmpl_cl_my_pic_height="110";
$order_session=get_set("order_session");
$default_gan_js=1;
$json_data.="\"uid\":\"".$uid."\",";
switch($_a){
case "smll":
$arr_yc_old=explode(",",$str_yc_old);
$arr_bxk_old=explode(",",$str_bxk_old);
//----------------------------------------扫描录入
//取得本陈列mb参数
$arr_this_mb=array();
for($i=0;$i<count($sys_zycl_mb);$i++){
$tmp=explode("|",$sys_zycl_mb[$i]);
$tmp1=explode(",",$tmp[0]);
if($tmp1[0]==$mb){
$arr_this_mb=explode("|",$sys_zycl_mb[$i]);
break;
}
}
//
$arr_this_wzh=explode(",",$arr_this_mb[1]);
$content="<form name='form_smll' action='./?_m=zycl' method='post'><input type=\"hidden\" name=\"_a\" value=\"smll_sub\"><input type=\"hidden\" name=\"mb\" value=\"".$mb."\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\">";
$content.="<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr>";
for($i=0;$i<count($arr_this_wzh);$i++){
//取得已穿数据
$tmp_ks="";
for($j=0;$j<count($arr_yc_old);$j++){
$arr1=explode("|",$arr_yc_old[$j]);
if($arr1[0]==$arr_this_wzh[$i]){
$tmp_ks.=str_replace("&",",",$arr1[5])."\n";
}
}
$content.="<td><span style=\"font-size:14px;font-weight:bold;\">".$arr_this_wzh[$i]."</span><br><textarea id=\"wz_".$arr_this_wzh[$i]."\" name=\"wz_".$arr_this_wzh[$i]."\" style=\"width:150px;\" rows=\"35\">".$tmp_ks."</textarea></td>";
}
//备选款
$tmp_ks="";
for($j=0;$j<count($arr_bxk_old);$j++){
$arr1=explode("|",$arr_bxk_old[$j]);
if($arr1[3])
$tmp_ks.=str_replace("&",",",$arr1[3])."\n";
}
$content.="<td><span style=\"font-size:14px;font-weight:bold;\">备选款</span><br><textarea id=\"bxk\" name=\"bxk\" style=\"width:150px;\" rows=\"35\">".$tmp_ks."</textarea></td>";
$content.="</tr></table></td></tr>";
$content.="<tr><td align=\"center\" height=\"40\"><input type=\"image\" src=\"images/button_gray_yl.png\" style=\"width:90px;height:30px;\"></td></tr></table></form>";
echo $content;
exit;
break;
case "smll_sub":
//取得本陈列mb参数
$arr_this_mb=array();
for($i=0;$i<count($sys_zycl_mb);$i++){
$tmp=explode("|",$sys_zycl_mb[$i]);
$tmp1=explode(",",$tmp[0]);
if($tmp1[0]==$mb){
$arr_this_mb=explode("|",$sys_zycl_mb[$i]);
break;
}
}
//
$arr_this_wzh=explode(",",$arr_this_mb[1]);
$arr_this_num_limit=explode(",",$arr_this_mb[4]);
//验证
$str_yc=$wrong_msg="";
$num_gan=0;
for($i=0,$ord=1;$i<count($arr_this_wzh);$i++){
$v1="wz_".$arr_this_wzh[$i];
$v2="gan_num_".$arr_this_wzh[$i];
$v3="arr_wz_".$arr_this_wzh[$i];
$$v1=trim($$v1);
$arr_ks=array();
$arr_dress_level=array();
if($$v1){
$arr_tmp=explode("\n",$$v1);
for($j=0;$j<count($arr_tmp);$j++){
if(trim($arr_tmp[$j])){
$arr_tmp1=explode(",",trim($arr_tmp[$j]));
$kh=$arr_tmp1[0];
$color=$arr_tmp1[1];
$m=get_db_msg("select * from ".$table_pre."kh_cl_pic where kh='".$kh."' and color='".$color."'");
if($m["id"]>0){
//取得dress_level
$tmp=get_db_msg("select dress_level from ".$table_pre."kh where no='".$m["kh"]."'");
$is_pic_z1=$is_pic_z2=$is_pic_c="n";
$pic_z1="../attachments/zycl/".$sys_zycl_pic_path_zen1."/".trim($m["pic"]).".png";
if(is_file($pic_z1))
$is_pic_z1="y";
$pic_z2="../attachments/zycl/".$sys_zycl_pic_path_zen2."/".trim($m["pic"]).".png";
if(is_file($pic_z2))
$is_pic_z2="y";
$pic_c="../attachments/zycl/".$sys_zycl_pic_path_gan."/".trim($m["pic"]).".png";
if(is_file($pic_c)){
$is_pic_c="y";
$g_wh=getimagesize($pic_c);
}else{
$g_wh=array(0,0);
}
$js=(get_zycl_pic_path($mb,$arr_this_wzh[$i])=="gan")?$default_gan_js:1;
$str_yc.=$arr_this_wzh[$i]."|".$ord."|".$tmp["dress_level"]."|".$m["pic"]."|".out_good_pic_set(get_zycl_pic(trim($m["pic"]),"mini"),$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."|".$m["kh"]."&".$m["color"]."|".$js."|".$g_wh[0]."|".$is_pic_z1."&".$is_pic_z2."&".$is_pic_c.",";
$ord++;
$$v2+=$default_gan_js;
$arr_ks[]=$kh.",".$color;
$arr_dress_level[$kh.",".$color]=$tmp["dress_level"];
}else{
//款号信息有误
$wrong_msg.=$kh.",".$color.";\\n";
}
}
}
}
//
if(get_zycl_pic_path($mb,$arr_this_wzh[$i])!="gan"){
//检测正挂重复dress_level
$arr1=find_repeat_data($arr_dress_level);
$msg_repeat_dress_level="";
foreach($arr1[1] as $k1 => $v1){
$msg_repeat_dress_level.=$k1.";";
}
if($msg_repeat_dress_level)
$wrong_msg.="穿着层级重复:".$msg_repeat_dress_level."\\n";
}
//检测重复款色
$arr1=find_repeat_data($arr_ks);
$msg_repeat_ks="";
foreach($arr1[1] as $k1 => $v1){
$msg_repeat_ks.=$v1.";";
}
if($msg_repeat_ks)
$wrong_msg.="重复数据:".$msg_repeat_ks."\\n";
}
//检查是否超过件数限制
for($i=0;$i<count($arr_this_wzh);$i++){
$v2="gan_num_".$arr_this_wzh[$i];
if($arr_this_num_limit[$i]>0 && $$v2>$arr_this_num_limit[$i]){
$wrong_msg.="位置".$arr_this_wzh[$i]."陈列了".$$v2."件,超过件数限制".$arr_this_num_limit[$i]."件;\\n";
}
}
//备选款
$str_bxk="";
$bxk=trim($bxk);
if($bxk){
$arr_tmp=explode("\n",$bxk);
for($j=0;$j<count($arr_tmp);$j++){
if(trim($arr_tmp[$j])){
$arr_tmp1=explode(",",trim($arr_tmp[$j]));
$kh=$arr_tmp1[0];
$color=$arr_tmp1[1];
$m=get_db_msg("select * from ".$table_pre."kh_cl_pic where kh='".$kh."' and color='".$color."'");
if($m["id"]>0){
//取得dress_level
$tmp=get_db_msg("select dress_level from ".$table_pre."kh where no='".$m["kh"]."'");
$pic1="../attachments/zycl/".$sys_zycl_pic_path_gan."/".trim($m["pic"]).".png";
if(is_file($pic1)){
$g_wh=getimagesize($pic1);
}else{
$g_wh=array(0,0);
}
$str_bxk.=$tmp["dress_level"]."|".$m["pic"]."|".out_good_pic_set(get_zycl_pic(trim($m["pic"]),"mini"),$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."|".$kh."&".$color."|".get_cate_title_no("color",$m["color"])."|".$g_wh[0].",";
}else{
//款号信息有误
$wrong_msg.=$kh.",".$color.";\\n";
}
}
}
}
//检查
if($wrong_msg){
alert_and_back("以下数据有问题,请检查:\\n".$wrong_msg);
}else{
if($str_yc)
$str_yc=substr($str_yc,0,-1);
if($str_bxk)
$str_bxk=substr($str_bxk,0,-1);
echo "<script>
var str_yc_sm='".$str_yc."';
if(str_yc_sm){
window.parent.str_yc=str_yc_sm;
window.parent.re_order_str_yc();
window.parent.dress_all();
}
var str_bxk_sm='".$str_bxk."';
if(str_bxk_sm){
window.parent.str_bxk=str_bxk_sm;
window.parent.put_bxk();
}
window.parent.document.getElementById('div_smll').style.display='none';
window.parent.document.getElementById('msll_frame').src='about:blank';
</script>";
}
exit;
break;
case "save":
//----------------------------------------保存
//http://localhost/edt/yyj/ipad/index.php?_m=zycl&zsh=0&_a=save&mb=mb1&str_yc=D1|1|22|12W2120_51| width=92 height=110|12W2120%2651|1|27|y%26y%26y,C|1|22|12W2120_51| width=92 height=110|12W2120%2651|1|27|y%26y%26y,C|2|22|12W2120_82| width=92 height=110|12W2120%2682|1|24|y%26y%26y,C|3|22|12W2121_91| width=87 height=110|12W2121%2691|1|25|y%26y%26y
//参数str_yc,str_pic_zz,mb
$clh=trim($clh);
if($zsh>0){
//--------------------修改
//删除原来图片
$m1=get_db_msg("select pic from ".$table_pre."kh_cl where zsh='".$zsh."' limit 0,1");
del_file("../attachments/cl/".$order_session."/big/".$m1["pic"].".jpg");
del_file("../attachments/cl/".$order_session."/mini/".$m1["pic"].".jpg");
//删除图片库
$db->query("delete from ".$table_pre."pic where pic_mod='zycl' and pic_name='".$m1["pic"].".jpg'");
//删除数据
$db->query("delete from ".$table_pre."kh_cl where zsh='".$zsh."'");
}else{
//--------------------新增
//取得zsh
$tmp=get_db_msg("select max(zsh) 'zsh' from ".$table_pre."kh_cl");
$zsh=$tmp["zsh"]+1;
}
//----------------------------------------图片处理
//取得本陈列mb参数
$arr_this_mb=array();
for($i=0;$i<count($sys_zycl_mb);$i++){
$tmp=explode("|",$sys_zycl_mb[$i]);
$tmp1=explode(",",$tmp[0]);
if($tmp1[0]==$mb){
$arr_this_mb=explode("|",$sys_zycl_mb[$i]);
break;
}
}
//
$mt_pic="../attachments/zycl/".$mb.".jpg";
$target_img=Imagecreatefromjpeg($mt_pic);
$arr_this_wzh=explode(",",$arr_this_mb[1]);
$arr_this_pic_path=explode(",",$arr_this_mb[2]);
$arr_this_map_rec=explode(",",$arr_this_mb[3]);
$arr_yc=explode(",",$str_yc);
//
$arr_pic_my_zz=array();
if($str_pic_zz!=""){
$arr_pic_zz=explode(",",$str_pic_zz);
for($i1=0;$i1<count($arr_pic_zz);$i1++){
$tmp=explode("_",$arr_pic_zz[$i1]);
$arr_pic_my_zz[$tmp[1]]="../attachments/zycl/".$arr_pic_zz[$i1].".png";
}
}
//
$arr_pic_my=array();
$arr_is_xz=array();
$arr_pic_wzh=array();
for($i=0;$i<count($arr_this_wzh);$i++){
if($arr_pic_my_zz[$arr_this_wzh[$i]]){
$zz_pic=$arr_pic_my_zz[$arr_this_wzh[$i]];
}else{
$zz_pic="";
}
$list_sz=0;
for($j=0;$j<count($arr_yc);$j++){
$arr_tmp=explode("|",$arr_yc[$j]);
if($arr_tmp[0]==$arr_this_wzh[$i]){
for($k=0;$k<$arr_tmp[6];$k++){
if($arr_tmp[3]!="")
$arr_pic_my[]="../attachments/zycl/".get_zycl_pic_big_path($mb,$arr_tmp[0],$list_sz)."/".$arr_tmp[3].".png";
if($arr_tmp[2]>=11 && $arr_tmp[2]<=20){
$arr_is_xz[]="y";
}else{
$arr_is_xz[]="n";
$list_sz++;
}
$arr_pic_wzh[]=$arr_tmp[0];
}
}
}
if($zz_pic){
//插入遮罩图
$arr1=insert_last_2($arr_pic_my,$zz_pic);
$arr2=insert_last_2($arr_pic_wzh,$arr_this_wzh[$i]);
$arr3=insert_last_2($arr_is_xz,"n");
$arr_pic_my=$arr1;
$arr_pic_wzh=$arr2;
$arr_is_xz=$arr3;
}
}
$source= array();
foreach($arr_pic_my as $k=>$v){
if(is_file($v)){
$source[$k]['source']=Imagecreatefrompng($v);
$source[$k]['size']=getimagesize($v);
}else{
$source[$k]['source']="";
$source[$k]['size']=array(0,0);
}
}
//取得每个侧挂位置的杆宽度,图片总宽度
for($i=0;$i<count($arr_this_wzh);$i++){
if($arr_this_pic_path[$i]=="gan"){
$var="arr_pic_width_".$arr_this_wzh[$i];//图片总宽度
$$var=get_gan_pic_width($mb,$arr_this_wzh[$i],$arr_yc);
$v1=$$var;
//echo "pic_width:".$v1[0]."|".$v1[1].",";
$var="gan_width_".$arr_this_wzh[$i];//杆宽度
$$var=get_gan_width($arr_this_mb,$arr_this_wzh[$i]);
//echo "gan_width:".$$var.",<br>";
//初始化
$var="lj_x_".$arr_this_wzh[$i];
$$var=0;
$var="tmp_x_".$arr_this_wzh[$i];
$$var=0;
$var="gan_num_".$arr_this_wzh[$i];
$$var=0;
}
}
//
$arr_pic_gan=array();
for($i=0,$j=0;$i<count($arr_pic_my);$i++){
if($source[$i]['source']){
$arr_zb=get_zycl_pic_zb($mb,$arr_pic_wzh[$i],$arr_is_xz[$i],$source[$i]['size'][0]);
if(get_zycl_pic_path($mb,$arr_pic_wzh[$i])=="gan"){
//侧挂图片特殊处理,只记录信息
$var="gan_width_".$arr_pic_wzh[$i];
$gan_width=$$var;//本杆宽度
$var="arr_pic_width_".$arr_pic_wzh[$i];
$arr_tmp=$$var;
$gan_pic_width=$arr_tmp[0];//本杆图片压缩总宽度
$sj_pic_width=$arr_tmp[1];//本杆图片实际总宽度
//
$var="lj_x_".$arr_pic_wzh[$i];
$lj_x=$$var;
$var="tmp_x_".$arr_pic_wzh[$i];
$$var=$arr_zb[0]+$lj_x;
$tmp_x1=$$var;
//
$var="lj_x_".$arr_pic_wzh[$i];
$$var+=$source[$i]['size'][0]-$source[$i]['size'][0]*$sys_zycl_sjbl-count_gan_pic_die_num($gan_width,$gan_pic_width,$sj_pic_width,$source[$i]['size'][0]);
//
$arr_pic_gan[$j]=array($source[$i]['source'],$tmp_x1,$arr_zb[1],$source[$i]['size'][0],$source[$i]['size'][1]);
$var="gan_num_".$arr_pic_wzh[$i];
$$var++;
$gan_num=$$var;
$j++;
//测试代码
//echo $i.":".$arr_pic_wzh[$i].",".$arr_pic_my[$i].",".$arr_is_xz[$i].",".$source[$i]['size'][0]."|"."tmp_x_".$arr_pic_wzh[$i].":".$tmp_x1.",".$arr_zb[1]."|".$gan_num."<br>";
}else{
$tmp_x=$arr_zb[0];
imagecopymerge_alpha($target_img,$source[$i]['source'],$tmp_x,$arr_zb[1],0,0,$source[$i]['size'][0],$source[$i]['size'][1]);
}
}
}
//exit;
//添加侧挂图片,从最后一张开始加
for($j=count($arr_pic_gan)-1;$j>=0;$j--){
imagecopymerge_alpha($target_img,$arr_pic_gan[$j][0],$arr_pic_gan[$j][1],$arr_pic_gan[$j][2],0,0,$arr_pic_gan[$j][3],$arr_pic_gan[$j][4]);
}
$pic=$msg_login["username"]."_".$zsh."_".get_rand(4);
$dest_big_name="../attachments/cl/".$order_session."/big/".$pic.".jpg";
$dest_mini_name="../attachments/cl/".$order_session."/mini/".$pic.".jpg";
Imagejpeg($target_img,$dest_big_name,100);
//复制图片
make_mini_picture($dest_big_name,$dest_big_name,800,90);
make_mini_picture($dest_big_name,$dest_mini_name,200);
//图片插入数据库
put_pic_to_mysql("zycl","big",$pic.".jpg",$dest_big_name);
put_pic_to_mysql("zycl","mini",$pic.".jpg",$dest_mini_name);
$ord=1;
for($i=0;$i<count($arr_yc);$i++){
$arr_tmp=explode("|",$arr_yc[$i]);
$arr_tmp2=explode("&",$arr_tmp[5]);
$kh=$arr_tmp2[0];
$color=$arr_tmp2[1];
$pic_my=$arr_tmp[3];
$wzh=$arr_tmp[0];
$js=$arr_tmp[6];
$q="insert into ".$table_pre."kh_cl (zsh,title,pic,kh,color,ord,remark,zd1,zd2,zd3,zd4,zd5,upath,pic_my,mb,wzh,js,bxk) values ('".$zsh."','".$clh."','".$pic."','".$kh."','".$color."','".$ord."','".$remark."','".$zd1."','".$zd2."','".$zd3."','".$zd4."','".$zd5."','".$upath."','".$pic_my."','".$mb."','".$wzh."','".$js."','".$sub_bxk."')";
$ord++;
//echo $q."<br>";
$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_cl where zsh='".$zsh."' limit 0,1");
//取得new_zsh
$tmp=get_db_msg("select max(zsh) 'zsh' from ".$table_pre."kh_cl");
$new_zsh=$tmp["zsh"]+1;
//图片处理
$tmp=get_db_msg("select max(title) 'title' from ".$table_pre."kh_cl where upath='".$upath."'");
$new_clh=deel_multi_num($tmp["title"]+1,3);
$order_session=get_set("order_session");
$pic=$msg_login["username"]."_".$new_zsh."_".get_rand(4);
$old_pic="../attachments/cl/".$order_session."/big/".$m_old["pic"].".jpg";
$dest_big_name="../attachments/cl/".$order_session."/big/".$pic.".jpg";
$dest_mini_name="../attachments/cl/".$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("zycl","big",$pic.".jpg",$dest_big_name);
put_pic_to_mysql("zycl","mini",$pic.".jpg",$dest_mini_name);
//
$q="select * from ".$table_pre."kh_cl where zsh='".$zsh."'";
$r=$db->query($q);
while($m=$db->fetch_array($r)){
$q1="insert into ".$table_pre."kh_cl (zsh,title,pic,kh,color,ord,remark,zd1,zd2,zd3,zd4,zd5,upath,pic_my,mb,wzh,js,bxk) values ('".$new_zsh."','".$new_clh."','".$pic."','".$m["kh"]."','".$m["color"]."','".$m["ord"]."','".$m["remark"]."','".$m["zd1"]."','".$m["zd2"]."','".$m["zd3"]."','".$m["zd4"]."','".$m["zd5"]."','".$upath."','".$m["pic_my"]."','".$m["mb"]."','".$m["wzh"]."','".$m["js"]."','".$m["bxk"]."')";
//echo $q1."<br>";
$db->query($q1);
}
$json_data.="\"cate\":\"copyok\",";
break;
case "del":
//----------------------------------------删除
$m_old=get_db_msg("select * from ".$table_pre."kh_cl where zsh='".$zsh."' limit 0,1");
//删除图片
del_file("../attachments/cl/".$order_session."/big/".$m_old["pic"].".jpg");
del_file("../attachments/cl/".$order_session."/mini/".$m_old["pic"].".jpg");
//删除图片库
$db->query("delete from ".$table_pre."pic where pic_mod='zycl' and pic_name='".$m_old["pic"].".jpg'");
//删除数据
$db->query("delete from ".$table_pre."kh_cl where zsh='".$zsh."'");
//
$json_data.="\"cate\":\"delok\",";
break;
case "kh_list":
$sql_con="";
$page_size=8;
$offset=$offset?$offset:0;
$url_var="s_no=".$s_no."&s_xh=".$s_xh."&s_is_ordered=".$s_is_ordered;
if(is_array($sys_zycl_select)){
for($i=0;$i<count($sys_zycl_select);$i++){
$v1="s_".$sys_zycl_select[$i];
if($$v1){
$sql_con.=" and b.".$sys_zycl_select[$i]."='".$$v1."'";
$url_var.="&".$v1."=".$$v1;
}
}
}
if($s_no)
$sql_con.=" and a.kh like '%".$s_no."%'";
if($s_xh){
if($xh_ms=="2"){
$sql_con=" and c.xh='".$s_xh."' and c.kh=a.kh";
$t1=",".$table_pre."kh_xh c";
}else{
$sql_con=" and b.xh='".$s_xh."'";
$t1="";
}
}
if($s_is_ordered=="y"){
$query="select count(*) 'num' from ".$table_pre."kh_cl_pic a,".$table_pre."kh b".$t1.",".$table_pre."order o where o.uid='".$uid."' and o._key='".$_key."' and o.iid=b.id and a.kh=b.no and o.color=a.color".$sql_con;
}else{
$query="select count(*) 'num' from ".$table_pre."kh_cl_pic a,".$table_pre."kh b".$t1." where a.kh=b.no ".$sql_con;
}
//计算上下组
$m1=get_db_msg($query);
$total_num=$m1["num"];
if($offset>0)
$url_pre_page="?_m=zycl&_a=kh_list&offset=".($offset-8)."&".$url_var;
else
$url_pre_page="javascript:alert('没有了')";
if($offset<$total_num-$page_size)
$url_next_page="?_m=zycl&_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_cl_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 a.kh,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_cl_pic a,".$table_pre."kh b".$t1." where a.kh=b.no ".$sql_con." order by a.kh,a.color limit ".$offset.",".$page_size;
}
//echo $q."<Br>";
$r=$db->query($q);
$content="<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"1\"><tr><td height=\"280\" width=\"25\" valign=\"middle\"><a href=\"".$url_pre_page."\"><img src=\"images/button_s_syz.png\" width=\"25\" height=\"100\" border=0></a></td><td valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"1\">";
if($total_num>0){
$list=0;
for($i=0;$i<$page_size/4;$i++){
$content.="<tr height=\"110\">";
$line1="";
for($j=0;$j<4;$j++){
$m=$db->fetch_array($r);
if(trim($m["pic"])){
$pic=get_zycl_pic(trim($m["pic"]),"mini");
$is_pic_z1=$is_pic_z2=$is_pic_c="n";
$pic_z1="../attachments/zycl/".$sys_zycl_pic_path_zen1."/".trim($m["pic"]).".png";
if(is_file($pic_z1))
$is_pic_z1="y";
$pic_z2="../attachments/zycl/".$sys_zycl_pic_path_zen2."/".trim($m["pic"]).".png";
if(is_file($pic_z2))
$is_pic_z2="y";
$pic_c="../attachments/zycl/".$sys_zycl_pic_path_gan."/".trim($m["pic"]).".png";
if(is_file($pic_c)){
$g_wh=getimagesize($pic_c);
$is_pic_c="y";
}else{
$g_wh=array(0,0);
}
if($pic=="images/no_pic_80.gif")
$put_pic="";
else
$put_pic=trim($m["pic"]);
$content.="<td width=\"25%\" align=\"center\" valign=\"middle\" style=\"cursor:pointer;\" onclick=\"window.parent.dress_up(".$m["dress_level"].",'".$put_pic."','".out_good_pic_set($pic,$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."','".$m["kh"]."&".$m["color"]."',1,'".$g_wh[0]."','".$is_pic_z1."&".$is_pic_z2."&".$is_pic_c."')\">";
$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.="<td align=\"center\" bgcolor=\"#f0f0f0\" height=\"30px\">".$m["kh"].",".$m["color"].get_cate_title_no("color",$m["color"]).$yd." <a href=\"javascript:window.parent.in_bxk(".$m["dress_level"].",'".trim($m["pic"])."','".out_good_pic_set($pic,$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."','".$m["kh"]."&".$m["color"]."','".get_cate_title_no("color",$m["color"])."','".$g_wh[0]."')\"><img src=\"images/button_in_bx.png\" align=\"middle\" border=0 style=\"margin-top:-15px;\" ></a></td>";
$list++;
}else{
$content.="&nbsp;";
$line1.="<td>&nbsp;</td>";
}
$content.="</td>";
}
$content.="</tr><tr height=\"20\">".$line1."</tr>";
}
}else{
$content.="<tr><td align=\"center\" height=\"50\">暂无记录!</td></tr>";
}
$content.="</table></td><td width=\"25\" valign=\"middle\"><a href=\"".$url_next_page."\"><img src=\"images/button_s_xyz.png\" width=\"25\" height=\"100\" border=0></a></td></tr></table>";
echo $content;
exit;
break;
default:
$json_data.="\"sys_zycl_dress_level\":\"".$sys_zycl_dress_level."\",";
$json_data.="\"zen1_pic_path\":\"".$sys_zycl_pic_path_zen1."\",";
$json_data.="\"zen2_pic_path\":\"".$sys_zycl_pic_path_zen2."\",";
$json_data.="\"sys_zycl_xz_top\":\"".$sys_zycl_xz_top."\",";
$json_data.="\"gan_pic_path\":\"".$sys_zycl_pic_path_gan."\",";
$json_data.="\"sys_zycl_sjbl\":\"".$sys_zycl_sjbl."\",";
//款号筛选条件
if(is_array($sys_zycl_select)){
$select_dz="";
for($i=0;$i<count($sys_zycl_select);$i++){
$v1="s_".$sys_zycl_select[$i];
$strtmp="";
$r=$db->query("select no,title from ".$table_pre."keyword where cate='".$sys_zycl_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_zycl_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_cl=get_db_msg("select * from ".$table_pre."kh_cl where zsh='".$zsh."' limit 0,1");
$clh=$msg_cl["title"];
//取得已穿的款色数组
$q="select * from ".$table_pre."kh_cl where zsh='".$zsh."' order by ord";
$r=$db->query($q);
$str_yc="";
$list=1;
$cltp="";
while($m=$db->fetch_array($r)){
$tmpcl=explode("_",$m["title"]);
if($tmpcl[2]){
$cltp=$tmpcl[2];
}
//取得dress_level
$tmp=get_db_msg("select dress_level from ".$table_pre."kh where no='".$m["kh"]."'");
$is_pic_z1=$is_pic_z2=$is_pic_c="n";
$pic_z1="../attachments/zycl/".$sys_zycl_pic_path_zen1."/".trim($m["pic_my"]).".png";
if(is_file($pic_z1))
$is_pic_z1="y";
$pic_z2="../attachments/zycl/".$sys_zycl_pic_path_zen2."/".trim($m["pic_my"]).".png";
if(is_file($pic_z2))
$is_pic_z2="y";
$pic_c="../attachments/zycl/".$sys_zycl_pic_path_gan."/".trim($m["pic_my"]).".png";
if(is_file($pic_c)){
$is_pic_c="y";
$g_wh=getimagesize($pic_c);
}else{
$g_wh=array(0,0);
}
$str_yc.=$m["wzh"]."|".$list."|".$tmp["dress_level"]."|".$m["pic_my"]."|".out_good_pic_set(get_zycl_pic(trim($m["pic_my"]),"mini"),$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."|".$m["kh"]."&".$m["color"]."|".$m["js"]."|".$g_wh[0]."|".$is_pic_z1."&".$is_pic_z2."&".$is_pic_c.",";
$list++;
}
if($str_yc)
$str_yc=substr($str_yc,0,-1);
$mb=$msg_cl["mb"];
$str_bxk="";
if(trim($msg_cl["bxk"])!=""){
$arr_tmp=explode(",",trim($msg_cl["bxk"]));
for($i=0;$i<count($arr_tmp);$i++){
$arr_tmp1=explode("&",$arr_tmp[$i]);
$m1=get_db_msg("select pic from ".$table_pre."kh_cl_pic where kh='".$arr_tmp1[0]."' and color='".$arr_tmp1[1]."'");
$pic1="../attachments/zycl/".$sys_zycl_pic_path_gan."/".trim($m1["pic"]).".png";
if(is_file($pic1))
$g_wh=getimagesize($pic1);
else
$g_wh=array(0,0);
$m2=get_db_msg("select dress_level from ".$table_pre."kh where no='".$arr_tmp1[0]."'");
$str_bxk.=$m2["dress_level"]."|".$m1["pic"]."|".out_good_pic_set(get_zycl_pic(trim($m1["pic"]),"mini"),$tmpl_cl_my_pic_width,$tmpl_cl_my_pic_height)."|".$arr_tmp[$i]."|".get_cate_title_no("color",$arr_tmp1[1])."|".$g_wh[0].",";
}
}
if($str_bxk)
$str_bxk=substr($str_bxk,0,-1);
$remark=trim(str_replace("\r\n","\\n",$msg_cl["remark"]));
}else{
//新增
$tmp=get_db_msg("select max(title) 'title' from ".$table_pre."kh_cl where upath='".$msg_login["path"]."-".$msg_login["id"]."'");
$zsh=0;
$clh=deel_multi_num($tmp["title"]+1,3);
$str_yc="";
$tmp=explode("|",$sys_zycl_mb[0]);
$tmp=explode(",",$tmp[0]);
$mb=$tmp[0];
$remark="";
$str_bxk="";
}
//自定义筛选条件
$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="zd".($i+1);
$r=$db->query("select zd".($i+1)." from ".$table_pre."kh_cl 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_cl_zd[$i]."\",\"value\":\"".$msg_cl[$v1]."\",\"op\":[".$strtmp2."]},";
}
$str_arr_select=deel_end($str_arr_select);
$json_data.="\"select_zdy\":[".$str_arr_select."],";
if($cltp){
$cl=get_db_msg("select * from web_kh_cl where zsh='".$cltp."'");
$clpic=get_kh_ty_big($cl["pic"]);
$ck=out_good_pic_set_arr($clpic,460,335);
$json_data.="\"clpic\":\"".$clpic."\",\"clpic_w\":\"".$ck[0]."\",\"clpic_h\":\"".$ck[1]."\",";
}
$json_data.="\"clh\":\"".$clh."\",";
$json_data.="\"zsh\":\"".$zsh."\",";
$json_data.="\"str_yc\":\"".$str_yc."\",";
$json_data.="\"str_bxk\":\"".$str_bxk."\",";
$json_data.="\"remark\":\"".$remark."\",";
$json_data.="\"mb\":\"".$mb."\",";
$json_data.="\"str_pic_zz\":\"\",";
//模版
$str="";
for($i=0;$i<count($sys_zycl_mb);$i++){
$str.="\"".$sys_zycl_mb[$i]."\",";
}
if($str)
$str=substr($str,0,-1);
$json_data.="\"arr_mb\":[".$str."],";
$json_data.="\"cate\":\"other\",";
break;
}
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;
?>