<%@ 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>
<base target="_self">
<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>
<%
	//学号
	int iSelectSubject = SzConvert.toInt(request.getParameter("selectSubject"));
	Subject subjectClass = new Subject();
	String sSubjectName = subjectClass.getSubjectName(iSelectSubject);
	
	String txtShijianduan = SzConvert.toZeroStr(request.getParameter("txtShijianduan"));
	String txtDate = SzConvert.toZeroStr(request.getParameter("txtDate"));
	
	//条件sCond
	StringBuffer sCond = new StringBuffer(" ");
	
	//以下几种状态可练车
	//sCond.append(" AND XXMC37 in ('桩考教练已分配','桩考练车','桩考可考','桩考预约','桩考不及格')");
	Exam exam = new Exam();
	sCond.append(" AND BMID not in ( select KCXXMC22 from BD_DRIVINGSCHOOL_TOSETUPCOURSE where KCXXMC5='' AND KCXXMC8='");
	sCond.append(txtDate);
	sCond.append("' and KCXXMC9='");
	sCond.append(txtShijianduan);
	sCond.append("' and KCXXMC13='");
	sCond.append(iSelectSubject);
	sCond.append("' ");
	sCond.append(") ");	
	
	String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
  int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
  if (sSortField.equals("")) { 
    	sSortField = "BMBH";
    	iSortOrder = SzProperties.I_SortOrder_ASC;
  }
	sCond.append(" ORDER BY "+ sSortField + (iSortOrder==SzProperties.I_SortOrder_DESC? " DESC":" ASC"));
	//获取Vehicle对象
  Student student = new Student();
	//获取学员信息
	ArrayList<String[]> fendianList = student.getFenDianList(sCond.toString());
	int iSize = fendianList.size();
	//学员
	String[] fendianInfo = null;
	ToSetUpCourse toSetUpCourse = new ToSetUpCourse();
	
%>
<!-----上面的工具栏------>
<form name="formList" method="post">
<%@ include file="/share/titleDialog.jsp"%>

<table width="100%">
  <tr>
    <td>
      科目：<B><%=sSubjectName%></B>    
     <input type="hidden" name="selectSubject" value="<%=iSelectSubject%>">   
     <input type="hidden" name="txtShijianduan" value="<%=txtShijianduan%>">
     <input type="hidden" name="selectCoachName">
     <input type="hidden" name="selectSubjectName" value="<%=sSubjectName%>">
  		<input type="hidden" name="KSKM" value="<%=sSubjectName%>">
 	 	<input type="hidden" name="KSKMID" value="<%=iSelectSubject %>">     
  	 <input type="hidden" name="txtDate" value="<%=txtDate%>">    
      当前日期：<b><%=txtDate%></b>
      当前时间段：<b><%=txtShijianduan%></b>
 
      <br>
     <%//=SzPageHelp.button("查询", "javascript:FormSubmit(formList,'student_select.jsp');")%>
		 <%=SzPageHelp.closeButton() %>
		 <%=SzPageHelp.button("btnClassLong","批量保存当前课程安排", "javascript:ShenHeSubmit(formList,'control.jsp');")%>
    </td>
  </tr>
</table>
<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <input type="hidden" name="OPERATOR" value="addFD"> 
  <input type="hidden" name="SzDLXM" value="<%=sDLXM_SESSION %>">
  <input type="hidden" name="SzDLID" value="<%=iDLID_SESSION %>">
  <input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
  <input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
  <tr>
	<td>
<%
	String sKey = "";
	
	for (int i = 0;i<iSize;i++){
		fendianInfo = fendianList.get(i);
		sKey = fendianInfo[0];
	%>
		<input type="hidden" name="fendianMC<%=sKey %>" value="<%=fendianInfo[1]%>"> 
		<span style="width:150;"><input title="<%=i+1 %>" type="checkbox" name="fendianID" value="<%=sKey %>"><%=fendianInfo[1] %></span>
	<%
	}
%>  
	</td>
  </tr>
</table>
</form>

<!-----下面的工具栏------>
<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");	
  }  

	function ShenHeSubmit(formName,sUrl){
		if (!confirm("确定是否要批量保存?")){
			return false;
		}
		//科目名称
		formName.action = sUrl;
		formName.submit();
	}
	  		
</script>
