开放源码 - 访客统计查询(四)

发表于:2007-06-30来源:作者:点击数: 标签:
!--#Include File=Statistics_Connection.asp-- !DOCTYPE HTML PUBLIC -//W3C//D TD HTML 4.01 Transitional//EN html head titleStatistics Details/title meta http-equiv=Content-Type content=text/html; charset=gb2312 meta name=Author content=Jack M
<!--#Include File="Statistics_Connection.asp"-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Statistics Details</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="Jack Ma">
<link rel="stylesheet" type="text/css" href="Statistics_CSS.css">

<SCRIPT LANGUAGE="javascript">
<!--
function ChangeColor(argPtr, argColor)
{
argPtr.style.backgroundColor=argColor;
}
-->
</script>

</head>

<body>
<div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="ColorBottomL1">
<tr>
<td>
<%
Dim rstStatisticsDay
Dim strWriteHTML, colorOver, colorOut, ColorDbClick

Set rstStatisticsDay = Server.CreateObject("ADODB.Recordset")
With rstStatisticsDay
.ActiveConnection = cnnStatistics
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
.Source = "Select VisitDate, Count(ID) As VisitsDaily From IPs Group By VisitDate Order By VisitDate Desc"
.Open
End With

strWriteHTML = _
"<table class=‘’ColorBottomL1_Back‘’ border=‘’0‘’ width=‘’100%‘’ cellpadding=‘’5‘’ cellspacing=‘’1‘’>" & vbCrLf & _
"<tr class=‘’ColorBottomL2_ItemTop‘’><td><B>Date</B></td><td><B>Visits</B></td></tr>" & vbCrLf
colorOver = Chr(34) & "#ffclearcase/" target="_blank" >cc66" & Chr(34)
colorOut = Chr(34) & "#cccccc" & Chr(34)

Do While Not rstStatisticsDay.EOF
strWriteHTML = strWriteHTML _
& ( _
"<tr class=‘’ColorBottomL2_ItemBody‘’ " _
& "onmouseout=‘’ChangeColor(this, " & colorOut & ");‘’ " _
& "onmouseover=‘’ChangeColor(this, " & colorOver & ");‘’ " _
& "title=‘’On " & rstStatisticsDay("VisitDate") & " my homepage gots " & vbCrLf _
& rstStatisticsDay("VisitsDaily") & " visit(s)!‘’>" & vbCrLf _
& vbTab & "<td>" & rstStatisticsDay("VisitDate") & "</td>" & vbCrLf _
& vbTab & "<td><img border=‘’0‘’ src=‘’Image/Red.gif‘’ height=‘’10‘’ " _
& "width=‘’" & rstStatisticsDay("VisitsDaily") * 5 & "‘’>&nbsp;" _
& rstStatisticsDay("VisitsDaily") & "</td>" & vbCrLf _
& "</tr>" & vbCrLf _
)
rstStatisticsDay.MoveNext
Loop
strWriteHTML = strWriteHTML & "</table>"

Response.Write strWriteHTML

rstStatisticsDay.Close
Set rstStatisticsDay = Nothing

Call CloseDatabase
%>
<td>
<tr>
</table>
</div>
</body>
</html>

原文转自:http://www.ltesting.net