<%@ 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>
	<form id="searchForm" action="${ctx}/admin/exam-param/subjectPaper" 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 class="input-large" name="code" id="subject-select">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" data-level="${subject.level}" <c:if test="${subject.code==query.code}">selected</c:if>>${subject.code}-${subject.name}</option>
				</c:forEach>
			</select>
			<label>层次</label>
			<select class="input-small" name="level" id="level-select">
				<option value="">请选择</option>
				<c:forEach items="${levelList}" var="level">
				<option value="${level}" data-level="${level}" <c:if test="${level==query.level}">selected</c:if>>${level}</option>
				</c:forEach>
			</select>
			<label>专业类型</label>
			<select class="input-small" name="category" id="category-select">
				<option value="">请选择</option>
				<c:forEach items="${categoryList}" var="category">
				<option value="${category}" <c:if test="${category==query.category}">selected</c:if>>${category}</option>
				</c:forEach>
			</select>
			&nbsp;
			<label>状态</label>
			<select class="input-small" name="upload">
				<option value="">不限</option>
				<option value="1" <c:if test="${upload!=null && upload==true}">selected</c:if>>已扫描</option>
				<option value="0" <c:if test="${upload!=null && upload==false}">selected</c:if>>未扫描</option>
			</select>
			&nbsp;
			<label>总分不等于</label>
			<input type="text" name="totalScoreNotEqual" value="${query.totalScoreNotEqual}"  maxlength="10" class="input-mini"/>
			<br/><br/>
			&nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
			<!-- 
			&nbsp;<input id="btnSubmit" class="btn btn-danger" type="button" value="客观题题型同步" onclick="copeQuestionType()"/>
			 -->
		</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>
				<th>试卷总分</th>
				<th>试卷结构</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${query.result}" var="subject">
			<tr>
				<td>
					<a href="${ctx}/admin/exam-param/subjectPaper/detail?subjectCode=${subject.code}">${subject.code}-${subject.name}&nbsp;${subject.remark}</a>
				</td>
				<td>${subject.level}</td>
				<td>${subject.category}</td>
				<td>
				<c:if test="${subject.hasPaper}">
				<a href="${cardServer}${subject.paperUrl}" target="_blank">已上传</a>
				</c:if>
				</td>
				<td>
				<c:if test="${subject.hasAnswer}">
				<a href="${cardServer}${subject.answerUrl}" target="_blank">已上传</a>
				</c:if>
				</td>
				<td>${subject.objectiveScore}</td>
				<td>${subject.subjectiveScore}</td>
				<td>${subject.totalScore}</td>
				<td><a href="${ctx}/admin/exam-param/subjectPaper/examQuestionTypeEdit?subjectCode=${subject.code}" class="btn btn-primary">编辑</a></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;
}
function copeQuestionType(){
	alert('a');
}
</script>	
</body>
</html>