<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzDateHelp"%>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.drivingSchool.*" %>
<%@ 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">
<script language="javascript" src="../../share/js/commonTool.js"></script>
</head>
<%
	
	//查询时间段
	String sSearchBegin = SzConvert.strWriteData(request.getParameter("txtSearchBegin"));
	String sSearchEnd = SzConvert.strWriteData(request.getParameter("txtSearchEnd"));
	//获取选择的部门信息
	String BMID = SzConvert.toZeroStr(request.getParameter("BMID"));
	String BMMC = SzConvert.strWriteData(request.getParameter("BMMC"));
	//学号
	String XH = SzConvert.strWriteData(request.getParameter("XH"));
	//流水号
	String LSH = SzConvert.strWriteData(request.getParameter("LSH"));
	//条件sCond
	StringBuffer sCond = new StringBuffer("");
	//如果开始时间和结束时间都为空，就默认为当前月
	if(sSearchBegin.equals("")){
		sSearchBegin = SzDateHelp.dateToYMD(SzDateHelp.getFirstDateMonth());
	}
	if (sSearchEnd.equals("")){
		sSearchEnd = SzDateHelp.dateToYMD(SzDateHelp.getLastDateMonth());
	}
	//查询的结束时间
	String searchEnd = SzDateHelp.dateToYMD(SzDateHelp.nextDay(SzDateHelp.stringToDate(sSearchEnd)));
	
	if (!sSearchBegin.equals("")) {
        sCond.append(" AND XXMC24>='" + sSearchBegin + "'");
    }
    if (!searchEnd.equals("")) {
        sCond.append(" AND XXMC24<'" + searchEnd + "'");
    }
	
	
	if (!BMMC.equals("")){
		sCond.append(" AND XXMC6='"+BMMC+"'");
	}
	//学号
	if (!XH.equals("")){
		sCond.append(" AND XXMC3='"+ XH +"'");
	}
	//流水号
	if (!LSH.equals("")){
		sCond.append(" AND XXMC32='"+ LSH +"'");
	}
	sCond.append(" AND XXMC37='毕业领证'");
	
	String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
    int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
    if (sSortField.equals("")) { 
    	sSortField = "XXMC49";
    	iSortOrder = SzProperties.I_SortOrder_DESC;
    }
	sCond.append(" ORDER BY "+ sSortField + (iSortOrder==SzProperties.I_SortOrder_DESC? " DESC":" ASC"));
	//获取Vehicle对象
    Student student = new Student();
	//信息ID,流水号,学号,报名时间,姓名,性别,户籍,班别,报名点,身份证号,数码回执,接送地址,招收人员
	String[] fields = new String[]{"XXMC1","XXMC3","XXMC32","XXMC24","XXMC2","XXMC40","XXMC5","XXMC16","XXMC6","XXMC8","XXMC10","XXMC28","XXMC23",
			"XXMC21","XXMC25","XXMC47","XXMC48"};
	
	//获取学员信息
	ArrayList<String[]> studentList = student.getXueYuanList(fields,sCond.toString());
	int iSize = studentList.size();
	//学员
	String[] studentInfo = null;
	
%>
<!-----上面的工具栏------>
<%@ include file="/docEngine/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <tr>
    <td>
      报名点<input type="text" name="BMMC" class="txtClassSearch" value="<%=BMMC%>">
      学号<input type="text" name="XH" class="txtClassSearch" value="<%=XH %>">
      流水号<input type="text" name="LSH" class="txtClassSearch" value="<%=LSH %>">
      开始<input type="text" name="txtSearchBegin" class="txtClassSearch" value="<%=sSearchBegin%>">
      <%=SzPageHelp.calendar2Select("../../","formBar.txtSearchBegin")%>
      结束<input type="text" name="txtSearchEnd" class="txtClassSearch" value="<%=sSearchEnd%>">
      <%=SzPageHelp.calendar2Select("../../","formBar.txtSearchEnd")%>
      <%=SzPageHelp.button("查询", "javascript:FormSubmit(formBar,'lingzhengIndex.jsp');")%>
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="1500" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <input type="hidden" name="BMMC" value="<%=BMMC%>">
  <input type="hidden" name="XH" value="<%=XH %>">
  <input type="hidden" name="LSH" value="<%=LSH %>">
  <input type="hidden" name="txtSearchBegin" value="<%=sSearchBegin%>">
  <input type="hidden" name="txtSearchEnd" value="<%=sSearchEnd%>">
  <tr class="trClassTitle">
  	<!-- 信息ID,学号,报名时间,姓名,性别,户籍,班别,报名点,身份证号,数码回执,接送地址,招收人员 -->
  	<td>序号</td>
  	<td><%=SzPageHelp.sortTitle("学号", "XXMC3", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("流水号", "XXMC32", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("报名时间", "XXMC24", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("姓名", "XXMC2", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("性别", "XXMC40", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("户籍", "XXMC5", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("班别", "XXMC16", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("报名点", "XXMC6", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("身份证号", "XXMC8", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("数码回执", "XXMC10", sSortField, iSortOrder, strLevel_SESSION)%></td>
    <td><%=SzPageHelp.sortTitle("接送地址", "XXMC28", sSortField, iSortOrder, strLevel_SESSION)%></td>
    
  </tr>
<%
	String sKey = "";
	for (int i = 0;i<iSize;i++){
		studentInfo = studentList.get(i);
		sKey = studentInfo[0];
	%>
	<tr>
		<td><%=i+1 %></td>
		<td><a href="javascript:void(0);" onclick="javascript:OpenWin_Detail('../../share/formEngine2/update.jsp?OPERATOR=detail&FormID=1384&type=0&ShowMode=open&KEY=<%=sKey %>');"><%=studentInfo[1] %></a>&nbsp;</td>
		<td><%=studentInfo[2] %>&nbsp;</td>
		<td><%=SzConvert.truncate(studentInfo[3],10) %>&nbsp;</td>
		<td><%=studentInfo[4] %>&nbsp;</td>
		<td><%=studentInfo[5] %>&nbsp;</td>
		<td><%=studentInfo[6] %>&nbsp;</td>
		<td><%=studentInfo[7] %>&nbsp;</td>
		<td><%=studentInfo[8] %>&nbsp;</td>
		<td><%=studentInfo[9] %>&nbsp;</td>
		<td><%=studentInfo[10] %>&nbsp;</td>
		<td><%=studentInfo[11] %>&nbsp;</td>
	</tr>
	<%
	}
%>

  </form>
</table>

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" type="text/javascript">
    function OpenWin_Detail(sUrl) {
  		window.open(sUrl,"","left=100,top=50,width=800,height=600,status=yes,scrollbars=yes,resizable=yes");	
  	}

</script>
<%
    ////如果要使用日历控件，必须输出这个calendarFrame
    out.println(SzPageHelp.calendar2Frame("../../"));
%>