<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />


<%
call logquanxian("e5",1)
furl="adminxiaoshou.asp"
%>


<title><%=webname%>-最高权限-销售统计</title> 

<DIV>


<DIV id=main1200> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<script language=javascript>
function tongjiall(str)
{
document.getElementById("buquan"+str).style.display='none';
document.getElementById("tishi"+str).style.display='';

var xmlhttp;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){try{xmlhttp=new XMLHttpRequest();}catch (e){}}}
xmlhttp.open("get","/user/aoto.asp?act=all&name="+str);
  		xmlhttp.onreadystatechange=function()
   		{
   		if(4==xmlhttp.readyState)
	 	{
	  		if(200==xmlhttp.status)
	  		{	
				if (xmlhttp.responseText=="ok")
				{ 
				alert('近30天数据已补齐');
				window.top.location.href='<%=furl%>';
				}
	   		}
		}
   		}
  		xmlhttp.send(null); 
		

}
</script> 
<DIV class=right_titleadmin>&nbsp;&nbsp;商户销售统计TOP10</DIV>
<DIV class=main>

<br>
<span id="tongjiall"></span><br><br>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
  <tr style="line-height:18px;">
    <td>
    
<%	uid=""
	maxjin=0  '最大金额
	
	wrinoda=DateAdd("d",-1,now())
	set rs2=server.CreateObject("adodb.recordset")
	set rsu=server.CreateObject("adodb.recordset")
	
	response.Write "["&DateValue(wrinoda)&"]<br><br>"
	
	n=0
	rs.open "select top 20 * from aypttj where datediff(day,ayptdate,'"&wrinoda&"')=0 and aypttjuid<>0 order by ayptcjje desc",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	n=n+1
			'读取商户信息
			uid=uid&rs("aypttjuid")&","
			rs2.open "select top 1 aynameid,aytrueuser from ayname where aynameid="&rs("aypttjuid")&"",conn,1,1
			if not(rs2.bof and rs2.eof) then%>
				<%=n%>.<a href="adminuseredit.asp?id=<%=rs("aypttjuid")%>" target="_blank"><%=trim(rs2("aytrueuser"))%></a> 
				<span id="buquan<%=rs("aypttjuid")%>" onClick="tongjiall(<%=rs("aypttjuid")%>)" style="cursor:pointer">[补全该商户统计]</span>
				<span id="tishi<%=rs("aypttjuid")%>" style="display:none"> <img src="<%=ossurl%>Template/Template4/images/load.gif">请稍等···</span>
			<%
			end if
			rs2.close%><br>
<%
			str2="&nbsp;"	
			  
			rs2.open "select top 7 aypttjuid,ayptid,ayptdate,ayptcjje from aypttj where aypttjuid="&rs("aypttjuid")&" and aypttjzq=3 order by ayptdate desc",conn,1,1	
			if not(rs2.bof and rs2.eof) then
			do while not rs2.eof
			if len(DateValue(rs2("ayptdate")))=8 then str2="&nbsp;&nbsp;&nbsp;"
			if len(DateValue(rs2("ayptdate")))=9 then str2="&nbsp;&nbsp;"
			response.Write "<div style='float:left'>"&DateValue(rs2("ayptdate"))&str2&" </div> <div style='float:left; height:12px; background-color:#69F; width:"&rs2("ayptcjje")*0.01&"px;'></div> <div style='float:left'>["&rs2("ayptcjje")&"元]</div><br>"
			rs2.movenext 
			loop
			end if
			rs2.close%>  <br>          
	<%
	rs.movenext 
	loop
	end if
rs.close%>

<%
if uid<>"" then uid=mid(uid,1,len(uid)-1)
if uid<>"" then%>
<script type="text/javascript">document.getElementById("tongjiall").innerHTML="<a href=adminxiaoshou_buquan.asp?uid=<%=uid%> target=_blank style=font-size:14px;color:#F30 >[补全该页商户统计数据]</a>";</script>
<%end if%>
    </td>
    <td>

<%	uid=""
	maxjin=0  '最大金额
	
	wrinoda=DateAdd("d",-2,now())
	set rs2=server.CreateObject("adodb.recordset")
	set rsu=server.CreateObject("adodb.recordset")
	
	response.Write "["&DateValue(wrinoda)&"]<br><br>"
	
	n=0
	rs.open "select top 20 * from aypttj where datediff(day,ayptdate,'"&wrinoda&"')=0 and aypttjuid<>0 order by ayptcjje desc",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	n=n+1
	
			'读取商户信息
			uid=uid&rs("aypttjuid")&","
			rs2.open "select top 1 aynameid,aytrueuser from ayname where aynameid="&rs("aypttjuid")&"",conn,1,1
			if not(rs2.bof and rs2.eof) then%>
				<%=n%>.<a href="adminuseredit.asp?id=<%=rs("aypttjuid")%>" target="_blank"><%=trim(rs2("aytrueuser"))%></a> 
				<span id="buquan<%=rs("aypttjuid")%>" onClick="tongjiall(<%=rs("aypttjuid")%>)" style="cursor:pointer">[补全该商户统计]</span>
				<span id="tishi<%=rs("aypttjuid")%>" style="display:none"> <img src="<%=ossurl%>Template/Template4/images/load.gif">请稍等···</span>
			<%
			end if
			rs2.close%><br>
<%
			str2="&nbsp;"	
			  
			rs2.open "select top 7 aypttjuid,ayptid,ayptdate,ayptcjje from aypttj where aypttjuid="&rs("aypttjuid")&" and aypttjzq=3 and datediff(day,ayptdate,'"&wrinoda&"')>=0 order by ayptdate desc",conn,1,1	
			if not(rs2.bof and rs2.eof) then
			do while not rs2.eof
			if len(DateValue(rs2("ayptdate")))=8 then str2="&nbsp;&nbsp;&nbsp;"
			if len(DateValue(rs2("ayptdate")))=9 then str2="&nbsp;&nbsp;"
			response.Write "<div style='float:left'>"&DateValue(rs2("ayptdate"))&str2&" </div> <div style='float:left; height:12px; background-color:#69F; width:"&rs2("ayptcjje")*0.01&"px;'></div> <div style='float:left'>["&rs2("ayptcjje")&"元]</div><br>"
			rs2.movenext 
			loop
			end if
			rs2.close%>  <br>          
	<%
	rs.movenext 
	loop
	end if
rs.close%>
    
    </td>
    <td>
  <%	uid=""
	maxjin=0  '最大金额
	
	wrinoda=DateAdd("d",-3,now())
	set rs2=server.CreateObject("adodb.recordset")
	set rsu=server.CreateObject("adodb.recordset")
	
	response.Write "["&DateValue(wrinoda)&"]<br><br>"
	
	n=0
	rs.open "select top 20 * from aypttj where datediff(day,ayptdate,'"&wrinoda&"')=0 and aypttjuid<>0 order by ayptcjje desc",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	n=n+1
	
			'读取商户信息
			uid=uid&rs("aypttjuid")&","
			rs2.open "select top 1 aynameid,aytrueuser from ayname where aynameid="&rs("aypttjuid")&"",conn,1,1
			if not(rs2.bof and rs2.eof) then%>
				<%=n%>.<a href="adminuseredit.asp?id=<%=rs("aypttjuid")%>" target="_blank"><%=trim(rs2("aytrueuser"))%></a> 
				<span id="buquan<%=rs("aypttjuid")%>" onClick="tongjiall(<%=rs("aypttjuid")%>)" style="cursor:pointer">[补全该商户统计]</span>
				<span id="tishi<%=rs("aypttjuid")%>" style="display:none"> <img src="<%=ossurl%>Template/Template4/images/load.gif">请稍等···</span>
			<%
			end if
			rs2.close%><br>
<%
			str2="&nbsp;"	
			  
			rs2.open "select top 7 aypttjuid,ayptid,ayptdate,ayptcjje from aypttj where aypttjuid="&rs("aypttjuid")&" and aypttjzq=3 and datediff(day,ayptdate,'"&wrinoda&"')>=0 order by ayptdate desc",conn,1,1	
			if not(rs2.bof and rs2.eof) then
			do while not rs2.eof
			if len(DateValue(rs2("ayptdate")))=8 then str2="&nbsp;&nbsp;&nbsp;"
			if len(DateValue(rs2("ayptdate")))=9 then str2="&nbsp;&nbsp;"
			response.Write "<div style='float:left'>"&DateValue(rs2("ayptdate"))&str2&" </div> <div style='float:left; height:12px; background-color:#69F; width:"&rs2("ayptcjje")*0.01&"px;'></div> <div style='float:left'>["&rs2("ayptcjje")&"元]</div><br>"
			rs2.movenext 
			loop
			end if
			rs2.close%>  <br>          
	<%
	rs.movenext 
	loop
	end if
rs.close%>
    </td>
    </tr>
  <tr>
    <td height="35" colspan="3"><strong>月销售统计TOP10</strong></td>
    </tr>
  <tr>
    <td colspan="3"  style="line-height:18px;">
  <%
	maxjin=0  '最大金额
	
	wrinoda=DateAdd("m",-1,now())
	set rs2=server.CreateObject("adodb.recordset")
	set rsu=server.CreateObject("adodb.recordset")
	
	rs.open "select top 20 * from aypttj where datediff(Month,ayptdate,'"&wrinoda&"')=0 and aypttjuid<>0 order by ayptcjje desc",conn,1,1
	if not(rs.bof and rs.eof) then
	do while not rs.eof
	
			'读取商户信息
			rs2.open "select top 1 aynameid,aytrueuser from ayname where aynameid="&rs("aypttjuid")&"",conn,1,1
			if not(rs2.bof and rs2.eof) then%>
				<a href="adminuseredit.asp?id=<%=rs("aypttjuid")%>" target="_blank"><%=trim(rs2("aytrueuser"))%></a> 
				<span id="buquan<%=rs("aypttjuid")%>" onClick="tongjiall(<%=rs("aypttjuid")%>)" style="cursor:pointer">[补全该商户统计]</span>
				<span id="tishi<%=rs("aypttjuid")%>" style="display:none"> <img src="<%=ossurl%>Template/Template4/images/load.gif">请稍等···</span>
			<%
			end if
			rs2.close%><br>
<%
			  
			rs2.open "select top 5 aypttjuid,ayptid,ayptdate,ayptcjje from aypttj where aypttjuid="&rs("aypttjuid")&" and aypttjzq=2 order by ayptdate desc",conn,1,1	
			if not(rs2.bof and rs2.eof) then
			do while not rs2.eof
			if len(DateValue(rs2("ayptdate")))=8 then str2="&nbsp;&nbsp;&nbsp;"
			if len(DateValue(rs2("ayptdate")))=9 then str2="&nbsp;&nbsp;"
			response.Write "<div style='float:left'>"&DateValue(rs2("ayptdate"))&str2&" </div> <div style='float:left; height:12px; background-color:#69F; width:"&rs2("ayptcjje")*0.001&"px;'></div> <div style='float:left'>["&rs2("ayptcjje")&"元]</div><br>"
			rs2.movenext 
			loop
			end if
			rs2.close%>  <br>          
	<%
	rs.movenext 
	loop
	end if
rs.close%>
    
    </td>
  </tr>
</table>


 

</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>


<!--#include virtual="/show/footadmin.asp"-->

