<%
'乘风多用户计数器
'作者QQ：178575
'作者EMail：yliangcf@163.com
'作者网站：http://www.qqcf.com
'详细简介：http://www.qqcf.com/cfcount.htm
'上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
'因为这些内容可能时常更新，没有放在程序里，请自己上网站上查看
%>

<%If SysCode="" Then Response.End%>

<%
AddDate=ChkStr(Request("AddDate"),3)
Px=ChkStr(Request("Px"),1)

If AddDate="" Then AddDate=Cstr(Date)
If Px="" Then Px="MyCounter"

PageUrl = "?Action="&Action&"&AddDate="&AddDate

Call PxFilter(Px,"UserName,MyCounter,IPCounter")
%>
<table class="tb_1">
<tr>
<td colspan="6"><select  name="adddate" id="adddate" size="1" onChange="window.location='?Action=<%=Action%>&AddDate='+document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value="">请选择日期</option>
<%Sql="Select AddDate From CFCount_Count_Day Group By AddDate Order By AddDate Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1

While Not Rs.Eof 
 Response.Write "<option value='"&Rs("AddDate")&"'"
 If Cstr(AddDate)=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"  
Rs.MoveNext
Wend  
%>
</select></td>
</tr>
<tr class="tr_1">
<td colspan="6"><%=AddDate%> 用户排行</td>
</tr>
<tr class="tr_2">
<td><a href="<%=PageUrl%>&Px=UserName">用户名</a></td>
<td><a href="<%=PageUrl%>&Px=MyCounter">浏览数量</a></td>
<td><a href="<%=PageUrl%>&Px=IpCounter">IP数量</a></td>
</tr>
<%
Sql="Select * From CFCount_Count_Day Where AddDate=#"&AddDate&"#"
Sql=Sql&" Order By "&px&" Desc"

Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1

If Not Rs.eof then
 Rs.pagesize=20
 TotalRs=Rs.RecordCount
 TotalPage=Rs.PageCount
 MyPageSize=Rs.PageSize
 Page=CLng(ChkStr(Request("Page"),2))
 If Page<=0 Then Page=1
 If Page>TotalPage Then Page=TotalPage
 Rs.AbsolutePage=Page
End If


While Not Rs.Eof And MyPageSize>0
%>
<tr class="tr_2"> 
<td><%=Rs("UserName")%></td>
<td><%=Rs("MyCounter")%></td>
<td><%=Rs("IpCounter")%></td>
</tr>
<%rs.movenext
mypagesize=mypagesize-1
wend%>
</table>
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>
