📄 pcard_l.asp
字号:
<%
'************************************************************************************************
' 文件名: pcard_l.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="pcard_l.inc" -->
<%
call CheckSecurity()
'********************************************************************************************************
' 服务器端代码
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sWhere1, sWhere2, sOrderby
Dim sFileName : sFileName = "pcard_l.asp"
Dim iEmpSerial : iEmpSerial = GetEmpSerial
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 5
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 pCardGroup : pCardGroup = GetParam("card_group")
if IsEmpty(pCardGroup) then pCardGroup = -1
dim pIsPublic : pIsPublic = GetParam("ispublic")
if IsEmpty(pIsPublic) then pIsPublic = -1
dim pName : pName = GetParam("name")
dim pCompanyName : pCompanyName = GetParam("company_name")
sFormParams = "card_group=" & pCardGroup & "&ispublic=" & pIsPublic & "&name=" & pName & "&company=" & pCompanyName & "&"
''********************************************************************************************************
'' 构造分页的SQL语句
''********************************************************************************************************
sSQL = "select t1.serial, t1.emp_serial, t2.group_desp as card_group_desp, t1.ispublic, t1.name, t3.gender_desc, t1.post, t1.company_name, t1.company_addr, t1.company_zip, t1.company_phone, t1.home_addr, t1.home_zip, t1.home_phone, t1.fax, t1.beep, t1.mobile, t1.email, t1.memo from t_personalcard t1, t_personalcardgroup t2, t_gender t3"
'' 我的个人名片
sWhere1 = " where t1.gender = t3.gender_id" & _
" and t1.card_group = t2.group_id" & _
" and t1.emp_serial = " & iEmpSerial
'' 他人共享的名片
sWhere2 = " where t1.gender = t3.gender_id" & _
" and t1.card_group = t2.group_id" & _
" and t1.emp_serial <> " & iEmpSerial & _
" and t1.ispublic = 1"
sOrderby = " order by t1.serial desc"
''********************************************************************************************************
'' 查询条件限制
''********************************************************************************************************
if pCardGroup >= 0 then sWhere1 = sWhere1 & " and card_group = " & pCardGroup '' 只有个人名片才能有这个限制
if pIsPublic >=0 then sWhere = sWhere & " and ispublic = " & pIsPublic '' 只有个人名片才能有这个限制
if Not IsEmpty(pName) then sWhere = sWhere & " and name like " & ToSQL("%" & pName & "%","Text")
if Not IsEmpty(pCompanyName) then sWhere = sWhere & " and company_name like " & ToSQL("%" & pCompanyName & "%","Text")
'Response.write sSQL & sWhere1 & sWhere & sOrderby & "<br><br>"
'Response.write sSQL & sWhere2 & sWhere & sOrderby & "<br>"
'response.end
'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(7), sDelimiter
sDelimiter = "*"
arrayFields(0) = "name"
arrayFields(1) = "company_phone"
arrayFields(2) = "home_phone"
arrayFields(3) = "mobile"
arrayFields(4) = "beep"
arrayFields(5) = "fax"
arrayFields(6) = "email"
arrayFields(7) = "ispublic"
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">
<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 "<tr><td colspan=""" & iCols & """ class=tdlist style=""color:blue;background-color:#ffffcc""> 以下是我个人的通讯录...</td></tr>"
call PrepareListData(sSQL & sWhere & sWhere1 & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
Response.Write TableRecords(sSQL & sWhere1 & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams )
'' 他人共享的通讯录
Response.Write "<tr><td colspan=""" & iCols & """ class=tdlist style=""color:blue;background-color:#ffffcc""> 以下是他人共享的通讯录...</td></tr>"
call PrepareListData(sSQL & sWhere & sWhere2 & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
Response.Write TableRecords(sSQL & sWhere2 & 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 + -