<!-- #INCLUDE FILE = "conn.asp" -->
<!-- #INCLUDE FILE = "date.asp" -->
<!-- #INCLUDE FILE = "session.asp" -->
<%
dim Rs,sql,totalNum,imgWidth,bydate
if(request.QueryString("bydate")<>"") then
	bydate=trim(request.QueryString("bydate"))
else
	bydate=iYear&"-"&iMonth&"-"&iDay
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style2 {
	color: #cc3300;
	font-weight: bold;
}
.style3 {
	color: #006699;
	font-weight: bold;
}
.style4 {
	color: #000000;
	font-weight: bold;
}
-->
</style>
<LINK media=screen href="js/dhtmlgoodies_calendar.css" rel=stylesheet></LINK>
<SCRIPT src="js/dhtmlgoodies_calendar.js" type=text/javascript></SCRIPT>
</head>
<body>
<p><br />
  &nbsp;&nbsp;<span class="style3">24小时统计：<%=bydate%></span></p>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="20" bgcolor="#006699"><div align="center" class="style1">24小时访问统计</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
      <tr>
        <td width="35%" height="20" valign="bottom" bgcolor="#F5F5F5">      <div align="center">时间</div>
        <td width="65%" valign="bottom" bgcolor="#F5F5F5"><div align="center">点击</div></td>
      </tr>
      
	  <%
	  	dim hourPercent,j
		
		Set Rs=Server.CreateObject("ADODB.Recordset")
		If databaseType = 1 Then
			sql="select * from t_hour WHERE f_date=#"&bydate&"#"
		Else
			sql="SELECT * from t_hour WHERE datediff(d,f_date,'"&bydate&"')=0"
		end if		
		Rs.open sql,conn,3,1
		if not rs.eof then
			for j=1 to 24
				totalNum=totalNum+rs(j)
			next
			for j=1 to 24
				imgWidth=formatnumber(rs(j)/totalNum,2)*500
				hourPercent=formatnumber(rs(j)/totalNum,4)*100
	  %>
	  <tr>
        <td height="20" valign="bottom" bgcolor="#FFFFFF"><div align="center"><%=j-1%></div>
        <td valign="bottom" bgcolor="#FFFFFF">
		<div align="left"><img src="images/green.gif" width="<%=imgWidth%>" height="10" /> <%=rs(j)%> ：<%=hourPercent%>%</div></td>
	   </tr>
	  <%
	  		next 	 
	  end if
	  Rs.close
	  set Rs=nothing
	  %>
     
    </table>
	<div align="center">	
	<form id="form1" name="form1" method="get" action="">
	  按天查看：
	  <input name="bydate" type="text" id="bydate" size="15" />
        <input name="button" type="button" onclick="displayCalendar(document.forms[0].bydate,'yyyy-mm-dd',this)" value="选择" />
        <input type="submit" value="查 看" />
	</form>
	</div>
	</td>
  </tr>
</table>
</body>
</html>
<%
call connclose()
%>