<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%ColumnName="":Tablename="HX_InternetEMail":Orderby=" where WS_USERID="&LOGINUid
WS_INID=request("WS_INID"):WS_InternetEmail=WS_s.HX_Replace(request.form("WS_InternetEmail")):WS_InternetPOP3=WS_s.HX_Replace(request.form("WS_InternetPOP3")):WS_InternetSMTP=WS_s.HX_Replace(request.form("WS_InternetSMTP")):WS_InternetSendName=WS_s.HX_Replace(request.form("WS_InternetSendName")):WS_InternetPassword=WS_s.HX_Replace(request.form("WS_InternetPassword")):WS_InternetContent=request.form("WS_InternetContent"):action=request("action")
if (WS_INID<>"" and isnumeric(WS_INID)) and (action="editsave" or action="edit") then  Orderby=Orderby&" and WS_INID="&WS_INID
if action="saveinfo" then Orderby=Orderby&" and WS_InternetEmail='"&WS_InternetEmail&"'"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
select case action
case "saveinfo"
    if rs.recordcount>0 then
       msg="邮件账户已存在!"
    else
       msg="邮件账户创建成功!"
       rs.addnew:rs("WS_USERID")=LOGINUid:rs("WS_InternetEmail")=WS_InternetEmail:rs("WS_InternetPOP3")=WS_InternetPOP3:rs("WS_InternetSMTP")=WS_InternetSMTP:rs("WS_InternetSendName")=WS_InternetSendName:rs("WS_InternetPassword")=WS_InternetPassword:rs("WS_InternetContent")=WS_InternetContent:rs.update
	end if
	   call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg)
       HX_GoBack msg,""
case "editsave"
    if rs.recordcount>0 then
       msg="邮件账户修改成功!"
       rs("WS_InternetEmail")=WS_InternetEmail:rs("WS_InternetPOP3")=WS_InternetPOP3:rs("WS_InternetSMTP")=WS_InternetSMTP:rs("WS_InternetSendName")=WS_InternetSendName:rs("WS_InternetPassword")=WS_InternetPassword:rs("WS_InternetContent")=WS_InternetContent:rs.update
	end if
	   call WS_S.SaveAdminLog(LOGINUSERNAME,LogAppointment,msg)
       HX_GoBack msg,"internetinbox.asp"   
case "edit"
     if rs.recordcount>0 then
       WS_InternetEmail=rs("WS_InternetEmail"):WS_InternetPOP3=rs("WS_InternetPOP3"):WS_InternetSMTP=rs("WS_InternetSMTP"):WS_InternetSendName=rs("WS_InternetSendName"):WS_InternetPassword=rs("WS_InternetPassword"):WS_InternetContent=rs("WS_InternetContent")
	  end if
	   msg="修改邮件账户"
case else
       msg="新建邮件账户"	   
end select
const WSOAWith=450:const WSOAHeight=300
%><script language="javascript">
<!--
function retruecheck(){
var frm=document.form1;
if(frm.WS_InternetEmail.value=="")
 {
  alert('电子邮箱不能为空!');
  frm.WS_InternetEmail.focus();
  return false;
  }
  if(frm.WS_InternetPOP3.value=="")
 {
  alert('接收服务器不能为空!');
  frm.WS_InternetPOP3.focus();
  return false;
  }
  if(frm.WS_InternetSMTP.value=="")
 {
  alert('发送服务器不能为空!');
  frm.WS_InternetSMTP.focus();
  return false;
  }
  if(frm.WS_InternetSendName.value=="")
 {
  alert('登录账户不能为空!');
  frm.WS_InternetSendName.focus();
  return false;
  }
  if(frm.WS_InternetPassword.value=="")
 {
  alert('登录密码不能为空!');
  frm.WS_InternetPassword.focus();
  return false;
  }
return true;
}
function startmode(){
  var frm=document.form1;
  frm.WS_InternetEmail.value="<%=WS_ConfigInternetEmail%>";
  frm.WS_InternetPOP3.value="<%=WS_ConfigInternetPOP3%>";
  frm.WS_InternetSMTP.value="<%=WS_ConfigInternetSMTP%>";
  frm.WS_InternetSendName.value="<%=WS_ConfigInternetSendName%>";
  frm.WS_InternetPassword.value="<%=WS_ConfigInternetPassword%>";
  frames.message.document.body.innerHTML="<%if WS_ConfigInternetContent<>"" then response.Write Replace(Replace(WS_ConfigInternetContent,chr(10),"<br>")," ","")%>";
}
-->
</script>
<%response.write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>"&msg&"</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'></head><body topmargin='20' leftmargin='0' bottommargin='20'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>"&msg&"</font></td></tr></table>"
if action="edit" then
response.write "<table border='0' cellspacing='1' cellpadding='3' width='100%' align='center' bgcolor='#FFFBE8'><form action='?action=editsave' method='post' name='form1' onsubmit='return retruecheck();'><tr bgcolor='#FFFBE8'><td width='26%'><div align='right'>电子邮箱(E_mail)：</div></td><td width='74%'> <input type='text' name='WS_InternetEmail' size='40' value='"&WS_InternetEmail&"'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>接收服务器(POP3)：</div></td><td> <input type='text' name='WS_InternetPOP3' size='40' value='"&WS_InternetPOP3&"'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>发送服务器(SMTP)：</div></td><td> <input type='text' name='WS_InternetSMTP' size='40' value='"&WS_InternetSMTP&"'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>登录账户(用户名)：</div></td><td> <input type='text' name='WS_InternetSendName' size='40' value='"&WS_InternetSendName&"'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>登录密码(密　码)：</div></td><td> <input type='password' name='WS_InternetPassword' size='40' value='"&WS_InternetPassword&"'></td></tr><tr bgcolor='#FFFBE8'><td valign='top'><div align='right'>发送信件模版：</div></td><td>"
session("WSOACOMCONTENT")=rs("WS_InternetContent")
%><!--#include file=../HXEditor/WSOAEDITOR.ASP--><%
response.write "</td></tr><tr bgcolor='#FFFBE8'><td>&nbsp;</td><td> <input name='WS_InternetContent' type='hidden' value=''> <input type='submit' name='dodsend2' value=' 保 存 ' onClick=""document.form1.WS_InternetContent.value = frames.message.document.body.innerHTML;""> <input type='button' name='Submit' value=' 删 除 ' onClick=""javascript:location.href='internetinbox.asp?action=del&WS_INID="&WS_INID&"';""> <input type='button' name='Submit' value='默认设置' onclick='javascript:startmode();'> <input name='reset' type='reset' value=' 重 置 '> <input type='button' name='Submit' value=' 返 回 ' onclick='javascript:history.go(-1);'> <input type='hidden' name='WS_INID' value='"&WS_INID&"'></td></tr></form></table>"
else
response.write "<table border='0' cellspacing='1' cellpadding='3' width='100%' align='center' bgcolor='#FFFBE8'><form action='?action=saveinfo' method='post' name='form1' onsubmit='return retruecheck();'><tr bgcolor='#FFFBE8'><td width='26%'><div align='right'>电子邮箱(E_mail)：</div></td><td width='74%'> <input type='text' name='WS_InternetEmail' size='40'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>接收服务器(POP3)：</div></td><td> <input type='text' name='WS_InternetPOP3' size='40'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>发送服务器(SMTP)：</div></td><td> <input type='text' name='WS_InternetSMTP' size='40'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>登录账户(用户名)：</div></td><td> <input type='text' name='WS_InternetSendName' size='40'></td></tr><tr bgcolor='#FFFBE8'><td><div align='right'>登录密码(密　码)：</div></td><td> <input type='password' name='WS_InternetPassword' size='40'></td></tr><tr bgcolor='#FFFBE8'><td valign='top'><div align='right'>发送信件模版：</div></td><td>"%>
<!--#include file=../HXEditor/WSOAEDITOR.ASP-->
<%response.write "</td></tr><tr bgcolor='#FFFBE8'><td>&nbsp;</td><td> <input name='WS_InternetContent' type='hidden' value=''> <input type='submit' name='dodsend' value=' 保 存 ' onClick=""document.form1.WS_InternetContent.value = frames.message.document.body.innerHTML;""> <input type='button' name='Submit' value='默认设置' onClick='javascript:startmode();'> <input name='reset' type='reset' value=' 重 置 '> <input type='button' name='Submit' value=' 返 回 ' onclick='javascript:history.go(-1);'></td></tr></form></table>"
end if
response.write "</td></tr></table>"
%>