📄 type_mgr.asp
字号:
<%
'##############################################################################
'#
'# 文 件 名 : type_mgr.asp
'#
'#
'# 创 建 人 : yaoxiaohui
'# 日 期 : 2002-11-4
'#
'# 修改历史 : ****年**月**日 ******
'# 修改内容 : **************************************************
'#
'# 功能描述 : 实现仓库信息的管理
'# 版 本 : v1.0
'#
'# Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'##############################################################################
'------------------------------------------------------------------------------
'---- 服务器端设置
'------------------------------------------------------------------------------
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- include files begin -->
<!-- include files begin -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/commonpage.inc" -->
<!-- #include file="type_mgr.inc" -->
<!-- include files end -->
<%
'##############################################################################
'---- 服务器端代码
'##############################################################################
call CheckSecurity()
'------------------------------------------------------------------------------
'---- 用户权限检查
'------------------------------------------------------------------------------
if hasright(ID_STOCK) < RIGHT_WRITE then
Response.Clear
Response.Redirect "../include/error.asp?error=只有仓库管理员才能进行物品类别的管理!"
Response.end
end if
'******************************************************************************
'---- 建立数据库连接
'------------------------------------------------------------------------------
dim conn
Set conn = DBConnection
Dim pTypeID : pTypeID = GetParam("type_id")
Dim sTypeDesc
if Not IsEmpty(pTypeID) then
sTypeDesc = DLookUp(conn, "select type_desc from t_goods_type where type_id = " & ToSQL(pTypeID, "Number"))
if sTypeDesc = "" then
Response.Redirect "../include/error.asp"
Response.end
end if
end if
'******************************************************************************
'---- 如果是提交,则调用函数InsertType或UpdateType或DeleteType更新数据库
'------------------------------------------------------------------------------
Dim sFormAction
if UCase(Request.ServerVariables("REQUEST_METHOD") = "POST") then
sFormAction = GetParam("FormAction")
select case sFormAction
case "insert":
call AddType()
case "update":
call UpdateType()
case "delete":
call DeleteType()
end select
end if
'******************************************************************************
'---- 分页相关的变量定义
'------------------------------------------------------------------------------
Dim sSQL, sOrderby
Dim sFileName : sFileName = "type_mgr.asp"
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 12
Dim iTotalPages : iTotalPages = 0
Dim iCols : iCols = 1
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 type_id, type_desc from t_goods_type"
sOrderby = " order by type_desc asc"
'******************************************************************************
'---- 分页SQL语句构造完毕,调用PrepareListData进行分页前的准备
'------------------------------------------------------------------------------
dim arrayFields(1), sDelimiter
sDelimiter = "*"
arrayFields(0) = "type_desc"
call PrepareListData(conn, 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="../include/common.css" type="text/css">
<script language="javascript" src="type_mgr.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
Disconnect(conn)
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -