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

📄 position.asp

📁 物业管理和办公自动化系统
💻 ASP
字号:
<%
'************************************************************************************************
' 文件名: position.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'
'  创建人 : 周秋舫
'  日 期 : 2002-05-13
' 修改历史 :
'   ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 职务管理
'  版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
'response.end
%>

<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.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="position.inc" -->

<%
call CheckSecurity()

'' 如果不是人事管理员,则无权进入本页
if Not IsHrAdmin then
	Response.Clear
	Response.Redirect "../common/error.asp?error=只有人事管理员才能进行职务管理!"
	Response.end
end if

'********************************************************************************************************
' 服务器端代码
Dim pPositionId : pPositionId = GetParam("id")
Dim sPositionDesp, sAdminLevel, sDefaultRole
if Not IsEmpty(pPositionId) then
	dim crs, rs
	set crs = New CRecordset
	set rs = crs.Open(dbLocal, "select position_desc, admin_level, default_role from t_position where position_id = " & ToSQL(pPositionId, "Number"))
	if rs.EOF then
		crs.Close()
		Response.Redirect("../common/error.asp")
		Response.end
	end if
	sPositionDesp = crs.GetValue("position_desc")
	sAdminLevel = crs.GetValue("admin_level")
	sDefaultRole = crs.GetValue("default_role")
	crs.Close()
end if

if sAdminLevel = "" then sAdminLevel = 0
if sDefaultRole = "" then sDefaultRole = 0
'********************************************************************************************************
' 如果是提交,则调用函数InsertPosition或UpdatePosition或DeletePosition更新数据库
Dim sFormAction
if UCase(Request.ServerVariables("REQUEST_METHOD") = "POST") then
	sFormAction = GetParam("FormAction")
	select case sFormAction
	case "insert":
		call AddPosition()
	case "update":
		call UpdatePosition()
	case "delete":
		call DeletePosition()
	end select
end if

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

''********************************************************************************************************
'' 构造分页的SQL语句
''********************************************************************************************************
sSQL = "select position_id as id, position_desc as description, admin_level, role_desp as role" & _
			" from t_position t1 left join t_role t2 on t1.default_role = t2.role_id"
sOrderby = " order by position_desc"

'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(2), sDelimiter
sDelimiter = "*"
arrayFields(0) = "description"
arrayFields(1) = "admin_level"
arrayFields(2) = "role"
call PrepareListData(sSQL, 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="../common/common.css" type="text/css">
<style type="text/css">
input {color:blue;border-width:1}
</style>
<script language="javascript" src="position.js"></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 _
	"<table cellspacing=1 cellpadding=0 border=0 bgcolor=navy>" & _
	"<tr>" & _
	"<td width=300 valign=top>" & _
			ListTableHeader & _
			ListTableRecords(sSQL & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams ) & _
			ListTableTailer() & _
	"</td>" & _
	"<td width=300 valign=top>" & _
			FormTable & _
	"</td></tr></table>"

Response.Write TableLink
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>

</body>
</html>

⌨️ 快捷键说明

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