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

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

<td colspan="7" ><select  name="adddate" id="adddate" onchange="window.location='?Action=<%=Action%>&adddate='+document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value="">请选择日期</option>
<%Sql="Select AddDate From CFCount_Ly_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=Date()

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

Call PxFilter(Px,"id,ip,lyhead,addtime,MyCounter,IpCounter,lasttime")

Sql="Select * From CFCount_Ly_Day where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0"

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
%>
<tr class="tr_1"> 
<td colspan="7"><%=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=LyHead">来源网站</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=MyCounter">PV数量</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=IpCounter">IP数量</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=AddTime">上站时间</a></td>
<td class="td_nowrap"><a href="<%=PageUrl%>&Px=Ip">最后IP地址</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"> 
<%If Rs("LyHead")="" Then
  Response.Write "直接从浏览器输入"
 Else
  Response.Write "<a href=?Action=urlgo&Url="&Server.URLEncode("http://"&Rs("LyHead"))&" target='_blank'>"&Rs("LyHead")&"</a>&nbsp;[<a href=?Action=urlgo&Url="&Server.URLEncode(Rs("Ly"))&" target='_blank'>详细</a>]"
 End If%>
</td>
<td class="td_nowrap"><%=Rs("MyCounter")%></td>
<td class="td_nowrap"><%=Rs("IpCounter")%></td>
<td class="td_nowrap"><%=GetTurnTime(Hour(Rs("AddTime")))&":"&GetTurnTime(Minute(Rs("AddTime")))&":"&GetTurnTime(Second(Rs("AddTime")))%></td>
<td class="td_nowrap"> 
<%If Ip=Rs("Ip") Then Response.Write "<font color=ff0000>"%>
<%=Rs("Ip")%> 
<%If Ip=Rs("Ip") Then Response.Write "</font>"%>
<%If RsSet("IpArea")=-1 Then
  Response.write "<br>"&GetIpArea(Rs("Ip"))
 End If%>
</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)
%>
