<%@ 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.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzLevelNumber" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.mail.*" %>
<%@ include file="/sessionInfo.jsp"%>
<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 sFormID = SzConvert.toZeroStr(request.getParameter("FormID"));
		String sName = SzConvert.strWriteData(request.getParameter("name"));   
    String sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sSearchName = SzConvert.strWriteData(request.getParameter("txtSearchName"));
    String txtDate1 = SzConvert.strWriteData(request.getParameter("txtDate1"));
    String txtDate2 = SzConvert.strWriteData(request.getParameter("txtDate2")); 

    String sTable_type = "";
    //读取数据
    YjMass yjMass = new YjMass();
    YjMassInfo yjMassInfo = null;
    String sCond = "1=1";
    if (!isBarManager_SESSION) {
    	sCond = "FSDLID=" + iDLID_SESSION;
    }
    if (!sFormID.equals("")) {
    	sCond += " AND FSBDID=" + sFormID;
    }
    if (!txtDate1.equals("")) {
    	sCond += " AND FSSJ>='" + txtDate1 + "'";
    }
    if (!txtDate2.equals("")) {
    	sCond += " AND FSSJ<='" + txtDate2 + "'";
    }      
    String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
    if (sSortField.equals("")) { 
    	sSortField = "FSID";
    	iSortOrder = SzProperties.I_SortOrder_DESC;
    } 
    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }

    Iterator iter = yjMass.getArrayList(sCond, sSortField, iSortOrder, iCurrentPage, sSearch).iterator();

    SzPageInfo pageInfo = yjMass.getPageInfo();
    int iPageCount = pageInfo.getPageCount();
    int iRecordCount = pageInfo.getRecordCount();
    iCurrentPage = pageInfo.getCurrentPage();
    int i = 0;
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="name" value="<%=sName%>"> 
  <tr>
    <td>
      <%=SzPageHelp.addButtonSubmit()%>
      <%=SzPageHelp.deleteButton()%>
  录入时间<input type="text" class="txtClass120" name="txtDate1" value="<%=txtDate1%>"><%=SzPageHelp.calendarSelect2("formBar.txtDate1")%>-<input type="text" class="txtClass120" name="txtDate2" value="<%=txtDate2%>"><%=SzPageHelp.calendarSelect2("formBar.txtDate2")%>
  <input type="button" class="btnClass" value="查询" OnClick="javascript:FormSubmit(formBar, 'index.jsp');">
          
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="name" value="<%=sName%>">    
  <input type="hidden" name="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">  
  <tr class="trClassTitle">
    <td width="5"><input type="checkbox" name="chkCheckAll" OnClick="javascript:CheckAll(formList, chkCheckAll, 'chkId');"></td>
    <td><%=SzPageHelp.sortTitle("标题", "FSBT", sSortField, iSortOrder, strLevel_SESSION)%></td>  
    <td><%=SzPageHelp.sortTitle("发送人邮箱", "FSYJDZ", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("发送人姓名", "FSDLXM", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("录入时间", "FSSJ", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("收件人邮箱", "JSYJDZ", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("收件人信息", "JSSM", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("实际发送时间", "JSFSSJ", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("状态", "JSFSBZ", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td width="40">操作</td>
  </tr>
<% 
    String s = "";

    while (iter != null && iter.hasNext()) {
    		yjMassInfo = (YjMassInfo)iter.next();
        i++;  
        if (yjMassInfo.getJSFSBZ() == 0) {
        	s = "未发";
        } else {
        	s = "已发";
        }
%>
  <tr>
    <td width="5" title="<%=i%>"><input type="checkbox" name="chkId" id="chkId" value="<%=yjMassInfo.getFSID()%>"></td>
    <td><%=yjMassInfo.getFSBT()%>&nbsp;</td>
    <td><%=yjMassInfo.getFSYJDZ()%>&nbsp;</td>
    <td><%=yjMassInfo.getFSDLXM()%>&nbsp;</td>
    <td><%=yjMassInfo.getFSSJ()%>&nbsp;</td>
    <td><%=yjMassInfo.getJSYJDZ()%>&nbsp;</td>
    <td><%=yjMassInfo.getJSSM()%>&nbsp;</td>
    <td><%=yjMassInfo.getJSFSSJ()%>&nbsp;</td>
    <td><%=yjMass.getForeignMailStateName(yjMassInfo.getJSFSBZ())%>&nbsp;</td>
    <td>
      <a href="javascript:FormSubmit(formPage,'detail.jsp?OPERATOR=update&type=<%=sType%>&KEY=<%=yjMassInfo.getFSID()%>');">详情</a>           
    </td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 10));
%>

  </form>
</table>

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="txtSearchName" value="<%=sSearchName%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="name" value="<%=sName%>">   
  <input type="hidden" name="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">  
  <tr>
    <td align="right">
      <%@ include file="/share/page/page_include.jsp"%>
    </td>
  </tr>
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="type" value="<%=sType%>">
  <input type="hidden" name="page" value="<%=iCurrentPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>"> 
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="name" value="<%=sName%>">   
  <input type="hidden" name="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">  
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<%
    ////如果要使用日历控件，必须输出这个calendarFrame
    out.println(SzPageHelp.calendarFrame2());
%>

