⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doc_l.asp

📁 物业管理和办公自动化系统
💻 ASP
字号:
<%
'************************************************************************************************
' 文件名: file_l.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司

'  创建人 : 周秋舫
'  日 期 : 2002-08-16
' 修改历史 :
'   ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 显示文件列表
'  版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>

<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/emp.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->

<!-- #include file="../common/commonpage.inc" -->
<!-- #include file="file.inc" -->
<!-- #include file="doc_l.inc" -->

<%
call CheckSecurity()

'' 只有公文管理员或办公室主任或具有公文查询权限的人员才能访问本页
if (not IsDocAdmin) and (not IsOfficer) and (not HasRightToDocInfor) then
	Response.Clear
	Response.Redirect("../common/error.asp?error=对不起,您没有权限访问本页!&")
	Response.end
end if

'********************************************************************************************************
'' 获取或定义各种参数值
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim pDay1			: pDay1 = GetParam("day1")
dim pDay2			: pDay2 = GetParam("day2")
dim pDocTypeId		: pDocTypeId = GetParam("doc_type_id")
dim pDocSubject	: pDocSubject = GetParam("doc_subject")
dim pDocKeyword	: pDocKeyword = GetParam("doc_keyword")
dim pReportSendPerson	: pReportSendPerson = GetParam("report_send_person")

if IsEmpty(pDay1) then pDay1 = dateSerial(year(date), month(date), 1)
if IsEmpty(pDay2) then pDay2 = date
if IsEmpty(pDocTypeId) then pDocTypeId = 0

'********************************************************************************************************
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName			: sFileName = "doc_l.asp"
Dim iTotalRecords		: iTotalRecords = 0			' 分页
Dim iRecordsPerPage	: iRecordsPerPage = 15
Dim iTotalPages			: iTotalPages = 0
Dim iCols					: iCols = 4
Dim iCurrentPage		: iCurrentPage = GetParam("Page")
Dim iSort					: iSort = GetParam("Sorting")
Dim iSorted				: iSorted = GetParam("Sorted")
Dim sSortParams		: sSortParams = ""
Dim sFormParams		: sFormParams = ""
Dim sDirection			: sDirection = ""

sFormParams = "doc_type_id=" & pDocTypeId & "&doc_subject=" & pDocSubject & "&doc_keyword=" & pDocKeyword & "&report_send_person=" & pReportSendPerson & "&"


'********************************************************************************************************
' 构造分页的SQL语句
'-------------------------------------------------------------------------------------------------------------------------------------------------
sSQL = "select t1.doc_id, t1.doc_type_id, t2.type_desc, t3.urgent_desc, t4.secret_desc" & _
		", t1.doc_subject, t1.doc_number, t1.doc_keyword, t1.doc_report_person, t1.doc_send_person, t1.doc_sender, t1.doc_sent_date" & _
		", t1.doc_reg_person, t1.doc_reg_date" & _
		", t1.content, t1.contenttype, t1.filetype, t1.filesize" & _
		" from T_document t1" & _
		" left join t_doc_type t2 on t2.type_id = t1.doc_type_id" & _
		" left join t_doc_urgent t3 on t3.urgent_level = t1.doc_urge_level" & _
		" left join t_doc_secret t4 on t4.secret_level = t1.doc_secret_level"

sOrderby = " order by doc_sent_date desc"

'********************************************************************************************************
'' 设置查询限制条件
'-------------------------------------------------------------------------------------------------------------------------------------------------
'' 查询时间段
sWhere = " where doc_reg_date >= " & ToSQL(pDay1, "Text") & " and doc_reg_date < " & ToSQL(DateAdd("d", 1, pDay2), "Text")

'' 收文或发文
'if not IsEmpty(pDocTypeId) then sWhere = sWhere & " and doc_type_id = " & ToSQL(pDocTypeId, "Number")
if (( not IsEmpty(pDocTypeId)) and ( pDocTypeId <> 0 )) then sWhere = sWhere & " and doc_type_id = " & ToSQL(pDocTypeId, "Number")

'' 公文主题
if pDocSubject <>"" then sWhere = sWhere & " and doc_subject like " & ToSQL("%" & pDocSubject & "%", "Text")

'' 公文关键字
if pDocKeyword <> "" then sWhere = sWhere & " and doc_keyword like " & ToSQL("%" & pDocKeyword & "%", "Text")

'' 抄报抄送人员
if pReportSendPerson <> "" then
	sWhere = sWhere & " and (doc_report_person like " & ToSQL("%" & pReportSendPerson & "%", "Text") & _
										" or doc_send_person like " & ToSQL("%" & pReportSendPerson & "%", "Text") & _
									")"
end if

'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的变量准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(3), sDelimiter
sDelimiter = "*"
arrayFields(0) = "doc_sent_date"
arrayFields(1) = "doc_subject"
arrayFields(2) = "doc_number"
arrayFields(3) = "type_desc"
call PrepareListData(sSQL & sWhere & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
''response.write sSQL & sWhere & sOrderby & "<br>"
'********************************************************************************************************
%>

<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../common/common.css" type="text/css">

<!-- 日历 -->
<IFRAME style="display:none;position:absolute;width:148;height:194;z-index=100" ID="CalFrame" MarginHeight=0 MarginWidth=0 noresize frameborder=0 scrolling=no src="../common/cal/calendar.htm"></IFRAME>
<script language="javascript" src="../common/cal/calendar.js"></script>
<script for=document event="onclick()">
<!--
document.all.CalFrame.style.display="none";
//-->
</script>
<!-- 日历 -->


</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>

<%
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader

'********************************************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------------------------
Response.Write TableSearch

Response.Write TableHeader
Response.Write TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.write TableTailer
if IsDocAdmin or IsOfficer then
	Response.Write TableLink
end if
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************

Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -