<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>扫描进度</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/head.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li <c:if test="${type=='subject'}">class="active"</c:if>><a href="${ctx}/admin/exam/scan/subject">按科目统计</a></li>
		<li <c:if test="${type=='examSite'}">class="active"</c:if>><a href="${ctx}/admin/exam/scan/examSite">按考点统计</a></li>
		<!--<li <c:if test="${type=='campus'}">class="active"</c:if>><a href="${ctx}/admin/exam/scan/campus">按学习中心统计</a></li>-->
		<li><a href="${ctx}/admin/exam/scan/package">统计签到表</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/scan/${type}" 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 }"/>
		
		<c:if test="${subjectList!=null}">
		<label>科目</label>
		<select class="input-large" name="code">
			<option value="">全部</option>
			<c:forEach items="${subjectList}" var="subject">
			<option value="${subject.code}" <c:if test="${subject.code==query.code}">selected</c:if>>${subject.code}-${subject.name}</option>
			</c:forEach>
		</select>
		</c:if>
		
		<c:if test="${levelList!=null}">
		<label>层次</label>
		<select class="input-small" name="level">
			<option value="">全部</option>
			<c:forEach items="${levelList}" var="level">
			<option value="${level}" <c:if test="${level==query.level}">selected</c:if>>${level}</option>
			</c:forEach>
		</select>
		</c:if>
		
		<c:if test="${categoryList!=null}">
		<label>专业类型</label>
		<select class="input-small" name="category">
			<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>
		</c:if>
		
		<c:if test="${campusList!=null}">
		<select class="input-large" name="campusName">
			<option value="">全部</option>
			<c:forEach items="${campusList}" var="campus">
			<option value="${campus}" <c:if test="${campus==query.campusName}">selected</c:if>>${campus}</option>
			</c:forEach>
		</select>
		</c:if>
		
		<c:if test="${type=='examSite'}">
		<label>考点</label>
		<select class="input-large" name="examSite">
			<option value="">全部</option>
			<c:forEach items="${examSiteList}" var="examSite">
			<option value="${examSite}" <c:if test="${examSite==query.examSite}">selected</c:if>>${examSite}</option>
			</c:forEach>
		</select>
		</c:if>
		&nbsp;
		<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
		<c:if test="${type=='subject'|| type=='examSite'}">
		&nbsp;
			<input id="btnExport" class="btn btn-primary" type="button" value="导出" onclick="goExport()"/>
		</c:if>
	</form>
	<form id="exportForm" action="${ctx}/admin/exam/scan/${type}/export" method="post" class="breadcrumb form-search hide">
		<c:if test="${type=='subject'}">
		<input type="text" name="code" value="${query.code}" maxlength="100" class="input-mini"/>
		<input type="text" name="category" value="${query.category}" maxlength="20" class="input-small"/>
        <input type="text" name="level" value="${query.level}" maxlength="64" class="input-mini"/>
		</c:if>
		<c:if test="${type=='examSite'}">
		<input type="text" name="examSite" value="${query.examSite}" maxlength="100" class="input-mini"/>
		</c:if>
	</form>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>名称</th>
				<th>考生总数</th>
				<th>已扫张数</th>
				<th>已扫人数</th>
				<th>进度</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${infoList}" var="info">
			<tr>
				<td>${info.name}</td>
				<td>${info.totalCount}</td>
				<td>${info.scanSheetCount}</td>
				<td>${info.scanCount}</td>
				<td>
					<c:if test="${info.totalCount==0}">
						0%
					</c:if>
					<c:if test="${info.totalCount>0}">
						<fmt:formatNumber type="PERCENT" value="${info.scanCount/info.totalCount}"/>
					</c:if>
				</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").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").submit();
	return false;
}
function goExport(){
	$("#exportForm").submit();
	return false;
}
</script>	
</body>
</html>