📄 emp_ol.asp
字号:
<%
'************************************************************************************************
' 文件名: emp_ol.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="emp_ol.inc" -->
<%
call CheckSecurity()
'' 如果既不是人事管理员,也没有人事信息查询的权限,则进入error页面
if not IsHrAdmin and not HasRightToHrInfor then
Response.Clear
Response.Redirect "../common/error.asp?error=只有人事管理员或具有人事信息查询权限的人员才能访问人事信息页面&"
Response.End
end if
'********************************************************************************************************
' 服务器端代码
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName : sFileName = "emp_ol.asp"
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 12
Dim iTotalPages : iTotalPages = 0
Dim iCols : iCols = 7
Dim iCurrentPage : iCurrentPage = GetParam("Page")
Dim iSort : iSort = GetParam("Sorting")
Dim iSorted : iSorted = GetParam("Sorted")
Dim sSortParams : sSortParams = ""
Dim sFormParams : sFormParams = ""
Dim sDirection : sDirection = ""
'-----------------------------------------------------------------------------------------------------'
' 查询参数
'-----------------------------------------------------------------------------------------------------
'' 部门
dim pDepartId : pDepartId = GetParam("depart_id")
if IsEmpty(pDepartId) then pDepartId = -1
'' 姓名
dim pName : pName = GetParam("name")
'' 职务
dim pPos : pPos = GetParam("pos")
if IsEmpty(pPos) then pPos = -1
'' 职称
dim pTitle : pTitle = GetParam("title")
if IsEmpty(pTitle) then pTitle = -1
sFormParams = "name=" & pName & "&pos=" & pPos & "&title=" & pTitle & "&"
''********************************************************************************************************
'' 构造分页的SQL语句
''********************************************************************************************************
sSQL = "select t1.serial as emp_serial, t1.name, t2.gender_desc as gender, t3.education_desc as education, t4.position_desc as pos, t5.title_desc as title, t6.parent_node_id as depart_id, t6.node_name as position" & _
" from t_employee t1" & _
" left join t_gender t2 on t1.gender = t2.gender_id" & _
" left join t_education t3 on t1.education = t3.education_id" & _
" left join t_position t4 on t1.pos = t4.position_id" & _
" left join t_title t5 on t1.title = t5.title_id" & _
" left join t_node t6 on t1.node_id = t6.node_id"
' " from t_employee t1, t_gender t2, t_education t3, t_position t4, t_title t5, t_node t6"
'sWhere = " where t1.gender = t2.gender_id" & _
' " and t1.education = t3.education_id" & _
' " and t1.pos = t4.position_id" & _
' " and t1.title = t5.title_id" & _
' " and t1.node_id = t6.node_id" & _
' " and t1.co_id = 1 and t1.isdummy = 0 and t1.dismissed = 0"
sWhere = " where t1.co_id = 1 and t1.isdummy = 0 and t1.dismissed = 0"
sOrderby = " order by t1.name"
''response.write sSQL & sWhere & sOrderby & "<br>" : response.end
''********************************************************************************************************
'' 查询条件限制
''********************************************************************************************************
if pDepartId > 0 then sWhere = sWhere & " and t6.parent_node_id = " & pDepartId
if pName <> "" then sWhere = sWhere & " and t1.name like " & ToSQL("%" & pName & "%","Text")
if pPos > 0 then sWhere = sWhere & " and t1.pos = " & pPos
if pTitle > 0 then sWhere = sWhere & " and t1.title = " & pTitle
''response.write sSQL & sWhere & sOrderby & "<br>" : response.end
'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(6), sDelimiter
sDelimiter = "*"
arrayFields(0) = "name"
arrayFields(1) = "gender"
arrayFields(2) = "education"
arrayFields(3) = "pos"
arrayFields(4) = "title"
arrayFields(5) = "depart_id"
arrayFields(6) = "position"
call PrepareListData(sSQL & sWhere & sOrderby, 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">
.tdlist {border-width:0px}
.tdHead {border-width:0px}
</style>
<script language="VBScript">
Sub btnSearch_OnClick()
document.all.frmSearch.submit()
End Sub
</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 TableLink
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -