?? mail_template_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="tbioaMail_template" '表名
if request.form("addedit_subed")="true" then
'表單提交后
'接受錄入參數
input_title=Request.Form("input_title")'模板標題
input_body=Request.Form("input_body")'模板內容
'添加時使用的字段
field1=array("title","body","sdate","userid")
value1=array(input_title,input_body,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('mail_template_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("title"))) then show_title="無" else show_title=Server.HTMLEncode(rs("title"))
if (isnull(rs("body"))) then show_body="無" else show_body=Server.HTMLEncode(rs("body"))
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){
if (!checnull(form.input_title,"請填寫模板標題!")) return false;
form.input_body.value=editor.save()
if (form.input_body.value=="") {alert("請填寫模板內容!"); return false;}
return true;
}
-->
</script>
</head>
<body topmargin="10" leftmargin="10">
<!--#include file="mail_template_menu.html"-->
<hr width="100%" size=1 color="#000000">
<br>
<%=SearchScrip(Search)%>
<div align="center">
<table width="100%" 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('mail_template_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 valign="top" nowrap>模板標題:
<input type="text" name="input_title" value="<%=show_title%>" size="40" maxlength="250" class="input"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td valign="top" nowrap>模板內容:<br>
<input type=hidden name="input_body" value="">
<%if pid="" then pid=0%>
<iframe id="editor" src="../inc/editor.asp?edit=select body from tbioaMail_Template where ID=<%=pid%>" width="100%" height="400" scrolling="yes" style="border: 1 solid #000000"></iframe>
</td>
</tr>
<tr>
<td width="100%">
<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 + -