"; //-------------------处理尺码表头 //取得合并尺码 $arr_size_merged=get_size_merged(); $num_size_total=count($arr_size_merged); //文胸 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; } //童装 if($child_sizegroup_title){ $tmp=get_db_msg("select id from ".$table_pre."keyword where cate='size' and title='".$child_sizegroup_title."' limit 0,1"); $child_sizegroup_id=$tmp["id"]; }else{ $child_sizegroup_id=0; } //-------------------/处理尺码表头结束 if($start==0){ $_tbody.=""; //取得定制选项 $q="select * from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' order by ord"; $r=$db->query($q); $num_dz=0; while($m=$db->fetch_array($r)){ $_tbody.=""; $num_dz++; } $_tbody.=""; if($bx_sizegroup_id>0) $_tbody.=""; else if($child_sizegroup_id>0) $_tbody.=""; if($is_gg!="n") $_tbody.=""; $_tbody.=""; } $sql_con="where ka<>'y'"; $q="select * from ".$table_pre."order ".$sql_con." order by id limit ".$start.",".$end; //echo $q."
"; $r=$db->query($q); $count=0; while($m=$db->fetch_array($r)){ $m_client=get_db_msg("select path,title,username from ".$table_pre."client where id='".$m["uid"]."'"); $msg_kh=get_db_msg("select no,xh,title,zd1,zd2,zd3 from ".$table_pre."kh where id='".$m["iid"]."'"); $qy_id=get_qy_id($m_client["path"]); if($qy_id){ //取得区域 $tmp=get_db_msg("select title from ".$table_pre."client where id='".$qy_id."'"); $qy=$tmp["title"]; }else{ $qy=""; } //取得代理 $dl_id=get_dl_id($m_client["path"]); if($dl_id){ $tmp=get_db_msg("select title from ".$table_pre."client where id='".$dl_id."'"); $dl=$tmp["title"]; }else{ $dl=""; } //取得定制选项 $tr_dz=""; $q2="select * from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' order by ord"; $r2=$db->query($q2); while($m2=$db->fetch_array($r2)){ if($m2["no"]=="zd1" || $m2["no"]=="zd2" || $m2["no"]=="zd3") $tr_dz.=""; else $tr_dz.=""; } for($k=0;$k<$num_size_total;$k++){ $num=$m["num_".$arr_size_merged[$k]]; if($num>0){ //取得尺码名称 $tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m["size_group_id"]."' and no='".$arr_size_merged[$k]."'"); $_tbody.=""; $_tbody.=$tr_dz; $_tbody.=""; if($bx_sizegroup_id>0 || $child_sizegroup_id>0) $_tbody.=""; if($is_gg!="n") $_tbody.=""; $_tbody.=""; } } } $_tbody.="
".d_translate("qy")."".d_translate("dl")."客户名称客户代码序号款号款式名".get_cate_title_no("arr_select",$m["no"])."吊牌价颜色名称颜色代码杯型款型".d_translate("gg")."尺码数量
".$msg_kh[$m2["no"]]."".get_cate_title_no($m2["no"],$m[$m2["no"]])."
".$qy."".$dl."".$m_client["title"]."".$m_client["username"]."".get_kh_xh($msg_kh,$m["color"])."".$m["no"]."".$msg_kh["title"]."".$m["price"]."".get_cate_title_no("color",$m["color"])."".$m["color"]."".$m["bx"]."".get_gg_title($m["bx"])."".$tmp["title"]."".$num."
"; $db->close(); return $_tbody; } require "../config.php"; include "../../tmpl/config.php"; require THIS_FILE_ROOT."/include/function.php"; require THIS_FILE_ROOT."/include/db_mysql.php"; //require THIS_FILE_ROOT."/include/page.class.php"; error_reporting(E_ERROR | E_WARNING | E_PARSE); header("Content-type: text/html; charset=utf-8"); //-------------------------------mysql connect $db=new DB_Sql; $db->connect($dbhost,$dbuser,$dbpw,$dbname,"p"); $sys_size_num=get_max_size_num(); $sub=$_GET["sub"]; $step=$_GET["step"]; $list=$_GET["list"]; if($sub=="y"){ //定义每次导出的订单数量 $xh_ms=get_set("xh_ms"); $step=$step?$step:20000; $tmp=get_db_msg("select count(*) 'num' from ".$table_pre."order where ka<>'y'"); $total_num=$tmp["num"]; $list=$_GET["list"]?$_GET["list"]:1; $start=($list-1)*$step; if($step*$list<$total_num){ $content=get_order_by_client($start,$step); $file_name="order_detail_all_s-".$list.".xls"; $file_name=iconv("utf-8","gb2312",$file_name); write_file("xls",$file_name,$content); echo $list*$step."/".$total_num."条记录导出完成(".$file_name."),位于admin/debug/xls下面,请手动下载!"; $list++; url_redirect($_SERVER[PHP_SELF]."?sub=y&list=".$list."&step=".$step); }else{ $end=$total_num-($list-1)*$step; $content=get_order_by_client($start,$end); $file_name="order_detail_all_s-".$list.".xls"; $file_name=iconv("utf-8","gb2312",$file_name); write_file("xls",$file_name,$content); echo $total_num."条记录导出完成(共".$list."个文件),位于admin/debug/xls下面,请手动下载!"; } exit; }else{ $step=20000; } ?> 导出订单明细总表(尺码竖排)
"; } ?>
导出订单明细总表(尺码竖排)
单文件订单条数条 (如果执行超时,请减小条数)
".$msg."