<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.mail.*" %>
<%@ include file="/sessionInfo.jsp"%>
<% 
  String strLevel = "../../"; 
%> 
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sTable_type = "SZKC_CPFL";
%>
<%
    SzData szData = null;
    SzDataInfo szDataInfo = null;

    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    String sReadonly = "";
    boolean bReadonly = false;
    if (sOPERATOR.equals("detail")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    //读取数据
    YjServerInfo yjServerInfo = null;
    YjServer yjServer = new YjServer();
    if (!sKEY.equals("0")) {
        yjServerInfo = (YjServerInfo)yjServer.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (yjServerInfo == null) {
        yjServerInfo = new YjServerInfo();
        yjServerInfo.setFWDK(25);
    } else {
    }

%>

<body>
<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="FWID" value="<%=yjServerInfo.getFWID()%>">
  <input type="hidden" name="type" value="<%=sType%>">
<%@ include file="/share/title.jsp"%>
<table width="100%">
  <tr>
    <td>
    <% if (!bReadonly) { %>
      <%=SzPageHelp.saveButton()%>
    <% } %>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">邮件后缀</td>
    <td><input type="text" name="FWDZ" class="txtClass2" value="<%=yjServerInfo.getFWDZ()%>" <%=sReadonly%> ></td>
  </tr>
  <!-- 
  <tr>
    <td class="tdClassTitle">pop3地址</td>
    <td><input type="text" name="FWPOP" class="txtClass2" value="<%=yjServerInfo.getFWPOP()%>" <%=sReadonly%> >
        <%//=SzPageHelp.button("同上","javascript:copy(formUpdate.FWPOP, formUpdate.FWDZ);") %>   
    </td>
  </tr>
     -->
  <tr>
    <td class="tdClassTitle">smtp地址</td>
    <td><input type="text" name="FWSMTP" class="txtClass350" value="<%=yjServerInfo.getFWSMTP()%>" <%=sReadonly%> >
   	端口<input type="text" name="FWDK" class="txtClass60" value="<%=yjServerInfo.getFWDK()%>" <%=sReadonly%> > 
              
    </td>
  </tr>

  <tr>
    <td class="tdClassTitle">说明</td>
    <td><input type="text" name="FWSM" class="txtClass2" value="<%=yjServerInfo.getFWSM()%>" <%=sReadonly%> ></td>
  </tr>  
  <tr>
    <td class="tdClassTitle">验证</td>
    <td><%=SzPageHelp.checkbox("FWYZ",yjServerInfo.getFWYZ()) %>
        发送邮件的时候是否需要验证
    </td>
  </tr>
  <tr>
    <td class="tdClassTitle">设置范例</td>
    <td>
    	邮箱域名: qq.com<br>    	
    	pop3地址: pop3.com<br>
    	smtp地址: smtp.com<br>
    	端口一般默认为25<br>
    	OA系统中个人“外部邮箱帐号”可接收和发送外部邮件，前提是外部邮箱设置有对应的smtp和pop3设置<br>
    	
    </td>
  </tr>
</table>


</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.FWDZ, "邮件后缀")) {
      return false;
    }
    /*
    if (!notSpace(formName.FWPOP, "pop3地址")) {
      return false;
    }
    */
    if (!notSpace(formName.FWSMTP, "smtp地址")) {
      return false;
    }
    if (!notNum(formName.FWDK, "端口")) {
      return false;
    }

    formName.action = url;
    formName.submit();
  }
  
  function copy(obj1, objSource) {
	obj1.value = objSource.value;
  }
</script>
</body>
