onlinemain.asp
来自「OFFICE办公自动化」· ASP 代码 · 共 105 行
ASP
105 行
<%
'作者:卓耀科技
'功能:用户在线状态
'参数:
'开发时间:2003-12-9 17:33
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/const.asp"-->
<%
'变量申明区
%>
<%
'主程序区
'清理过期登陆
oConn.Execute "UPDATE tbioaUser SET OnlineMod=0 where DATEDIFF(hh, LastLog, GETDATE())>24"
'读入部门
set Rsdepart=server.createobject("adodb.recordset")
Sqldepart="select * from tbioadepartment"
Rsdepart.open Sqldepart,oconn,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; chaRscaret=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
</head>
<body topmargin="10" leftmargin="10">
<table width="100%" border="0" align="center" cellspacing="1" cellpadding="2" class="tab">
<tr >
<td colspan="6" class="tdTop2"><img border="0" src="../images/icon_title.gif" align="left"> 用户在线状态</td>
</tr>
<%
set Rsuser=server.CreateObject("adodb.recordset")
do while not Rsdepart.eof
%>
<tr>
<td colspan="6" align="left" class="td2">
<img src="../images/menu_open.gif" align="left" border="0" id="p_<%=Rsdepart("id")%>" onClick="if (t_<%=Rsdepart("id")%>.style.display=='none'){t_<%=Rsdepart("id")%>.style.display='';p_<%=Rsdepart("id")%>.src='../images/menu_open.gif';} else {t_<%=Rsdepart("id")%>.style.display='none';p_<%=Rsdepart("id")%>.src='../images/menu_close.gif';} ">
<%=Rsdepart("name")%> </td>
</tr>
<%
Rsuser.open "SELECT tbioaUser.*, tbioaOutline.lxyy, tbioaOutline.sjlxsj FROM tbioaOutline RIGHT OUTER JOIN tbioaUser ON tbioaOutline.UserID = tbioaUser.ID where department='" &Rsdepart("id")& "'",oconn,1,3
if not Rsuser.eof then
%>
<tr id="t_<%=Rsdepart("id")%>">
<td class=td1>
<table width="100%" border="0" align="center" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td align=center width=150 class=tdbottom nowrap>员工姓名</td>
<td align=center width=90 class=tdbottom nowrap>在线状态</td>
<td align=center class=tdbottom>离线原因</td>
<td align=center width=120 class=tdbottom nowrap>最后离线时间</td>
</tr>
<%
do while not Rsuser.eof
%>
<tr>
<td class=td1 nowrap>
<a href="../hrm/userdetail.asp?strid=<%=Rsuser("id")%>"><%=htmlout(Rsuser("name"))%></a>
</td>
<td class=td1 nowrap>
<%if Rsuser("OnlineMod") then%>
<font color=green>在线</font>
<%else%>
<%if Rsuser("lxyy")&""="" then%>
<font color=red>离线</font>
<%else%>
<a href="../OutLine/OutLine_Show.asp?strid=<%=Rsuser("id")%>" target="blank"><font color=blue>离线(详细)</font></a>
<%end if%>
<%end if%>
<%if Rsuser("AgentOnlineMod") then%>
<img src="../images/icon_agent1.gif" align="absmiddle">
<%end if%>
</td>
<td class=td1>
<%if not Rsuser("OnlineMod") then%><%=htmlout(Rsuser("lxyy"))%><%end if%>
</td>
<td class=td1 nowrap><%=htmlout(Rsuser("sjlxsj"))%></td>
</tr>
<%
Rsuser.movenext
loop
%>
</table>
</td>
</tr>
<%
else
response.write "<tr id='t_"&Rsdepart("id")&"'><td class='td1'> 本部门暂无用户</td></tr>"
end if
Rsuser.close
Rsdepart.movenext
loop
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?