<%@ 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" %>
	<%@include file="/WEB-INF/views/include/dialog.jsp" %>
	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/admin/exam-param/objective/import" method="post" enctype="multipart/form-data"
			style="padding-left:20px;text-align:center;" class="form-search" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/admin/exam-param/objective/template">下载模板</a>
		</form>
	</div>
	<!--
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/admin/exam-param/objective">客观题列表</a></li>
		<li><a href="${ctx}/admin/exam-param/objective/form">新增客观题</a></li>
	</ul>
	-->
	<form id="searchForm"  action="${ctx}/admin/exam-param/objective" 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="subjectCode">
				<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;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			<!-- &nbsp;<input id="btnExport" class="btn btn-primary" type="button" value="导出"/> -->
			&nbsp;<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			&nbsp;
			<%-- <a class="btn" href="${ctx}/admin/exam-param/objective/config">通卡设置</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="block">
			<tr>
				<td>${block.examSubject.code}-${block.examSubject.name}</td>
				<td>${block.title}</td>
				<td>${block.number}</td>
				<td>${block.questionScore }</td>
				<td>${block.questionCount }</td>
				<td>
				<a href="${ctx}/admin/exam-param/objective/${block.id}">详细</a>
				<a class="delete-button" href="${ctx}/admin/exam-param/objective/delete/${block.id}" onclick="return confirmx('确定要删除该大题吗?？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${query}</div>
<script type="text/javascript">
$("#btnImport").click(function(){
	$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
		bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
});
function page(n,s){
	$("#pageNumber").val(n);
	$("#pageSize").val(s);
	$("#searchForm").attr("action","${ctx}/admin/exam-param/objective");
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr("action","${ctx}/admin/exam-param/objective");
	$("#searchForm").submit();
	return false;
}
</script>	
</body>
</html>