<!-- #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;
}
.style5 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<p><br />
  &nbsp;&nbsp;<span class="style3">摘要：</span><span class="style2"><%=strDate%></span></p>
<p align="left"><span class="style5">友情提示</span>：如果您是第一次使用统计系统，为了安全，请点击左侧“<a href="chanpass.asp">修改前台登录密码</a>”链接，修改统计前台登录查看管理员的密码。(修改此密码不影响CMS后台管理员查看统计信息)</p>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000" class="line20">
  <tr>
    <td width="36%" height="20" bgcolor="#006699">&nbsp;</td>
    <td width="64%" bgcolor="#006699"><div align="center" class="style1">页面显示</div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="style4">今日：</span></td>
    <td bgcolor="#FFFFFF" class="paddleft10">
	<%	
	Set Rs=Server.CreateObject("ADODB.Recordset")
	If databaseType = 1 Then
		sql= "SELECT f_hits FROM t_daily WHERE f_date=#"&strDate&"#"
	Else
		sql = "SELECT f_hits FROM t_daily WHERE datediff(d,f_date,'"&strDate&"')=0"
	End If
	Rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then
		response.Write(rs(0))
	end if
	Rs.close
	set Rs=nothing
	%>	</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><strong>每天平均<span class="style4">：</span></strong></td>
    <td bgcolor="#FFFFFF" class="paddleft10">
	<%
	dim dayAverage,dailyTotal,dailyHitsTotal
	Set Rs=Server.CreateObject("ADODB.Recordset")
	sql= "SELECT count(*),sum(f_hits) FROM t_daily"	
	Rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then
		dailyTotal=rs(0)
		dailyHitsTotal=rs(1)
		if dailyTotal=0 then		
			dayAverage=0
		else
			dayAverage=FormatNumber(dailyHitsTotal/dailyTotal, 1)
		end if
	end if
	Rs.close
	set Rs=nothing
	response.Write(dayAverage)
	%></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><strong>最后一周<span class="style4">：</span></strong></td>
    <td bgcolor="#FFFFFF" class="paddleft10"><%
	dim weekCount
	Set Rs=Server.CreateObject("ADODB.Recordset")
	if(databaseType=1) then
		sql= "SELECT sum(f_hits) FROM t_daily where dateDiff('d','"&strDate&"',f_date)<=7"
	else
		sql= "SELECT sum(f_hits) FROM t_daily where dateDiff(d,'"&strDate&"',f_date)<=7"
	end if
	Rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then		
		weekCount=rs(0)
	end if
	Rs.close
	set Rs=nothing
	response.Write(weekCount)
	%></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><strong>本月<span class="style4">：</span></strong></td>
    <td bgcolor="#FFFFFF" class="paddleft10">
	<%
	dim monthCount
	Set Rs=Server.CreateObject("ADODB.Recordset")
	if(databaseType=1) then
		sql= "SELECT sum(f_hits) FROM t_daily where dateDiff('d','"&strDate&"',f_date)<=31"
	else
		sql= "SELECT sum(f_hits) FROM t_daily where dateDiff(d,'"&strDate&"',f_date)<=31"
	end if
	Rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then		
		monthCount=rs(0)
	end if
	Rs.close
	set Rs=nothing
	response.Write(monthCount)
	%></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><strong>总计</strong><span class="style4">：</span></td>
    <td bgcolor="#FFFFFF" class="paddleft10">
	<%
	dim totalIp,totalPv
	Set Rs=Server.CreateObject("ADODB.Recordset")
	sql= "SELECT f_totalip,f_totalpv from t_global"	
	Rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then
		rs.movefirst	
		totalIp=rs(0)
		totalPv=rs(1)
	end if
	Rs.close
	set Rs=nothing
	response.Write("独立IP:"&totalIp&" 页面PV:"&totalPv&" 最新缓存:"&application("statNum"))
	%>
	</td>
  </tr>
</table>
<br />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="20" bgcolor="#006699"><div align="center" class="style1">最近7天统计 &nbsp;&nbsp;<a href="days.asp" style="color:#FFFFFF">更多日期</a></div> </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
	  <%
	  	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&"')<7 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&"')<7 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 top 7 f_hits,f_week,f_date FROM t_daily where dateDiff('d',f_date,'"&strDate&"')>=0 and dateDiff('d',f_date,'"&strDate&"')<7 order by f_date asc"
		else
			sql= "SELECT top 7 f_hits,f_week,f_date FROM t_daily where dateDiff(d,f_date,'"&strDate&"')>=0 and dateDiff(d,f_date,'"&strDate&"')<7 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)*100
	  %>
        <td valign="bottom"><div align="center"><%=w_hits%><br />
<img src="images/green.gif" width="10" height="<%=imgHeight%>" /><br />
星期<%=w_week%>:<%=rs(2)%></div>
		</td>
	  <%
	 	 Rs.movenext
	  wend
	  Rs.close
	  set Rs=nothing
	  %>
      </tr>
    </table></td>
  </tr>
</table>
<div align="center">
  <textarea name="textarea" style="width:98%; height:150px;">初次使用系统时，需要配置stat.js中的siteUrl变量，方法如下：
用编辑软件，如UltraEdit、EditPlus打开totstat目录中的stat.js文件，找到以下代码：

siteUrl="http://localhost/totstat/stat.asp";

假设您有一个网站，www.abc.com，同时将淘特统计系统totstat文件夹传到www.abc.com下。

那么siteUrl就应该修改为：

siteUrl="http://www.abc.com/totstat/stat.asp";

注：双引号后的分号一定要保留。

配置完毕后，在系统后台中左面一栏，找到“获取统计代码“，点击，将右栏的统计代码加入到

您要统计的页面中即可。

注：为不影响页面浏览效果，建议将统计代码加入到页面的&lt;/body&gt;之前。</textarea>
</div>
</body>
</html>
<%
call connclose()
%>