<%@ 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.online.*" %>
<%@ 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 sRefresh = SzConvert.strWriteData(request.getParameter("refresh"));
    String sOPERATOR = SzConvert.strWriteData(request.getParameter("OPERATOR"));
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));

    String sReadonly = "readonly";
    boolean bReadonly = true;
    //读取数据
	OlMessageControl olMessageControl = new OlMessageControl();
    OlMessageInfo messageInfo = null;
    //getInfo的时候会更新map，所以下一条的数据已经改变了。在更新map前先读上一条、下一条
    int iKEY = SzConvert.toInt(sKEY); 
    String sPrioButton = olMessageControl.prioButton(iKEY, iDLID_SESSION);
    String sNextButton = olMessageControl.nextButton(iKEY, iDLID_SESSION);
 
    messageInfo = (OlMessageInfo)olMessageControl.readMessage(iKEY);
    if (messageInfo == null) {
    	messageInfo = new OlMessageInfo();
    }
    String sTableAnnex = "SZJS_XXFJ";
    //2010-03-30 修改为能支持换行、空格。
    String sContent = messageInfo.getFSNR();
    sContent = sContent.replaceAll("\n", "<br>");
    sContent = sContent.replaceAll(" ", "&nbsp;");
%>

<body>
<!-----上面的工具栏------>
<form name="formUpdate" method="post" ENCTYPE="multipart/form-data">
  <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="type" value="<%=sType%>">

<table width="100%">
  <tr>
    <td align="center">

    </td>
  </tr>
</table>
<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0" align="center">
  <tr>
    <td class="tdClassTitleB">发送人员</td>
    <td><%=messageInfo.getFSDLXM()%>&nbsp;</td>
    <td class="tdClassTitleB">发送时间</td>    
    <td><%=messageInfo.getFSSJ()%>&nbsp;</td>    
  </tr>  
  <tr>
    <td class="tdClassTitleB">发送标题</td>
    <td colspan="3">
      <%=messageInfo.getFSBT()%>
      <%=olMessageControl.faceTag(messageInfo.getFSBQ())%>&nbsp;
    </td>
  </tr>
  <tr>
    <td class="tdClassTitleB">发送内容</td>
    <td colspan="3" height="100" valign="top"><%=sContent%>&nbsp;</td>
  </tr>
  <% if (ReadOaConfig.getAlert_button().indexOf("weixin") >=0) { %>
  <tr>
    <td class="tdClassTitleB">微信状态</td>
    <td colspan="3"><%=olMessageControl.getWeixinStateName(messageInfo.getJSWJJ(), messageInfo.getJSDLID())%>&nbsp;</td>
  </tr>  
  <% } %>
  <tr>
    <td class="tdClassTitleB">发送文件</td>
    <td colspan="3">
      <%//=SzPageHelp.annex(sTableAnnex, "" + messageInfo.getFSID(), bReadonly)%>
      <%=SzPageHelp.detailAnnexNew2(sTableAnnex, "" + messageInfo.getFSID(), strLevel_SESSION)%>
    </td>
  </tr>
</table>
<table width="100%">
  <tr>
    <td align="center">
	<%
  	out.println(sPrioButton);
	 	out.println(sNextButton);
	 	if (messageInfo.getFSDLID()>0) {
	 	out.println(SzPageHelp.button("回复","ReplyMessageWin('" +sKEY + "')"));
	 	}
	 	out.println(SzPageHelp.closeButton());
	%>
    </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 (!notNum(formName.FSDLID, "发送人ID")) {
      return false;
    }
    if (!notSpace(formName.FSBT, "发送标题")) {
      return false;
    }

    formName.action = url;
    formName.submit();
  }
  
  function ReceiveMessageWin(vJSID) {
    	var vUrl = "../message/receive.jsp?OPERATOR=receive&KEY=" + vJSID;
	  	document.location.href=vUrl;  
  }
  
  function ReplyMessageWin(vJSID) {
    	var vUrl = "../message/send.jsp?OPERATOR=reply&KEY=" + vJSID;
	  	document.location.href=vUrl;  
  }
  
  var vRefresh = "<%=sRefresh%>";
  if (vRefresh == "true") {
	window.opener.location.reload();
  }
</script>
</body>
