<%qx="06"%>
<!--#include file="login/0.asp"-->
<!--#include file="../mycartconn/conn.asp"-->
<!--#include file="../mycartconn/page.asp"-->
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../mycartconn/admin.css" rel="stylesheet" type="text/css">
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center" valign="middle"> 
    <td width="25%" height="45"><a href="?">-&gt; 基本数据统计</a></td>
    <td width="25%"><a href="?abc=online">-&gt; 当前在线列表</a></td>
    <td width="25%" height="45"><a href="?abc=31">-&gt; 最近31日流量查看</a></td>
    <td width="25%"><a href="?abc=my">-&gt; 自定义时段流量查看</a></td>
  </tr>
</table>
<%Select case request("abc")
case "online"
Response.Write("<table border=0 cellpadding=0 cellspacing=0 align=center style='border-collapse: collapse' bordercolor=#ffffff width=590 >")
Response.Write("<tr><td height=30 colspan=4>目前有"&online_line&"人在线。其中"&online_huiyuan&"位会员，"&online_youke&"位游客。最高峰在线："&online_s&"人，发生时间："&conn.execute("select sj from bbs_info")(0)&"。<br>"&my_name&"服务器标准时间："&now()&"，在线会员涮新统计时间："&my_online_sj&"分钟</td></tr><table>") 
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select name,pic,ip,sj from online order by pic desc,id desc"
rs.open sql,conn,3,1 
page1("15")%>
<table width=590 border=0 align=center cellpadding=2 cellspacing=1 bordercolor=#ffffff bgcolor="#CCCCCC" style='border-collapse: collapse' >
  <tr bgcolor=#f1f1f1><td width=220 align=center bgcolor=#f1f1f1>来客身份标识</td><td width=150 align=center>来访IP</td><td align=center>最后活动时间</td></tr>
<%i=1
do while not rs.eof and i<=rs.pagesize%>
  <tr bgcolor="#FFFFFF"> 
    <td width="220" bgcolor="#FFFFFF"><img border=0 src=/jst/image/line<%=rs(1)%>.gif>&nbsp;<%if rs(1)=0 then Response.Write rs(0) else Response.Write"<a href=huiyuan/huiyuan.asp?abc=xs&page=1&id="&conn.execute("select id from huiyuan where huiyuan='"&rs(0)&"'")(0)&">"&rs(0)&"</a>"%></td>
    <td width="150">&nbsp;<%=rs(2)%></td>
    <td align="center"><%=rs(3)%></td>
  </tr>
<%i=i+1
rs.movenext
loop%>
</table>
<%Response.Write "<table border=0 cellpadding=0 cellspacing=0 align=center style='border-collapse: collapse' bordercolor=#ffffff width=590 ><tr><td height=30>"
page2("abc=online&")
Response.Write "</td></tr>"
rs.Close:set rs=nothing
Response.Write("</table>")
case "my_ok"
if request("rq1")="" or request("rq2")="" then
Response.redirect "?abc=my"
else
rq1=datediff("d",cdate(request("rq1")),now())+1
rq2=datediff("d",cdate(request("rq2")),now())-1
rq=rq2-rq1
end if
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select js1,js2,sj from jishuqi where datediff(d,sj,getdate())<"&rq1&" and datediff(d,sj,getdate())>"&rq2&" order by id asc"
rs.open sql,conn,1,3
do while not rs.eof
zs1 = zs1 + rs(0)
zs2 = zs2 + rs(1)
rs.movenext
loop
rs.movefirst%>
<br><br>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="40" valign="middle"><strong><font color="#FF0000"><%=request("rq1")%>至<%=request("rq2")%>网站流量图</font></strong>(提示: 
      在鼠标的悬停提示中包含了更详细的信息) </td>
  </tr>
</table>
<table width="600" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="250" align="center" valign="bottom" bgcolor="#f1f1f1"> 
<%do while not rs.eof
g1 = Round((rs(0)/zs1)*100,2)
g2 = Round((rs(1)/zs1)*100,2)
%><img src="../../image/tu1.gif" height="<%=g1*3.1%>" width="9" alt="<%=formatdatetime(rs(2),2)%>，流量<%=rs(0)%>次"><img src="../../image/tu2.gif" height="<%=g2*3.1%>" width="9" alt="<%=formatdatetime(rs(2),2)%>，人次<%=rs(1)%>次"><%rs.movenext
loop%>
    </td>
  </tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="40" align="center" valign="middle">本统计时段总数据： <img src="../image/tu1.gif" width="12" height="12" border="1" align="absmiddle"> 
      流量&nbsp;<%=zs1%>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../image/tu2.gif" width="12" height="12" border="1" align="absmiddle"> 
      人次&nbsp;<%=zs2%></td>
  </tr>
</table>
<p>
<%rs.close
set rs=nothing
case "my"%>
<script type="text/javascript" src="../mycartconn/rq.js"></script>
<p></p><br>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="35" valign="middle"><strong><font color="#FF0000">自定义时段网站流量查看</font></strong>(日期跨度很长时，请在访问量低的时间查看)</td>
  </tr>
  <tr>
    <td height="50" align="center" valign="bottom"> 
      <form name="form1" method="post" action="?abc=my_ok">
        开始日期 
        <script language=JavaScript>arrowtag("rq1",'');</script>
        截止日期<script language=JavaScript>arrowtag("rq2",'');</script>
        <input name="Submit" type="submit" class="go-wenbenkuang" value="查询">
      </form></td>
  </tr>
</table>
<%case "31"
set rs = conn.execute("select js1,js2,sj from jishuqi where datediff(d,sj,getdate())>0 and datediff(d,sj,getdate())<31 order by id asc")
rs.open sql,conn,1,3
do while not rs.eof
zs1 = zs1 + rs(0)
zs2 = zs2 + rs(1)
rs.movenext
loop
rs.movefirst%>
<br><br>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="40" valign="middle"><strong><font color="#FF0000">最近31日网站流量图</font></strong>(提示: 
      在鼠标的悬停提示中包含了更详细的信息) </td>
  </tr>
</table>
<table width="600" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="250" align="center" valign="bottom" bgcolor="#f1f1f1"> 
      <%do while not rs.eof
g1 = Round((rs(0)/zs1)*100,2)
g2 = Round((rs(1)/zs1)*100,2)%><img src="../../image/tu1.gif" height="<%=g1*3.1%>" width="9" alt="<%=formatdatetime(rs(2),2)%>，流量<%=rs(0)%>次"><img src="../../image/tu2.gif" height="<%=g2*3.1%>" width="9" alt="<%=formatdatetime(rs(2),2)%>，人次<%=rs(1)%>次"><%rs.movenext
loop%>
    </td>
  </tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="40" align="center" valign="middle">本统计时段总数据： <img src="../image/tu1.gif" width="12" height="12" border="1" align="absmiddle"> 
      流量&nbsp;<%=zs1%>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../image/tu2.gif" width="12" height="12" border="1" align="absmiddle"> 
      人次&nbsp;<%=zs2%></td>
  </tr>
</table>
<p>
<%rs.close
set rs=nothing
case else
if Request.Cookies(my_url)("admin_ip_sj")="" or datediff("n",cdate(Request.Cookies(my_url)("admin_ip_sj")),now())>15 then
'自动更新商户
conn.execute("Update user_name set zt=3 where (zt=2 or zt=1) and datediff(d,sj2,getdate())>rq")
'隐藏回归已审产品却时间到商家
conn.execute("Update chanpin set cang=1 where tui=0 and userid in (select id from user_name where zt=3 or zt=4)")
'隐藏到期产品
conn.execute("Update chanpin set cang=1 where datediff(n,sj2,getdate())>1")
'删除超过3天未激活的会员账号
conn.execute("Delete huiyuan where zt=0 and datediff(d,sj,getdate())>3")
'删除超过15天的收藏记录
conn.execute("Delete shoucang where datediff(d,sj,getdate())>15")
'删除超过20分钟的SQL入侵记录
conn.execute("Delete nosql where (datediff(n,sj,getdate())>js*6 or datediff(n,sj,getdate())>20) and js<>999")
'删除超过15天的短信记录
conn.execute("Delete duanxin where datediff(d,sj,getdate())>15")
'删除过期的登陆记录
conn.execute("Delete ip where datediff(d,sj,getdate())>30")
'删除过期的房产信息
conn.execute("Delete fangchan where datediff(d,sj,getdate())>sj2")
end if
Response.Cookies(my_url)("admin_ip_sj")=now()
'显示登陆信息
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from ip  order by id DESC"
rs.open sql,conn,1,1
%>
<meta http-equiv='refresh' content='60'>
</p>
<p>&nbsp; </p>
<table width="650" align="center" cellpadding="0" cellspacing="0">
  <tr> 
          <td valign="top">您的登陆名称<%= rs("name") %>，IP地址<%= rs("ip") %>，所用浏览器<%= rs("win") %>，登陆时间<%= rs("sj") %>。以下统计数椐为域名根直接访问量。</td>
        </tr>
        <tr> 
          <td height="150" valign="middle"> <%rs.close
set rs=nothing
set rs = conn.execute("select top 1 * from jishuqi order by id desc")
todaycount=rs("js1")
personcount=rs("js2")
rs.close
set rs=nothing
set rs = conn.execute("select sum(js1) as tota,sum(js2) as persont from jishuqi")
totalc=rs("tota")
persont=rs("persont")
rs.close
set rs=nothing%> 
      <table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td >目前在线 <%=online_line%></td>
          <td >会员/游客 <%=online_huiyuan%>/<%=online_youke%></td>
        </tr>
        <tr>
          <td >最高在线 <%=online_s%></td>
          <td >产生时间 <%=conn.execute("select sj from bbs_info")(0)%></td>
        </tr>
        <tr> 
          <td width="45%" >今日流量 <font color="#FF3333"><%=todaycount%></font></td>
          <td width="55%" >今日人次 <font color="#FF3333"><%=personcount%></font></td>
        </tr>
        <tr> 
          <td width="45%" > 昨日流量 <%=conn.execute("select js1 from jishuqi where datediff(d,sj,getdate())=1")(0)%></td>
          <td width="55%" >昨日人次 <%=conn.execute("select js2 from jishuqi where datediff(d,sj,getdate())=1")(0)%></td>
        </tr>
        <tr> 
          <td width="45%" >总游览量 <%=totalc%></td>
          <td width="55%" >总计人次 <%=persont%></td>
        </tr>
        <tr> 
          <td >开始统计 <%=formatdatetime(conn.execute("select sj from jishuqi order by id asc")(0),2)%></td>
          <td >统计天数 
            <%tj=conn.execute("select count(id) from jishuqi")(0)
				Response.Write tj%></td>
        </tr>
        <tr> 
          <td >平均流量 <%=formatnumber(totalc/tj,2)%></td>
          <td >平均人次 <%=formatnumber(persont/tj,2)%></td>
        </tr>
        <tr> 
          <td >最高流量 <%=conn.execute("select js1 from jishuqi order by js1 desc")(0)%></td>
          <td >发生日期 <%=formatdatetime(conn.execute("select sj from jishuqi order by js1 desc")(0),2)%></td>
        </tr>
        <tr> 
          <td >最高人次 <%=conn.execute("select js2 from jishuqi order by js2 desc")(0)%></td>
          <td >发生日期 <%=formatdatetime(conn.execute("select sj from jishuqi order by js2 desc")(0),2)%></td>
        </tr>
        <tr> 
          <td >最低流量 <%=conn.execute("select js1 from jishuqi order by js1 asc")(0)%></td>
          <td >发生日期 <%=formatdatetime(conn.execute("select sj from jishuqi order by js1 asc")(0),2)%></td>
        </tr>
        <tr> 
          <td >最低人次 <%=conn.execute("select js2 from jishuqi order by js2 asc")(0)%></td>
          <td >发生日期 <%=formatdatetime(conn.execute("select sj from jishuqi order by js2 asc")(0),2)%></td>
        </tr>
      </table>
            <br> </td>
        </tr>
      </table>
<br>
</body></html>
<%End Select
conn.close
set conn=nothing%>