<!--#include file="../check.asp"--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>商户后台 - 高消费用户</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->



<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<%

upline=Session("Usr_UserName")
Nowpage=cint(request.QueryString("page"))
startdate=request("startdate")
if startdate="" or isnull(startdate) then startdate=date()
enddate=request("enddate")
if enddate="" or isnull(enddate) then enddate=date()
wanjia=request("wanjia")
gameid=request("gid")
wooolid=request("wooolid")


		   searchstr=""
		   dateparam="d"
		   if upline<>"" then searchstr="state<3 and upline='"&upline&"'"
		   
		  	   if isdate(startdate) then 
			      if not searchstr="" then searchstr=searchstr+" and "
 		          searchstr=searchstr+"datediff("&dateparam&",regdate,'"&startdate&"')<=0"
		  	    end if
		  	
			 	if isdate(enddate) then 
		      		 if not searchstr="" then searchstr=searchstr+" and "
 		     		 searchstr=searchstr+"datediff("&dateparam&",regdate,'"&enddate&"')>=0"
		  	 	end if
				
			if wanjia<>"" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"number='"&wanjia&"'"
		   end if



			if wooolid<>"" then 
		      if not searchstr="" then searchstr=searchstr+" and "
 		      searchstr=searchstr+"wooolid="&wooolid&""
		   end if		 
		   if not searchstr="" then searchstr=" where "+searchstr



%>

<script src="/scripts/time.js" type="text/javascript"></script>


<script language = "JavaScript">
var onecount;
subcat = new Array();



                              <%
						  set Rsq=GrateRs("select * from l_woool where userid="&session("Usr_userid"),1)
						  if not (rsq.eof or rsq.bof) then
							i=0
						  do while not rsq.eof
						  

						  %>
subcat[<%=i%>] = new Array("<%=rsq("wooolname")%>","<%=rsq("fzid")%>","<%=rsq("id")%>");
                              <%			i=i+1
							rsq.movenext
							loop
							end if
							%>



        
onecount=<%=i%>;

function changelocation(locationid)
    {  
   if (document.from.gid.value != 0)
document.from.wooolid.disabled = false
else 
document.from.wooolid.disabled = true 
    
    document.from.wooolid.length = 1; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.from.wooolid.options[document.from.wooolid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
    }    

</script> 




<form action="good.asp" method="post" name="from" id="from">
          <div class="leshu_a_sou">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left"><table border="0" cellspacing="0" cellpadding="0" class="tdr">
                    <tr>
						<td> 　 服务分组：</td>
						<td>


			<select name="gid" onChange="changelocation(document.from.gid.options[document.from.gid.selectedIndex].value)" class="leshu_a_input">
          <option value="" selected>----所有分组----</option>
                              <%
						  set Rsq=GrateRs("select * from L_fenzu where userid="&session("Usr_userid"),1)
						  if not (rsq.eof or rsq.bof) then
						  do while not rsq.eof
						  
						  if gid="" or isnull(gid) then
						  %>
                              <option value="<%=rsq("id")%>"><%=rsq("name")%></option>
                              <%else%>
                              <option value="<%=rsq("id")%>" <%if gid<>"" then
						  if int(rsq("id"))=int(gid) then response.Write "selected"
						  end if
						  %>><%=rsq("name")%></option>
                              <%end if
							rsq.movenext
							loop
							end if
							%>
                          </select>




</td>
						<td>服务名称：</td>
<td>

                    <SELECT style="WIDTH: 130px" name="wooolid" disabled class="leshu_a_input">  
                  <OPTION value="" selected>----所有服务----</OPTION>
      </select>

				</td>


						<td rowspan="2" class="do-search">
							<div class="large-button">
								<input type="submit"  value="查询" class="leshu_a_r4"></a>
								<div class="clearing"></div>
							</div>
						</td>
					</tr>









					<tr>
				
						<td>　 时间：</td>
						<td>
<input id="fromDate" name="startdate" class="leshu_a_input" type="text" size="12" value="<%=startdate%>" readonly onclick="javascript:__calendar.setHook(this);"/>
                            至
                            <input name="enddate" class="leshu_a_input" id="toDate" size="12" value="<%=EndDate%>" readonly onclick="javascript:__calendar.setHook(this);"/>
</td>
						<td>充值账号：</td>
						<td>
<input style="WIDTH: 125px" name="wanjia" type="text" class="leshu_a_input" id="wanjia" value="<%=wanjia%>" size="10">
						</td>
					</tr>









                    </tr></form>
                  </table></td>
              </tr>
            </table>
          </div>


  
          <div class="leshu_table">
            <table width="760" border="0" cellspacing="0" cellpadding="0">
              <tr class="title">
                <td width="100">游戏帐号</td>
                <td width="100">交易笔数(个)</td>
                <td width="100">交易金额(元)</td>
                <td width="100">分成金额(元)</td>
              </tr>



                                    




                <%









Function articleSum2(user,Tm) 


			if wanjia<>"" then 
			else
 		      searchstr2=" and number='"&Tm&"' "
		   end if


sql="select sum(fencheng) as total from [mobile] "&searchstr&" "&searchstr2&" " 
set rss=conn.execute(sql) 
if rss("Total")<>"NULL"  then 
articleSum2=rss("Total")
else
articleSum2=0
end if
rss.close 
set rss=nothing 



end function 



		   sqlInfo = "select number,SUM(Price) as gaga ,count(*) as total from mobile "&searchstr&"     group BY number   order by gaga desc  "


		   set Rs=GrateRs(sqlInfo,1)
		   Rs.PageSize=15
		   if not Rs.eof then 
		   If Nowpage=0 then Nowpage=1
		   Rs.AbsolutePage=Nowpage
		   i=1
		   do while not Rs.eof and i<=Rs.pagesize
		   	

		   %>
		<tr class="tlist-item<%if i mod 2 =0 then response.Write(" tsw")%>">
                                        
                                            <td class="date"> <span class="large-orange"><%=rs("number")%></span></td>
                                             <td class="date"><%=rs("total")%></td>
                                            <td class="status"><%=zero(formatnumber(Rs("gaga")))%></td>
                                            <td class="date"><%=zero(formatnumber(articleSum2(upline,rs("number"))))%></td>
                                        </tr>



                <%
		   i=i+1
		   Rs.movenext
		   loop
		  %>
 



	              <tr>
                        <td colspan="4"><div class="leshu_a_page">
                            <div class="leshu_a_page_left">

<%
  myurl="?gid="&gameid&"&wooolid="&wooolid&"&pname="&pname&"&wanjia="&wanjia&"&numid="&numid&"&kaid="&kaid&"&startdate="&startdate&"&enddate="&enddate&"&"
 response.write("共有 "&Rs.recordcount&" 条信息 每页显示 "&Rs.PageSize&" 条 共 "&Rs.PageCount&" 页 当前第 "&NowPage&" 页&nbsp;</div>")
   response.write("<div class=""leshu_a_page_right""><div class=""leshu_a_manu"">")
   response.write("<a href='"&myurl&"page=1'>"&"首页</a>&nbsp;&nbsp;")
 if NowPage>1 then response.write("<a href='"&myurl&"page="&Nowpage-1&"'>上一页</a>&nbsp;&nbsp;")
 if int(NowPage)<int(pageC) then response.write("<a href='"&myurl&"page="&Nowpage+1&"'>下一页</a>&nbsp;&nbsp;")
 response.write("<a href='"&myurl&"page="&Rs.PageCount&"'>尾页</a></div></div>&nbsp;")
		%>

</div></div></div></td>
              </tr>


            </table>
          </div></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="leshu_main_table">
      <tr>
        <td class="leshu_main_leftx">&nbsp;</td>
        <td class="leshu_main_rightx">&nbsp;</td>
      </tr>
    </table>
  </div>
</div>


  
                <%else%>


                      <tr>
                <td colspan="4">
                            数据信息不存在
                </td>
              </tr>
                          </table>
          </div></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="leshu_main_table">
      <tr>
        <td class="leshu_main_leftx">&nbsp;</td>
        <td class="leshu_main_rightx">&nbsp;</td>
      </tr>
    </table>
  </div>
</div>



   
                <%end if%>












</body>
</html>

