<%@ 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 XH = SzConvert.strWriteData(request.getParameter("XH"));
	//流水号
	String LSH = SzConvert.strWriteData(request.getParameter("LSH"));
	//班级
	String BJ = SzConvert.strWriteData(request.getParameter("BJ"));
	//姓名
	String XM = SzConvert.strWriteData(request.getParameter("XM"));
	//条件sCond
	StringBuffer sCond = new StringBuffer("");
	//学号
	if (!XH.equals("")){
		sCond.append(" AND XXMC3='"+ XH +"'");
	}
	//姓名
	if (!XM.equals("")){
		sCond.append(" AND XXMC2='"+ XM +"'");
	}
	//流水号
	if (!LSH.equals("")){
		sCond.append(" AND B.XXMC32='"+ LSH +"'");
	}
	//班级
	if (!BJ.equals("")){
		sCond.append(" AND B.XXMC16='"+ BJ +"'");
	}
	
	String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
	int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
	if (sSortField.equals("")) { 
		sSortField = "XXMC3";
		iSortOrder = SzProperties.I_SortOrder_DESC;
	}
	String strSort = " ORDER BY "+ sSortField + (iSortOrder==SzProperties.I_SortOrder_DESC? " DESC":" ASC");
	//获取Charge对象
	Charge charge = new Charge();
	
	
	//获取学员信息
	ArrayList<String[]> chargeList = charge.getArrearageList(sCond.toString(),"","",strSort);
	int iSize = chargeList.size();
	//学员
	String[] chargeInfo = 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="XH" class="txtClassSearch" value="<%=XH %>">
  流水号<input type="text" name="LSH" class="txtClassSearch" value="<%=LSH %>">
  班别<input type="text" name="BJ" class="txtClassSearch" value="<%=BJ %>">
  姓名<input type="text" name="XM" class="txtClassSearch" value="<%=XM %>">
  <%=SzPageHelp.button("查询", "javascript:FormSubmit(formBar,'charge_list.jsp');")%>
</td>
</tr>
</form>
</table>

<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
<form name="formList" method="post">
	<input type="hidden" name="OPERATOR" value="add">   
	<input type="hidden" name="SzDLXM" value="<%=sDLXM_SESSION %>">
	<input type="hidden" name="SzDLID" value="<%=iDLID_SESSION %>">
	<input type="hidden" name="SzBMMC" value="<%=sBMMC_SESSION %>">
	<input type="hidden" name="SzBMID" value="<%=iBMID_SESSION %>">
	<input type="hidden" name="txtSortField" value="<%=sSortField%>"> 
	<input type="hidden" name="txtSortOrder" value="<%=iSortOrder%>">
	<input type="hidden" name="XH" value="<%=XH %>">
	<input type="hidden" name="XM" value="<%=XM %>">
	<input type="hidden" name="LSH" value="<%=LSH %>">
  	<input type="hidden" name="BJ" value="<%=BJ %>">
<tr class="trClassTitle">
	<!-- 信息ID,学号,报名时间,姓名,性别,户籍,班别,报名点,身份证号,数码回执,接送地址,招收人员 -->
	<td>序号</td>
	<td><%=SzPageHelp.sortTitle("学号", "XXMC3", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("姓名", "XXMC2", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("流水号", "XXMC32", sSortField, iSortOrder, strLevel_SESSION)%></td>
  	<td><%=SzPageHelp.sortTitle("班别", "XXMC16", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("应交学费", "YSXF", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("已交学费", "YJXF", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td>尚欠学费</td>
	<td><%=SzPageHelp.sortTitle("应交补考费", "YSBKF", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("已交补考费", "YJBKF", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td>尚欠补考费</td>
</tr>
<%
	//获取当前时间
	String time_str = SzDateHelp.getTimeStr();
	String sKey = "0";
	boolean isPass = false;
	int i = 0;
	double YSXF=0,YJXF=0,YSBKF=0,YJBKF=0;
	for (;i<iSize;i++){
		chargeInfo = chargeList.get(i);
		YSXF = Double.valueOf(chargeInfo[3]);
		YJXF = Double.valueOf(chargeInfo[4]);
		YSBKF = Double.valueOf(chargeInfo[5]);
		YJBKF = Double.valueOf(chargeInfo[6]);
%>
		<tr id="tr<%=i %>">
			<td><%=i+1 %></td>
			<td><a href="javascript:void(0);" onclick="javascript:OpenWin_Detail('charge_detail.jsp?ShowMode=open&post=ajaxPost&XH=<%=java.net.URLEncoder.encode(chargeInfo[2],"utf-8") %>');"><%=chargeInfo[2] %></a>&nbsp;</td>
			<td><%=chargeInfo[1] %>&nbsp;</td>
			<td><%=chargeInfo[8] %>&nbsp;</td>
			<td><%=chargeInfo[7] %>&nbsp;</td>
			<td><%=YSXF %>&nbsp;</td>
			<td><%=YJXF %>&nbsp;</td>
			<td><%=(YSXF - YJXF) %>&nbsp;</td>
			<td><%=YSBKF %>&nbsp;</td>
			<td><%=YJBKF %>&nbsp;</td>
			<td><%=(YSBKF - YJBKF) %>&nbsp;</td>
		</tr>
	<%
	}
	%>
	<input type="hidden" name="count" value="<%=i %>">
</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("../../"));
%>