<%@ 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="/sessionInfoWeixin.jsp"%>
<% 
  String strLevel = "../"; 
%> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
<%@ include file="/share/oa_app_title.jsp"%>
 <link href="<%=strLevel_SESSION%>app/images/soarwell_css.css" rel="stylesheet" type="text/css" />
 <script type="text/javascript" src="<%=strLevel_SESSION%>share/js/commonTool.js"></script> 
</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") || sOPERATOR.equals("manage")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    //读取数据
    YjMailInfo yjMailInfo = null;
    YjMailNew yjMail = new YjMailNew();
    YjMailReceive yjMailReceive = new YjMailReceive();
    if (!sKEY.equals("0")) {
        //阅读邮件，同时判断是否需要回执：先改变读的状态，再读信息
        if (!sOPERATOR.equals("manage")) {
        	yjMailReceive.readMail(Integer.parseInt(sKEY), iDLID_SESSION);
        }
        
        yjMailInfo = (YjMailInfo)yjMail.getInfoByKey(Integer.parseInt(sKEY));
        //收件人
        yjMailInfo.setJSDLXM(SzUserHelp.getLoginName(yjMailReceive.getReceiveUserId(yjMailInfo.getFSID(), yjMail.intReceiveType)));
        yjMailInfo.setCSDLXM(SzUserHelp.getLoginName(yjMailReceive.getReceiveUserId(yjMailInfo.getFSID(), yjMail.intReceiveTypeCS)));
        yjMailInfo.setMSDLXM(SzUserHelp.getLoginName(yjMailReceive.getReceiveUserId(yjMailInfo.getFSID(), yjMail.intReceiveTypeMS)));
        yjMailInfo.setJSYJDZ(yjMailReceive.getReceiveUserId(yjMailInfo.getFSID(), yjMail.intReceiveTypeYJ));
        
    }
    if (yjMailInfo == null) {
        yjMailInfo = new YjMailInfo();
    } 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="FSID" value="<%=yjMailInfo.getFSID()%>">
  <input type="hidden" name="YJBZ" value="<%=yjMailInfo.getYJBZ()%>">
  <input type="hidden" name="type" value="<%=sType%>">
<%@ include file="/app/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%
      if (!sOPERATOR.equals("manage")) {
    	  out.println(SzPageHelp.button("回复","javascript:FormSave(formUpdate, 'update.jsp');"));    	  
    	  out.println(SzPageHelp.button("转发","javascript:FormTransfer(formUpdate, 'update.jsp');"));
      }
      %>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table height="227" width="100%" border="0" cellspacing="3" cellpadding="3" style="border:#D7D7D9 1px solid;">
  <tr>
    <td><span class="product_content"><b>[发件人]</b><%=yjMailInfo.getFSDLXM()%>&nbsp;<%=yjMailInfo.getFSYJDZ()%></span></td>
  </tr> 
  <tr>
    <td><span class="product_content"><b>[发件时间]</b><%=yjMailInfo.getFSSJ()%></span></td>
  </tr>  
  <% if (!yjMailInfo.getJSDLXM().equals("")) { %> 
  <tr>
    <td><span class="product_content"><b>[收件人]</b><%=yjMailInfo.getJSDLXM()%></span></td>
  </tr>   
  <% } %>
  <% if (!yjMailInfo.getCSDLXM().equals("")) { %> 
  <tr>
    <td><span class="product_content"><b>[抄送人]</b><%=yjMailInfo.getCSDLXM()%></span></td>
  </tr>      
  <% } %>
  <% if (!yjMailInfo.getMSDLXM().equals("")  && yjMailInfo.getFSDLID() == iDLID_SESSION ) { %>   
  <tr>
    <td><span class="product_content"><b>[密送人]</b><%=yjMailInfo.getMSDLXM()%></span></td>
  </tr>      
  <% } %>
  <% if (!yjMailInfo.getJSYJDZ().equals("")) { %>   
  <tr>
    <td><span class="product_content"><b>[收件邮箱]</b><%=yjMailInfo.getJSYJDZ()%></b>&nbsp;<%=yjMail.getForeignMailStateName(yjMailInfo) %></span></td>
  </tr> 
  <% } %>    
  <tr>
    <td><span class="product_content"><b>[邮件标题]</b><%=yjMailInfo.getFSBT()%></span></td>
  </tr>      
  <tr>
    <td><span class="product_content"><b>[邮件内容]</b><%=yjMailInfo.getFSNR()%></span></td>
  </tr> 
  <tr>
    <td height="8" align="left" background="../images/line.gif"></td>
  </tr> 
  <tr>
    <td><%out.println(SzPageHelp.detailAnnexNew2(yjMail.strAnnexTable, "" + yjMailInfo.getFSID(), strLevel_SESSION));%></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) {
    formName.OPERATOR.value = "return";
    formName.action = url;
    formName.submit();
  }
  
  function FormTransfer(formName, url) {
    formName.OPERATOR.value = "transfer";
    formName.action = url;
    formName.submit();
  }   
</script>
</body>
