📄 online.inc
字号:
<%
Function TableHeader()
TableHeader = _
"<table cellspacing=1 cellpadding=0 width=600 align=center bgcolor=silver style=""table-layout:fixed"">" & _
"<tr style=""display:none"">" & vbLF & _
" <td width=50>这一行仅用于控制表格宽度</td>" & vbLF & _
" <td width=70>这一行仅用于控制表格宽度</td>" & vbLF & _
" <td width=""*"">这一行仅用于控制表格宽度</td>" & vbLF & _
" <td width=90>这一行仅用于控制表格宽度</td>" & vbLF & _
"</tr>" & vbLF & _
"<tr height=20>" & vbLF & _
" <td colspan=" & iCols & " bgcolor=""#0040a0"" align=center style=""color:white;font-weight:600"">员工登录状态表</td></tr>" & _
"<tr bgcolor=white>" & _
" <td class=tdHead align=center>" & TableHeaderField(sFileName, "online_status", "状态", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead align=center> " & TableHeaderField(sFileName, "name", "姓名", sFormParams, iSort, iSorted) & "</td>" & _
" <!--td class=tdHead align=center>" & TableHeaderField(sFileName, "login_status", "登录状态", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead align=center>" & TableHeaderField(sFileName, "online_status", "在线状态", sFormParams, iSort, iSorted) & "</td-->" & _
" <td class=tdHead align=center>" & TableHeaderField(sFileName, "leave_infor", "留言信息", sFormParams, iSort, iSorted) & "</td>" & _
" <td class=tdHead align=center>" & TableHeaderField(sFileName, "leave_time", "留言时间", sFormParams, iSort, iSorted) & "</td>" & _
"</tr>"
End Function
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
dim sTemp : sTemp = "" ' 临时字符串变量
dim j ' 临时循环变量
'------------------------------------
' 分页所需的变量定义
'------------------------------------
Dim iCounter : iCounter = 1
Dim iPrevPage, iNextPage
'------------------------------------
' 获取数据库连接
'------------------------------------
dim crs : set crs = New CRecordset
dim rs : set rs = crs.open(dbLocal,sSQL)
dim iEmpSerial, sName, sLoginStatus, sOnlineStatus, sLeaveInfor, sLeaveTime
dim sImg, sImgTitle
''response.write sSQL : response.end
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.Move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
iEmpSerial = crs.GetValue("emp_serial")
sName = crs.GetValue("name")
sLoginStatus = crs.GetValue("login_status")
sOnlineStatus = crs.GetValue("online_status")
sLeaveInfor = ToHTML(crs.GetValue("leave_infor"))
sLeaveTime = crs.GetValue("leave_time")
if sLeaveInfor = "(无)" then sLeaveInfor = ""
sLeaveTime = FormatDT(sLeaveTime, "yyyy-mm-dd hh:mm")
sLeaveTime = FormatDT(sLeaveTime, "m月d日 hh:mm")
''if CStr(sLoginStatus) = "0" then sImg = "images/out.gif"
if CStr(sLoginStatus) = "1" and CStr(sOnlineStatus) = "1" then
sImg = "<img border=0 src=""images/on2.gif"">"
sImgTitle = "在线状态"
elseif CStr(sLoginStatus) = "1" then
sImg = "<img border=0 src=""images/on.gif"">"
sImgTitle = "登录后暂时离开"
else
sImg = "<img border=0 src=""images/out.gif"" style=""filter:alpha(opacity=40)"">"
sImgTitle = "未登录状态"
end if
sTemp = sTemp & "<tr bgcolor=white height=20>" & _
"<td align=center title=""" & sImgTitle & """ nowrap> " & sImg & " </td>" & _
"<td title=""" & sLeaveInfor & """ style=""color:navy;"" nowrap> " & sName & " </td>" & _
"<!--td align=center title=""" & sLoginStatus & """ nowrap> " & sImg & " " & sLoginStatus & " </td>" & _
"<td align=center title=""" & sOnlineStatus & """ nowrap> " & sOnlineStatus & " </td-->" & _
"<td align=left title=""" & sLeaveInfor & """ nowrap> " & sLeaveInfor & " </td>" & _
"<td align=center title=""" & sLeaveTime & """ nowrap> " & sLeaveTime & " </td>" & _
"</tr>"
iCounter = iCounter + 1
rs.movenext
wend
crs.Close()
' 填补空白行
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
' 首页、前页、后页、尾页等分页信息
sTemp = sTemp & "<tr bgcolor=white height=20><td colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr>"
TableRecords = sTemp
End Function
Function TableTailer()
TableTailer = "</table>"
End Function
Function TableLink()
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
"<tr height=10>" & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
"</tr>" & _
"<tr>" & _
" <td width=600> " & _
" <img src=""../images/goto.gif""> <a href=""emp_oe.asp"">新员工登记</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""position.asp"">职务管理</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""title.asp"">职称管理</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""node_o.asp"">组织结构管理</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""emp_odl.asp"">离职员工查询</a></td>" & _
"</tr>" & _
"</table>"
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -