d_translate("admin_order_print_detail"),"confirm"=>d_translate("admin_order_print_confirm"),"auto"=>"自助打印"); }else{ $arr_report=array("detail"=>d_translate("admin_order_print_detail"),"confirm"=>d_translate("admin_order_print_confirm")); } //$arr_report=array("detail"=>d_translate("admin_order_print_detail")); $_a=$_a?$_a:"detail"; $json_data.="\"uid\":".$uid.","; $file_root1=dir_cutb(THIS_FILE_ROOT,1); //有权限 //-----------------------tab $str_tab=""; $i=0; foreach($arr_report as $k => $v){ $str_tab.="{\"no\":\"".$k."\",\"title\":\"".$v."\"},"; } $str_tab=deel_end($str_tab); $json_data.="\"tab\":[".$str_tab."],"; $json_data.="\"s_cate\":\"".$_a."\","; //-----------------------/tab switch($_a){ case "detail" : //明细单 if($sys_ver_hy=="xz"){ require_once $file_root1."/tmpl/order_print_detail_xz.php"; }else{ require_once $file_root1."/tmpl/order_print_detail.php"; } break; case "confirm" : //确认单 require_once $file_root1."/tmpl/order_print_confirm.php"; break; case "export" : //导出 require_once $file_root1."/tmpl/order_print_export.php"; break; case "auto" : require THIS_FILE_ROOT."/include/print.class.php"; //尺码前字段 $arr_zd1=array("xh"=>"圆牌号","no"=>"款号","category"=>"大类","color"=>"颜色","bx"=>"杯型","price"=>"价格"); //尺码后字段 $arr_zd2=array("num"=>"数量","je"=>"吊牌金额","jsje"=>"结算金额"); //是否显示颜色代码 $is_show_color="n"; //是否显示金额 $is_show_je="y"; // $is_brand=is_brand(); $detail_size_ms=get_set("detail_size_ms"); $print_not_qr=get_set("print_not_qr"); $sys_size_num=get_max_size_num(); //查询条件定制 $s_ka="n"; $s_key=$_key; $con=" and ka<> 'y'"; if($s_brand){ $con.=" and brand='".$s_brand."'"; $con_brand=" and brand='".$s_brand."'"; }else{ $con_brand=""; } //杯型参数 if($bx_sizegroup_title){ $tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$bx_sizegroup_title."' limit 0,1"); $bx_sizegroup_id=$tmp["id"]; }else{ $bx_sizegroup_id=0; } $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=$confirm_str1=$p_title=$error=""; for($i=0;$i,"; $confirm_str1.=$arr_username[$i].","; }else{ $confirm_str.="".$arr_username[$i]."(已确认),"; } }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].","; } } } $json_data.="\"s_username\":\"".$s_username."\","; $json_data.="\"confirm_str\":\"".$confirm_str."\","; $json_data.="\"sub\":\"".$sub."\","; $json_data.="\"print_not_qr\":\"".$print_not_qr."\","; // if($error){ $json_data.="\"code\":100,\"msg\":\"".$error."\","; }else{ $con_u_exp=""; if($s_username_exp){ $s_username_exp=str_replace(",",",",$s_username_exp); //去掉最后一个逗号 if(substr($s_username_exp,strlen($s_username_exp)-1,1)==",") $s_username_exp1=substr($s_username_exp,0,-1); else $s_username_exp1=$s_username_exp; $arr_username_exp=explode(",",$s_username_exp1); //去掉重复值 $arr_username_exp=array_unique($arr_username_exp); $title_exp=""; for($i=0;$i".$sys_client_title."
".$title_dl.substr($p_title,0,-1).$title_exp."明细单 ".date("Y年m月d日 H点i分")."
"; //$search_content.=""; //-------------------处理尺码表头 //取得合并尺码 $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]."',"; } //取得尺码表头内容 $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)){ $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"]:" "; $size_tr[$num_size_group].="".$t.""; } $arr_size_merged[]=$m1["no"]; $num_size_group++; } //-------------------/处理尺码表头结束 //仅在第一页显示但是表头 $p_head="
".$sys_client_title."
".$title_dl.substr($p_title,0,-1).$title_exp."明细单 ".date("Y年m月d日 H点i分")."
"; //仅在最后一页显示的页尾 $p_foot="
客户确认签字:日期:
"; $pt=new pt; $pt->db=$db; $pt->con=$con; $pt->p_head=$p_head; $pt->arr_zd2=$arr_zd2; $pt->arr_zd1=$arr_zd1; $pt->table_pre=$table_pre; $pt->p_foot=$p_foot; $pt->show_xs="n"; $pt->px="category"; $content=$pt->rt_table(); $json_data.="\"tb\":\"".$content."\","; $json_data.="\"con\":\"".$con."\","; //是否打印预览 $json_data.="\"is_pre\":\"y\","; } break; case "set_log": //记录日志 $arr_username=explode(",",$s_username); for($i=0;$i0) update_order_state($uid,$m["id"],"打印订单",""); } } break; } } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>