"; //-------------------处理尺码表头 //取得合并尺码 $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].=""; } $num_size_group++; } //-------------------/处理尺码表头结束 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.=""; $_tbody.=$size_tr[0].""; for($i=1;$i<$num_size_group;$i++){ $_tbody.="".$size_tr[$i].""; } } $sql_con=""; $q="select a.id 'id',a.uid 'uid',a.iid 'iid',a.color 'color',a.pmid 'pmid',a.xs 'xs' from ".$table_pre."order_pm a,".$table_pre."order b where a._key='".$sys_this_order_flag."' and b._key='".$sys_this_order_flag."' and a.uid=b.uid and a.iid=b.iid and a.color=b.color and b.ka<>'y' group by id order by id limit ".$start.",".$end; //echo $q."
"; $r=$db->query($q); $count=0; while($m=$db->fetch_array($r)){ $list=$count+1; $bg="#ffffff"; $m2=get_db_msg("select path,title,username from ".$table_pre."client where id='".$m["uid"]."'"); $msg_kh=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'"); $arr_kh_size=explode(",",$msg_kh["size"]); $kh_pm_size_start=$arr_kh_size[0]; $qy_id=get_qy_id($m2["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($m2["path"]); if($dl_id){ $tmp=get_db_msg("select title from ".$table_pre."client where id='".$dl_id."'"); $dl=$tmp["title"]; }else{ $dl=""; } $td_size1=""; $m_pm=get_db_msg("select * from ".$table_pre."size_pm where id='".$m["pmid"]."'"); $arr_pm=explode(":",$m_pm["gz"]); $arr_pm1=tz_pm($arr_kh_size,$arr_pm); for($k=1;$k<=$num_size_total;$k++){ $td_size1.=""; } $_tbody.=""; //取得定制选项 $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") $_tbody.=""; else $_tbody.=""; } $xs=$m["xs"]; $num=$xs*$m_pm["num"]; $_tbody.=""; $_tbody.=$td_size1.""; $count++; } $_tbody.="
".$t."
区域代理客户名称客户代码圆牌号款号款式名".get_cate_title_no("arr_select",$m["no"])."吊牌价颜色名称颜色代码箱数双数
".deel_0($arr_pm1[$k])."
".$qy."".$dl."".$m2["title"]."".$m2["username"]."".get_kh_xh($msg_kh,$m["color"])."".$msg_kh["no"]."".$msg_kh["title"]."".$msg_kh[$m2["no"]]."".get_cate_title_no($m2["no"],$msg_kh[$m2["no"]])."".$msg_kh["price"]."".get_cate_title_no("color",$m["color"])."".$m["color"]."".deel_td(deel_0($xs))."".$num."
"; 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:50000; $tmp=get_db_msg("select count(*) 'num' from ".$table_pre."order_pm where _key='".$sys_this_order_flag."'"); $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_xz-".$list.".xls"; $file_name=iconv("utf-8","gb2312",$file_name); write_file("xls",$file_name,$content); //echo $list*$step."/".$total_num."条记录导出完成(".$file_name.")!"; 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_xz-".$list.".xls"; $file_name=iconv("utf-8","gb2312",$file_name); write_file("xls",$file_name,$content); //echo $total_num."条记录导出完成(共".$list."个文件),位于admin/debug/xls/下面,请手动下载!"; echo $total_num."条记录导出完成(共".$list."个文件),位于admin/debug/xls下面,请手动下载!"; } exit; }else{ $step=50000; } ?> 导出订单明细总表
"; } ?>
导出订单明细总表
单文件订单条数条 (如果执行超时,请减小条数)
".$msg."