<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>题库报表</title>
<%@ include file="../common/top.jsp"%>
<link rel="stylesheet" href="${ctx}/resources/css/main.css" type="text/css" />
<link rel='stylesheet' href='${ctx}/resources/css/easyui.css' type='text/css' media='screen' />
<link rel='stylesheet' href='${ctx}/resources/css/easyui/icon.css' type='text/css' media='screen' />
<link rel='stylesheet' href='${ctx}/resources/css/user-center-style.css' type='text/css' media='screen' />
<link href="${ctx}/resources/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/resources/css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="${ctx}/resources/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/question/add.jsp"></script>
<script type="text/javascript" src="${ctx}/resources/js/question/list.jsp"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#searchBtn").on('click', function(){
		$("#search-form").submit();
	});
});
</script>
</head>
<body>
	<%@ include file="../common/header.jsp"%>
	<div>
		<%@ include file="../common/sub_menu.jsp"%>
		<div id="page">
			<div class="page-header">题库报表</div>
			<div class="page-body">
				<!-- 
				<div id="status" style="float: left; width: 250px;">
					<table id="status" style="width: 250px; height: 500px;"
						class="easyui-datagrid"
						data-options="url:'${ctx}/question/getStatusCount',
						singleSelect: true,
						striped:true">
						<thead>
							<tr class="title">
								<th data-options="field:'statusCode',width:150">状态</th>
								<th data-options="field:'count',width:93">题量</th>
							</tr>
						</thead>
					</table>
				</div>
				 -->
				 <div>
					<form id="search-form" method="post" action="${ctx}/question/getReport">
						<label>课程：</label> <input name="courseCode" id="courseCode" placeholder="课程编号" value="${courseCode }" />
						<a href="#" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查找</a>
					</form>
					<div class="error">
						${errorMsg }
					</div>
					<div>
						<table class="table table-bordered">
							<tr>
								<td></td>
								<c:forEach var="x" begin="1" end="${chapter}" step="1">
									<td>${x}</td>
								</c:forEach>
								<th>题型汇总</th>
							</tr>
							<c:forEach var="qt" items="${questionTypes }">
								<tr>
									<td>${qt.name }</td>
									<c:forEach var="x" begin="1" end="${chapter}" step="1" >
										<c:set value="qtChapterCount_${qt.id}_${x}" var="key" />
										<td>${quesCountMap[key] }</td>
									</c:forEach>
									<td>
										<c:set value="quesTypeSum_${qt.id}" var="key" />
										<b>${quesCountMap[key] }</b>
									</td>
								</tr>
							</c:forEach>
							<tr>
								<th>章节汇总</th>
								<c:forEach var="x" begin="1" end="${chapter}" step="1">
									<td>
										<c:set value="chapter_${x}" var="key" />
										<b>${quesCountMap[key] }</b>
									</td>
								</c:forEach>
								<td>总题量：<font color="red"><b>${quesCountMap['total'] }</b></font></td>
							</tr>
						</table>
					</div>
					
				</div>
								
			</div>
		</div>
	</div>
</body>
</html>