<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Map" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.*" %>
<%@ page import="net.sz600.database.*" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="/sessionInfoWeixin.jsp"%>
<head>
<%@ include file="/share/oa_app_title.jsp"%>
<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" />
<link href="<%=strLevel_SESSION%>app/images/soarwell_css.css" rel="stylesheet" type="text/css" />
</head>
<%
    //获取提交的参数
    String sName = SzConvert.toZeroStr(request.getParameter("name"));
    String sFormID = SzConvert.toZeroStr(request.getParameter("FormID"));
    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"));
    BdAlertControl bdAlertControl = new BdAlertControl();
		String str[] = null;
	  String sCond = bdAlertControl.genCond(sFormID, txtDate1, txtDate2, iDLID_SESSION, isBarManager_SESSION);
    String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField"));
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder")));
    if (sSortField.equals("")) {
    	sSortField = "TXID";
    	iSortOrder = SzProperties.I_SortOrder_ASC;
    }
    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }

    int iPageSize = SzProperties.I_PageSize_APP;  
    Iterator iter = bdAlertControl.getArrayList(sCond, sSortField, iSortOrder, iCurrentPage, iPageSize, sSearch).iterator();

    SzPageInfo pageInfo = bdAlertControl.getPageInfo();
    int iPageCount = pageInfo.getPageCount();
    int iRecordCount = pageInfo.getRecordCount();
    iCurrentPage = pageInfo.getCurrentPage();
    int i = 0;
    
%>
<!-----上面的工具栏------>
<%@ include file="/app/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="name" value="<%=sName%>">
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <input type="hidden" name="page" value="<%=sPage%>">  
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>">
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <tr>
  	<td>
  提醒日期<input type="text" class="txtClassSearch" name="txtDate1" value="<%=txtDate1%>"><%=SzPageHelp.calendar2Select2("formBar.txtDate1")%>-<input type="text" class="txtClassSearch" name="txtDate2" value="<%=txtDate2%>"><%=SzPageHelp.calendar2Select2("formBar.txtDate2")%>
  <input type="button" class="btnClass" value="查询" OnClick="javascript:FormSubmit(formBar, 'indexMy.jsp');">
  	</td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="100%" border="0" cellspacing="3" cellpadding="3" style="border:#D7D7D9 1px solid;">

  <form name="formList" method="post">
  <input type="hidden" name="name" value="<%=sName%>">
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <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="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">  
<%
    BdAlert bdAlert = new BdAlert();
	String temp = "";
	String sClass = "";
    while (iter != null && iter.hasNext()) {
        str = (String[])iter.next();
        i++;
			temp = bdAlert.getAlertTypeName(SzConvert.toInt(str[7]));
			if (SzConvert.toInt(str[7]) == 2) {
				//循环
				temp += " " + bdAlert.getRepeatTypeName(SzConvert.toInt(str[8]));
			}
			if (SzConvert.toInt(str[7]) != 0 && SzConvert.toInt(str[7]) != 3) {
				temp += " 提前" + str[9] + " " + bdAlert.getBeforeTypeName(SzConvert.toInt(str[10]));
			}
			sClass = bdAlertControl.getClass(str[12], 3);
			
      if (i>1) {
  		  out.println("	<tr>");
  		  out.println("	<td height=\"5\" align=\"left\" background=\"../images/line.gif\"></td>");
  		  out.println("	</tr>\n"); 
        }			
%>
  <tr>
    <td width="100%"><span class="product_content"><b>[内容]</b><%=str[4]%></span></td>
  </tr>  
  <tr>
    <td width="100%"><span class="product_content"><b>[时间]</b><%=str[5]%></span></td>
  </tr>  
  <tr>
    <td width="100%"><span class="product_content"><b>[类型]</b><%=temp%></span></td>
  </tr> 
  <tr>
    <td width="100%"><span class="product_content"><b>[提醒]</b><%=str[11]%>次</span></td>
  </tr>       
  <tr>
    <td width="100%" class="<%=sClass%>"><span class="product_content"><b>[提醒时间]</b><%=str[12]%></span></td>
  </tr>    
<%
    }
    BdValueControl bdValueControl = new BdValueControl();
    out.println(bdValueControl.printTableBlankApp(i, iPageSize));
%>

  </form>
</table>

<!-----下面的工具栏------>
<table width="100%" border="0" cellspacing="3" cellpadding="3">
  <form name="formPage" method="post">  
  <input type="hidden" name="name" value="<%=sName%>">
  <input type="hidden" name="FormID" value="<%=sFormID%>">
  <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="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>"> 
  <%@ include file="/app/share/page_include.jsp" %>
  </form>
</table>
<BR><BR>


<script language="javascript" src="../../share/js/commonTool.js"></script>
<%
    ////如果要使用日历控件，必须输出这个calendarFrame
    out.println(SzPageHelp.calendar2Frame2());
%>
