<%@ 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>
	<script src="${ctxStatic}/echarts/echarts.min.js" type="text/javascript"></script>
</head>
<body>
    <ul class="nav nav-tabs">
        <li class="active"><a href="##">成绩复核进度</a></li>
        <c:if test="${fnx:hasPrivilegeCode(role_privilege_codes, 'exam_inspected_info-list')}">
        <li><a href="${ctx}/admin/exam/inspected/list">全卷复核</a></li>
        </c:if>
        <c:if test="${examFinish && fnx:hasPrivilegeCode(role_privilege_codes, 'exam_inspected_info-score_verify')}">
        <li><a href="${ctx}/admin/exam/score/verify/init">成绩校验</a></li>
        </c:if>
    </ul>
     <c:if test="${web_user.schoolAdmin==true}">
    	<div id="main" style="width: 1000px;height:400px;"></div>
   	</c:if>
	<form id="searchForm" action="${ctx}/admin/exam/inspected/info" 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">
				<option value="">请选择</option>
				<c:forEach items="${subjectList}" var="subject">
				<option value="${subject.code}" <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="selective">
				<option value="" <c:if test="${null==query.selective}">selected</c:if>>不限</option>
				<option value="1" <c:if test="${query.selective!=null &&query.selective}">selected</c:if>>是</option>
				<option value="0" <c:if test="${query.selective!=null &&!query.selective}">selected</c:if>>否</option>
			</select>
			<c:if test="${web_user.schoolAdmin==true }">
			<label>完成进度</label>
			<select class="input-small" name="finished">
				<option value="" <c:if test="${null==query.finished}">selected</c:if>>请选择</option>
				<option value="1" <c:if test="${query.finished!=null &&query.finished}">selected</c:if>>已完成</option>
				<option value="0" <c:if test="${query.finished!=null &&!query.finished}">selected</c:if>>未完成</option>
			</select>
			</c:if>
			&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
		</div>
	</form>
	<tags:message content="${message}"/>
	<form id="checkForm" action="${ctx}/admin/exam/mark/finish" method="post" class="breadcrumb form-search">
	<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>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${resultList}" var="result">
			<tr>
				<td>
				${result.subject.code}-${result.subject.name}
				</td>
				<td>
					<c:if test="${result.subject.selective}">
					是
					</c:if>
					<c:if test="${!result.subject.selective}">
					</c:if>
				</td>
				<td>${result.totalPaperCount}</td>
				<td>${result.totalCount}</td>
				<td>${result.inspectedCount}</td>
				<td>${result.leftCount}</td>
				<td>${result.percent}</td>
				<td>${result.finishCount}</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").attr('action', '${ctx}/admin/exam/inspected/info');
	$("#searchForm").submit();
	return false;
}
function goSearch(){
	$("#pageNumber").val(1);
	$("#pageSize").val('${query.pageSize}');
	$("#searchForm").attr('action', '${ctx}/admin/exam/inspected/info');
	$("#searchForm").submit();
	return false;
}
var markedCount =${markedCount};
var unMarkedCount =${unMarkedCount};
var finishCount =${finishCount};
var unFinishCount =${unFinishCount};
var myChart = echarts.init(document.getElementById('main'));
var unMarkedCountTitle="任务待完成"+unMarkedCount;
var markedCountTitle="任务已完成"+markedCount;
var unFinishCountTitle="科目待完成"+unFinishCount;
var finishCountTitle="科目已完成"+finishCount;
myChart.setOption({
	title: [{
        text: '复核总进度'
    }, {
        text: '科目复核进度',
        left: '50%',
     
    }],
    tooltip: [{
        trigger: "item",
        formatter: "占比:{d}%",
    }],
	legend: [{
	    orient: "vertical",
	    left: "left",
	    top: "50px",
	    data: [unMarkedCountTitle, markedCountTitle]
	  },
	  {
		orient: "vertical",
	    left: "50%",
	    top: "50px",
	    data: [unFinishCountTitle, finishCountTitle]
	}],
    series : [
        {
        type: 'pie',
        radius: '55%',
        center: ['25%', '50%'],
        data:[
              {value:unMarkedCount, name:unMarkedCountTitle},
  			  {value:markedCount, name:markedCountTitle}
           ],
        animation: false,
        label: {
            position: 'outer',
            alignTo: 'none',
            bleedMargin: 5
        },
        color:["#7CB5EC",'#FE8463']
    }, {
        type: 'pie',
        radius: '55%',
        center: ['75%', '50%'],
        data:[
            {value:unFinishCount, name:unFinishCountTitle},
			{value:finishCount, name:finishCountTitle}
         ],
        animation: false,
        label: {
            position: 'outer',
            alignTo: 'none',
            bleedMargin: 5
        },
        color:["#7CB5EC",'#FE8463']
    }]
})
</script>	
</body>
</html>