<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.system.SzOut" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.drivingSchool.*" %>
<%
    //获取提交的参数
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    
    String sSubjectOrder = SzConvert.strWriteData(request.getParameter("subjectOrder"));	 //科目
    String sSearchBegin = SzConvert.strWriteData(request.getParameter("txtSearchBegin"));
	String sSearchEnd = SzConvert.strWriteData(request.getParameter("txtSearchEnd"));
	//教练
	int iSelectCoach = SzConvert.toInt(request.getParameter("selectCoach"));
	String selectWeek = SzConvert.toZeroStr(request.getParameter("selectWeek"));
	//学号
	String XH = SzConvert.strWriteData(request.getParameter("XH"));
	//流水号
	String LSH = SzConvert.strWriteData(request.getParameter("LSH"));
%>
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <!-- 传递数据 -->
  <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%>">
  <input type="hidden" name="txtShijianduan" value="">
  <input type="hidden" name="txtDate" value="">
  <input type="hidden" name="selectCoach" value="<%=iSelectCoach%>">
  <input type="hidden" name="subjectOrder" value="<%=sSubjectOrder%>">
  <input type="hidden" name="selectWeek" value="<%=selectWeek%>">
</form>
<%
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
    ToSetUpCourse toSetUpCourse = new ToSetUpCourse();
    boolean flag = false;
    String sUrl = "index.jsp?subjectOrder=" + sSubjectOrder;
    String sMessage = "";
    if (sOPERATOR.equals("delete")) {
    	//sUrl = "courseList.jsp?subjectOrder=" + sSubjectOrder;
        String id_str[] = request.getParameterValues("chkId");
        flag = toSetUpCourse.delete(id_str);
    } else if (sOPERATOR.equals("deleteFD")){
    	sUrl = "zb_index.jsp?subjectOrder=" + sSubjectOrder;
    	String id_str[] = request.getParameterValues("chkId");
        flag = toSetUpCourse.delete(id_str);
    }
    sMessage = SzOut.getMessage();

    if (flag) {
        out.println(SzPageHelp.jsAlert("操作成功"));
        //out.println(SzPageHelp.jsGoUrl(sUrl));
        out.println(SzPageHelp.jsFormSubmit("formHidden",sUrl));
    } else {
        out.println(SzPageHelp.jsAlertBack(sMessage));
    }
%>