📄 equi_mtplan_list_print.asp
字号:
<%
''*******************************************************************************
' 文件名: equi_mtplan_list.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'
' 创建人 : 周秋舫
' 日 期 : 2002-11-15
'
' 修改历史 :
' ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 维保计划查询和打印,即对表t_maintain进行查询
' 版 本 :
'-------------------------------------------------------------------------------------------------------------------------------
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="equi_mtplan_list_print.inc" -->
<%
call CheckSecurity()
'' 如果不是设备管理员,则无权进入本页
if hasright(ID_EQUIPMENT) < RIGHT_READ then
Response.Clear
Response.Redirect "../include/error.asp?error=对不起,您没有系统/设备维保计划查询权限!"
Response.end
end if
''*******************************************************************************
' 服务器端代码
''*******************************************************************************
' 建立数据库连接
dim conn : Set conn = DBConnection
'-------------------------------------------------------------------------------------------------------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName : sFileName = "equi_mtplan_list.asp"
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 12
Dim iTotalPages : iTotalPages = 0
Dim iCols : iCols = 18
Dim iCurrentPage : iCurrentPage = GetParam("Page")
Dim sSorting : sSorting = GetParam("Sorting")
Dim sSorted : sSorted = GetParam("Sorted")
Dim sSortParams : sSortParams = ""
Dim sFormParams : sFormParams = ""
Dim sDirection : sDirection = ""
''*******************************************************************************
'' 构造分页的SQL语句
''*******************************************************************************
'' 设备/系统代码,设备/系统名称(设备和系统用不同的图标表示);
'' 多少时间保养一次,下次保养时间,保养内容,预计工时,完成的天数,提醒方式
'' 负责部门,备注
sSQL = "select t1.plan_id, t1.equi_sys_id, t1.object_type, t1.period, t1.nexttime, t1.content" & _
", t1.plan_hours, t1.limit_days, t1.remindmethod, t2.node_desp as department, t1.remark" & _
" from t_maintain t1" & _
" left join t_node t2 on t2.node_id = t1.department"
sOrderby = " order by nexttime"
''*******************************************************************************
'' 根据查询参数构造Where子句
'-------------------------------------------------------------------------------------------------------------------------------
'' 查询年份
dim pYear : pYear = GetParam("year")
if IsEmpty(pYear) then pYear = Year(date)
sWhere = " where ( period <> 24 or (period = 24 and (year(nexttime)%2) = " & ToSQL((pYear Mod 2), "Number") & ") )"
'' 保养周期
dim pPeriod : pPeriod = GetParam("period")
if IsEmpty(pPeriod) then pPeriod = "-1"
if CStr(pPeriod) <> "-1" then sWhere = sWhere & " and t1.period = " & ToSQL(pPeriod, "Number")
'' 负责部门
dim pDeptId : pDeptId = GetParam("dept_id")
if IsEmpty(pDeptId) then pDeptId = "-1"
if CStr(pDeptId) <> "-1" then sWhere = sWhere & " and t1.department = " & ToSQL(pDeptId, "Number")
'response.write sSQL & sWhere & sOrderby & "<br>"
'response.end
''*******************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(5), sDelimiter
sDelimiter = "*"
arrayFields(0) = "equi_sys_id"
arrayFields(1) = "period"
arrayFields(2) = "nexttime"
arrayFields(3) = "department"
arrayFields(4) = "plan_hours"
arrayFields(5) = "remark"
call PrepareListData(conn, sSQL&sWhere, Join(arrayFields, sDelimiter), sDelimiter)
''*******************************************************************************
%>
<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<link rel="stylesheet" href="../include/common.css" type="text/css">
<style type="text/css" media=print>
.noprint {display:none; BORDER: 1PX SOLID #008800; FONT-SIZE: 9PT}
</style>
<style type="text/css" media=screen>
.noprint {display:block; BORDER: 1PX SOLID #008800; FONT-SIZE: 9PT}
</style>
<OBJECT id=WB classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 width=0></OBJECT>
<script language="JavaScript">
function doPrint() { WB.ExecWB(6,1) } // 打印
function doPrintSetup() { WB.ExecWB(8,1) } // 打印设置
function doPrintPreview(){ WB.ExecWB(7,1) } // 打印预览
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<%
'Response.Write OuterTableHeader
'Response.Write HeaderWithMenu
'Response.Write InnerTableHeader
''*******************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------
'Response.Write FormSearchPlan
Response.Write DeptName(conn, pDeptId)
Response.Write ListTableHeader
Response.Write ListTableRecords(sSQL&sWhere&sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write ListTableTailer()
'' 打印和打印预览的按钮
Response.write "<br>" & vbLF & _
"<table border=0 width=""100%"">" & _
"<tr>" & _
"<td align=right>" & _
"<img src=""../images/button/preview.gif"" class=""noprint"" onclick=""javascript:doPrintPreview();"">" & _
"</td>" & _
"<td width=20></td>" & _
"<td align=left>" & _
"<img src=""../images/button/print.gif"" class=""noprint"" onclick=""javascript:doPrint();"">" & _
"</td>" & _
"</tr>" & _
"</table>" & vbLF
'-------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
''*******************************************************************************
'Response.Write InnerTableTailer
'Response.Write Footer
'Response.Write OuterTableTailer
Disconnect(conn)
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -