📄 cardcase_edit.asp
字号:
<%
'功能:编辑名片夹信息
'参数:request("id")=int #当前名片夹ID; request.form("addedit_subed")="true"#表单提交;
%>
<!--#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
cid=request("id") '名片夹ID
'------------------------------------------------
'------------------------------------------------编辑记录
table="tbioaCardcase" '表名
if request.form("addedit_subed")="true" then
'表单提交后
Title=Request.Form("Title")'标题
Body=Request.Form("Body")'说明
'编辑时使用的字段
field1=array("Title","Body")
value1=array(Title,Body)
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=" & cid & " and UserID=" & LoginID
next
oConn.Execute sql
word="<p>名片夹信息修改成功!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=cardcase_index.asp>返回我的名片夹</a>"
else'------------------------------------------------取记录
'取名片夹记录 (返回rs对象)
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where ID="&cid
rs.open sql,oConn,1,1
'------------------------------------------------
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>
<base target="FrmMain">
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
function require(form){
return checnull(form.Title,"请填写名片夹标题!")
}
-->
</script>
</head>
<body topmargin="10" leftmargin="10">
<!--#include file="cardcase_menu.html"-->
<hr width="100%" size=1 color="#000000">
<br>
<div align="center">
<table width="400" 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>
</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="" onSubmit="return require(this)">
<input type=hidden name="addedit_subed" value="true">
<table width="100%" cellspacing="3" cellpadding="2">
<tr>
<td width="50" class="td1" align="right"><font COLOR="RED">*</font> 标题:</td>
<td class="td1"><input type="text" name="Title" size="25" value="<%=Server.HTMLEncode(rs("Title"))%>" maxlength="10" class="input"></td>
</tr>
<tr>
<td width="50" class="td1" align="right" valign="top">说明:</td>
<td class="td1"><textarea rows="3" name="Body" cols="40" class="textarea"><%=Server.HTMLEncode(rs("Body"))%></textarea></td>
</tr>
<tr>
<td class="tdBottom" colspan="2"></td>
</tr>
<tr>
<td class="td1" 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>
<% 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 + -