<%@ 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><a href="${ctx}/admin/exam/check/answer">识别结果检查</a></li>
		<li><a href="${ctx}/admin/exam/check/image">图片检查</a></li>
		<li class="active"><a href="${ctx}/admin/exam/check/student">人工确认</a></li>
	</ul>
	<form id="searchForm" action="${ctx}/admin/exam/check/student" 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 name="type" id="type" >
				<c:forEach items="${typeList}" var="item">
				<option value="${item.value}" <c:if test="${item.value==query.type.value}">selected</c:if>>${item.name}</option>
				</c:forEach>
			</select>
			&nbsp;
			<label>科目</label>
	        <select class="input-large" name="subjectCode" id="subject-select">
	            <option value="">请选择</option>
	            <c:forEach items="${subjectList}" var="subject">
	                <option value="${subject.code}" <c:if test="${subject.code==query.subjectCode}">selected</c:if>>${subject.code}-${subject.name}</option>
	            </c:forEach>
	        </select>
	        &nbsp;
	        <label>考点</label>
	        <input type="text" name="examSite" id="examSite" value="${query.examSite}" class="input-medium"/>
	        &nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<a href="${ctx}/web/admin/exam/check/student/start?type=${query.type.value}" target="_blank" class="btn btn-primary" id="start-button">开始处理</a>
		</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>科目</th>
				<th>考点</th>
				<th>扫描批次</th>
				<th>上传时间</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${studentList}" var="student">
			<tr>
				<td>${student.examNumber}</td>
				<td>${student.name}</td>
				<td>${student.studentCode}</td>
				<td>${student.subjectCode}-${student.subjectName}</td>
				<td>${student.examSite}</td>
				<td>${student.batchCode}</td>
				<td><fmt:formatDate value="${student.uploadTime}" pattern="yyyy-MM-dd hh:MM:ss"/></td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">

$('#start-button').click(function(){
	var checkType = $('#type').val();
	var subjectCode = $('#subject-select').val();
	var examSite = $('#examSite').val();
	$('#start-button').attr('href','${ctx}/web/admin/exam/check/student/start?checkType='+checkType+'&subjectCode='+subjectCode+'&examSite='+examSite);
});

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