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/tmpl/order_print_confirm1.php
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

189 lines
7.8 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
//-----------------------------------------------------后台->订单打印->确认单
//定制条件
$s_group_by1="brand";
$s_group_by2="category1";
//查询条件定制
$s_key=$_key;
$s_ka="n";
$s_key=$_key;
$con=" and ka<> 'y'";
//
$con_u="";
if($s_username){
$s_username=str_replace("",",",$s_username);
//去掉最后一个逗号
if(substr($s_username,strlen($s_username)-1,1)==",")
$s_username1=substr($s_username,0,-1);
else
$s_username1=$s_username;
$arr_username=explode(",",$s_username1);
//去掉重复值
$arr_username=array_unique($arr_username);
$confirm_str=$p_title=$error="";
for($i=0;$i<count($arr_username);$i++){
//检查是否存在
$m_client=get_db_msg("select * from ".$table_pre."client where username='".$arr_username[$i]."'");
//
if($m_client["id"]){
if($m_client["face"]=="4"){
$con_u.=" (uid='".$m_client["id"]."') or ";
if($m_client["is_checked"]!="y"){
$error_confirm.=$arr_username[$i].",";
$confirm_str.="<span style=\"color:#0000ff;\">".$arr_username[$i]."(未确认)</span>,";
}else{
$confirm_str.="<span style=\"color:#ff0000;\">".$arr_username[$i]."(已确认)</span>,";
}
}else{
$con_u.=" (upath='".$m_client["path"]."-".$m_client["id"]."' or upath like '".$m_client["path"]."-".$m_client["id"]."-%') or ";
}
$p_title.=$m_client["title"]."(".$m_client["username"]."),";
}else{
$error.=$arr_username[$i].",";
}
}
}
if($con_u)
$con.=" and (".substr($con_u,0,-3).") ";
if($confirm_str)
$confirm_str=substr($confirm_str,0,-1);
//取得店铺框
$str="var clients = [\n";
for($i=0;$i<count($arr_dp);$i++){
$str.="{id:\"".$arr_dp[$i][0]."\",t:\"".$arr_dp[$i][3]."\",u:\"".$arr_dp[$i][1]."\",p:\"".$arr_dp[$i][2]."-".$arr_dp[$i][0]."\"},\n";
}
if($i>0)
$str=substr($str,0,-2);
$str.="];\n";
$js_function.=$str."\n$(function() {
$('#s_username').autocomplete(clients, {
max: 100, //列表里的条目数
minChars: 0, //自动完成激活之前填入的最小字符
width: 300, //提示的宽度,溢出隐藏
scrollHeight: 300, //提示的高度,溢出显示滚动条
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
autoFill: false, //自动填充
multiple:true,
multipleSeparator:',',
formatItem: function(row, i, max) {
return row.t+'('+row.u+')';
},
formatMatch: function(row, i, max) {
return row.t + row.u;
},
formatResult: function(row) {
return row.u;
}
}).result(function(event, row, formatted) {
$('#s_username').value=row.u;
});
});";
$search_content.="店铺:<input type=text name=\"s_username\" id=\"s_username\" style=\"width:300px\" value=\"".$s_username."\">";
$search_content.=" <input type=\"hidden\" name=\"sub\" value=\"yes\"><input type=submit value=\"提交\" class=\"button_act\"> ";
if($confirm_str)
$search_content.="<div style=\"width:100%;padding:4px;\" align=\"center\">".$confirm_str."</div>";
if($con_u){
$sys_client_title=get_set("sys_client_title");
$dl=get_dl_title($m_client["path"]);
$title_dl=$dl?$dl."-":"";
$_title="<div align=\"center\" style=\"font-size:20px;line-height:30px;\">".$sys_client_title."</div><div align=\"center\" style=\"font-size:15px;\">".$title_dl.substr($p_title,0,-1)."汇总单 ".date("Y年m月d日 H点i分")."<div>";
//$search_content.="<input type=\"button\" value=\"重新设置折扣\" onclick=\"o_window('?_m=".$_m."&_cid=".$_cid."&_a=set_zk&id=".$m_client["id"]."','set_zk',400,600)\">";
//----------------------------------------------
//$tmp=get_db_msg("");
$je_w=$m_client["order_money_zk"];
$je_w=$je_w/10000;
//表头
$_tbody="<tr>
<td colspan=\"2\" bgcolor=\"#cccccc\">指标金额(万)</td>
<td colspan=\"2\" bgcolor=\"#cccccc\">订单金额(万)</td>
<td bgcolor=\"#cccccc\">订单数量(件)</td>
<td bgcolor=\"#cccccc\">金额完成比</td>
</tr>
<tr>
<td colspan=\"2\" bgcolor=\"#cccccc\"><b>".$m_client["zb"]."</b></td>
<td colspan=\"2\" bgcolor=\"#cccccc\"><b>".$je_w."</b></td>
<td bgcolor=\"#cccccc\"><b>".$m_client["order_num"]."</b></td>
<td bgcolor=\"#cccccc\"><b>".deel_bfb1($je_w,$m_client["zb"],2)."</b></td>
</tr>
<tr>
<td width=\"16%\">".get_cate_title_no("arr_select",$s_group_by1)."</td>
<td width=\"16%\">".get_cate_title_no("arr_select",$s_group_by2)."</td>
<td width=\"17%\">设计款数</td>
<td width=\"17%\">已订款数</td>
<td width=\"17%\">已订件数(件)</td>
<td width=\"17%\">已订金额(元)</td>
</tr>";
$q4="select * from ".$table_pre."keyword where cate='".$s_group_by1."' order by no";
$r4=$db->query($q4);
//取得已订总件数和金额
$tmp=get_db_msg("select sum(num) 'num',sum(jsje) 'je' from ".$table_pre."order where ".$s_group_by1."<>'' and ".$s_group_by2."<>'' ".$con);
$total_yd_js=$tmp["num"];
$total_yd_je=$tmp["je"];
//
//取得已订总款数
$tmp=get_db_msg("select count(distinct no) 'num' from ".$table_pre."order where ".$s_group_by1."<>'' and ".$s_group_by2."<>'' ".$con);
$total_yd_ks=$tmp["num"];
$count=0;
while($m4=$db->fetch_array($r4)){
$q="select * from ".$table_pre."keyword where cate='".$s_group_by2."' order by no";
//echo $q."<br>";
$r=$db->query($q);
//取得已订小计款数
$tmp=get_db_msg("select count(distinct no) 'num' from ".$table_pre."order where ".$s_group_by1."='".$m4["no"]."' and ".$s_group_by1."<>'' and ".$s_group_by2."<>'' ".$con);
$xj_yd_ks=$tmp["num"];
//
$xj_z_ks=$xj_z_sku=0;
$count1=0;
while($m=$db->fetch_array($r)){
$con1=" and ka<>'y'";
//
//取得款数
$tmp=get_db_msg("select count(distinct no) 'num' from ".$table_pre."order where _key='".$s_key."' and ".$s_group_by1."='".$m4["no"]."' and ".$s_group_by2."='".$m["no"]."'".$con);
$tmp_yd_ks=$tmp["num"];
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."kh where ".$s_group_by1."='".$m4["no"]."' and ".$s_group_by2."='".$m["no"]."'".$con1);
$tmp_z_ks=$tmp["num"];
$total_ks+=$tmp_z_ks;
$xj_z_ks+=$tmp_z_ks;
//取得数量
$tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num',sum((".get_size_sql("sum").")*price) 'je' from ".$table_pre."order where _key='".$s_key."' and ".$s_group_by1."='".$m4["no"]."' and ".$s_group_by2."='".$m["no"]."'".$con);
$tmp_yd_js=$tmp["num"];
$tmp_yd_je=$tmp["je"];
if($zk_type=="y1"){
//取得折扣金额
$zk=$m_client["zk"];
$zk=($zk>0)?$zk:"100";
$tmp_yd_je=$tmp_yd_je*$zk/100;
}else if($zk_type=="y2"){
$zk=get_zk($m_client["id"],$m["no"]);
$zk=($zk>0)?$zk:"100";
$tmp_yd_je=$tmp_yd_je*$zk/100;
}
//取得合并单元格的数量
$num_group2=0;
$q_tmp="select * from ".$table_pre."keyword where cate='".$s_group_by2."'";
$r_tmp=$db->query($q_tmp);
while($m_tmp=$db->fetch_array($r_tmp)){
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."kh where ".$s_group_by1."='".$m4["no"]."' and ".$s_group_by2."='".$m_tmp["no"]."'".$con1);
if($tmp["num"]>0)
$num_group2++;
}
//
if($tmp_z_ks>0){
if($count1==0)
$_tcontent[$count]="<tr><td rowspan=\"".$num_group2."\">".deel_td($m4["title"])."</td><td>".deel_td($m["title"])."</td><td>".deel_td($tmp_z_ks)."</td><td>".deel_td($tmp_yd_ks)."</td><td>".deel_td($tmp_yd_js)."</td><td>".deel_td($tmp_yd_je)."</td></tr>";
else
$_tcontent[$count]="<tr><td>".deel_td($m["title"])."</td><td>".deel_td($tmp_z_ks)."</td><td>".deel_td($tmp_yd_ks)."</td><td>".deel_td($tmp_yd_js)."</td><td>".deel_td($tmp_yd_je)."</td></tr>";
$count++;
$count1++;
}
}
if($count1==0){
$_tcontent[$count]="<tr><td rowspan=\"".$num_group2."\">".deel_td($m4["title"])."</td><td>".deel_td($m["title"])."</td><td>".deel_td($tmp_z_ks)."</td><td>".deel_td($tmp_yd_ks)."</td><td>".deel_td($tmp_yd_js)."</td><td>".deel_td($tmp_yd_je)."</td></tr>";
$count++;
}
}
$_tcontent[$count]="<tr><td colspan=\"2\" bgcolor=\"#cccccc\">总计</td><td bgcolor=\"#cccccc\">".deel_td($total_ks)."</td><td bgcolor=\"#cccccc\">".deel_td($total_yd_ks)."</td><td bgcolor=\"#cccccc\">".deel_td($total_yd_js)."</td><td bgcolor=\"#cccccc\">".deel_td(deel_num($total_yd_je))."</td></tr>";
$bottom_button="<input type=\"button\" name=\"s1\" value=\"打 印\" onclick=\"start_print()\">";
}
?>