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

103 lines
6.5 KiB
PHP

<?
//-----------------------------------------------------客户端->订单分析->款号排行,到色
setup_ph();
$s_order=$s_order?$s_order:"num";
$s_desc=$s_desc?$s_desc:"d1";
$kh_ph_num=get_set("kh_ph_num");
$kh_ph_num=$kh_ph_num>0?$kh_ph_num:10;
//区域
$op="";
$q="select qy from ".$table_pre."ph where qy<>'' group by qy order by qy";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$m1=get_db_msg("select * from ".$table_pre."client where id='".$m["qy"]."'");
$op.="<option value=\"".$m["qy"]."\"";
if($s_qy==$m["qy"])
$op.=" selected";
$op.=">".$m1["title"]."</option>";
$i++;
}
if($i>0)
$content_search.="<select name=\"s_qy\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按区域过滤-</option>".$op."</select> ";
//代理
$op="";
$q="select dl from ".$table_pre."ph where dl<>'' group by dl order by dl";
$r=$db->query($q);
$i=0;
while($m=$db->fetch_array($r)){
$m1=get_db_msg("select * from ".$table_pre."client where id='".$m["dl"]."'");
$op.="<option value=\"".$m["dl"]."\"";
if($s_dl==$m["dl"])
$op.=" selected";
$op.=">".$m1["title"]."</option>";
$i++;
}
if($i>0)
$content_search.="<select name=\"s_dl\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按代理过滤-</option>".$op."</select> ";
//系列
if(check_arr_select_show("series"))
$content_search.="<select name=\"s_series\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","series")."过滤-</option>".op_select_cate1("series",$s_series)."</select> ";
//主题
if(check_arr_select_show("theme"))
$content_search.="<select name=\"s_theme\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","theme")."过滤-</option>".op_select_cate1("theme",$s_theme)."</select> ";
//季节
if(check_arr_select_show("season"))
$content_search.="<select name=\"s_season\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","season")."过滤-</option>".op_select_cate1("season",$s_season)."</select> ";
//波段
if(check_arr_select_show("bc"))
$content_search.="<select name=\"s_bc\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","bc")."过滤-</option>".op_select_cate1("bc",$s_bc)."</select> ";
//大类
if(check_arr_select_show("category"))
$content_search.="<select name=\"s_category\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","category")."过滤-</option>".op_select_cate1("category",$s_category)."</select> ";
//小类
if(check_arr_select_show("category1"))
$content_search.="<select name=\"s_category1\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\"><option value=\"\">-按".get_cate_title_no("arr_select","category1")."过滤-</option>".op_select_cate1("category1",$s_category1)."</select> ";
$content_search.="<select name=\"s_desc\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\">".get_main_op(array("d1"=>"".$kh_ph_num."","d2"=>"".$kh_ph_num.""),$s_desc)."</select> ";
$content_search.="<select name=\"s_order\" onchange=\"tj.submit();show_loading();\" style=\"width:100px;height:30px;\">".get_main_op(array("num"=>"按数量排序","je"=>"按金额排序"),$s_order)."</select> ";
//
$content="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" bgcolor=\"#000000\"><tr><td width=\"50\" height=\"25\" align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\"><strong>总排名</strong></td><td align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\"><strong>款号</strong></td><td align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\"><strong>单价(元)</strong></td><td width=\"90\" height=\"25\" align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\"><strong>我的排名</strong></td><td width=\"90\" align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\"><strong>我的件数</strong></td><td align=\"center\" bgcolor=\"#333333\" class=\"fontWhite\" width=\"90\"><strong>吊牌金额</strong></td></tr>";
$order_ph=($s_desc=="d1")?" desc":"";
//取得款号总数
$tmp=get_db_msg("select count(distinct no) 'num' from ".$table_pre."ph where no<>'' ".$con);
$total_kh=$tmp["num"];
//取得我的排行
$arr_my_ph_num=array();
$q1="select sum(num) 'num',sum(je) 'je' from ".$table_pre."order where uid='".$uid."' ".$con." group by no order by ".$s_order." desc";
$r1=$db->query($q1);
while($m1=$db->fetch_array($r1)){
$arr_my_ph_num[]=$m1["num"];
}
$arr_my_ph_num=array_unique($arr_my_ph_num);
//
$q="select iid,no,sum(num),sum(je) from ".$table_pre."ph where num>0 ".$con." group by no order by ".$s_order.$order_ph." limit 0,".$kh_ph_num;
//echo $q."<br>";
$r=$db->query($q);
$total_num=$total_money=$count=0;
$count_my=$count_total=0;
while($m=$db->fetch_array($r)){
$bg=($count%2)?"#333333":"#444444";
if($s_desc=="d1")
$list=$count+1;
else
$list=$total_kh+$count;
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
$num_my=get_order_num_kh($m1["id"]);
$total_num+=$num_my;
$money_my=$m1["price"]*$num_my;
$total_money+=$money_my;
$ph_my="";
if($num_my>0){
$ph_my=get_main_key($arr_my_ph_num,$num_my);
$ph_my++;
$count_my++;
}
$content.="<tr><td bgcolor=\"".$bg."\" class=\"fontWhite\">".$list."</td><td height=\"25\" bgcolor=\"".$bg."\" class=\"fontWhite\"><a href=\"?_m=order_single&id=".$m1["id"]."&rurl=".urlencode($rurl).$thickbox."\" title=\"".$m1["no"]."的订单\"".$thickbox1.">".get_kh_xh($m1,$m["color"])."#".$m1["no"]."</a></td><td height=\"25\" bgcolor=\"".$bg."\" class=\"fontWhite\">".$m1["price"]."</td><td height=\"25\" bgcolor=\"".$bg."\" class=\"fontWhite\" align=\"right\">".$ph_my."</td><td height=\"25\" bgcolor=\"".$bg."\" class=\"fontWhite\" align=\"right\">".$num_my."</td><td height=\"25\" bgcolor=\"".$bg."\" class=\"fontWhite\" align=\"right\">".$money_my."</td></tr>";
if($s_desc=="d1")
$count++;
else
$count--;
$count_total++;
}
$content.="<tr><td height=\"25\" colspan=\"3\" align=\"right\" bgcolor=\"#333333\" class=\"fontWhite\">合计</td><td height=\"25\" bgcolor=\"#333333\" class=\"fontWhite\" align=\"right\">".deel_bfb1($count_my,$count_total,1)."</td><td height=\"25\" bgcolor=\"#333333\" class=\"fontWhite\" align=\"right\">".$total_num."</td><td height=\"25\" bgcolor=\"#333333\" class=\"fontWhite\" align=\"right\">".$total_money."</td></tr></table></td></tr></table>";
?>