📄 infomgr1.inc
字号:
'***************************************************************************************************
'***************************************************************************************************
' Name : TableHeader
' Function : Table head for Record Table
' In : No
' Out : No
' Return : Table head of table record
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableHeader()
sFileName = "infomgr1.asp"
TableHeader = _
TableTitle("系统现有的公文列表", 300, "", "#0040a0") & _
"<table cellspacing=0 cellpadding=0 width=300 align=center class=tablelist>" & _
"<tr>" & _
"<td class=tdHead align=center width=130> " & TableHeaderField(sFileName, "doc_subject", "公文主题", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead align=center width=50> " & TableHeaderField(sFileName, "type_desc", "类别", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead align=center width=120> " & TableHeaderField(sFileName, "doc_sent_date", "发送日期", sFormParams, iSort, iSorted) & "</td>" & _
"</tr>"
End Function
'***************************************************************************************************
'***************************************************************************************************
' Name : TableRecords
' Function : Table List the Records
' In : 9 parameters
' sSQL --- sql statement
' iCols --- columns
' iRecordsPerPage --- records per page
' iTotalRecords --- total records
' iCurrentPage --- current page
' iTotalPages --- total pages
' sFileName --- file name
' sFormParams --- form parameters
' sSortParam --- sort parameters
' Out : No
' Return : Table head of table record
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
'-------------------------------------------------------------
' declares
'-------------------------------------------------------------
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 sDocSubject, sDocId, sDocSender, sDocSentDate,sDocType
'--------------------------------------------------
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
'--------------------------------------------------
if Not rs.EOF then
rs.Move (iCurrentPage - 1) * iRecordsPerPage
end if
'--------------------------------------------------
' write the record list table
'--------------------------------------------------
while not rs.EOF and iCounter <= iRecordsPerPage
sDocSubject = crs.GetValue("doc_subject")
sDocId = crs.GetValue("doc_id")
sDocType = crs.GetValue("type_desc")
sDocSentDate = crs.GetValue("doc_sent_date")
sTemp = sTemp & "<tr valign=center>" & _
"<td class=tdlist width=130 title='" & sDocSubject & "' style=""cursor:hand"" onclick=""javascript:location.href='../docmgr/infomgr1.asp?id=" & sDocId & "';""><img src=""../images/bg/ar-g.gif"" width=8 height=8> " & ToHtml(Bref(sDocSubject,25)) & " </td>" & _
"<td class=tdlist align=center width=50 title='" & sDocType & "' >" & sDocType & " </td>" & _
"<td class=tdlist align=center width=120 title='" & sDocSentDate & "' >" & sDocSentDate & " </td>" & _
"</tr>"
iCounter = iCounter + 1
rs.movenext
wend
crs.Close()
'--------------------------------------------------
' 填补空白行
'--------------------------------------------------
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
'--------------------------------------------------
' 首页、前页、后页、尾页等分页信息
'--------------------------------------------------
sTemp = sTemp & "<tr><td class=tdlist colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr>"
'--------------------------------------------------
' Returns
'--------------------------------------------------
TableRecords = sTemp
End Function
'***************************************************************************************************
'***************************************************************************************************
' Name : TableLink
' Function : Table Show the Search records detail
' In : No
' Out : No
' Return : Table of record detail
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableLink()
'-----------------------------------------------------
' declares and get parameter
'-----------------------------------------------------
Dim id : id = GetParam("id")
Dim path
Dim links
'-----------------------------------------------------
' Connect to Database
'-----------------------------------------------------
dim crs : set crs = New CRecordset
dim sSQL : sSQL = "select doc_path from T_Document where doc_id=" & ToSQL(id, "Number")
dim rs : set rs = crs.open(dbLocal,sSQL)
path = crs.GetValue("doc_path")
crs.Close()
'--------------------------------------------------
' Construct the link string
'--------------------------------------------------
If IsEmpty(id) Then
'------------------------------------------
' hide the Browse and Upload links
'------------------------------------------
links = ""
Else
'------------------------------------------
' show the Browse and Upload links
'------------------------------------------
links = _
" <img src=""../images/goto.gif"" > <a href='infomgr1_a.asp?did=" & id & "'>公文附件管理</a>"
If path <> "" Then
links = links & " " & _
" <img src=""../images/goto.gif"" > <a href='" & path & "' target=_blank>公文文件阅读</a>"
End If
End If
'--------------------------------------------------
' Return the table of links
'--------------------------------------------------
TableLink = _
"<table width=400 cellspacing=0 cellpadding=0 border=0 align=center>" & _
"<tr height=10>" & _
" <td width=400><img src=""../images/bg/line.gif"" width=400 height=3></td>" & _
"</tr>" & _
"<tr height=20 align=center>" & _
" <td width=400 align=left> " & _
links & _
" </td>" & _
"</tr>" & _
"</table>"
End Function
'***************************************************************************************************
'***************************************************************************************************
' Name : TableSearch
' Function : Form Table of Search
' In : No
' Out : No
' Return : Table of Search entries
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function TableSearch()
'-------------------------------------------------
' Declares
'-------------------------------------------------
Dim settime,starttime,endtime
'--------------------------------------------------
' Initialize
'--------------------------------------------------
settime=Date
starttime=Date
endtime=Date
'--------------------------------------------------
' Construct the search form table and return
'--------------------------------------------------
TableSearch = _
TableTitle("制度查询", 600, "", "") & _
"<table cellspacing=0 cellpadding=0 width=600 align=center border=0>" & _
"<form name=""frmSearch"" method=post action=""infomgr1.asp"">" & _
"<tr height=30>" & _
" <td width=250>制度名称:<input type=text name='rulename' value=''>" & "</td>" & _
" <td width=200>" & DrawCal("有效起始日期", starttime, "time1", "dateimg11") & " </td>" & _
" <td width=150> </td>" & _
"</tr>" & _
"<tr height=30>" & _
" <td width=200>制定部门:<input type=text name='ruledept' value=''>" & "</td>" & _
" <td width=200>" & DrawCal("有效结束日期", endtime, "time2", "dateimg12") & "</td>" & _
" <td width=150> </td>" & _
"</tr> " & _
"<tr height=20>" & _
" <td width=250>制度类别:<select name=""ruletype"" style=""width:86px"">" & _
" <option value=""*"" selected>全部</option>" & _
SelectOptions(dbLocal,"t_rule_types","type","type","","") & _
" </select>" & _
" </td>" & _
" <td width=200> " & _
" </td>" & _
" <td width=150><span id=btnSearch style=""cursor:hand"" title=""设置查询条件,然后点击查询按钮进行查询""><img border=0 src=""../images/search.gif"" style=""vertical-align:middle"">查询</span></td></tr>" & _
"<tr height=10><td colspan=3 width=600> </td></tr>" & _
"</form>" & _
"</table>"
End Function
'***************************************************************************************************
'***************************************************************************************************
' Name : InfoSearch
' Function : Deal with the search form post
' In : No
' Out : No
' Return : where clause of sql statement
' Comment : No
'
'---------------------------------------------------------------------------------------------------
Function InfoSearch()
'-------------------------------------------------
' Declares
'-------------------------------------------------
Dim settime,starttime,endtime,ruledept
Dim rulename
Dim ruletype
Dim sWh
'--------------------------------------------------
' Get Parameters
'--------------------------------------------------
' settime = GetParam("time3")
starttime = GetParam("time1")
endtime = GetParam("time2")
ruledept = GetParam("ruledept")
rulename = GetParam("rulename")
ruletype = GetParam("ruletype")
'--------------------------------------------------
' Set Default Values
'--------------------------------------------------
' If IsEmpty(settime) Then
' settime = Date
' End If
If IsEmpty(starttime) Then
starttime = Date
End If
If IsEmpty(endtime) Then
endtime = Date
End If
' If IsEmpty(name) Then
' name = "*"
' End If
'--------------------------------------------------
' Construct the sWhere statement
'--------------------------------------------------
sWh = " WHERE starttime >= " & ToSQL(starttime,"Text") & " and endtime <= " & ToSQL(endtime,"Text")
'--------------------------------------------------
' Search rulename
'--------------------------------------------------
If Not IsEmpty(rulename) Then
sWh = sWh & " and name LIKE '%"& rulename &"%'"
End If
'--------------------------------------------------
' Search ruledept
'--------------------------------------------------
If Not IsEmpty(ruledept) Then
sWh = sWh & " and dept LIKE '%" & ruledept & "%'"
End If
'--------------------------------------------------
' Search ruletype
'--------------------------------------------------
If ruletype <> "*" Then
sWh = sWh & " and ruletype = '"& ruletype &"'"
End If
'--------------------------------------------------
' Returns
'--------------------------------------------------
InfoSearch = sWh
End Function
'**************************************************************************************************
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -