<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Map" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.*" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.orginaze.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    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("", "", 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_DESC;
    }
    int iCurrentPage = 1;
    try {
        iCurrentPage =  Integer.parseInt(sPage);
    }catch(Exception e) {
    }

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

    SzPageInfo pageInfo = bdAlertControl.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="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>">
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <tr>
    <td>
    <% if (isSystemManager_SESSION || isBarManager_SESSION) { %>
      <% out.println(SzPageHelp.deleteButton()); %>
    <% } %>
  提醒日期<input type="text" class="txtClass80" name="txtDate1" value="<%=txtDate1%>"><%=SzPageHelp.calendar2Select2("formBar.txtDate1")%>-<input type="text" class="txtClass80" name="txtDate2" value="<%=txtDate2%>"><%=SzPageHelp.calendar2Select2("formBar.txtDate2")%>
  <input type="button" class="btnClass" value="查询" OnClick="javascript:FormSubmit(formBar, 'index.jsp');">
      
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="100%" border="1"  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="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">
  <tr class="trClassTitle">
  <!-- TXID,TXMC,TXBDID,TXXXID,TXNR,TXSJ,TXDLID,TXLX,TXXH,TXTQSJ,TXTQLX,TXCS,TXTXSJ  -->
    <td width="5"><input type="checkbox" name="chkCheckAll" OnClick="javascript:CheckAll(formList, chkCheckAll, 'chkId');"></td>
    <td><%=SzPageHelp.sortTitle("提醒内容", "TXNR", sSortField, iSortOrder)%></td>    
    <td width="120"><%=SzPageHelp.sortTitle("时间", "TXSJ", sSortField, iSortOrder)%></td>
    <td>提醒人员</td>
    <td>提醒类型</td>
    <td width="45">已提醒</td>
    <td width="120">提醒时间</td>
  </tr>
<%
    BdAlert bdAlert = new BdAlert();
		String temp = "";
    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]));
			}
%>
  <tr  onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td width="5" title="<%=i%>"><input type="checkbox" name="chkId" id="chkId" value="<%=str[0]%>"></td>
		<td><%=str[4]%>&nbsp;</td>
		<td><%=str[5]%>&nbsp;</td>
		<td><%=SzUserHelp.getInstance().getLoginName(str[6]," ")%>&nbsp;</td>
		<td><%=temp%>&nbsp;</td>
		<td><%=str[11]%>次</td>
		<td><%=str[12]%>&nbsp;</td>

  </tr>
<%
    }
    int iLen = 7;
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, iLen));
%>

  </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="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="txtDate1" value="<%=txtDate1%>">
  <input type="hidden" name="txtDate2" value="<%=txtDate2%>">  
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<%
    ////如果要使用日历控件，必须输出这个calendarFrame
    out.println(SzPageHelp.calendar2Frame2());
%>