<%@ 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/marker?subjectCode=${subject.code}">评卷员管理</a></li>
		<li  class="active"><a href="#">科目：${subject.code }-${subject.name }设置</a></li>
	</ul>
	<form id="searchForm"  action="${ctx}/admin/exam/marker/save" 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}"/>
		<input type="hidden" name="subjectCode" value="${subject.code }"/>
		<div>
			<label>登录名</label>
			<input type="text" name="loginName" value="${query.loginName }"  maxlength="20" class="input-small"/> 
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			<input id="addSubmit" class="btn btn-primary" type="button" value="下一步" onclick="goAdd()"/>
		</div>
	</form>
	<tags:message content="${message}"/>
	<form id="addForm"  action="${ctx}/admin/exam/group/markerGroup" method="post" class="breadcrumb form-search">
	<input type="hidden" id="subjectCode" name="subjectCode" value="${subject.code}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th></th>
				<th>登录名</th>
				<th>姓名</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="user">
			<tr>
				<td><input name="userIds" type="checkbox" value="${user.id }"/></td>
				<td>${user.loginName}</td>
				<td>${user.name}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	</form>
	<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 goAdd(){
	var check_list = []
	$("input[name='userIds']:checked").each(function(){
		check_list.push($(this).val())
	})
    if(check_list.length==0) {
        alert('请选择用户');
        return false;
    }
	$("#addForm").submit();
	return false;
}
</script>	
</body>
</html>