<%@ 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>
<%!
public String decode(String str,String code){
	try {
		str = str == null? "":str;
		return java.net.URLDecoder.decode(str,code);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return str == null? "":str;
	}
}
%>
<%

	String post = SzConvert.toSpaceStr(request.getParameter("post"));
	boolean isAjax = post.equals("ajaxPost")? true:false;
	//显示模式
	String showMode = SzConvert.strWriteData(request.getParameter("ShowMode"));
	//学号
	String XH = isAjax? decode(request.getParameter("XH"),"UTF-8"):SzConvert.strWriteData(request.getParameter("XH"));
	//姓名
	String XM = isAjax? decode(request.getParameter("XM"),"UTF-8"):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 +"'");
	}
	
	String sSortField = SzConvert.toSpaceStr(request.getParameter("txtSortField")); 
	int iSortOrder    = Integer.parseInt(SzConvert.toZeroStr(request.getParameter("txtSortOrder"))); 
	if (sSortField.equals("")) { 
		sSortField = "LRSJ";
		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.getChargeDetailList(sCond.toString(),sCond.toString(),strSort);
	int iSize = chargeList.size();
	//学员
	String[] chargeInfo = null;

%>
<!-----上面的工具栏------>
<%if (!showMode.startsWith("open")){ %>
<%@ 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%>"> 
<input type="hidden" name="ShowMode" value="<%=showMode%>">
<tr>
<td>
  学号<input type="text" name="XH" class="txtClassSearch" value="<%=XH %>">
  姓名<input type="text" name="XM" class="txtClassSearch" value="<%=XM %>">
  <%=SzPageHelp.button("查询", "javascript:FormSubmit(formBar,'charge_detail.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="ShowMode" value="<%=showMode%>">
<input type="hidden" name="XH" value="<%=XH %>">
<input type="hidden" name="XM" value="<%=XM %>">
<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("款项", "JE", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("条目", "XXMC6", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("款项类型", "XXMC13", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("时间", "LRSJ", sSortField, iSortOrder, strLevel_SESSION)%></td>
	<td><%=SzPageHelp.sortTitle("收款类型", "SKLX", sSortField, iSortOrder, strLevel_SESSION)%></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);
%>
		<tr id="tr<%=i %>">
			<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=<%=chargeInfo[0] %>');"><%=chargeInfo[2] %></a>&nbsp;</td>
			<td><%=chargeInfo[1] %>&nbsp;</td>
			<td><%=chargeInfo[3] %>&nbsp;</td>
			<td><%=chargeInfo[4] %>&nbsp;</td>
			<td><%=chargeInfo[5] %>&nbsp;</td>
			<td><%=chargeInfo[6] %>&nbsp;</td>
			<td><%=chargeInfo[7] %>&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("../../"));
%>