<%
'乘风多用户计数器
'作者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">
<tr>
<td><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_Count_Hour 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>
</table>
    
<%
AddDate=ChkStr(Request("AddDate"),3)
If AddDate="" Then AddDate=Date()
%>

<%
Sql="Select Sum(MyCounter),Sum(IpCounter) From CFCount_Count_Hour where UserName='"&UserName&"' And AddDate=#"&AddDate&"#"
Set Rs=Conn.Execute(Sql)
ShowTotal=Rs(0)
IpTotal=Rs(1)
If ShowTotal=0 Then ShowTotal=1
If IpTotal=0 Then IpTotal=1

Sql="Select AddHour,AddDate From CFCount_Count_Hour Where UserName='"&UserName&"' And AddDate=#"&AddDate&"# Group By AddHour,AddDate Order By AddHour Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1
%>
<table class="tb_1">
<tr class="tr_1">
<td colspan="4"><%=AddDate%> 每小时报表</td>
</tr>
<tr class="tr_2"> 
<td>小时</td>
<td>显示数量</td>
<td>IP数量</td>
<td>比率</td>
</tr>
<%
do while not rs.eof
I=I+1

Sql="Select MyCounter,IpCounter From CFCount_Count_Hour where UserName='"&UserName&"' And AddDate=#"&AddDate&"# And AddHour="&Rs("AddHour")
Set Rs1=Conn.Execute(Sql)
%>
<tr class="tr_2"> 
<td><%=Rs("AddHour")%>-<%=Rs("AddHour")+1%></td>
<td><%=Rs1(0)%><br>
</td>
<td><%=Rs1(1)%></td>
<td style="text-align:left;"><img src=images/bar_blue.gif width=<%=Rs1(0)/ShowTotal*350%> height=10><%=MyRate(Rs1(0),ShowTotal)%>%<br><img src=images/bar_green.gif width=<%=Rs1(1)/IpTotal*350%> height=10><%=MyRate(Rs1(1),IpTotal)%>%</td>
</tr>
<%
rs.movenext
loop%>
<tr> 
<td colspan="6" >图例： <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="4"><%=AddDate%>此日期：总计浏览<%=ShowTotal%>次 IP<%=IpTotal%>个</td>
</tr>
</table>
  

