<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
	<title>成绩分析</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/head.jsp" %>
	<%@include file="/WEB-INF/views/include/dialog.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/admin/exam/statistics">分段统计</a></li>
		<li><a href="${ctx}/admin/exam/rate">得分率</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/statistics" method="post" class="breadcrumb form-search">
		<input type="hidden" id="pageNumber" name="pageNumber" value="${query.pageNumber }"/>
		<input type="hidden" id="pageSize" name="pageSize" value="${query.pageSize }"/>
		<div>
			<label>科目</label>
			<select class="input-large" name="code" id="subject-select">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" data-level="${subject.level}" <c:if test="${subject.code==query.code}">selected</c:if>>${subject.code}-${subject.name}</option>
				</c:forEach>
			</select>
			<label>层次</label>
			<select class="input-small" name="level" id="level-select">
				<option value="">请选择</option>
				<c:forEach items="${levelList}" var="level">
				<option value="${level}" data-level="${level}" <c:if test="${level==query.level}">selected</c:if>>${level}</option>
				</c:forEach>
			</select>
			<label>专业类型</label>
			<select class="input-small" name="category" id="category-select">
				<option value="">请选择</option>
				<c:forEach items="${categoryList}" var="category">
				<option value="${category}" <c:if test="${category==query.category}">selected</c:if>>${category}</option>
				</c:forEach>
			</select>
			&nbsp;
			<label>是否包含缺考</label>
			<select class="input-mini" name="upload">
				<option value="">是</option>
				<option value="1" <c:if test="${upload!=null && upload==true}">selected</c:if>>否</option>
			</select>
            &nbsp;
            <label>是否包含违纪</label>
            <select class="input-mini" name="breach">
                <option value="">是</option>
                <option value="1" <c:if test="${breach!=null && breach==true}">selected</c:if>>否</option>
            </select>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<input id="export-button" class="btn" type="button" value="导出"/> 
		</div>
	</form>
	<tags:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>科目名称</th>
				<th>层次</th>
				<th>专业类型</th>
				<th>0-49</th>
				<th>0-49占比</th>
				<th>50-59</th>
				<th>50-59占比</th>
				<th>60-69</th>
				<th>60-69占比</th>
				<th>70-79</th>
				<th>70-79占比</th>
				<th>80-89</th>
				<th>80-89占比</th>
				<th>90-100</th>
				<th>90-100占比</th>
				<th>&lt;60</th>
				<th>&lt;60占比</th>
				<th>&ge;60</th>
				<th>&ge;60占比</th>
				<th>总数</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${statisticsVOs}" var="subject">
			<tr>
				<td>
					${subject.code}-${subject.name}&nbsp;${subject.remark}
				</td>
				<td>${subject.level}</td>
				<td>${subject.category}</td>
				<td>${subject.count0_49}</td>
				<td>${subject.percent0_49}%</td>
				<td>${subject.count50_59}</td>
				<td>${subject.percent50_59}%</td>
				<td>${subject.count60_69}</td>
				<td>${subject.percent60_69}%</td>
				<td>${subject.count70_79}</td>
				<td>${subject.percent70_79}%</td>
				<td>${subject.count80_89}</td>
				<td>${subject.percent80_89}%</td>
				<td>${subject.count90_100}</td>
				<td>${subject.percent90_100}%</td>
				<td>${subject.count0_60}</td>
				<td>${subject.percent0_60}%</td>
				<td>${subject.count60_100}</td>
				<td>${subject.percent60_100}%</td>
				<td>${subject.studentCount}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
function page(n,s){
	$("#pageNumber").val(n);
	$("#pageSize").val(s);
	$("#searchForm").attr('action','${ctx}/admin/exam/statistics');
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr('action','${ctx}/admin/exam/statistics');
	$("#searchForm").submit();
	return false;
}
$("#export-button").click(function(){
	$("#searchForm").attr("action","${ctx}/admin/exam/statistics/export");
	$("#searchForm").submit();
});
</script>	
</body>
</html>