?? admin_online.asp
字號:
<!--#include file="setup.asp"-->
<!--#include file="check.asp"-->
<%
Admin_header
'=====================================================================
' 軟件名稱:新云網(wǎng)站管理系統(tǒng)
' 當(dāng)前版本:NewCloud Site Management System Version 2.1
' 文件名稱:admin_online.asp
' 更新日期:2004-12-20
' 官方網(wǎng)站:新云網(wǎng)絡(luò)(www.newasp.net www.newasp.cn) QQ:94022511
'=====================================================================
' Copyright 2002-2005 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th>在線人數(shù)信息管理</th>
</tr>
<tr>
<td class=tablerow1>菜單導(dǎo)航:<a href='admin_online.asp'>管理首頁</a> |
<a href='admin_online.asp?action=zone'>詳細(xì)地址</a> |
<a href='admin_online.asp?action=refer'>訪問來源</a> |
<a href='admin_online.asp?action=online'>流量統(tǒng)計(jì)</a> |
<a href='admin_online.asp?action=delall' onclick="{if(confirm('您確定要?jiǎng)h除所有在線人數(shù)嗎?')){return true;}return false;}"><font color=blue>刪除所有在線人數(shù)</font></a></td>
</tr>
<tr>
<td class=tablerow2>當(dāng)前位置:在線人數(shù)統(tǒng)計(jì)信息</td>
</tr>
</table>
<br>
<%
Dim Action,i,strClass,sFileName
Dim maxperpage,CurrentPage,totalnumber,TotalPageNum
maxperpage = 30 '###每頁顯示數(shù)
If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
Response.Write ("錯(cuò)誤的系統(tǒng)參數(shù)!請輸入整數(shù)")
Response.End
End If
If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
CurrentPage = CInt(Request("page"))
Else
CurrentPage = 1
End If
If CInt(CurrentPage) = 0 Then CurrentPage = 1
TotalNumber = Newasp.Execute("Select Count(ID) from NC_Online")(0)
TotalPageNum = CInt(TotalNumber / maxperpage) '得到總頁數(shù)
If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
Action = LCase(Request("action"))
If Not ChkAdmin("Online") Then
Server.Transfer("showerr.asp")
Response.End
End If
Select Case Trim(Action)
Case "refer"
Call OnlineReferer
Case "zone"
Call OnlineZone
Case "del"
Call DelOnline
Case "delall"
Call DelAllOnline
Case "online"
Call OnlineCount
Case "remove"
Call DelCount
Case "removeall"
Call DelAllCount
Case Else
Call showmain
End Select
If FoundErr = True Then
ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Private Sub showmain()
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th width='5%' nowrap>選擇</th>
<th nowrap>用 戶 名</th>
<th nowrap>訪 問 時(shí) 間</th>
<th nowrap>活 動(dòng) 時(shí) 間</th>
<th nowrap>用 戶 IP 地 址</th>
<th nowrap>操 作 系 統(tǒng)</th>
<th nowrap>瀏 覽 器</th>
</tr>
<%
sFileName = "admin_online.asp?"
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from [NC_Online] order by startTime desc"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1, 1
Else
Set Rs = Conn.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.bof And Rs.EOF Then
Response.Write "<tr><td align=center colspan=7 class=TableRow2>當(dāng)前無人在線!</td></tr>"
Else
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
%>
<tr>
<td class=tablerow2 colspan=7><%Call showpage()%></td>
</tr>
<form name=selform method=post action=?action=del>
<%
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
End If
%>
<tr align=center>
<td <%=strClass%>><input type=checkbox name=OnlineID value='<%=Rs("id")%>'></td>
<td <%=strClass%>><%=Rs("username")%></td>
<td <%=strClass%>><%=Rs("startTime")%></td>
<td <%=strClass%>><%=Rs("lastTime")%></td>
<td <%=strClass%>><%=Rs("ip")%></td>
<td <%=strClass%>><%=usersysinfo(Rs("browser"), 0)%></td>
<td <%=strClass%>><%=usersysinfo(Rs("browser"), 1)%></td>
</tr>
<%
Rs.movenext
i = i + 1
If i >= maxperpage Then Exit Do
Loop
End If
Rs.Close:Set Rs = Nothing
%>
<tr>
<td class=tablerow1 colspan=7>
<input class=Button type="button" name="chkall" value="全選" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反選" onClick="ContraSel(this.form)">
<input class=Button type="submit" name="Submit2" value="刪除" onclick="{if(confirm('您確定要?jiǎng)h除此在線人員嗎?')){this.document.selform.submit();return true;}return false;}">
<input class=Button type="button" name="Submit3" value="清空所有在線人數(shù)" onclick="{if(confirm('您確定要清空所有在線人數(shù)嗎?')){location.href='admin_online.asp?action=delall';return true;}return false;}"></td>
</tr>
</form>
<tr>
<td class=tablerow2 colspan=7><%Call showpage()%></td>
</tr>
</table>
<%
End Sub
Private Sub OnlineReferer()
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th width='5%' nowrap>選擇</th>
<th width='15%' nowrap>來訪時(shí)間/IP</th>
<th>訪 問 來 源</th>
<th>當(dāng) 前 位 置</th>
<th width='5%' nowrap>Alexa</th>
</tr>
<%
sFileName = "admin_online.asp?action=refer&"
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from [NC_Online] order by startTime desc"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1
Else
Set Rs = Conn.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.bof And Rs.EOF Then
Response.Write "<tr><td align=center colspan=4 class=TableRow2>當(dāng)前無人在線!</td></tr>"
Else
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
%>
<tr>
<td class=tablerow2 colspan=5><%Call showpage()%></td>
</tr>
<form name=selform method=post action=?action=del>
<%
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
End If
%>
<tr>
<td align=center <%=strClass%>><input type=checkbox name=OnlineID value='<%=Rs("id")%>'></td>
<td align=center <%=strClass%> nowrap><%=Rs("startTime")%><br><%=Rs("ip")%></td>
<td <%=strClass%>><a href='<%=Rs("strReferer")%>' target=_blank><%=URLDecode(Rs("strReferer"))%></a></td>
<td <%=strClass%>><a href='<%=Rs("station")%>' target=_blank><%=Rs("station")%></a></td>
<td align=center <%=strClass%>><a href="http://www.alexa.com/data/details/traffic_details?q=&url=<%=Replace(LCase(Newasp.SiteUrl), "http://", "")%>" target="_blank"><%=usersysinfo(Rs("browser"), 2)%></a></td>
</tr>
<%
Rs.movenext
i = i + 1
If i >= maxperpage Then Exit Do
Loop
End If
Rs.Close:Set Rs = Nothing
%>
<tr>
<td class=tablerow1 colspan=5>
<input class=Button type="button" name="chkall" value="全選" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反選" onClick="ContraSel(this.form)">
<input class=Button type="submit" name="Submit2" value="刪除" onclick="{if(confirm('您確定要?jiǎng)h除此在線人員嗎?')){this.document.selform.submit();return true;}return false;}">
<input class=Button type="button" name="Submit3" value="清空所有在線人數(shù)" onclick="{if(confirm('您確定要清空所有在線人數(shù)嗎?')){location.href='admin_online.asp?action=delall';return true;}return false;}"></td>
</tr>
</form>
<tr>
<td class=tablerow2 colspan=5><%Call showpage()%></td>
</tr>
</table>
<%
End Sub
Private Sub OnlineZone()
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th width='5%' nowrap>選擇</th>
<th nowrap>用 戶 名</th>
<th nowrap>用 戶 組</th>
<th nowrap>IP 地 址</th>
<th nowrap>詳 細(xì) 地 址</th>
<th nowrap>操 作 系 統(tǒng)</th>
<th nowrap>瀏 覽 器</th>
</tr>
<%
sFileName = "admin_online.asp?action=zone&"
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from [NC_Online] order by startTime desc"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1
Else
Set Rs = Conn.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.bof And Rs.EOF Then
Response.Write "<tr><td align=center colspan=7 class=TableRow2>當(dāng)前無人在線!</td></tr>"
Else
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
%>
<tr>
<td class=tablerow2 colspan=7><%Call showpage()%></td>
</tr>
<form name=selform method=post action=?action=del>
<%
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
End If
%>
<tr align=center>
<td <%=strClass%>><input type=checkbox name=OnlineID value='<%=Rs("id")%>'></td>
<td <%=strClass%>><%=Rs("username")%></td>
<td <%=strClass%>><%=Rs("identitys")%></td>
<td <%=strClass%>><%=Rs("ip")%></td>
<td <%=strClass%>><%=GetAddress(Rs("ip"))%></td>
<td <%=strClass%>><%=usersysinfo(Rs("browser"), 0)%></td>
<td <%=strClass%>><%=usersysinfo(Rs("browser"), 1)%></td>
</tr>
<%
Rs.movenext
i = i + 1
If i >= maxperpage Then Exit Do
Loop
End If
Rs.Close:Set Rs = Nothing
%>
<tr>
<td class=tablerow1 colspan=7>
<input class=Button type="button" name="chkall" value="全選" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反選" onClick="ContraSel(this.form)">
<input class=Button type="submit" name="Submit2" value="刪除" onclick="{if(confirm('您確定要?jiǎng)h除此在線人員嗎?')){this.document.selform.submit();return true;}return false;}">
<input class=Button type="button" name="Submit3" value="清空所有在線人數(shù)" onclick="{if(confirm('您確定要清空所有在線人數(shù)嗎?')){location.href='admin_online.asp?action=delall';return true;}return false;}"></td>
</tr>
</form>
<tr>
<td class=tablerow2 colspan=7><%Call showpage()%></td>
</tr>
</table>
<%
End Sub
Private Sub OnlineCount()
'Newasp.Execute ("UPDATE [NC_SiteCount] SET AlexaToolbar=0")
%>
<table border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<tr>
<th width='5%' nowrap>選擇</th>
<th nowrap>統(tǒng) 計(jì) 日 期</th>
<th nowrap>唯 一 IP</th>
<th nowrap>訪 問 數(shù)</th>
<th nowrap>Google搜索</th>
<th nowrap>百度搜索</th>
<th nowrap>雅虎搜索</th>
<th nowrap>3721搜索</th>
<th nowrap>中國搜索</th>
<th nowrap>搜狗搜索</th>
<th nowrap>其它站點(diǎn)</th>
<th nowrap>直接訪問</th>
<th nowrap>Alexa</th>
</tr>
<%
TotalNumber = Newasp.Execute("SELECT COUNT(id) FROM NC_SiteCount")(0)
TotalPageNum = CInt(TotalNumber / maxperpage) '得到總頁數(shù)
If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
sFileName = "admin_online.asp?action=online&"
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM [NC_SiteCount] ORDER BY CountDate DESC,id DESC"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1
Else
Set Rs = Conn.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.bof And Rs.EOF Then
Response.Write "<tr><td align=center colspan=13 class=TableRow2>沒有流量統(tǒng)計(jì)!</td></tr>"
Else
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
%>
<tr>
<td class=tablerow2 colspan=13><%Call showpage()%></td>
</tr>
<form name=selform method=post action=?action=remove>
<%
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -