📄 message.asp
字号:
<!--#include file="include.asp"-->
<%
dim sql,rs,user
dim title,web_url,count,ip_hits,start_date,today_count,today_ip
dim date01,hits,ip_address,url
dim yd_count,yd_ip,av_count,av_ip
user=trim(request("user"))
date01=now()
sql="select * from cnt_msg where user01='"&user&"'"
set rs=conn.execute(sql)
title=rs("title")
title="<a href='"&rs("web_url")&"'target='_blank'>"&title&"</a>"
start_date=datevalue(rs("start_date"))
today_count=rs("today_count")
today_ip=rs("today_ip")
yd_count=rs("yd_count")
yd_ip=rs("yd_ip")
count=rs("count01")
ip_hits=rs("ip_hits")
av_count=rs("av_count")
av_ip=rs("av_ip")
if clng(av_count)=0 then av_count="(未知)"
if clng(av_ip)=0 then av_ip="(未知)"
if clng(yd_count)=0 then yd_count="(未知)"
if clng(yd_ip)=0 then yd_ip="(未知)"
%>
<html>
<head>
<title>计数器信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
td { font-size: 9pt}
p { font-size: 9pt}
a { text-decoration: none}
a:hover { color: #CC0033; text-decoration: underline}
-->
</style>
</head>
<body bgcolor="#6A4F9A" text="#FFFFFF" link="#FFFFCC" vlink="#FFFFCC" alink="#CCCCFF">
<div align="center">
<table width="616" border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="3">
<tr bgcolor="#000000">
<td colspan="2" align="center" height="22"><font color="#FFFFFF">【<%=title%>】统计信息</font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="308" height="22"><font color="#000000">开始统计日期:<font color="#800040"><%=start_date%></font></font></td>
<td width="296" height="22"><font color="#000000">当前日期:<font color="#800040"><%=datevalue(date01)%> </font><font color="#000099">(已统计<%=datediff("d",start_date,date01)%>天)</font></font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="308" height="22"><font color="#000000">今日访问次数:<font color="#800040"><%=today_count%></font></font></td>
<td width="296" height="22"><font color="#000000">今日IP次数:<font color="#800040"><%=today_ip%></font></font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="308" height="22"><font color="#000000">昨日访问次数:<font color="#800040"><%=yd_count%></font></font></td>
<td width="296" height="22"><font color="#000000">昨日IP次数:<font color="#800040"><%=yd_ip%></font></font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="308" bgcolor="#E1E1E1" height="22"><font color="#000000">日均访问次数:<font color="#800040"><%=av_count%></font></font></td>
<td width="296" height="22"><font color="#000000">日均IP次数:<font color="#800040"><%=av_ip%></font></font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="308" height="22"><font color="#000000">总访问次数:<font color="#800040"><%=count%></font></font></td>
<td width="296" height="22"><font color="#000000">总IP次数:<font color="#800040"><%=ip_hits%></font></font></td>
</tr>
</table>
<table width="616" border="1" cellspacing="0" bordercolorlight="#666666" bordercolordark="#FFFFFF">
<tr bgcolor="#990033" align="center">
<td height="22">最近7天统计信息</td>
</tr>
</table>
<table width="616" border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF">
<tr bgcolor="#E1E1E1" align="center">
<td height="22" width="60"><font color="#003399">统计日期</font></td>
<%
sql="select top 7 * from cnt_history where user01='"&user&"' order by date01 desc"
set rs=conn.execute(sql)
for j=1 to 7
if not rs.eof then
tjrq=rs("date01")
tjrq=month(tjrq)&"月"&day(tjrq)&"日"
rs.movenext
else
tjrq="(未知)"
end if
%>
<td height="22" width="79"><font color="#003399"><%=tjrq%></font></td>
<% next %>
</tr>
<tr bgcolor="#E1E1E1">
<td bgcolor="#E1E1E1" align="center" height="22" width="60"><font color="#000000">访问次数</font></td>
<%
set rs=conn.execute(sql)
for j=1 to 7
if not rs.eof then
vi_num=rs("vi_num")
rs.movenext
else
vi_num="(未知)"
end if
%>
<td align="center" height="22" width="79"><font color="#000000"><%=vi_num%></font></td>
<% next %>
</tr>
<tr bgcolor="#E1E1E1">
<td width="60" bgcolor="#E1E1E1" align="center" height="22"><font color="#000000">IP
次 数</font></td>
<%
set rs=conn.execute(sql)
for j=1 to 7
if not rs.eof then
ip_num=rs("ip_num")
rs.movenext
else
ip_num="(未知)"
end if
%>
<td align="center" height="22" width="79"><font color="#000000"><%=ip_num%></font></td>
<% next %>
</tr>
</table>
<%
set rs01=server.createobject("adodb.recordset")
rs01.open sql,conn,1,1
rec_num=rs01.recordcount
if rec_num=7 then
vi_total=0
ip_total=0
while not rs01.eof
vi_total=vi_total+clng(rs01("vi_num"))
ip_total=ip_total+clng(rs01("ip_num"))
rs01.movenext
wend
vi_avg=fix(vi_total/7)
ip_avg=fix(ip_total/7)
rs01.close()
set rs01=nothing
%>
<table width="616" border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" height="17">
<tr bgcolor="#E1E1E1">
<td colspan="3" height="22"><font color="#990033">最近7天平均访问次数:<font color="#003399"><%=vi_avg%></font></font></td>
<td colspan="2" width="312" height="22"><font color="#990033">最近7天平均IP次数:<font color="#003399"><%=ip_avg%></font></font></td>
</tr>
</table>
<% end if %>
<table width="616" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#999999" bordercolordark="#FFFFFF">
<tr bgcolor="#000000">
<td colspan="4" align="center" height="22"><font color="#FFFFFF">最近20位访问者信息</font></td>
</tr>
<tr bgcolor="#E1E1E1">
<td width="116"><font color="#000099">访问日期</font></td>
<td width="106" align="center"><font color="#000099">访问者IP地址</font></td>
<td width="27" align="center"><font color="#000099">次数</font></td>
<td width="333"><font color="#000099">请求页来源</font></td>
</tr>
<%
sql="select top 20 * from cnt_info where user01='"&user&"' order by vi_date desc"
set rs=conn.execute(sql)
while not rs.eof
url=rs("url")
if len(url)>45 then url=left(url,45)&"……"
if url=empty then url="(未知)"
%>
<tr bgcolor="#E1E1E1">
<td width="116"><font color="#000000"><%=rs("vi_date")%></font></td>
<td width="106" align="center"><font color="#000000"><%=rs("ip_address")%></font></td>
<td width="27" align="center"><font color="#000000"><%=rs("hits")%></font></td>
<td width="333"><font color="#000000"><%=url%></font></td>
</tr>
<%
rs.movenext
wend
%>
<tr align="center" bgcolor="#E1E1E1">
<td colspan="4"><font color="#000000">【</font><a href="javascript:window.close()"><font color="#330099">关闭窗口</font></a><font color="#000000">】</font></td>
</tr>
</table>
<table width="616" border="0">
<tr>
<td> </td>
</tr>
<tr align="center">
<td> <font color="#CCCCCC">SQL Server 版原创计数器 © CaiQing</font></td>
</tr>
</table>
<p> </p>
<p> </p>
</div>
</body>
<%
rs.close()
conn.close()
set rs=nothing
set conn=nothing
%>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -