?? tj_day.asp
字號:
<%@ CODEPAGE = "936" %>
<%
'=================================
'
' 阿江酷站訪問統(tǒng)計系統(tǒng)
' Ajiang info@ajiang.net
' www.ajiang.net
'
' 版權(quán)所有·抄襲挪用必究
'
'=================================
%>
<!--#include file="inc_config.asp"-->
<%
'權(quán)限檢查
if session.Contents("master")=false and whatcan<2 then Response.Redirect "help.asp?id=004&error=您沒有查看日訪問統(tǒng)計的權(quán)限。"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Copyright" content="Ajiang http://www.ajiang.net">
<title><%=countname%>-日訪問統(tǒng)計</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin=5 rightmargin=0 leftmargin=0 vlink=#000000>
<!--#include file="inc_top.asp"-->
<br>
<table width=500 cellspacing=0 align=center>
<tr><td>
<p style="line-height: 100%; margin-left: 15; margin-top: 5; margin-bottom: 0">
Tips: 用鼠標點指圖形柱或者圖形柱下的數(shù)字可以看到對應(yīng)的訪問量。</p>
</td></tr>
</table>
<br>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
<tr><td colspan="3"><img src="images/photoup.gif"></td></tr>
<tr height="30">
<td width="1" class="backs"></td>
<td width="498"class="backq">
<SCRIPT type="text/javascript" src="http://bar.baidu.com/ad/popprg.js"></SCRIPT>
<SCRIPT language="JavaScript">
<!--
BaiduWriteAD("zouwenyedg","3");
//-->
</SCRIPT> <img src= http://un.baidu.com/images/st.gif?tn=zouwenye width=0 height=0>
<img src="images/tb_title.gif" align=absmiddle> ∷∷∷ 最近31天訪問量 ∷∷∷<br>
<table border="0" cellpadding="0" cellspacing="0" width="453" align=center>
<tr height="9"><td></td></tr>
<tr height="101">
<%
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath(connpath)
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'找到開始統(tǒng)計天數(shù),如果天數(shù)不足31天,則跳過前面的空間
tmprs=conn.execute("Select top 1 vtime from view order by id")
vfirst=tmprs("vtime")
set tmprs=nothing
if isnull(vfirst) then vfirst=now()
vdays=int(date()-vfirst+1)
'聲明二維數(shù)組,voutday(*,0)為訪問量,voutday(*,1)為日期,voutday(*,2)為星期
dim vday(31,3),voutday(31,3)
maxday=0
sumday=0
for i=0 to 30
vday(i,0)=vdaycon(date()-30+i)
if vday(i,0)>maxday then maxday=vday(i,0)
sumday=sumday+vday(i,0)
vday(i,1)=day(date()-30+i)
vday(i,2)=weekday(date()-30+i)
next
'防止除數(shù)為0而出錯
if maxday=0 then maxday=1
if sumday=0 then sumday=1
'根據(jù)已統(tǒng)計天數(shù)將數(shù)值左移
if vdays>=31 then
for i=0 to 30
voutday(i,0)=vday(i,0)
voutday(i,1)=vday(i,1)
voutday(i,2)=vday(i,2)
next
else
on error resume next
for i=0 to 30
if i<=vdays then
voutday(i,0)=vday(i+30-vdays,0)
voutday(i,1)=vday(i+30-vdays,1)
voutday(i,2)=vday(i+30-vdays,2)
else
voutday(i,0)=0
voutday(i,1)=""
voutday(i,2)=0
end if
next
end if
%>
<td align=right valign=top>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(maxday*10+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(3*maxday*10/4+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(maxday*10/2+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0">
<font face="Arial"><%=int(maxday*10/4+0.5)/10%><br></font></td>
<td width=10><img src="images/tu_back_left.gif"></td>
<%
'
for i= 0 to 30
%>
<td width=13 valign=bottom background="images/tu_back.gif" align=center>
<img style="BORDER-BOTTOM: #000000 1px solid" src="images/tu.gif"
height="<%=(voutday(i,0)/maxday)*100%>" width="9"
alt="<%=voutday(i,1)%>日,訪問<%=voutday(i,0)%>次,<%
'計算訪問量的百分數(shù),精確到小數(shù)后1位,小于零的在前面加字母0
lsbf=int(voutday(i,0)*1000/sumday+0.5)/10
if lsbf<1 then lsbf="0" & lsbf
Response.Write lsbf
%>%"></td>
<%
next
%>
<td width=10><img src="images/tu_back_right.gif"></td>
<td width=10></td>
</tr>
<tr>
<td align=right>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0">
<font face="Arial">0</font></td>
<td width=10></td>
<%
for i= 0 to 30
%>
<td width=13 align=center>
<a title="<%=voutday(i,1)%>日,訪問<%=voutday(i,0)%>次,<%
'計算訪問量的百分數(shù),精確到小數(shù)后1位,小于零的在前面加字母0
lsbf=int(voutday(i,0)*1000/sumday+0.5)/10
if lsbf<1 then lsbf="0" & lsbf
Response.Write lsbf
%>%"><%
'根據(jù)當天的日期用不同的顏色區(qū)分日期,周六用綠色,周日用紅色
select case voutday(i,2)
case 1%>
<font face="Arial" style="letter-spacing: -1" color="red">
<%case 7%>
<font face="Arial" style="letter-spacing: -1" class="fonts">
<%case else%>
<font face="Arial" style="letter-spacing: -1">
<%end select%>
<%=voutday(i,1)%></font></a></font></font></td>
<%
next
%>
<td width=10></td>
<td width=10></td>
</tr>
<tr height="5"><td></td></tr>
</table>
</td>
<td width="1" class="backs"></td>
</tr>
<tr><td colspan="4"><img src="images/photodown.gif"></td></tr>
</table>
<br>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
<tr><td colspan="3"><img src="images/photoup.gif"></td></tr>
<tr height="30">
<td width="1" class="backs"></td>
<td width="498"class="backq">
<img src="images/tb_title.gif" align=absmiddle> ∷∷∷ 所有月份日訪問量 ∷∷∷<br>
<table border="0" cellpadding="0" cellspacing="0" width="453" align=center>
<tr height="9"><td></td></tr>
<tr height="101">
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select vday,count(id) as allday from view group by vday"
rs.Open sql,conn,1,1
dim vallday(31)
maxallday=0
sumallday=0
do while not rs.EOF
vallday(cint(rs("vday"))-1)=cint(rs("allday"))
if vallday(cint(rs("vday"))-1)>maxallday then maxallday=vallday(cint(rs("vday"))-1)
sumallday=sumallday+vallday(cint(rs("vday"))-1)
rs.MoveNext
loop
'防止除數(shù)為0而出錯
if maxallday=0 then maxallday=1
if sumallday=0 then sumallday=1
%>
<td align=right valign=top>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(maxallday*10+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(3*maxallday*10/4+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<font face="Arial"><%=int(maxallday*10/2+0.5)/10%></font>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0">
<font face="Arial"><%=int(maxallday*10/4+0.5)/10%><br></font></td>
<td width=10><img src="images/tu_back_left.gif"></td>
<%
for i= 0 to 30
%>
<td width=13 valign=bottom background="images/tu_back.gif" align=center>
<img style="BORDER-BOTTOM: #000000 1px solid;" src="images/tu.gif"
height="<%=(vallday(i)/maxallday)*100%>" width="9"
alt="<%=i+1%>日,訪問<%=vallday(i)%>次,<%
'計算訪問量的百分數(shù),精確到小數(shù)后1位,小于零的在前面加字母0
lsbf=int(vallday(i)*1000/sumallday)/10
if lsbf<1 then lsbf="0" & lsbf
Response.Write lsbf
%>%"></td>
<%
next
%>
<td width=10><img src="images/tu_back_right.gif"></td>
<td width=10></td>
</tr>
<tr>
<td align=right>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0">
<font face="Arial">0</font></td>
<td width=10></td>
<%
for i= 0 to 30
%>
<td width=13 align=center><a title="<%=i+1%>日,訪問<%=vallday(i)%>次,<%
'計算訪問量的百分數(shù),精確到小數(shù)后1位,小于零的在前面加字母0
lsbf=int(vallday(i)*1000/sumallday)/10
if lsbf<1 then lsbf="0" & lsbf
Response.Write lsbf
%>%">
<%
'因為相鄰的日期靠的太近,所以用隔一顯示的辦法
if (i+1) mod 2 then%>
<font face="Arial" style="letter-spacing: -1"><%=i+1%></font><%end if%></a></td>
<%
next
%>
<td width=10></td>
<td width=10></td>
</tr>
<tr height="5"><td colspan=29></td></tr>
</table>
</td>
<td width="1" class="backs"></td>
</tr>
<tr><td colspan="4"><img src="images/photodown.gif"></td></tr>
</table>
<%
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
<br>
<!--#include file="inc_bottom.asp"-->
</body>
</html>
<%
'計算指定日期的訪問量
function vdaycon(theday)
theday=cdate(theday)
thetday=cdate(theday+1)
tmprs=conn.execute("Select count(id) as vdaycon from view where" & _
" vtime>=datevalue('" & theday & "') and vtime<=datevalue('" & thetday & "')")
vdaycon=tmprs("vdaycon")
set tmprs=nothing
if isnull(vdaycon) then vdaycon=0
end function
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -