当前位置:编程学习 > asp >>

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

答案:<!--#Include File="Statistics_Connection.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href=><title>Statistics View</title>

<SCRIPT LANGUAGE="JScript">
<!--
// ---------- 函数 - 处理表格交互变化
function ChangeColor(argPtr, argColor)
{
if(!argColor)
argPtr.style.backgroundColor = "#dddddd";
else
argPtr.style.backgroundColor = "#eeeeee";
}

// ---------- 函数 - 处理多选框 ----------
var ie = document.all ? 1 : 0;
//var ns4 = document.layers ? 1 : 0;

function HighLight(cb)
{
if(ie)
{ while(cb.tagName != "TR")
{ cb = cb.parentElement;
}
}
else
{ while (cb.tagName != "TR")
{ cb = cb.parentNode;
}
}
cb.className = 'ColorHighLight';
}

function LowLight(cb)
{
if(ie)
{ while (cb.tagName != "TR")
{ cb = cb.parentElement;
}
}
else
{ while (cb.tagName != "TR")
{ cb = cb.parentNode;
}
}
cb.className = 'ColorLowLight';
}

function Check(cb)
{
if (cb.checked)
{ HighLight(cb);
}
else
{ LowLight(cb);
}
}

function CheckAll()
{
var fmobj = document.frmOperation;

for(var i = 0; i < fmobj.elements.length; i ++)
{ var e = fmobj.elements[i];

if((e.name != 'Check_All') && (e.type == 'checkbox') && (!e.disabled))
{ e.checked = fmobj.Check_All.checked;
if(e.checked)
{ HighLight(e);
}
else
{ LowLight(e);
}
}
}
}

function CheckCheckAll()
{
var fmobj = document.frmOperation;
var TotalBoxes = 0;
var TotalOn = 0;

for(var i = 0; i < fmobj.elements.length; i ++)
{ var e = fmobj.elements[i];
if((e.name != 'Check_All') && (e.type == 'checkbox'))
{ TotalBoxes ++;
if(e.checked)
{ TotalOn ++;
}
}
}
if(TotalBoxes == TotalOn)
{ fmobj.Check_All.checked = true;
}
else
{ fmobj.Check_All.checked = false;
}
}

function Check_Read()
{
var fmobj = document.frmOperation;

for(var i = 0; i < fmobj.elements.length; i ++)
{ var e = fmobj.elements[i];

if((e.type == 'hidden') && (e.value == 1) && (! isNaN(e.name)))
{ eval("fmobj.Check_ID_" + e.name + ".checked = true;");
HighLight(e);
}
}
}

function UnCheck_All()
{
var fmobj = document.frmOperation;

for(var i = 0; i < fmobj.elements.length; i ++)
{ var e = fmobj.elements[i];

if(e.type == 'checkbox')
{ e.checked = false;
LowLight(e);
}
}
}

// ---------- 函数 - 处理Submit() ----------
function CheckSubmit(argAction)
{
var frmObject = document.frmOperation;
var 易做图Checked = false;
var 易做图Submit = false;

for(var i = 0; i < frmObject.elements.length; i ++)
{ var e = frmObject.elements[i];
if((e.name != 'CheckAll') && (e.type == 'checkbox') && e.checked)
{ 易做图Checked = true;
break;
}
}

if(! 易做图Checked)
{ alert("Please select any record first!");
return;
}
else
{ if(confirm(argAction + " the selected record(s)?"))
{ frmObject.HiddenAction.value = argAction;
frmObject.submit();
}
else
return;
}
}

// ---------- 函数 - 处理<TR> 双击响应 ----------
function CheckDblClick(argObject)
{
var olastChild = argObject.lastChild;

if(!olastChild.children.item(0).checked)
{ olastChild.children.item(0).checked = true;
HighLight(argObject);
}
else
{ olastChild.children.item(0).checked = false;
LowLight(argObject);
}

CheckCheckAll();
return;
}
//-->
</SCRIPT>

</head>
<body>

<%
' ---------- 函数 - 处理客户端信息( Request.ServerVariables("SCRIPT_NAME") )分解 ----------
Function UserSysInfo(info, getInfo)
If InStr(info, ";") > 0 Then
Dim UserSys
UserSys = Split(info, ";", -1, vbTextCompare)
If Ubound(UserSys) >= 2 Then
UserSys(1) = Replace(UserSys(1), "MSIE", "Internet Explorer")
UserSys(2) = Replace(UserSys(2), ")", "")
UserSys(2) = Replace(UserSys(2), "NT 5.1", "XP")
UserSys(2) = Replace(UserSys(2), "NT 5.0", "2000")
UserSys(2) = Replace(UserSys(2), "9x", "Me")
UserSys(1) = Trim(UserSys(1))
UserSys(2) = Trim(UserSys(2))
If getInfo = 1 Then
UserSysInfo = UserSys(1)
Else
UserSysInfo = UserSys(2)
End If
Else
If getInfo = 1 Then
UserSysInfo = "Unknown"
Else
UserSysInfo = "Unknown"
End If
End If
Else
If getInfo = 1 Then
UserSysInfo = "Unknown"
Else
UserSysInfo = "Unknown"
End If
End If
End Function
%>

<%
Dim rstStatistics, strSQLStatistics

Dim argPageSize, argPageNumber, argAgent, argPageType, argPageDaily
Dim argRecordCount, argID, argPageCount, argPageSizeLoop, I, sPlace

' ---------- 模块 - 处理页面大小参数 ----------
argPageSize = Trim(Request.Form("HiddenPageSize"))
If argPageSize = "" Then
argPageSize = 50
Else
argPageSize = CInt(argPageSize)
End If

' ---------- 模块 - 处理页面号码参数 ----------
argPageNumber = Trim(Request.Form("HiddenPageNumber"))
If argPageNumber = "" Then
argPageNumber = 1
Else
argPageNumber = CInt(argPageNumber)
End If

' ---------- 模块 - 处理Agent 字段参数 ----------
argAgent = Trim(Request.Form("HiddenAgent"))
Select Case argAgent
Case "OS" argAgent = argAgent
Case "BT" argAgent = argAgent
Case Else argAgent = "OS"
End Select

' ---------- 模块 - 处理相关页面参数 ----------
argPageType = Trim(Request.Form("HiddenPageType"))
Select Case argPageType
Case "sttPage" argPageType = "sttPage"
Case "refPage" argPageType = "refPage"
Case Else argPageType = "sttPage"
End Select

' ---------- 模块 - 处理日期参数,显示该日期访问记录 ----------
argPageDaily = Trim(Request.Form("HiddenPageDaily"))
If argPageDaily = "" Then
argPageDaily = "All"
End If

If argPageDaily = "All" Then
strSQLStatistics = _
"Select * From IPs " _
& "Left Join IPDatas " _
& "On IPs.IP_ID = IPDatas.IP_ID " _
& "Order By ID Desc"
Else
strSQLStatistics = _
"Select * From IPs " _
& "Left Join IPDatas " _
& "On IPs.IP_ID = IPDatas.IP_ID " _
& "where VisitDate = #" & argPageDaily & "# " _
& "Order By ID Desc"
End If

Set rstStatistics = Server.CreateObject("ADODB.Recordset")
With rstStatistics
.ActiveConnection = cnnStatistics
.CursorType = adOpenForwardOnly

上一个:开放源码 - 访客统计查询(三)
下一个:开放源码 - 访客统计查询(一)

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,