<%@ 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 class="active"><a href="${ctx}/admin/exam-param/header">科组长列表</a></li>
		<li><a href="${ctx}/admin/exam-param/header/batch-create">批量创建</a></li>
	</ul>
	<form id="searchForm"  action="${ctx}/admin/exam-param/header" 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 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>
			<label>登录名</label>
			<input type="text" name="loginName" value="${query.loginName }"  maxlength="50" class="input-small"/>
			
			&nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			&nbsp;<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>
		</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>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="subjectHeader">
			<tr>
				<td>${subjectHeader.subject.name}</td>
				<td>${subjectHeader.loginName}</td>
				<td>${subjectHeader.password}</td>
				<td>
					<a href="${ctx}/admin/exam-param/header/delete?id=${subjectHeader.id}" onclick="return confirmx('确认要删除该科组长吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
$("#btnExport").click(function(){
	top.$.jBox.confirm("确认要导出科组长数据吗？","系统提示",function(v,h,f){
		if(v=="ok"){
			$("#searchForm").attr("action","/admin/exam-param/header/export");
			$("#pageNumber").val('${query.pageNumber}');
			$("#pageSize").val('${query.pageSize}');
			$("#searchForm").submit();
		}
	},{buttonsFocus:1});
	top.$('.jbox-body .jbox-icon').css('top','55px');
});
function page(n,s){
	$("#pageNumber").val(n);
	$("#pageSize").val(s);
	$("#searchForm").attr("action","${ctx}/admin/exam-param/header");
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr("action","${ctx}/admin/exam-param/header");
	$("#searchForm").submit();
	return false;
}
</script>	
</body>
</html>