?? useronline_list.asp
字號:
<!--#include file="../Include/TimeOut.asp"-->
<!--#include file="../Include/adoconn.asp"-->
<!--#include file="../Include/online.asp"-->
<%
strsql="update xt_tc_user set 登錄時間='' where datediff(minute,登錄時間,getdate())>20"
conn.execute strsql,1
strSQLWhere=""
for i=0 to ubound(session("role"))-1
if session("role")(i)="系統(tǒng)管理員" then
strSQLWhere=""
info="現(xiàn)系統(tǒng)中"
exit for
else
if session("role")(i)="主管部門" then
strSQLWhere=" and left(用戶編碼,3)='"&left(session("usercode"),3)&"'"
info="您的部門中"
exit for
else
if session("role")(i)="項目申報單位或個人" then
strSQLWhere=" and 用戶編碼='"&session("usercode")&"'"
info="您只能看到您自己的信息"
exit for
else
strSQLWhere=""
info="現(xiàn)系統(tǒng)中"
exit for
end if
end if
end if
next
%>
<%
strsql="select 用戶編碼,用戶姓名,登錄時間 from xt_tc_user where 登錄時間<>'' "&strSQLWhere&" order by 登錄時間"
set rst=server.CreateObject ("adodb.recordset")
rst.CursorType =3
rst.CursorLocation =3
rst.LockType =2
rst.Open strsql,strconn
%>
<html>
<head>
<title>在線用戶列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
tr{
font-size:9pt;
BORDER-BOTTOM: #000000 1px solid;
BORDER-TOP: #000000 1px solid;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font color="#006699"><%=session("userName")%>您好!系統(tǒng)當前在線:<%=Application("AllUsers")%>人;游客:<%=Application("AllUsers")-rst.recordcount%>人;注冊用戶:<%=info%>共有<%=rst.recordcount%>人。</font></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="1" bordercolor="#666666" align="center">
<tr bordercolor="#0099FF" bgcolor="#EFEFEF">
<td width="35" height="20">
<div align="center">序號</div>
</td>
<td width="61" height="20">用戶編碼</td>
<td width="124" height="20" bgcolor="#EFEFEF"> 用戶名稱</td>
<td width="170" height="20">刷新時間</td>
</tr>
<%
if rst.recordcount<=0 then '如果沒有記錄
%>
<tr bgcolor="#FFFFFF">
<td colspan="4">對不起,沒有符合要求的記錄! </td>
</tr>
<%
response.end
else'有記錄
rst.pagesize=20 '每頁最多顯示20條紀錄
page=cint(request("page"))'從URL獲取當前要顯示的頁
'頁面參數(shù)異常處理
if page="" then page=1
if page<1 then page=1
if page>= rst.pagecount then page=rst.pagecount
rst.absolutepage=page '當前頁為page參數(shù)指定的頁
rowcount=rst.pagesize'當頁的記錄數(shù)
ThisCordCount=rst.PageSize*(page-1)+1
do while not rst.eof and rowcount>0
%>
<tr bgcolor="#FFFFFF" valign="top">
<td width="35" height="18">
<div align="center"><%=ThisCordCount%></div>
</td>
<td width="61" height="18"><%=rst("用戶編碼")%></td>
<td width="124" height="18"><%=rst("用戶姓名")%></td>
<td width="170" height="18" ><%=rst("登錄時間")%></td>
</tr>
<%
rst.movenext '紀錄指針下移
rowcount=rowcount-1
ThisCordCount=ThisCordCount+1
loop
end if
%>
<tr bgcolor="#EFEFEF">
<td colspan="4" height="20" align=center>
<%if page>1 then
response.write "<a href='/system/userOnline_List.asp?page=1' class=blank>首頁</a> | "
response.write "<a href='/system/userOnline_List.asp?page="&(page-1)&"' class=blank>上一頁</a> | "
else
Response.Write "首頁 | "
Response.Write "上一頁 | "
end if
if page<>rst.pagecount then
response.write "<a href='/system/userOnline_List.asp?page="&(page+1)&"' class=blank>下一頁</a> | "
response.write "<a href='/system/userOnline_List.asp?page="&rst.pagecount&"' class=blank>最后一頁</a> | "
else
Response.Write "下一頁 | "
Response.Write "末頁"
end if
response.write " 第"&page&"頁/共"&rst.pagecount &"頁/共"&rst.RecordCount&"條記錄"%>
</td>
</tr>
</table>
<%
'關閉對象,釋放內存
rst.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -