<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->


<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-最高权限-邮件/短信模版</title>
<% 
call logquanxian("f3",1)
%>

<DIV>
<%
Const stringmodarr = "abcdefghijklmnopqrstuvwxyz"
dim randarr,strlength
strlength = Len(stringmodarr)
Randomize timer
For i = 1 To 8 
randarr = randarr&Mid(stringmodarr,Int(Rnd * strlength + 1),1)  
Next 

act=request.form("act")

if act="add" then

aymbsuiji=request.form("aymbsuiji")
aymbname=request.form("aymbname")
aymbbiaoti=request.form("aymbbiaoti")
aymbdbiaoti=request.form("aymbdbiaoti")
aymbcon=request.form("aymbcon")

if trim(aymbname)="" or trim(aymbbiaoti)="" or trim(aymbdbiaoti)="" or trim(aymbcon)="" then call PopErr("请填写完整")

sql="select * from aymailmb" 
rs.open sql,conn,1,3
rs.addnew
rs("aymbsuiji")=trim(aymbsuiji)
rs("aymbname")=trim(aymbname)
rs("aymbbiaoti")=trim(aymbbiaoti)
rs("aymbdbiaoti")=trim(aymbdbiaoti)
rs("aymbcon")=trim(aymbcon)
rs.update
rs.close

call logadd(request.Cookies("aynameid"),"管理-邮件模版添加成功"&aymbname,0,0)
call PopErr2("邮件模版添加成功","adminmailmb.asp")

end if

if act="edit" then

aymbid=request.form("aymbid")
aymbname=request.form("aymbname")
aymbbiaoti=request.form("aymbbiaoti")
aymbdbiaoti=request.form("aymbdbiaoti")
aymbcon=request.form("aymbcon")

if trim(aymbid)="" or trim(aymbname)="" or trim(aymbbiaoti)="" or trim(aymbdbiaoti)="" or trim(aymbcon)="" then call PopErr("请填写完整")

sql="select * from aymailmb where aymbid="&aymbid&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("aymbname")=trim(aymbname)
rs("aymbbiaoti")=trim(aymbbiaoti)
rs("aymbdbiaoti")=trim(aymbdbiaoti)
rs("aymbcon")=trim(aymbcon)
rs.update
call logadd(request.Cookies("aynameid"),"管理-邮件模版修改成功"&aymbname,0,0)
call PopErr2("邮件模版修改成功","adminmailmb.asp")
else
call PopErr("未找到该邮件模版ID")
end if
rs.close

end if


if request.QueryString("act") ="del" then
aymbid=request.QueryString("aymbid")
sql="select * from aymailmb where aymbid="&aymbid&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs.delete
rs.update
call logadd(request.Cookies("aynameid"),"管理-邮件模版删除成功"&aymbname,0,0)
call PopErr2("邮件模版删除成功","adminmailmb.asp")
else
call PopErr("未找到该邮件模版ID")
end if
rs.close
end if
%>
<DIV id=main1200> 
<%call webleft()%>

<DIV id=main_right>
<DIV id=main_right_content>
<DIV class=right_titleadmin>&nbsp;&nbsp;邮件/短信模版</DIV>
<DIV class=main><br>

  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="" method="post" name="myform" id="myform"> 
  

      <tr>
        <th colspan="4" align="center"><span style="font-weight: bold; color: #FF6600">添加新模版</span></th>
        </tr>
      <tr>
        <th width="200" align="center">模版名称：</th>
        <td width="1649" colspan="3"><input name="aymbname" type="text" id="aymbname" size="40" maxlength="20"> 
          模版名称 
          <input name="aymbsuiji" type="hidden" id="aymbsuiji" value="<%=randarr%>"></td>
        </tr>
      <tr>
        <th align="center">邮件标题：</th>
        <td width="1649" colspan="3"><input name="aymbbiaoti" type="text" id="aymbbiaoti" size="40" maxlength="100">
          邮件通知标题 </td>
      </tr>
      <tr>
        <th align="center">短信标题：</th>
        <td colspan="3"><input name="aymbdbiaoti" type="text" id="aymbdbiaoti" size="40" maxlength="60"> 
          手机短信通知标题 建议30字符以内</td>
        </tr>
      <tr>
        <th align="center">内容：</th>
        <td colspan="3"><textarea name="aymbcon" cols="80" rows="8" id="aymbcon"></textarea> 
          通知内容</td>
        </tr>
      <tr>
        <th colspan="4" align="center"><input name="act" type="hidden" id="act" value="add">
          <input type="submit" name="Submit" value=" 添 加 新 模 版 "></th>
        </tr>
     </form>
    </table>
	
	
<%
sql="select * from aymailmb order by aymbid desc"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
do while not rs.eof
%>
<br>
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     <form action="" method="post" name="myform" id="myform"> 
  

      <tr>
        <th colspan="4" align="left">&nbsp;&nbsp;<span style="font-weight: bold; color: #FF6600">修改[<%=trim(rs("aymbname"))%>]模版
            <input name="aymbid" type="hidden" id="aymbid" value="<%=trim(rs("aymbid"))%>">
        </span></th>
        </tr>
      <tr>
        <th width="200" align="center">模版名称：</th>
        <td width="1649" colspan="3"><input name="aymbname" type="text" id="aymbname" value="<%=trim(rs("aymbname"))%>" size="40" maxlength="20"> 
          模版名称 
          </td>
      </tr>
      <tr>
        <th align="center">邮件标题：</th>
        <td width="1649" colspan="3"><input name="aymbbiaoti" type="text" id="aymbbiaoti" value="<%=trim(rs("aymbbiaoti"))%>" size="40" maxlength="100">
          邮件通知标题 </td>
      </tr>
      <tr>
        <th align="center">短信标题：</th>
        <td colspan="3"><input name="aymbdbiaoti" type="text" id="aymbdbiaoti" value="<%=trim(rs("aymbdbiaoti"))%>" size="40" maxlength="60"> 
          手机短信通知标题 建议30字符以内</td>
        </tr>
      <tr>
        <th align="center">内容：</th>
        <td colspan="3"><textarea name="aymbcon" cols="80" rows="8" id="aymbcon"><%=trim(rs("aymbcon"))%></textarea> 
        </td>
        </tr>
      <tr>
        <th colspan="4" align="center"><input name="act" type="hidden" id="act" value="edit">
          <input type="submit" name="Submit" value=" 修 改 模 版 "> <a onClick="javascript:return confirm('您确定要删除吗？');" href="?act=del&aymbid=<%=trim(rs("aymbid"))%>">【删除模板】</a></th>
        </tr>
     </form>
    </table>
<%
rs.movenext
loop
end if
rs.close%>
		
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>



<!--#include virtual="/show/footadmin.asp"-->

