📄 tasks.inc
字号:
<%
Function TableSearch()
'' 任务完成状况,0全部,1所有已完成任务,2所有未完成任务,3所有正常的未完成任务,4所有过时的未完成任务
'' 开始日期的日历,DrawCal函数定义在../common/commonpage.inc
'' 结束日期的日历
TableSearch = _
TableTitle("设置查询条件", 600, "", "") & vbLF & _
"<table cellspacing=0 cellpadding=0 width=600 align=center border=0>" & vbLF & _
"<form name=""frmSearchTask"" method=post action=""tasks.asp"">" & vbLF & _
"<tr height=30>" & vbLF & _
" <td>" & DrawCal("开始日期", pDay1, "day1", "dateimg1") & " </td>" & vbLF & _
" <td>" & DrawCal("结束日期", pDay2, "day2", "dateimg2") & "</td>" & vbLF & _
" <td>时效状态:<select name=""task_status"" style=""width:86px"">" & vbLF & _
" <option value=0>全部</option>" & vbLF & _
" <option value=1>已完成</option>" & vbLF & _
" <option value=2>未完成</option>" & vbLF & _
" <option value=3>正常未完成</option>" & vbLF & _
" <option value=4>过时未完成</option>" & vbLF & _
" </select>" & _
" <script language=""javascript"">document.all.task_status.value=" & pTaskStatus & "</script>" & vbLF & _
" </td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td>主题或内容包含文字:<input type=""text"" name=""keyword"" value=""" & pKeyword & """ size=9 maxlength=8 style=""color:blue""></td>" & vbLF & _
" <td><span id=btnSearch style=""cursor:hand"" title=""设置查询条件,然后点击查询按钮进行查询""><img border=0 src=""../images/search.gif"" style=""vertical-align:middle"">查询</span></td>" & vbLF & _
" <td> </td>" & _
"</tr>" & vbLF & _
"<tr height=10><td colspan=3 width=600></td></tr>" & vbLF & _
"</form>" & vbLF & _
"</table>" & vbLF
End Function
Function TableHeader()
TableHeader = _
TableTitle("您布置的在" & pDay1 & "~" & pDay2 & "期间需要完成的任务", 600, "", "#0040a0") & _
"<table cellspacing=1 cellpadding=0 width=600 align=center class=tablelist style=""table-layout:fixed"" bgcolor=silver>" & _
"<tr>" & _
"<td class=tdHead width=80> " & TableHeaderField(sFileName, "urgency", "紧急程度", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead width=220>" & _
" <img src=""../images/bg/ar-y.gif"" width=8 height=8>" & _
" " & TableHeaderField(sFileName, "subject", "任务名称", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead width=110> " & TableHeaderField(sFileName, "dofrom", "开始时间", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead width=110> " & TableHeaderField(sFileName, "doend", "完成期限", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead width=""*""> " & TableHeaderField(sFileName, "executor", "相关人员", sFormParams, iSort, iSorted) & "</td>" & _
"</tr>"
End Function
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
' response.write sSQL & "<br>" : response.end
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 iPTSerial, iTaskSerial, iUrgency, sUrgency, iProgressPercent, sSubject, sDoFrom, sDoEnd, sExecutors
dim foreColor '' 根据完成进度显示不同的颜色
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.Move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
iTaskSerial = crs.GetValue("Task_Serial")
sSubject = crs.GetValue("subject")
sUrgency = crs.GetValue("urgency_desc")
sDoFrom = crs.GetValue("dofrom")
sDoEnd = crs.GetValue("doend")
sExecutors = crs.GetValue("executor")
iProgressPercent = crs.GetValue("progress_percent")
'' 过了完成时间但任务尚未完成的任务信息用红色表示,已经完成的任务用灰色表示
if iProgressPercent = 100 then '' 任务已完成用灰色表示
foreColor = "gray"
elseif iProgressPercent < 100 and sDoEnd < now then '' 过期未完成用红色表示
foreColor = "red"
else
foreColor = "black"
end if
sDoFrom = FormatDT(sDoFrom, "yyyy-mm-dd hh:mm")
sDoEnd = FormatDT(sDoEnd, "yyyy-mm-dd hh:mm")
sExecutors = TransEmpSerial(dbLocal, sExecutors)
sTemp = sTemp & "<tr style=""color:" & foreColor & """ bgcolor=white height=20>" & _
"<td nowrap>" & _
" <img src=""../images/bg/news.gif"" width=9 height=9>" & _
" " & sUrgency & " </td>" & _
"<td nowrap title='" & sSubject & "' style=""cursor:hand""" & _
" onclick=""javascript:location.href='taskdetail.asp?serial=" & iTaskSerial & "';"">" & _
" <img src=""../images/bg/ar-g.gif"" width=8 height=8>" & _
" " & ToHtml(sSubject) & " </td>" & _
"<td nowrap> " & sDoFrom & " </td>" & _
"<td nowrap> " & sDoEnd & " </td>" & _
"<td nowrap title='" & sExecutors & "' style=""cursor:hand"">" & _
" " & ToHTML(sExecutors) & "</td>" & _
"</tr>"
iCounter = iCounter + 1
rs.movenext
wend
crs.Close()
' 填补空白行
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
' 首页、前页、后页、尾页等分页信息
sTemp = sTemp & "<tr bgcolor=white height=20><td class=tdlist colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr>"
TableRecords = sTemp
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 height=20>" & _
" <td width=600> " & _
" <img src=""../images/goto.gif""> <a href=""tasks.asp"">我安排的任务</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""task_a.asp"">安排新任务</a>" & _
" " & _
" <img src=""../images/goto.gif""> <a href=""tasktodo.asp"">我的待办事宜</a></td>" & _
"</tr>" & _
"</table>"
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -