<%@ 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>
	<%-- <%@include file="/WEB-INF/views/include/examInfoNavTabs.jsp" %> --%>
	<form id="searchForm" action="${ctx}/admin/exam-param/subject" 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="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>
			&nbsp;
			<label>状态：</label>
			<select name="status" class="input-small">
				<option value="">请选择</option>
				<c:forEach items="${statusList}" var="status">
				<option value="${status.value}" <c:if test="${status.value==query.status.value}">selected</c:if>>${status.name}</option>
				</c:forEach>
			</select>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;
			<div class="btn-group">
  				<a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#">批量操作
    			<span class="caret"></span>
  				</a>
  				<ul class="dropdown-menu">
					<li>
						<a href="${ctx}/admin/exam-param/subject/start-mark" class="batch-mark-button">开始评卷</a>
					</li>
					<li>
						<a href="${ctx}/admin/exam-param/subject/end-mark" class="batch-finish-button">结束评卷</a>
					</li>
  				</ul>
			</div>
			&nbsp;
			<a href="${ctx}/admin/exam-param/subject/upload-progress" class="btn">上传统计</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>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="subject">
			<tr>
				<td>${subject.code}-${subject.name}
				</td>
				<td>${subject.status.name}</td>
				<td>${subject.studentCount}</td>
				<td>${subject.scanCount}</td>
				<td>${subject.subjectiveCount}</td>
				<td>
				<c:if test="${subject.status.value!=1}">
				<a href="${ctx}/admin/exam-param/subject/start-mark?subjectCode=${subject.code}">开始评卷</a>
				</c:if>
				<c:if test="${subject.status.value==1}">
				<a href="${ctx}/admin/exam-param/subject/end-mark?subjectCode=${subject.code}">结束评卷</a>
				</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;
}
</script>	
</body>
</html>