?? showonline.asp
字號:
<!--#include file="Config.asp" -->
<!--#include file="../Include/check.asp"-->
<%CheckAdmin1%>
<%
const MaxPerPage=45
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim sql
dim rs
if not isempty(request("page")) then
currentPage=request("page")
else
currentPage=1
end if
set Rs=server.createobject("adodb.recordset")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>.:: 在線統(tǒng)計 ::.</title>
<link href="../other/admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<table width="98%" border=0 align="center" cellpadding=1 cellspacing=1 bgcolor="#ff9933">
<tr bgcolor="#ff9933" height=25>
<td width="9%" height="20" align="center"><span class="STYLE1">用戶</span></td>
<td width="15%" align="center"><span class="STYLE1">訪問時間</span></td>
<td width="15%" align="center" nowrap><span class="STYLE1">活動時間</span></td>
<td width="13%" align="center" nowrap><span class="STYLE1">用戶IP</span></td>
<td width="14%" align="center" nowrap><span class="STYLE1">操作系統(tǒng)</span></td>
<td width="15%" align="center" nowrap><span class="STYLE1">位置</span></td>
<td width="19%" align="center" nowrap><span class="STYLE1">瀏覽器</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="7">
<%
sql="select * from "&CategoryName&"_Online order by lastimebk Desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<table><tr><td border=""0"" width=""100%"" height=""100%"" cellspacing=""1"" cellpadding=""0"" bgcolor=""#FFFFFF""><p align=""center"">沒有或沒有找到任何在線用戶,</p></td></tr></table>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"ShowOnline.asp"
showContent
showpage totalput,MaxPerPage,"ShowOnline.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"ShowOnline.asp"
showContent
showpage totalput,MaxPerPage,"ShowOnline.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"ShowOnline.asp"
showContent
showpage totalput,MaxPerPage,"ShowOnline.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
%>
</td>
</tr>
<% do while not rs.eof %>
<tr bgcolor="#FFFFFF">
<td height="21" align="center"><%= rs("UserName") %></td>
<td height="21" align="center"><%= rs("startime") %></td>
<td height="21" align="center"><%= rs("lastimebk") %></td>
<td height="21" align="center"><%= rs("ip") %></td>
<td height="21" align="center"><%= system(rs("browser")) %></td>
<td align="center"><a href="<%=rs("Now_url")%>" target="_blank"><%=left(rs("Now_url"),18)%>...</a></td>
<td height="21" align="center"><%= browser(rs("browser")) %></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr bgcolor="#FFFFFF">
<td colspan="7" height="20">
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"""><tr><td align=right> "
if CurrentPage<2 then
response.write "當(dāng)前共有<strong><font color=red>"&totalnumber&"</font></strong>位用戶在線 首頁 上一頁 "
else
response.write ""&totalnumber&"位 <a href="&filename&"?page=1&"">首頁</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁</a> "
end if
if n-currentpage<1 then
response.write "下一頁 尾頁"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
response.write "下一頁</a> <a href="&filename&"?page="&n&">尾頁</a>"
end if
response.write " 頁次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>頁 "
response.write " <b>"&maxperpage&"</b>位用戶/頁 "
%>
轉(zhuǎn)到:
<select name='select' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
<%for i = 1 to n%>
<option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>頁</option>
<%next%>
</select>
<%
response.write "</td></tr></FORM></table>"
end function
%>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -