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

<%If RsSet("WebKeep")=0 Then Response.write "系统已经禁用此功能"%>
<table class="tb_1">

<tr>

<td colspan="5" ><select  name="adddate" id="adddate" onchange="window.location=''+document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value="">请选择日期</option>
<%Sql="Select AddDate From CFCount_Web_Day Where UserName='"&UserName&"' 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 Request("AddDate")=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"  
Rs.MoveNext
Wend  
%>
</select></td>

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

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

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

Call PxFilter(Px,"id,weburl,MyCounter,adddate,lasttime")

If AddDate<>"" Then
 If IsDate(Cdate(AddDate))=False Then Call AlertBack("输入了错误的时间",1)
End if

Sql="Select Sum(MyCounter) From CFCount_Web_Day where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0 And WebUrl<>'-'"
Set Rs=Conn.execute(Sql)
ThisDayTotal=Rs(0)
If ThisDayTotal=0 Then ThisDayTotal=1

Sql="Select * From CFCount_Web_Day where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0 And WebUrl<>'-'"

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=15
 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
%>
<tr class="tr_1">
<td colspan="5"><%=AddDate%> 页面浏览统计[可点击标题排序]</td>
</tr>
<tr class="tr_2"> 
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=ID">序号</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=WebUrl">网站页面</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=MyCounter">浏览数量</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=MyCounter">所占此天的比例</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=LastTime">最后访问时间</a></td>
</tr>
<%
While Not Rs.Eof And MyPageSize>0
%>
<tr class="tr_2"> 
<td class="td_nowrap"><%=Rs.RecordCount-Rs.Pagesize*(page)+mypagesize%></td>
<td class="td_nowrap"> 
<%
Response.Write "<a href="&Rs("WebUrl")&" target='_blank'>"&Left(BreakUrl(Rs("WebUrl"),2),30)&"</a>&nbsp;[<a href="&Rs("WebUrl")&" target='_blank'>详细</a>]"
%>
</td>
<td class="td_nowrap"><%=Rs("MyCounter")%></td>
<td class="td_nowrap" style="text-align:left;"><img src=images/bar_blue.gif width=<%=Rs("MyCounter")/ThisDayTotal*150%> height=10><%=MyRate(Rs("MyCounter"),ThisDayTotal)%>%</td>
<td class="td_nowrap"><%=GetTurnTime(Hour(Rs("LastTime")))&":"&GetTurnTime(Minute(Rs("LastTime")))&":"&GetTurnTime(Second(Rs("LastTime")))%></td>
</tr>
<%rs.movenext
mypagesize=mypagesize-1
wend%>
</table>
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>
