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

<table class="tb_1">
<%
PageUrl = "?Action="&Action

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

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

Sql="Select Sum(MyCounter),Sum(IPCounter) From CFCount_Count_Day"
Set Rs1=Conn.execute(Sql)
ShowTotal=Rs1(0)
IpTotal=Rs1(1)
%>
<tr class="tr_1"> 
<td colspan="5">每日统计</td>
</tr>
<tr class="tr_2"> 
<td>序号</td>
<td>日期</td>
<td>浏览数量</td>
<td>IP数量</td>
<td>所占此天的比例</td>
</tr>
<%
While Not Rs.Eof And MyPageSize>0
Sql="Select Sum(MyCounter),Sum(IPCounter) From CFCount_Count_Day where Datediff('d',AddDate,'"&Rs("AddDate")&"')=0"
Set Rs1=Conn.execute(Sql)
Counter=Rs1(0)
IpCounter=Rs1(1)
%>
<tr class="tr_2"> 
<td><%=Rs.RecordCount-Rs.Pagesize*(page)+mypagesize%></td>
<td> <%=Rs("AddDate")%> </td>
<td><%=Counter%></td>
<td><%=IpCounter%></td>
<td style="text-align:left;"><img src=images/bar_blue.gif width=<%=Counter/ShowTotal*300%> height=10><%=MyRate(Counter,ShowTotal)%>%<br> <img src=images/bar_green.gif width=<%=IpCounter/IpTotal*300%> height=10><%=MyRate(IpCounter,IpTotal)%>%</td>
</tr>
<%rs.movenext
mypagesize=mypagesize-1
wend%>
<tr> 
<td colspan="5" >图例： <img src=images/bar_blue.gif width=30 height=10>显示数，<img src=images/bar_green.gif width=30 height=10>IP数</td>
</tr>
<tr> 
<td colspan="5"><%
Sql="Select Sum(MyCounter),Sum(IpCounter) From CFCount_Count_Day"
Set Rs1=Conn.ExeCute(Sql)

If TotalRs=0 Then
AvgVisit=0
AvgIp=0
Else
AvgVisit=Int(Rs1(0)/TotalRs)
AvgIp=Int(Rs1(1)/TotalRs)
End If
%>
共有<%=TotalRs%>天记录，共<%=Rs1(0)%>次浏览，<%=Rs1(1)%>个IP，平均每天<%=AvgVisit%>次访问，平均每天IP<%=AvgIp%>个 </td>
</tr>
</table>
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>