📄 equi_mtplan_list.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/commonpage.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="equi_mtplan_list.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 = 17
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">
<script language="javascript">
function doPrint()
{
alert("12345");
}
</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 FormSearchPlan
Response.Write ListTableHeader
Response.Write ListTableRecords(sSQL&sWhere&sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
Response.Write ListTableTailer()
'-------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
''*******************************************************************************
%>
<table align=center border=0>
<form name="FormForPrint" method=post action="equi_mtplan_print.asp" target=_blank>
<input type="hidden" name="year" value="<%=pYear%>">
<input type="hidden" name="dept_id" value="<%=pDeptId%>">
<tr style="display:none"><td align=center>
<textarea name="IdOfPlanlist" id="IdOfPlanlist" style="display:block" cols=100 rows=10></textarea></td></tr>
<tr><td align=center>
<img border=0 src="../images/button/view.gif" onclick="javascript:FormForPrint.submit();"></td></tr>
</form>
</table>
<%
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
Disconnect(conn)
%>
<script language="javascript">
FormSearchPlan.year.value = "<%=pYear%>";
FormSearchPlan.period.value = "<%=pPeriod%>";
</script>
<script language="javascript">
document.all.IdOfPlanlist.innerText=document.all.tablePlanlist.outerHTML;
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -