<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ 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">
	<script type="text/javascript">
		function FCKeditor_OnComplete(editorInstance) {
			window.status = editorInstance.Description;
		}
	</script>
	<script type="text/javascript" src="<%=strLevel%>share/ckeditor/ckeditor.js"></script>
</head>
<%
    //获取提交的参数
    String sFormID = SzConvert.toZeroStr(request.getParameter("FormID"));
		String sName = SzConvert.strWriteData(request.getParameter("name"));
    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 = "send";
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    String sReadonly = "";
    boolean bReadonly = false;
    if (sOPERATOR.equals("detail")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    //读取数据
    YjMassInfo yjMassInfo = null;
    YjMass yjMass = new YjMass();
    if (!sKEY.equals("0")) {
        yjMassInfo = (YjMassInfo)yjMass.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (yjMassInfo == null) {
        yjMassInfo = new YjMassInfo();
        yjMassInfo.setFSDLID(0);
        yjMassInfo.setFSDLXM(sDLXM_SESSION);
        yjMassInfo.setFSFSSJ(SzDateHelp.getTimeStr());
    } else {
    }
    String s = "";

    
%>

<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="<%=yjMassInfo.getFSID()%>">
  <input type="hidden" name="FSDLID" value="<%=yjMassInfo.getFSDLID()%>" >
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="name" value="<%=sName%>">   
<%@ include file="/share/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="750" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">邮件标题</td>
    <td colspan="3"><%=yjMassInfo.getFSBT()%></td>
  </tr>
  <tr>
    <td class="tdClassTitle">预定发送时间</td>
    <td><%=yjMassInfo.getFSFSSJ()%>
    </td>
    <td class="tdClassTitle">发送人姓名</td>
    <td><%=yjMassInfo.getFSDLXM()%></td>
  </tr>   
  <tr>
    <td class="tdClassTitle">发送人邮箱</td>
    <td colspan="3"><%=yjMassInfo.getFSYJDZ()%>
    </td>
  </tr>  
  <tr>
    <td class="tdClassTitle">收件人邮箱</td>
    <td colspan="3"><%=yjMassInfo.getJSYJDZ()%>
    </td>
  </tr>   
  <tr>
    <td class="tdClassTitle">收件人信息</td>
    <td colspan="3"><%=yjMassInfo.getJSSM()%>
    </td>
  </tr>   
  <tr>
    <td class="tdClassTitle">实际发送时间</td>
    <td><%=yjMassInfo.getJSFSSJ()%>
    </td>
    <td class="tdClassTitle">发送状态</td>
    <td>
    <%
    s = "";
    if (yjMassInfo.getJSFSBZ() == 0) {
    	s = "未发";
    } else {
    	s = "已发";
    } 
    out.println(s);
    %>
    </td>
  </tr>
</table>  
<table width="750" border="0" cellpadding="1" cellspacing="0">
  <tr>
    <td valign="top"> 
		  <textarea id="FSNR" name="FSNR"><%=yjMassInfo.getFSNR()%></textarea>       
    </td>
  </tr>
</table>
	<script type="text/javascript">
    CKEDITOR.replace('FSNR', {
    	filebrowserBrowseUrl: '../share/ckeditor/uploader/browse.jsp',
    	filebrowserUploadUrl: '../share/ckeditor/uploader/upload.jsp'
    });
   </script>
</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.FSBT, "邮件标题")) {
      return false;
    }
    if (!notSpace(formName.FSYJDZ, "发送人邮箱")) {
      return false;
    }
    if (formName.receive1.length == 0) {
    	alert("请至少选择一个接收人");
    	return false;
    }

		SelectAllOption(formName.receive1);
		SelectAllOption(formName.receive2);
    formName.action = url;
    formName.submit();
  }
  
  function SelectWin() {
    var url = "index_select.jsp?FormID=<%=sFormID%>&name=<%=sName%>";
    //window.showModalDialog(url,window,"status=no;dialogWidth=750px;dialogHeight=580px");  
    window.open(url,"","left=100,top=100,scrollbars=yes,resizable=yes,status=yes,width=750,height=580");  
    
  }  
  
  function addOption1(text, value) {
  	var oSelect = formUpdate.receive1;
  	oSelect.add(new Option(text, value));
  }
  
  function addOption2(text, value) {
  	var oSelect = formUpdate.receive2;
  	oSelect.add(new Option(text, value));
  }  
  
  function Remove() {
  	var oSelect1 = formUpdate.receive1;
  	var oSelect2 = formUpdate.receive2;
  	var iLen = oSelect1.length;
  	for (var i=iLen-1; i>-1; i--) {
      if (oSelect1.options[i].selected) {
        oSelect1.options[i]=null;
        oSelect2.options[i]=null;
      }
    }
  }
  
  //把整个select的option都选上，这个在form.submit之前要调用，要不然request不到
  function SelectAllOption(oSelect) {
    var iLen = oSelect.length;
    for (var i=0; i<iLen; i++){
        oSelect.options[i].selected = true;
    }
  }  
</script>
</body>
<%=SzPageHelp.calendarFrame2()%>
