<!--#include file="../include/nowshop.asp"-->
<!--#include file="checkadmin.asp"-->
<script language=javascript src=../include/mouse_on_title.js></script>
     <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("11")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
<%
action = request.form("del")
if action="ok" then

Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from count_total"
rs.open sql,conn,1,3
rs("total")=0		'总访问量置0
rs("yesterday")=0	'昨天访问量置0
rs("today")=0		'今天访问量置0
rs.update
conn.execute "delete from count_shop"
rs.close
set rs=nothing

response.write "<script language='javascript'>"
response.write "alert('统计数据已被清除，系统将从现在开始重新统计。');"
response.write "</script>"
end if

conn.execute("delete from count_online where datediff('h',time,now())>1")

Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from count_total"
rs.open sql,conn,1,3
total=rs("total")		'总访问量
yesterday=rs("yesterday")	'昨天访问量
today=rs("today")		'今天访问量

set rs = server.createobject("adodb.recordset")
sql = "select * from count_online"
rs.open sql,conn,1,3 
if not (rs.eof and rs.bof) then
online=rs.RecordCount		'在线人数
else 
online=1
end if

set rs = server.createobject("adodb.recordset")
sql = "select * from count_shop order by day asc"
rs.open sql,conn,1,3 
if not (rs.eof and rs.bof) then
total_ip=rs.RecordCount		'总IP访问量
firstday=rs("day")		'firstday：开始计算的日期
else 
total_ip=0
firstday=date()
end if
per_ip=int(total_ip/(date()-firstday+1))	'平均每天IP访问量
if per_ip<1 then per_ip=0	
per=int(total/(date()-firstday+1))	'平均每天访问量
if per<1 then per=0

set rs = server.createobject("adodb.recordset")
sql = "select * from count_shop where day=#"&date()&"#"
rs.open sql,conn,1,3 
if not (rs.eof and rs.bof) then
today_ip=rs.RecordCount		'今天总IP访问量
else 
today_ip=0
end if
set rs=nothing

set rs = server.createobject("adodb.recordset")
sql = "select * from count_shop where day=#"&date()-1&"#"
rs.open sql,conn,1,3 
if not (rs.eof and rs.bof) then
yesterday_ip=rs.RecordCount		'昨天总IP访问量
else 
yesterday_ip=0
end if
set rs=nothing

conn.close
set conn=nothing
%>		  <table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR> 
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">网站访问统计基本数据</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30><font color="#000000">&nbsp;<a href="http://www.nowshop.com.cn/help/index.asp?boardid=2&page=1" target="_blank">设置帮助</a></font></TD>
    </TR>
  </TBODY>
</TABLE>		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
  <form action="tj1.asp" name="tongji" method=post>

          <tr bgcolor="#FFFFFF"> 
            <td width="22%" height="30">统计起始日期</td>
            <td width="28%"><%=firstday%></td>
            <td width="22%">统计截止日期</td>
            <td width="28%"><%=date()%>（共<%=date()-firstday+1%>天）</td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="30">总访问量</td>
            <td><%=total%></td>
            <td>平均每日访问量</td>
            <td><%=per%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="30">总IP访问量</td>
            <td><%=total_ip%></td>
            <td>平均每日IP访问量</td>
            <td><%=per_ip%></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="30">昨天访问量</td>
            <td><%=yesterday%></td>
            <td>昨天IP访问量</td>
            <td><%=yesterday_ip%> &nbsp; <a href=tj3.asp?day=<%=date()-1%>>查看明细</a></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="30">今天访问量</td>
            <td><%=today%></td>
            <td>今天IP访问量</td>
            <td><%=today_ip%> &nbsp; <a href=tj3.asp?day=<%=date()%>>查看明细</a></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="30">当前在线人数</td>
            <td><%=online%> 人</td>
            <td>统计数据置零</td>
            <td> <input type=hidden name="del" value="ok"> <input type="submit" name="action" value="执行" onclick="{if(confirm('清除全部统计数据，重新开始统计。此操作无法恢复，您确定要继续吗？')){this.document.tongji.submit();return true;}return false;}"> 
            </td>
          </tr>
		    </form>

        </table>
<table width="95%" border="0">
  <tr> 
    <td height="60"><font color="#FF0000">我们将为购买正版NowShop商城系统者免费设计全套广告图片；提供免费安装调试；免费送1%网银接口、支付宝接口；免费提供技术支持；免费提供系统升级；免费提供系统模板更换；免费代办网站ICP备案；使您的网店更具吸引力！</font></td>
  </tr>
  <tr> 
    <td><p>购买咨询或技术支持，请在周一至周五8：00-18：00间联系<br>
        Email / MSN：shop@nowshop.com.cn<br>
        电话：0551-5123308&nbsp;&nbsp;13965090551<br>
        QQ：2055008<br>
        网站：<a href="http://www.nowshop.com.cn" target="_blank">http://www.nowshop.com.cn</a><br>
        演示：<a href="http://ys.nowshop.com.cn" target="_blank">http://ys.nowshop.com.cn</a><br>
      </p>
      <p>Powerd By：NowShop商城系统 V3.5</p></td>
  </tr>
</table>
</body></html>
