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

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

If AddDate="" Then  AddDate=Date()
%>
<table class="tb_1">
<tr>

<td colspan="5"><select  name="siteflag" id="siteflag" onchange="window.location='?Action=<%=Action%>&siteflag='+document.getElementById('siteflag').options[document.getElementById('siteflag').selectedIndex].value+'&adddate='+document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value="">请选择搜索引擎</option>
          <%Sql="Select SiteDesc,SiteFlag From CFCount_Search_Set Order By SiteFlag Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1
While Not Rs.Eof 
 Response.Write "<option value='"&Rs("SiteFlag")&"'"
 If Cstr(SiteFlag)=Cstr(Rs("SiteFlag")) Then Response.Write " selected"
 Response.Write ">"&Rs("SiteDesc")&"</option>"  
 
 If SiteFlag="" Then
  If Instr(Rs("SiteFlag"),"baidu.com") Then
   SiteFlag = Rs("SiteFlag")
   SiteDesc = Rs("SiteDesc") 
  End If
 Else
  If Cstr(SiteFlag)=Cstr(Rs("SiteFlag")) Then
   SiteDesc = Rs("SiteDesc") 
  End if
 End If
Rs.MoveNext
Wend  
%>
</select>
        
<select  name="adddate" id="adddate" onchange="window.location='?Action=<%=Action%>&siteflag='+document.getElementById('siteflag').options[document.getElementById('siteflag').selectedIndex].value+'&adddate='+document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value="">请选择日期</option>
<%Sql="Select AddDate From CFCount_SearchKeywrod_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 Cstr(AddDate)=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"  
Rs.MoveNext
Wend  
%>
</select></td>

</tr>
<%
Px=ChkStr(request("Px"),1)
If Px="" Then Px="IpCounter"

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

Call PxFilter(Px,"KeyWord,IpCounter,MyCounter,AddDate,LastTime,LastLy")


Sql="Select * From CFCount_SearchKeywrod_Day Where UserName='"&UserName&"' And SiteFlag='"&SiteFlag&"' And AddDate=#"&AddDate&"# 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="5"><%=SiteDesc%>关键字统计[可点击标题排序]<br>
</td>
</tr>
<tr class="tr_2"> 
<td><a href="<%=PageUrl%>&Px=Keyword">关键字</a></td>
<td><a href="<%=PageUrl%>&Px=IpCounter">PV数量</a></td>
<td><a href="<%=PageUrl%>&Px=MyCounter">IP数量</a></td>
<td><a href="<%=PageUrl%>&Px=AddDate">加入日期</a></td>
<td><a href="<%=PageUrl%>&Px=LastTime">最后更新时间</a></td>
</tr>
<%While Not Rs.Eof And MyPageSize>0%>
<tr class="tr_2"> 
<td>
<a href="<%=Rs("LastLy")%>" target='_blank'> 
<%
 If Instr(Rs("LastLy"),"google")>0 Or Instr(Rs("LastLy"),"yahoo")>0 Then
  KeyWord=UTF2GB(Rs("KeyWord"))  
 Else
  KeyWord=URLDecode(Rs("KeyWord"))
 End If
 If Len(Keyword)=0 Then KeyWord=Rs("KeyWord")
 Response.write Server.HTMLEncode(KeyWord)
%>
</a>
</td>
<td><%=Rs("MyCounter")%></td>
<td><%=Rs("IpCounter")%></td>
<td><%=GetTurnTime(Month(Rs("AddDate")))&"-"&GetTurnTime(Day(Rs("AddDate")))%></td>
<td><%=Rs("LastTime")%></td>
</tr>
<%
Rs.MoveNext
MyPageSize=MyPageSize-1
Wend
Rs.Close
%>
</table>
<%
Response.write GetPageList(TotalRs,TotalPage,Page,PageUrl,Px)
%>
