<%@ 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 data-i18n-text="report.subject">总量统计</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/reportSubject" data-i18n-text="report.subject">课程总量统计</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/reportSubject" 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 data-i18n-text="report.subject.name">科目</label>
	        <select class="input-large" id="subjectCode" name="subjectCode">
		        <option value="">请选择</option>
	            <c:forEach items="${subjectList }" var="subject">
	                <option value="${subject.code }"
	                        <c:if test="${query.subjectCode eq subject.code }">selected</c:if>>${subject.code}-${subject.name}</option>
	            </c:forEach>
	        </select>
			&nbsp;
	        <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()" data-i18n-value="report.subject.search"/>
	        &nbsp;
			<input id="export-button" class="btn" type="button" value="导出" data-i18n-value="report.subject.export"/>
	    </div>
	</form>
	<form id="exportForm" action="${ctx}/admin/exam/reportSubject/export" method="post" class="breadcrumb form-search hide">
        <input type="text" name="subjectCode" value="${query.subjectCode}"  class="input-small"/>
	</form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th data-i18n-text="report.subject.name">课程</th>
				<th data-i18n-text="report.subject.totalCount">报考人数</th>
				<th data-i18n-text="report.subject.absentCount">缺考</th>
				<th data-i18n-text="report.subject.breachCount">违纪</th>
				<th data-i18n-text="report.subject.realityCount">有效人数</th>
				<th data-i18n-text="report.subject.avgScore">平均分</th>
				<th data-i18n-text="report.subject.maxScore">最高分</th>
				<th data-i18n-text="report.subject.minScore">最低分</th>
				<th data-i18n-text="report.subject.passCount">及格人数</th>
				<th data-i18n-text="report.subject.passRate">及格率</th>
				<th data-i18n-text="report.subject.excellentCount">优秀数</th>
        		<th data-i18n-text="report.subject.excellentRate">优秀率</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${list}" var="reportSubject">
			<tr>
				<td>${reportSubject.subjectCode}-${reportSubject.subjectName}
				<%-- <a href="${ctx}/admin/exam/reportSubjectCollege?subjectCode=${reportSubject.subjectCode}">${reportSubject.subjectCode}-${reportSubject.subjectName}</a> --%>
				</td>
				<td>${reportSubject.totalCount}</td>
				<td>${reportSubject.absentCount}</td>
				<td>${reportSubject.breachCount}</td>
				<td>${reportSubject.realityCount}</td>
				<td><fmt:formatNumber type="number" value="${reportSubject.avgScore}" pattern="0.00" maxFractionDigits="2"/></td>
				<td>${reportSubject.maxScore}</td>
				<td>${reportSubject.minScore}</td>
				<td>${reportSubject.passCount}</td>
				<td><fmt:formatNumber type="number" value="${reportSubject.passRate}" pattern="0.00" maxFractionDigits="2"/></td>            
				<td>${reportSubject.excellentCount}</td>
           		<td><fmt:formatNumber type="number" value="${reportSubject.excellentRate}" pattern="0.00" maxFractionDigits="2"/></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
<div class="pagination">${query}</div>
<script type="text/javascript">
$("#export-button").click(function(){
	$("#exportForm").attr("action","${ctx}/admin/exam/reportSubject/export");
	$("#exportForm").submit();
});

function page(n, s) {
    $("#pageNumber").val(n);
    $("#pageSize").val(s);
	$("#searchForm").attr("action","${ctx}/admin/exam/reportSubject");
    $("#searchForm").submit();
    return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr("action","${ctx}/admin/exam/reportSubject");
	$("#searchForm").submit();
	return false;
}
</script>	
</body>
</html>