7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
524 lines
22 KiB
PHP
524 lines
22 KiB
PHP
<?php
|
|
//-------------------------------------------------------总部修改订单,先找到款,再按照区域,代理,店铺修改
|
|
function get_kh_picture_debug($no,$main_pic,$color){
|
|
$pic="";
|
|
if(trim($main_pic)){
|
|
$pic="../../attachments/design/mini/".$no."_".$main_pic.".jpg";
|
|
}
|
|
if(!is_file($pic)){
|
|
$pic="../../attachments/design/mini/".$no.".jpg";
|
|
}
|
|
if(!is_file($pic)){
|
|
$tmp=explode(",",$color);
|
|
for($j=0;$j<count($tmp);$j++){
|
|
$pic="../../attachments/design/mini/".$no."_".$tmp[$j].".jpg";
|
|
if(is_file($pic))
|
|
break;
|
|
}
|
|
}
|
|
if(!is_file($pic)){
|
|
$pic="../images/no_pic_80.gif";
|
|
}
|
|
return $pic;
|
|
}
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
require "../config.php";
|
|
include "../../tmpl/config.php";
|
|
require "../../ipad/include/function.php";
|
|
require "../../ipad/include/db_mysql.php";
|
|
//-------------------------------mysql connect
|
|
$msg="";
|
|
$db=new DB_Sql;
|
|
$db->connect($dbhost,$dbuser,$dbpw,$dbname,"p");
|
|
$magic_quotes_gpc = get_magic_quotes_gpc();
|
|
$register_globals = @ini_get('register_globals');
|
|
if(!$register_globals || !$magic_quotes_gpc) {
|
|
@extract(daddslashes($_POST));
|
|
@extract(daddslashes($_GET));
|
|
}
|
|
$uid=$_COOKIE[THIS_COOKIE];
|
|
if($uid!="1"){
|
|
$msg=get_db_msg("select username from ".$table_pre."user where id='1'");
|
|
echo "对不起,无权查看,请先用(".$msg["username"].")账号登陆,<a href=\"../?_m=user/logout\">返回</a>!";
|
|
exit;
|
|
}
|
|
$xh_ms=get_set("xh_ms");
|
|
$sys_size_num=get_max_size_num();
|
|
switch($_a){
|
|
case "view_order":
|
|
//-------------------------------------取得订单
|
|
$default_group_by="";
|
|
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."client where face=9");
|
|
if($tmp["num"]>0){
|
|
$arr_group_by["9"]="区域";
|
|
$default_group_by="9";
|
|
}
|
|
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."client where face=3");
|
|
if($tmp["num"]>0){
|
|
$arr_group_by["3"]="代理";
|
|
$default_group_by="3";
|
|
}
|
|
$default_group_by=$default_group_by?$default_group_by:"4";
|
|
$arr_group_by["4"]="店铺";
|
|
$arr_group_by["1"]="明细";
|
|
$s_group_by=$s_group_by?$s_group_by:$default_group_by;
|
|
$m_kh=get_db_msg("select * from ".$table_pre."kh where id='".$khid."'");
|
|
$s_kh=$m_kh["no"];
|
|
$pic=get_kh_picture_debug($m_kh["no"],$m_kh["main_pic"],$m_kh["color"]);
|
|
$pic1=out_good_pic($pic,200,200,'border=0');
|
|
$content="<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#ffffff\"><tr><td bgcolor=\"#ffffff\" align=\"center\">".$pic1."</td></tr><tr><td bgcolor=\"#ffffff\" align=\"center\">".get_kh_xh($m_kh,'')."#".$m_kh["no"]."</td></tr>";
|
|
$content.="<tr><td>";
|
|
foreach($arr_group_by as $k1 => $v1){
|
|
$sty=($k1==$s_group_by)?"font-weight:bold;border:1px solid #f0f0f0;padding:6px;":"font-weight:normal;border:1px solid #cccccc;padding:4px;";
|
|
$content.="<a href=\"".$_SERVER[PHP_SELF]."?_a=".$_a."&khid=".$khid."&s_group_by=".$k1."\"><span style=\"".$sty."\">".$v1."</span></a> ";
|
|
}
|
|
$content.="</td></tr>";
|
|
$sql_con="iid='".$khid."' and _key='".$sys_this_order_flag."' and ";
|
|
if($color)
|
|
$sql_con.="color='".$color."' and ";
|
|
$sql_con=substr($sql_con,0,-4);
|
|
$size=explode(",",$m_kh["size"]);
|
|
if($s_group_by=="1"){
|
|
//------------------------明细
|
|
$con_dp_o="";
|
|
if($dpid){
|
|
$m1=get_db_msg("select id,path,title,username from ".$table_pre."client where id='".$dpid."'");
|
|
$p1=$m1["path"]."-".$m1["id"];
|
|
$con_dp_o.=" and uid='".$m1["id"]."'";
|
|
$content.="<tr><td align='left'><b>".$m1["title"]."(".$m1["username"].")</b> <input type='button' value=' 后 退 ' onclick='history.back();'></td></tr>";
|
|
}
|
|
$content.="<tr><td bgcolor=\"#ffffff\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#cccccc\">";
|
|
//表头
|
|
$content.="<tr><td bgcolor=\"#f0f0f0\">店铺</td><td bgcolor=\"#f0f0f0\">款号</td><td bgcolor=\"#f0f0f0\">颜色</td>";
|
|
$tmp1=explode(",",$m_kh["color"]);
|
|
for($l=0;$l<count($size);$l++){
|
|
$tmp3=get_db_msg("select * from ".$table_pre."size where iid='".$m_kh["size_group"]."' and no='".$size[$l]."' limit 0,1");
|
|
$content.="<td bgcolor=\"#f0f0f0\" width=\"25\">".$tmp3["title"]."</td>";
|
|
}
|
|
$content.="<td bgcolor=\"#f0f0f0\" width=\"30\">小计</td><td bgcolor=\"#f0f0f0\">订单时间</td></tr>";
|
|
$q="select * from ".$table_pre."order where ".$sql_con.$con_dp_o." order by uid,color,add_date";
|
|
$r=$db->query($q);
|
|
$hj=$count=0;
|
|
while($m=$db->fetch_array($r)){
|
|
$tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'");
|
|
$m_kh=get_db_msg("select no,color,color_ka from ".$table_pre."kh where id='".$m["iid"]."'");
|
|
$arr_color_ka=explode(",",$m_kh["color_ka"]);
|
|
$flag_ka=(in_array($m["color"],$arr_color_ka))?"<span class='font_ka'>(已删除)</span>":"";
|
|
$content.="<tr><td bgcolor=\"#ffffff\">".$tmp["title"]."(".$tmp["username"].")</td>";
|
|
$content.="<td bgcolor=\"#ffffff\">".$m_kh["no"]."</td>";
|
|
$content.="<td bgcolor=\"#ffffff\">".$m["color"]."-".get_cate_title_no("color",$m["color"]).$flag_ka."<input type='button' value='修改' onclick=\"o_window('".$_SERVER["PHP_SELF"]."?_a=edit&khid=".$khid."&color=".$m["color"]."&dpid=".$m["uid"]."','edit',760,550)\"></td>";
|
|
//尺码列表
|
|
$xj=0;
|
|
for($l=0;$l<count($size);$l++){
|
|
$xj+=$m["num_".$size[$l]];
|
|
$hj+=$m["num_".$size[$l]];
|
|
//尺码合计
|
|
$v1="hj_".$size[$l];
|
|
$$v1+=$m["num_".$size[$l]];
|
|
$content.="<td bgcolor=\"#ffffff\">".$m["num_".$size[$l]]."</td>";
|
|
}
|
|
$content.="<td bgcolor=\"#ffffff\">".$xj."</td><td bgcolor=\"#ffffff\">".date("d日 H点i分",$m["add_date"])."</td></tr>";
|
|
$count++;
|
|
}
|
|
if($count==0 && $dpid){
|
|
$arr_color=explode(",",$m_kh["color"]);
|
|
$arr_color_ka=explode(",",$m_kh["color_ka"]);
|
|
for($i1=0;$i1<count($arr_color);$i1++){
|
|
$flag_ka=(in_array($arr_color[$i1],$arr_color_ka))?"<span class='font_ka'>(已删除)</span>":"";
|
|
$content.="<tr><td bgcolor=\"#ffffff\">".$m1["title"]."(".$m1["username"].")</td><td bgcolor=\"#ffffff\">".$m_kh["no"]."</td><td bgcolor=\"#ffffff\" colspan='".(count($size)+3)."'>".$arr_color[$i1]."-".get_cate_title_no("color",$arr_color[$i1]).$flag_ka."<input type='button' value='下单' onclick=\"o_window('".$_SERVER["PHP_SELF"]."?_a=edit&khid=".$khid."&color=".$arr_color[$i1]."&dpid=".$dpid."','edit',760,550)\"></td></tr>";
|
|
}
|
|
}
|
|
//合计
|
|
$hj_colspan=3;
|
|
$content.="<tr><td bgcolor=\"#ffffff\" colspan=\"".($hj_colspan)."\" align=\"right\">合计</td>";
|
|
for($l=0;$l<count($size);$l++){
|
|
$v1="hj_".$size[$l];
|
|
$content.="<td bgcolor=\"#ffffff\">".$$v1."</td>";
|
|
}
|
|
$content.="<td bgcolor=\"#ffffff\">".$hj."</td><td bgcolor=\"#ffffff\"> </td></tr>";
|
|
}else{
|
|
//------------------------店铺、代理、区域
|
|
$con_dp=$con_dp_o="";
|
|
if($s_group_by=="4"){
|
|
if($s_sj){
|
|
$m1=get_db_msg("select id,path,title,username from ".$table_pre."client where id='".$s_sj."'");
|
|
$p1=$m1["path"]."-".$m1["id"];
|
|
$con_dp.=" and (path='".$p1."' or path like '".$p1."-%')";
|
|
$con_dp_o.=" and (upath='".$p1."' or upath like '".$p1."-%')";
|
|
$content.="<tr><td align='left'><b>".$m1["title"]."(".$m1["username"].")</b> <input type='button' value=' 后 退 ' onclick='history.back();'></td></tr>";
|
|
}
|
|
}
|
|
//取得数组
|
|
$arr1=array();
|
|
$q="select * from ".$table_pre."client where face='".$s_group_by."'".$con_dp;
|
|
$r=$db->query($q);
|
|
while($m=$db->fetch_array($r)){
|
|
if($s_group_by=="4"){
|
|
$tmp_sql=" and uid='".$m["id"]."'";
|
|
}else{
|
|
$p=$m["path"]."-".$m["id"];
|
|
$tmp_sql=" and upath like '".$p."-%'";
|
|
}
|
|
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_dp_o);
|
|
//if($tmp["num"]>0)
|
|
$arr1[$m["id"]]=$tmp["num"];
|
|
}
|
|
arsort($arr1);
|
|
$content.="<tr><td bgcolor=\"#ffffff\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" bgcolor=\"#cccccc\">";
|
|
//表头
|
|
$content.="<tr><td bgcolor=\"#f0f0f0\" width=\"25\">序号</td><td bgcolor=\"#f0f0f0\">客户</td>";
|
|
for($l=0;$l<count($size);$l++){
|
|
$tmp3=get_db_msg("select * from ".$table_pre."size where iid='".$m_kh["size_group"]."' and no='".$size[$l]."' limit 0,1");
|
|
$content.="<td bgcolor=\"#f0f0f0\" width=\"25\">".trim($tmp3["title"])."</td>";
|
|
}
|
|
$content.="<td bgcolor=\"#f0f0f0\" width=\"30\">小计</td></tr>";
|
|
//
|
|
$hj=0;
|
|
$list=1;
|
|
foreach($arr1 as $id1 => $num1){
|
|
$hj+=$num1;
|
|
$m=get_db_msg("select id,path,title,username from ".$table_pre."client where id='".$id1."'");
|
|
if($s_group_by=="4"){
|
|
$tmp_sql=" and uid='".$m["id"]."'";
|
|
$link_var="<a href=\"".$_SERVER["PHP_SELF"]."?_a=".$_a."&khid=".$khid."&s_group_by=1&dpid=".$m["id"]."\">";
|
|
}else{
|
|
$p=$m["path"]."-".$m["id"];
|
|
$tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')";
|
|
$link_var="<a href=\"".$_SERVER["PHP_SELF"]."?_a=".$_a."&khid=".$khid."&s_group_by=4&s_sj=".$m["id"]."\">";
|
|
}
|
|
$tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_dp_o);
|
|
$content.="<tr><td bgcolor=\"#ffffff\">".$list."</td><td bgcolor=\"#ffffff\">".$link_var.$m["title"]."(".$m["username"].")</a></td>";
|
|
for($l=0;$l<count($size);$l++){
|
|
$content.="<td bgcolor=\"#ffffff\">".$tmp["num_".$size[$l]]."</td>";
|
|
//尺码合计
|
|
$v1="hj_".$size[$l];
|
|
$$v1+=$tmp["num_".$size[$l]];
|
|
}
|
|
$content.="<td bgcolor=\"#ffffff\">".$num1."</td>";
|
|
$list++;
|
|
}
|
|
//合计
|
|
$hj_colspan=2;
|
|
$content.="<tr><td bgcolor=\"#ffffff\" align=\"right\" colspan=\"".$hj_colspan."\">合计</td>";
|
|
for($l=0;$l<count($size);$l++){
|
|
$v1="hj_".$size[$l];
|
|
$content.="<td bgcolor=\"#ffffff\">".$$v1."</td>";
|
|
}
|
|
$content.="<td bgcolor=\"#ffffff\">".$hj."</td></tr>";
|
|
}
|
|
$content.="</table></td></tr></table>";
|
|
break;
|
|
case "edit":
|
|
//-------------------------------------修改订单
|
|
$m_kh=get_db_msg("select no,size,size_group,color,color_ka,pm_dj from ".$table_pre."kh where id='".$khid."'");
|
|
$m_client=get_db_msg("select username,title from ".$table_pre."client where id='".$dpid."'");
|
|
$arr_size=explode(",",$m_kh["size"]);
|
|
$arr_color_ka=explode(",",$m_kh["color_ka"]);
|
|
//-----------------尺码
|
|
$str_size_title="";
|
|
$arr_size_title=array();
|
|
for($i=0;$i<count($arr_size);$i++){
|
|
$tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m_kh["size_group"]."' and no='".$arr_size[$i]."'");
|
|
$str_size_title.=$arr_size[$i]."|".$tmp["title"].",";
|
|
$arr_size_title[$i]=$tmp["title"];
|
|
}
|
|
if($str_size_title)
|
|
$str_size_title=substr($str_size_title,0,-1);
|
|
//-----------------
|
|
if(in_array($color,$arr_color_ka)){
|
|
$is_ka="y";
|
|
}else{
|
|
$is_ka="n";
|
|
}
|
|
$is_selected="n";
|
|
//-----------------取得装箱数
|
|
$q1="select distinct(num) 'num' from ".$table_pre."gz where cate='zxs' and (dj='".$m_client["username"]."' or dj='') and kh='".$m_kh["no"]."' order by num";
|
|
$r1=$db->query($q1);
|
|
$zxs="";
|
|
while($m1=$db->fetch_array($r1)){
|
|
$zxs.=$m1["num"].",";
|
|
}
|
|
if($zxs)
|
|
$zxs=substr($zxs,0,-1);
|
|
//-----------------取得配码的行数
|
|
$tmp1=get_db_msg("select count(*) 'num' from ".$table_pre."size_pm where uid='".$dpid."' and pm_dj='".$m_kh["pm_dj"]."'");
|
|
$pm_rows=$tmp1["num"];
|
|
//
|
|
$colspan1=3+count($arr_size);
|
|
//
|
|
$q="select * from ".$table_pre."order_pm where _key='".$sys_this_order_flag."' and uid='".$dpid."' and iid='".$khid."' and color='".$color."'";
|
|
//echo $q."--<br>";
|
|
$r=$db->query($q);
|
|
$num_arr="[";
|
|
$total_xs=$total_num=$j1=0;
|
|
while($m1=$db->fetch_array($r)){
|
|
$tmp=get_db_msg("select title,gz from ".$table_pre."size_pm where id='".$m1["pmid"]."'");
|
|
$num_arr.="[\"".$color."|".get_cate_title_no("color",$color)."\",".$j1.",\"".$tmp["title"]."|".$tmp["gz"]."\",".$m1["xs"].",\"".$is_ka."\",\"".$is_selected."\"],";
|
|
$total_xs+=$m1["xs"];
|
|
$total_num+=$m1["xs"]*count_pm_num($tmp["gz"]);
|
|
$j1++;
|
|
}
|
|
if($j1==0){
|
|
$num_arr.="[\"".$color."|".get_cate_title_no("color",$color)."\",0,\"|\",0,\"".$is_ka."\",\"".$is_selected."\"],";
|
|
$j1=1;
|
|
}
|
|
$num_arr.="]";
|
|
break;
|
|
case "save_edit":
|
|
//-------------------------------------保存修改
|
|
if(substr($str_sub,strlen($str_sub)-1,1)==",")
|
|
$str_sub=substr($str_sub,0,-1);
|
|
$arr_str_sub=explode(",",$str_sub);
|
|
$msg=get_db_msg("select * from ".$table_pre."kh where id='".$khid."'");
|
|
//检测配码
|
|
$arr_str_sub1=array();
|
|
$arr_pm_id=array();
|
|
$qy_uid=get_qy_id($msg_login["path"]);
|
|
for($i1=0;$i1<count($arr_str_sub);$i1++){
|
|
$arr_tmp=explode("|",$arr_str_sub[$i1]);
|
|
$arr_gz=explode(":",$arr_tmp[1]);
|
|
//取得配码id
|
|
$m_pm=get_db_msg("select id from ".$table_pre."size_pm where uid='".$dpid."' and gz='".$arr_tmp[1]."'");
|
|
if($m_pm["id"]>0){
|
|
$pmid1=$m_pm["id"];
|
|
}else{
|
|
$pm_title="临时".get_rand_num(4);
|
|
$num=count_pm_num($arr_tmp[1]);
|
|
$q="insert into ".$table_pre."size_pm (qyid,uid,size_group_id,pm_dj,khid,title,gz,num) values ('".$qy_uid."','".$dpid."','".$msg["size_group"]."','临时配码','".$msg["id"]."','".$pm_title."','".$arr_tmp[1]."','".$num."')";
|
|
//echo $q."<br>";
|
|
$db->query($q);
|
|
$pmid1=$db->insert_id();
|
|
}
|
|
$arr_pm_id[$i1]=$pmid1;
|
|
}
|
|
//保存订单
|
|
$arr_size=explode(",",$msg["size"]);
|
|
$arr_color_ka=explode(",",$msg["color_ka"]);
|
|
$tmp_total_num=0;
|
|
$tmp_old=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where _key='".$sys_this_order_flag."' and uid='".$dpid."' and iid='".$khid."'");
|
|
//取得总量
|
|
for($i=0;$i<count($arr_str_sub);$i++){
|
|
$arr_tmp=explode("|",$arr_str_sub[$i]);
|
|
$tmp_num=count_pm_num($arr_tmp[1])*$arr_tmp[2];
|
|
$tmp_total_num+=$tmp_num;
|
|
}
|
|
//取得到色的尺码数量
|
|
for($i1=0;$i1<count($arr_str_sub);$i1++){
|
|
$arr_tmp=explode("|",$arr_str_sub[$i1]);
|
|
$arr_gz=explode(":",$arr_tmp[1]);
|
|
for($j=0;$j<count($arr_gz);$j++){
|
|
$tmp_num=$arr_gz[$j]*$arr_tmp[2];
|
|
$v="pm_num_".$arr_tmp[0]."_".$arr_size[$j];
|
|
$$v+=$tmp_num;
|
|
}
|
|
}
|
|
/*
|
|
//检查订货规则
|
|
for($i=0;$i<count($arr_color);$i++){
|
|
if(!in_array($arr_color[$i],$arr_color_ka)){
|
|
$num1=0;
|
|
for($i1=0;$i1<count($arr_str_sub);$i1++){
|
|
$arr_tmp=explode("|",$arr_str_sub[$i1]);
|
|
if($arr_tmp[0]==$arr_color[$i]){
|
|
$tmp_num=count_pm_num($arr_tmp[1])*$arr_tmp[2];
|
|
$num1+=$tmp_num;
|
|
}
|
|
}
|
|
check_dhgz_bdks($msg,$arr_color[$i],$num1);
|
|
}
|
|
}
|
|
check_dhgz_bdk($msg,$tmp_total_num);
|
|
check_dhgz_qdl($msg["no"],$tmp_total_num);
|
|
check_dhgz_glk($msg["no"],$tmp_total_num);
|
|
*/
|
|
//取得选项
|
|
$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"];
|
|
}
|
|
$check1=get_db_msg("select * from ".$table_pre."kh_dp where kh='".$msg["no"]."' and color='".$color."' and gz='1' limit 0,1");
|
|
if(!in_array($color,$arr_color_ka) && !$check1["id"]){
|
|
$sql_size1=$sql_size2=$sql_size3="";
|
|
$c=0;
|
|
for($k=0;$k<count($arr_size);$k++){
|
|
$v="pm_num_".$color."_".$arr_size[$k];
|
|
$c+=$$v;
|
|
$sql_size1.="num_".$arr_size[$k]."='".$$v."',";
|
|
$sql_size2.=",'".$$v."'";
|
|
$sql_size3.=",num_".$arr_size[$k];
|
|
}
|
|
$check=get_db_msg("select id from ".$table_pre."order where _key='".$sys_this_order_flag."' and uid='".$dpid."' and iid='".$khid."' and color='".$color."'");
|
|
if($check["id"]){
|
|
if($c>0){
|
|
$q="update ".$table_pre."order set size_group_id='".$msg["size_group"]."',".$sql_size1."add_date='".time()."' where id='".$check["id"]."'";
|
|
$db->query($q);
|
|
cache_order($dpid,$khid,$color,"");
|
|
}else{
|
|
$q="delete from ".$table_pre."order where id='".$check["id"]."'";
|
|
$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 ('".$dpid."','".$upath."','".$khid."','".$msg["no"]."',".$sql2."'".get_jgd($msg["price"])."','".$color."','','".$msg["is_sp"]."','".$msg["size_group"]."'".$sql_size2.",'".$sys_this_order_flag."','".get_sx($color)."','".time()."')";
|
|
$db->query($q);
|
|
cache_order($dpid,$khid,$color,"");
|
|
}
|
|
}
|
|
count_ph($dpid,$khid,$color);
|
|
}
|
|
//清空配码信息
|
|
$db->query("delete from ".$table_pre."order_pm where _key='".$sys_this_order_flag."' and uid='".$dpid."' and iid='".$khid."' and color='".$color."'");
|
|
//保存配码信息
|
|
for($i1=0;$i1<count($arr_str_sub);$i1++){
|
|
$arr_tmp=explode("|",$arr_str_sub[$i1]);
|
|
$q="insert into ".$table_pre."order_pm (_key,uid,iid,color,pmid,xs) values ('".$sys_this_order_flag."','".$dpid."','".$khid."','".$arr_tmp[0]."','".$arr_pm_id[$i1]."','".$arr_tmp[2]."')";
|
|
$db->query($q);
|
|
}
|
|
//计算数量变化
|
|
$log_hd_old_num=$tmp_old["num"];
|
|
$log_hd_num=$tmp_total_num-$tmp_old["num"];
|
|
echo "<script>
|
|
alert('保存成功!');
|
|
window.opener.location.reload();
|
|
window.close();
|
|
</script>";
|
|
break;
|
|
default:
|
|
//
|
|
break;
|
|
}
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title><?php if(trim($m_kh["no"])) echo $m_kh["no"]." - ";?>总部修改订单</title>
|
|
<style>
|
|
BODY{
|
|
font-family:宋体;FONT-SIZE:12px;margin:0px;padding:0px;
|
|
}
|
|
a,a:link,a:visited,a:active {
|
|
text-decoration:none;COLOR: #0000ff;FONT-SIZE:12px;
|
|
}
|
|
a:hover {
|
|
TEXT-DECORATION: underline;COLOR: #aaaa9f;FONT-SIZE:12px;
|
|
}
|
|
body,input,td,select,div,li,ul,textarea,form {
|
|
font-family:宋体;
|
|
FONT-SIZE:12px;
|
|
}
|
|
.wrong{
|
|
color:#ff0000;font-weight:bold;
|
|
}
|
|
.order_single_table{
|
|
background-color:#cccccc;
|
|
}
|
|
.order_single_td1{
|
|
background-color:#e9e9e9;
|
|
}
|
|
.order_single_td2{
|
|
background-color:#d3d2d0;
|
|
}
|
|
.font_ka{
|
|
font-weight:bold;color:#ff0000;
|
|
}
|
|
</style>
|
|
<script language="javascript" src="../js/function.js"></Script>
|
|
<script type="text/javascript" src="js/function.order.js"></script>
|
|
<!--自动完成 -->
|
|
<script type="text/javascript" src="../js/autocomplete/jquery-1.4.4.min.js"></script>
|
|
<script type="text/javascript" src="../js/autocomplete/jquery.autocomplete.js"></script>
|
|
<link rel="Stylesheet" href="../js/autocomplete/jquery.autocomplete.css" />
|
|
<!--/自动完成 -->
|
|
<script>
|
|
<?php
|
|
if($_a=="edit"){
|
|
echo "var strColor='".$color."';\n";
|
|
echo "var arrColor=strColor.split(\",\");\n";
|
|
echo "var arr_color_hang=[".$j1."];\n";
|
|
echo "var strSize=\"".$m_kh["size"]."\";\n";
|
|
echo "var arrSize=strSize.split(\",\");\n";
|
|
echo "var str_size_title=\"".$str_size_title."\";\n";
|
|
echo "var num_arr=".$num_arr.";\n";
|
|
echo "var zxs=\"".$zxs."\";\n";
|
|
echo "var translate_unit=\"".$m_kh["unit_title"]."\";\n";
|
|
echo "var pm_rows=\"".$pm_rows."\";\n";
|
|
echo "var uid=".$dpid.";\n";
|
|
echo "var id=".$khid.";\n";
|
|
echo "var colspan1=\"".$colspan1."\";\n";
|
|
echo "var total_xs=\"".$total_xs."\";\n";
|
|
echo "var total_num=\"".$total_num."\";\n";
|
|
}else{
|
|
//取得款号自动完成
|
|
$str="var khs = [\n";
|
|
$q="select id,no from ".$table_pre."kh ".$con." order by no";
|
|
$r=$db->query($q);
|
|
$i=0;
|
|
while($m=$db->fetch_array($r)){
|
|
$str.="{id:\"".$m["id"]."\",no:\"".$m["no"]."\"},";
|
|
$i++;
|
|
}
|
|
if($i>0)
|
|
$str=substr($str,0,-1);
|
|
$str.="];\n";
|
|
echo $str;
|
|
echo "$(function() {
|
|
$('#s_kh').autocomplete(khs, {
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 100, //提示的宽度,溢出隐藏
|
|
scrollHeight: 300, //提示的高度,溢出显示滚动条
|
|
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
|
|
autoFill: false, //自动填充
|
|
formatItem: function(row, i, max) {
|
|
return row.no;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.no+row.id;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.id;
|
|
}
|
|
}).result(function(event, row, formatted) {
|
|
document.form1.s_kh.value=row.no;
|
|
document.form1.khid.value=row.id;
|
|
document.form1.submit();
|
|
});
|
|
});
|
|
function check_form(){
|
|
var obj=document.form1;
|
|
return true;
|
|
}";
|
|
}
|
|
?>
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<br />
|
|
<?php
|
|
if($_a=="edit"){
|
|
echo "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\" name=\"form1\" id=\"form1\" onsubmit=\"return save_order();\"><input type=\"hidden\" id=\"_a\" name=\"_a\" value=\"save_edit\"><input type=\"hidden\" name=\"khid\" value=\"".$khid."\" /><input type=\"hidden\" name=\"color\" value=\"".$color."\" /><input type=\"hidden\" id=\"_a\" name=\"_a\" value=\"save_edit\"><input type=\"hidden\" name=\"dpid\" value=\"".$dpid."\" /><input type=\"hidden\" id=\"str_sub\" name=\"str_sub\" value=\"\" /><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td>店 铺:".$m_client["title"]."(".$m_client["username"].")</td></tr><tr><td>款 号:".$m_kh["no"]."</td></tr><tr><td>颜 色:".$color."-".get_cate_title_no("color",$color)."</td></tr><tr><td>装箱数:".$zxs."</td></tr><tr><td><div id='div_num'></div></td></tr><tr><td align='center'><input id=\"sub_save\" name=\"sub_save\" class=\"button1\" type=\"submit\" value=\"保存订单\" /></td></tr></table></form>";
|
|
echo "<script> rebuild_num_tr();window.focus(); </script>";
|
|
}else{
|
|
echo "<form name=\"form1\" action=\"".$_SERVER["PHP_SELF"]."\" method=\"get\" onsubmit=\"return check_form();\"><input type=\"hidden\" id=\"_a\" name=\"_a\" value=\"view_order\"><input type=\"hidden\" id=\"khid\" name=\"khid\" value=\"".$khid."\"><table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#cccccc\">
|
|
<tr>
|
|
<td align=\"center\" bgcolor=\"#f0f0f0\"><b>总部修改订单</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td align=\"left\" bgcolor=\"#ffffff\" style=\"line-height:25px;\">输入款号<input type=text name=\"s_kh\" id=\"s_kh\" style=\"width:100px\" onfocus=\"this.select()\" value=\"".$s_kh."\"> <input type='submit' value=' 提 交 '></td>
|
|
</tr>";
|
|
if($content){
|
|
echo "<tr><td align=\"left\" bgcolor=\"#ffffff\" valign=\"top\" style=\"line-height:150%;\">".$content."</td></tr>";
|
|
}
|
|
echo "</table></form>";
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|