This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/pc/module/system/order_confirm.php
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

126 lines
6.2 KiB
PHP

<?php
//p1
if(THIS_IN!="edt_c")
exit("错误的访问!");
$uid=check_cookie();
$db=_mysql_connect();
$msg_login_user=get_db_msg("select * from ".$table_pre."client where id='".$uid."'");
$arr_zb_type=explode(",",$zb_type);
$arr_dp=array();
if($msg_login_user["face"]=="3"){
$q="select id,username,title,path from ".$table_pre."client where path='".$msg_login_user["path"]."-".$msg_login_user["id"]."'";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$arr_dp[$i]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i++;
}
}else if($msg_login_user["face"]=="2"){
$arr_upath=explode(",",$msg_login_user["charge_path"]);
$i2=0;
for($i=0;$i<count($arr_upath);$i++){
$m=get_db_msg("select face,id,title,username,path from ".$table_pre."client where id='".get_parent_id($arr_upath[$i])."'");
$arr_dp[$i2]=array($m["id"],$m["username"],$m["path"],$m["title"]);
$i2++;
}
}else{
$arr_dp[0]=array($msg_login_user["id"],$msg_login_user["username"],$msg_login_user["path"],$msg_login_user["title"]);
}
//--------------------------------------------
switch($_a){
case "confirm":
//---------确认客户订单
$m=get_db_msg("select * from ".$table_pre."client where id='".$id."'");
if($m["face"]=="4" && $m["is_checked"]=="y"){
//检查上级代理商是否确认
$dl_uid=get_dl_id($m["path"]);
if($dl_uid>0){
$t1=get_db_msg("select * from ".$table_pre."client where id='".$dl_uid."'");
if($t1["is_checked"]=="y"){
alert_and_back("对不起,该店铺的上级代理已经确认订单!");
}
}
}
if($m["is_checked"]=="y"){
$q="update ".$table_pre."client set is_checked='n' where id='".$id."'";
}else{
$q="update ".$table_pre."client set is_checked='y' where id='".$id."'";
}
$db->query($q);
$url=$rurl;
alert_and_redirect("操作成功!",$url);
break;
default:
$s_key=$s_key?$s_key:$_key;
$s_ka=$s_ka?$s_ka:"n";
$s_order=$s_order?$s_order:"num";
//-----------------------search
$search_content="";
$search_content.="<select name=\"s_is_checked\"><option value=''>-订单是否确认-</option>".get_main_op(array("y"=>"","n"=>""),$s_is_checked)."</select> ";
$_tbody="<tr><td align=\"center\" bgcolor=\"#dddddd\" width=\"40\">序号</td><td align=\"center\" bgcolor=\"#dddddd\">省代</td><td align=\"center\" bgcolor=\"#dddddd\">客户</td>";
$_tbody.="<td align=\"center\" bgcolor=\"#dddddd\">店铺代码</td><td align=\"center\" bgcolor=\"#dddddd\">店铺名称</td><td align=\"center\" bgcolor=\"#dddddd\" width=\"50\">订单数量</td><td align=\"center\" bgcolor=\"#dddddd\" width=\"60\">吊牌金额</td>";
$_tbody.="<td align=\"center\" bgcolor=\"#dddddd\" width=\"60\">指标</td>";
$_tbody.="<td align=\"right\" bgcolor=\"#dddddd\" width=\"50\">完成率</td>";
$_tbody.="<td align=\"right\" bgcolor=\"#dddddd\" width=\"50\">状态</td>";
$_tbody.="</tr>";
//$search_content.="<select name=\"s_order\">".get_main_op(array("num"=>"按数量排序","je"=>"按金额排序"),$s_order)."</select> ";
$search_content.=" <input type=submit value=\"开始分析\" class=\"button_act\"> ";
//-----------------------/search
$total_zb_js=$total_zb_je=0;
$count=0;
for($i=0;$i<count($arr_dp);$i++){
$m1=get_db_msg("select id,path,is_checked,face,order_money,order_num,zb,username,title from ".$table_pre."client where id='".$arr_dp[$i][0]."'");
if($m1["face"]=="4"){
if(!$s_is_checked || ($s_is_checked=="y" && $m1["is_checked"]=="y") || ($s_is_checked=="n" && $m1["is_checked"]!="y")){
//
$list=$count+1;
$m_qy=get_db_msg("select title from ".$table_pre."client where id='".get_qy_id($m1["path"]."-".$m1["id"])."'");
$m_dl=get_db_msg("select title from ".$table_pre."client where id='".get_dl_id($m1["path"]."-".$m1["id"])."'");
$bg=($l%2)?"#f0f0f0":"#ffffff";
//指标
$zb=$zb_style=$wcl="";
$td_zb="";
$ydje=$m1["order_money"];
$zb=$m1["zb"]*10000;
$wcl=deel_bfb1($m1["order_money"],$zb,1);
$total_zb_je+=$zb;
$td_zb.="<td bgcolor=\"".$bg."\" align=\"right\">".deel_td($zb)."</td>";
$ydjs=$m1["order_num"];
$button="";
if($m1["is_checked"]=="y"){
if($m1["face"]=="4")
$button="<br><input type=\"button\" value=\"取消确认\" onclick=\"window.location.href='?_m=".$_m."&_a=confirm&id=".$m1["id"]."&rurl=".urlencode("?_m=".$_m."&s_is_checked=".$s_is_checked)."'\">";
$st="已确认";
}else{
$st="未确认";
if($m1["face"]=="4")
$button="<br><input type=\"button\" value=\"确认订单\" onclick=\"window.location.href='?_m=".$_m."&_a=confirm&id=".$m1["id"]."&rurl=".urlencode("?_m=".$_m."&s_is_checked=".$s_is_checked)."'\">";
}
$_tcontent[$count]="<tr height=\"25\"><td bgcolor=\"".$bg."\" width=\"60\">".$list."</td><td bgcolor=\"".$bg."\" align=\"left\">".deel_td($m_qy["title"])."</td><td bgcolor=\"".$bg."\" align=\"left\">".deel_td($m_dl["title"])."</td>";
$_tcontent[$count].="<td bgcolor=\"".$bg."\" align=\"left\">".$m1["username"]."</td><td bgcolor=\"".$bg."\" align=\"left\">".$m1["title"].$button."</td><td bgcolor=\"".$bg."\" align=\"right\"><a href=\"".$_SERVER["PHP_SELF"]."?_m=system/order_report&_a=detail&s_username=".$m1["username"]."&is_sub=y\">".$ydjs."</a></td><td bgcolor=\"".$bg."\" align=\"right\">".$ydje."</td>";
$_tcontent[$count].=$td_zb;
$_tcontent[$count].="<td bgcolor=\"".$bg."\" align=\"right\">".deel_td(deel_0($wcl))."</td><td bgcolor=\"".$bg."\" align=\"right\">".$st."</td></tr>";
$count++;
$total_num+=$ydjs;
$total_money+=$ydje;
}
}
}
if(!$_tcontent){
//
}else{
$_tcontent[$count]="<tr height=\"25\">";
$hj_colspan=5;
$_tcontent[$count]="<td colspan=\"".$hj_colspan."\" align=\"right\" bgcolor=\"#dddddd\">合计</td><td bgcolor=\"#dddddd\" align=\"right\">".$total_num."</td><td bgcolor=\"#dddddd\" align=\"right\">".$total_money."</td>";
$wcl="";
$_tcontent[$count].="<td bgcolor=\"#dddddd\" align=\"right\">".deel_td(deel_num($total_zb_je))."</td>";
$wcl=deel_bfb1($total_money,$total_zb_je,1);
$_tcontent[$count].="<td bgcolor=\"#dddddd\" align=\"right\">".deel_td(deel_0($wcl))."</td><td bgcolor=\"#dddddd\" align=\"right\">&nbsp;</td>";
$_tcontent[$count].="</tr>";
}
$_title=$_title?$_title:$_title_;
include template("report");
break;
}
?>