📄 meetingroom_edit.asp
字号:
<%
'OA 表单生成器1.0
'功能:编辑会议室
'参数: request.form("addedit_subed")="true"#表单提交; request("id")#要编辑记录的ID;
' request("page")=int #当前页码; request.form("Search")=chr #上次查询条件
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
currentpage=request("page") : if currentpage="" then currentpage=1 '当前页码
Search=request("Search") '上次查询条件
pid=request("id") '记录ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaMeetingRoom" '表名
if request.form("addedit_subed")="true" then
'表单提交后
'接受录入参数
input_name=Request.Form("input_name")'名称
input_area=Request.Form("input_area")'地点
input_accept=Request.Form("input_accept")'可容纳人数
input_device=Request.Form("input_device")'设备情况
input_caption=Request.Form("input_caption")'使用说明
input_remark=Request.Form("input_remark")'备注
'添加时使用的字段
field1=array("name","area","accept","device","caption","remark","sdate","userid")
value1=array(input_name,input_area,input_accept,input_device,input_caption,input_remark,date(),LoginID)
sql="UPDATE " & table & " SET "
for i=0 to ubound(field1)
sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'"
if i <> ubound(field1) then sql=sql & "," else sql=sql & " where id=" & pid
next
oConn.Execute sql
word="<p>会议室修改成功!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=javascript:GoURL('MeetingRoom_list.asp?page="¤tpage&"')>返回列表</a>"
else'--------------------------------------------取记录
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where ID="&pid
rs.open sql,oConn,1,1
'显示字段变量
if (isnull(rs("id"))) then show_id="无" else show_id=Server.HTMLEncode(rs("id"))
if (isnull(rs("sdate"))) then show_sdate="无" else show_sdate=Server.HTMLEncode(rs("sdate"))
if (isnull(rs("userid"))) then show_userid="无" else show_userid=Server.HTMLEncode(rs("userid"))
if (isnull(rs("name"))) then show_name="无" else show_name=Server.HTMLEncode(rs("name"))
if (isnull(rs("area"))) then show_area="无" else show_area=Server.HTMLEncode(rs("area"))
if (isnull(rs("accept"))) then show_accept="无" else show_accept=Server.HTMLEncode(rs("accept"))
if (isnull(rs("device"))) then show_device="无" else show_device=Server.HTMLEncode(rs("device"))
if (isnull(rs("caption"))) then show_caption="无" else show_caption=Server.HTMLEncode(rs("caption"))
if (isnull(rs("remark"))) then show_remark="无" else show_remark=Server.HTMLEncode(rs("remark"))
end if
'------------------------------------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
function require(form){
return checnull(form.input_name,"请填写名称!")&&
checnull(form.input_area,"请填写地点!")&&
checnull(form.input_accept,"请填写可容纳人数!")&&
checnumber(form.input_accept,"可容纳人数必须为数字!")&&
1==1;
}
-->
</script>
</head>
<body topmargin="10" leftmargin="10">
<!--#include file="MeetingRoom_menu.html"-->
<hr width="100%" size=1 color="#000000">
<br>
<%=SearchScrip(Search)%>
<div align="center">
<table width="500" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td width="100%" class="tdTop">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="tdTop">
<p align="left"><img border="0" src="../images/icon_title.gif" align="left">编辑会议室</p>
</td>
<td width="90" class="tdTop">
<p align="left"><img border="0" src="../images/icon_return.gif" align="left">
<a href=javascript:GoURL('MeetingRoom_list.asp?page=<%=currentpage%>') class="linkTop">返回列表</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" class="td1">
<% if request.form("addedit_subed")="true" then %>
<table border="0" width="100%" cellspacing="10" cellpadding="0">
<tr>
<td width="36%">
<p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
</td>
<td width="64%"><p> </p>
<%=word%>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
</td>
</tr>
</table>
<% else %>
<form name="eventfrm" method="POST" action="?id=<%=pid%>&page=<%=currentpage%>" onSubmit="return require(this)">
<input type=hidden name="addedit_subed" value="true">
<table border="0" width="100%" cellspacing="10" cellpadding="0">
<tr>
<td width="100" align="right" valign="top" nowrap>名称:</td>
<td width="400" nowrap><input type="text" name="input_name" value="<%=show_name%>" size="40" maxlength="250" class="input"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>地点:</td>
<td width="400" nowrap><input type="text" name="input_area" value="<%=show_area%>" size="40" maxlength="250" class="input"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>可容纳人数:</td>
<td width="400" nowrap><input type="text" name="input_accept" value="<%=show_accept%>" size="40" maxlength="250" class="input"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>设备情况:</td>
<td width="400" nowrap><textarea name="input_device" rows="5" cols="39" class="textarea"><%=show_device%></textarea>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>使用说明:</td>
<td width="400" nowrap><textarea name="input_caption" rows="5" cols="39" class="textarea"><%=show_caption%></textarea>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>备注:</td>
<td width="400" nowrap><textarea name="input_remark" rows="5" cols="39" class="textarea"><%=show_remark%></textarea>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<input type="submit" value="确定" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1"> <input type="reset" value="全部重写" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
</tr>
</table>
</form>
<%
rs.close
end if
%>
</td>
</tr>
<tr>
<td width="25%" class="tdBottom">
</td>
</tr>
</table>
</div>
</body>
</html>
<%'释放对象变量
oConn.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -