📄 node.asp
字号:
<%'************************************************************************************************' 文件名: node.asp' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司'' 创建人 :魏霖' 日 期 : 2002-10-29' 修改历史 :' ****年**月**日 ****** 修改内容:**************************************************' 功能描述 : 部门管理' 版 本 :'************************************************************************************************option explicitResponse.CacheControl = "no-cache"Response.AddHeader "Pragma", "no-cache"Response.Expires = -1'response.end%><!-- #include file="../include/common.inc" --><!-- #include file="../include/recordlist.inc" --><!-- #include file="../include/commonpage.inc" --><!-- #include file="node.inc" --><%call CheckSecurity()'' 如果不是人事管理员,则无权进入本页dim iRight:iRight=HasRight(ID_HR)if iRight=1 or iRight=2 thenelse Response.Clear Response.Redirect "../include/error.asp?error=只有人事管理员或具有人事信息查询权限的人员才能访问人事信息页面&" Response.Endend ifdim conn:set conn=DBConnection'********************************************************************************************************' 服务器端代码Dim pNodeId : pNodeId = GetParam("id")Dim sNodeDespif Not IsEmpty(pNodeId) then sNodeDesp = DLookUp(conn,"select node_desp from t_node where node_id="& ToSQL(pNodeId, "Number")) if sNodeDesp = "" then Disconnect(conn) Response.Redirect "../include/error.asp" Response.end end ifend if'********************************************************************************************************' 如果是提交,则调用函数InsertNode或UpdateNode或DeleteNode更新数据库Dim sFormActionif UCase(Request.ServerVariables("REQUEST_METHOD") = "POST") then sFormAction = GetParam("FormAction") select case sFormAction case "addnode": call AddNode() case "updatenode": call UpdateNode() case "deletenode": call DeleteNode() end selectend if'-------------------------------------------------------------------------------------------------------------------------------------------------' 分页相关的变量定义'-------------------------------------------------------------------------------------------------------------------------------------------------Dim sSQL, sWhere, sOrderbyDim sFileName : sFileName = "node.asp"Dim iTotalRecords : iTotalRecords = 0 ' 分页Dim iRecordsPerPage : iRecordsPerPage = 12Dim iTotalPages : iTotalPages = 0Dim iCols : iCols = 1Dim 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 node_id as id, node_desp as description,mark from t_node where mark=0 order by node_desp"'********************************************************************************************************' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备'-------------------------------------------------------------------------------------------------------------------------------------------------dim arrayFields(1), sDelimitersDelimiter = "*"arrayFields(0) = "description"call PrepareListData(conn,sSQL, Join(arrayFields, sDelimiter), sDelimiter)'********************************************************************************************************%><html><head><title>部门管理</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">input {color:blue;border-width:1}</style><script language="vbscript"> sub btnSubmit_Onclick() if trim(frmnode.description.value) = "" then msgbox"请输入部门名称!" frmnode.description.focus() exit sub end if frmnode.formaction.value = "addnode" frmnode.submit() end sub sub btnUpdate_Onclick() '更新部门 if trim(frmnode.description.value) = "" then msgbox"请输入部门名称!" frmnode.description.focus() exit sub end if frmnode.formaction.value="updatenode" frmnode.submit() end sub sub btnDelete_Onclick() '删除部门 if msgbox("您确定要删除该部门吗?",324) = 7 then exit sub end if frmnode.formaction.value="deletenode" frmnode.submit() end sub sub btnClear_Onclick() ' 重新输入 frmnode.reset() end sub sub btnCancel_Onclick() ' 重新输入 frmnode.reset() end sub sub btnReturn_Onclick() '返回 history.go(-1) end sub</script></head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg"><br><%Response.Write OuterTableHeaderResponse.Write HeaderWithMenuResponse.Write InnerTableHeader'********************************************************************************************************' 主体从这里开始'-------------------------------------------------------------------------------------------------------------------------------------------------Response.Write _ "<table cellspacing=1 cellpadding=0 border=0 bgcolor=navy>" & _ "<tr>" & _ "<td width=300 valign=top>" & _ ListTableHeader & _ ListTableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams ) & _ ListTableTailer() & _ "</td>" & _ "<td width=300 valign=top>" & _ FormTable & _ "</td></tr></table>"Response.Write TableLink'-------------------------------------------------------------------------------------------------------------------------------------------------' 主体到这里结束'********************************************************************************************************Response.Write InnerTableTailerResponse.Write FooterResponse.Write OuterTableTailerDisconnect(conn)%></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -