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

194 lines
8.5 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.
<?
//-----------------------------------------------------后台->订单打印->明细单 for 马斯米亚
//查询条件定制
$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]."'");
//取得代理
$arr_p=explode("-",$m_client["path"]);
$m_dl=get_db_msg("select username,title from ".$table_pre."client where id='".$arr_p[count($arr_p)-1]."'");
//
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);
//取得店铺框
$js_function=get_client_autocompelete("","n")."\n";
$js_function.="$(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;
});
});";
$js_function.="
function export1(){
var u=document.getElementById('s_username').value;
if(u){
url='".$_SERVER[PHP_SELF]."?_m=".$_m."&_cid=".$_cid."&_a=export&s_username='+u;
location.href=url;
}else{
alert('请先选择店铺!');
}
}
";
$search_content.="店铺:<input type=text name=\"s_username\" id=\"s_username\" style=\"width:300px\" value=\"".$s_username."\">";
$search_content.=" <input type=submit value=\"提 交\" class=\"button_act\"> <input type=button value=\"导出明细\" class=\"button_act\" onclick=\"export1()\"> ";
if($confirm_str)
$search_content.="<div style=\"width:100%;padding:4px;\" align=\"center\">".$confirm_str."</div>";
if($con_u){
//头部
$_title1="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">
<tr>
<td colspan=\"3\" align=\"center\" style=\"font-size:22px;font-weight:bold;\" height=\"36\">钜兆时装(上海)有限公司(2013秋装)</td>
</tr>
<tr>
<td width=\"40%\" align=\"left\">表单名称:订货汇总表(".$m_client["username"]."-".$m_client["title"]."</td>
<td rowspan=\"2\" align=\"center\" valign=\"top\" style=\"font-size:22px;font-weight:bold;\">订单明细表</td>
<td width=\"40%\" align=\"right\">&nbsp;</td>
</tr>
<tr>
<td align=\"left\">品牌:Mia Mia 年度:13年 季节:秋 品项:全部</td>
<td align=\"right\">&nbsp;</td>
</tr>
<tr>
<td align=\"left\">总代理:".$m_dl["username"]."-".$m_dl["title"]." 起止货号:0 ZZ</td>
<td>&nbsp;</td>
<td align=\"right\">打印日:".date("Y-m-d")."</td>
</tr>
</table>";
//----------处理尺码表头
//取得合并尺码
$arr_size_merged=get_size_merged();
$num_size_total=count($arr_size_merged);
//取得尺码合计sql
$sql_sum_num="";
for($k=0;$k<$num_size_total;$k++){
$sql_sum_num.="sum(num_".$arr_size_merged[$k].") 'num_".$arr_size_merged[$k]."',";
}
//取得尺码表头内容
$tmp=get_db_msg("select count(*) 'num' from ".$table_pre."keyword where cate='size'");
$num_size_tr=$tmp["num"];
$num_size_group=0;
$size_tr=array();
$r1=$db->query("select * from ".$table_pre."keyword where cate='size' order by ord");
while($m1=$db->fetch_array($r1)){
if($num_size_group==0)
$sty=" style=\"border-top:1px solid #999999;\"";
else if($num_size_group==$num_size_tr-1)
$sty=" style=\"border-bottom:1px solid #999999;\"";
else
$sty="";
$size_tr[$num_size_group]="";
for($i=1;$i<=$num_size_total;$i++){
$tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m1["id"]."' and no='".$i."'");
$t=$tmp["title"]?$tmp["title"]:"&nbsp;";
$size_tr[$num_size_group].="<td align=\"center\" width=\"30\"".$sty.">".$t."</td>";
}
$arr_size_merged[]=$m1["no"];
$num_size_group++;
}
//-------------------/处理尺码表头结束
//----------------------------------------------取得订单记录
//
$_content="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">";
$_content.="<thead style=\"display:table-header-group;\"><tr><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">货号</td><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">品名</td><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">单价</td><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">形态</td><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">配件</td><td rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">尺</td>".$size_tr[0]."<td width=\"60\" rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">数量<br>小计</td><td width=\"80\" rowspan=\"".$num_size_group."\" align=\"center\" style=\"border-top:1px solid #999999;border-bottom:1px solid #999999;\">金额</td></tr>";
for($i=1;$i<$num_size_group;$i++){
$_content.="<tr>".$size_tr[$i]."</tr>";
}
$_content.="</thead>";
$q="select iid,color,".get_size_sql("sum1")."sum(".get_size_sql("sum").") 'xj_num',sum((".get_size_sql("sum").")*price) 'xj_money' from ".$table_pre."order where _key='".$s_key."'".$con." group by no,color order by no,color";
//echo $q."<br>";
$r=$db->query($q);
$total_num=$total_money=$total_money_zk=0;
$count=0;
$c=0;
while($m=$db->fetch_array($r)){
$list=$count+1;
//$bg=($c%2)?"#ffffff":"#f0f0f0";
$bg="#ffffff";
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
$num=0;
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$num+=$m["num_".$arr_size_merged[$k]];
$v11="hj_num_".$k;
$$v11+=$m["num_".$arr_size_merged[$k]];
$td_size1.="<td bgcolor=\"".$bg."\" align=\"right\">".$m["num_".$arr_size_merged[$k]]."</td>";
}
$money=$num*$m1["price"];
$total_num+=$num;
$total_money+=$money;
$_content.="<tr>";
$_content.="<td bgcolor=\"".$bg."\">".$m1["no"]."-".$m["color"]."</td>";
$_content.="<td bgcolor=\"".$bg."\">".$m1["title"]."</td>";
$_content.="<td bgcolor=\"".$bg."\" align=\"right\">".$m1["price"]."</td>";
$_content.="<td bgcolor=\"".$bg."\">".$m1["xt"]."</td>";
$_content.="<td bgcolor=\"".$bg."\">".$m1["pj"]."</td>";
$_content.="<td bgcolor=\"".$bg."\">B</td>";
$_content.=$td_size1;
$_content.="<td bgcolor=\"".$bg."\" rowspan=\"".$num1."\" align=\"right\">".$m["xj_num"]."</td>";
$_content.="<td bgcolor=\"".$bg."\" align=\"right\">".$m["xj_money"]."</td>";
$_content.="</tr>";
$c++;
}
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$v1="hj_num_".$k;
$td_size1.="<td bgcolor=\"#ffffff\" style=\"border-top:1px solid #999999;\" align=\"right\">".deel_td($$v1)."</td>";
}
$_content.="<tr height=\"20\"><td colspan=\"6\" align=\"right\" bgcolor=\"#ffffff\" style=\"border-top:1px solid #999999;\">合计</td>".$td_size1."<td bgcolor=\"#ffffff\" style=\"border-top:1px solid #999999;\" align=\"right\">".$total_num."</td><td bgcolor=\"#ffffff\" style=\"border-top:1px solid #999999;\" align=\"right\">".$total_money."</td></tr>";
$_content.="</table>";
$bottom_button="<input type=\"button\" name=\"s1\" value=\"打 印\" onclick=\"start_print()\">";
}
?>