<!-- #INCLUDE FILE = "conn.asp" -->
<!-- #INCLUDE FILE = "date.asp" -->
<!-- #INCLUDE FILE = "session.asp" -->
<%
dim Rs,sql
%>
<!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>
</head>

<body>
<p><br />
  &nbsp;&nbsp;<span class="style3">摘要：</span></p>
<form id="form1" name="form1" method="post" action="?act=do">
  查看最近
<input name="days" type="text" id="days" value="30" size="10" maxlength="10" /> 
    天数据
    <input type="submit" name="Submit" value="Submit" />
</form>
<br />
<%
dim act
act=request.QueryString("act")
if(act="do") then
	days=Clng(request.Form("days"))
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="20" bgcolor="#006699"><div align="center" class="style1">最近<%=days%>天统计</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      
	  <%
	  	dim w_hits,w_week,w_total,imgHeight
		Set Rs=Server.CreateObject("ADODB.Recordset")
		if(databaseType=1) then
			w_total=conn.execute("SELECT sum(f_hits) FROM t_daily where dateDiff('d',f_date,'"&strDate&"')<"&days&" and dateDiff('d',f_date,'"&strDate&"')>=0")(0)
		else
			w_total=conn.execute("SELECT sum(f_hits) FROM t_daily where dateDiff(d,f_date,'"&strDate&"')<"&days&" and dateDiff(d,f_date,'"&strDate&"')>=0")(0)
		end if
		if(w_total<=0) then
			w_total=1
		end if
		if(databaseType=1) then
			sql= "SELECT  f_hits,f_week,f_date FROM t_daily where dateDiff('d',f_date,'"&strDate&"')>=0 and dateDiff('d',f_date,'"&strDate&"')<"&days&" order by f_date asc"
		else
			sql= "SELECT  f_hits,f_week,f_date FROM t_daily where dateDiff(d,f_date,'"&strDate&"')>=0 and dateDiff(d,f_date,'"&strDate&"')<"&days&" order by f_date asc"
		end if
		Rs.open sql,conn,3,1
		while not rs.eof
			w_hits=rs(0)
			w_week=rs(1)			
			imgHeight=formatnumber(w_hits/w_total,2)*1000
	  %><tr>
        <td valign="bottom"><div align="center"><%=w_hits%>
<img src="images/green.gif" width="<%=imgHeight%>" height="10" /> <%=rs(2)%><br />
</div>
		</td></tr>
	  <%
	 	 Rs.movenext
	  wend
	  Rs.close
	  set Rs=nothing
	  %>
      
    </table></td>
  </tr>
</table>
<%
end if
%>
</body>
</html>
<%
call connclose()
%>