<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="fragment" content="!">
  
  <link rel="stylesheet" href="print.css" media="print" />
  
  <style type="text/css">
  	body{
  		 margin: 0 15mm 0 15mm;
  		 font-size:4mm;
  	}
		h1{
			text-align: center;
			font-size:50mm;
		}
  		p{
  			line-height:0.8em;
  		}
  		table{
  			border-collapse: collapse;
  		}
  		table th,table td{
  			padding:1px;
  		}
  		.block-center{
  			display: block;
  			margin:0 auto;
  		}
  		.text-right{
  			text-align: right;
  		}
  		.text-center{
  			text-align: center;
  		}
  		p.text-indent{
  			text-indent: 2em;
  		}
  		.page{
  			margin-top:25mm;
  			page-break-after: always;
  		}
  		.page-next{
  			page-break-after: always;
  		}
  		.whole{
  			page-break-inside: avoid;
  		}
  </style>
  <!--[if lte IE 8]
<script src="js/json2.js"></script>
<![endif]-->


</head>
<body>
		<p style="font-size:5mm;" class="text-center"><strong>${config.examTime}全国统一命题试卷样卷寄发<span style="text-decoration: underline;">核对单</span><strong></p>
		<fmt:parseNumber var="totalPageCount" integerOnly="true" value="${(fn:length(supplyCourses)+6)/7}" />
		<c:set var="listSize" value="${fn:length(supplyCourses)}" />
		<c:forEach items="${supplyCourses}" var="c" varStatus="s">
			<div class="whole" style="display: none;">
				<p style="font-size:4mm;"><strong>${c.courseCode}&nbsp;&nbsp;${c.courseName}&nbsp;&nbsp;合卷</strong></p>
				<c:set var="blankPaperCount" value="1" />
				<c:set var="acidPaperCount" value="0" />
				<c:set var="provCount" value="0" />
				<c:set var="sichuan" value="false" />
				<div style="border:1px solid; padding:3px;">
					<c:forEach items="${c.supplyProvInfo }" var="p" varStatus="idx">
						<c:if test="${p.paperFormat == 'MERGE' }">
							<c:set var="provCount" value="${provCount+1}" />
							<!-- 当四川和西藏同时存在时，只计算一次 -->
							<c:if test="${p.provCode == 51 }">
								<c:set var="sichuan" value="true" />				
							</c:if>
							<c:if test="${!sichuan || p.provCode != 54 }">
								<c:if test="${p.paperType == 'ACID'}">
									<c:set var="acidPaperCount" value="${acidPaperCount+1}" />
									<c:set var="blankPaperCount" value="${blankPaperCount+1}" />
									${p.provName }&nbsp;
								</c:if>
								<c:if test="${p.paperType == 'BLANK'}">
									<c:set var="blankPaperCount" value="${blankPaperCount+2}" />
									<span style='text-decoration: underline;color:red;'>${p.provName }</span>&nbsp;
								</c:if>
							</c:if>
							<c:if test="${sichuan && p.provCode == 54 }">
								<c:if test="${p.paperType == 'ACID'}">
									${p.provName }&nbsp;
								</c:if>
								<c:if test="${p.paperType == 'BLANK'}">
									<span style='text-decoration: underline;color:red;'>${p.provName }</span>&nbsp;
								</c:if>
							</c:if>
							
						</c:if>
					</c:forEach>
					<br />
					<br />
					<span class="text-center"><font color="gray">硫酸纸：${acidPaperCount } &nbsp;&nbsp; 白纸：${blankPaperCount } </font></span>
					<span class="text-right" style="float:right;">共计 ${provCount-1 } 省</span>
				</div>
			</div>
			<!-- 
			<c:if test="${(s.index*2 + 1)%7 == 0}">
				<br/>
				<p class="text-right">第 <fmt:formatNumber value="${(s.index*2 + 1)/7}" type="number"/> 页 / 共  <fmt:formatNumber value="${totalPageCount }" type="number" maxFractionDigits="0"/> 页</p>
				<div class="page-next"></div>
			</c:if>
			 -->
			<div class="whole">
				<p style="font-size:4mm;"><strong>${c.courseCode}&nbsp;&nbsp;${c.courseName}&nbsp;&nbsp;网评卷</strong></p><!-- 2016-01-20 张璇要求把“分卷”改成“网评卷” -->
				<c:set var="blankPaperCount" value="1" />
				<c:set var="acidPaperCount" value="0" />
				<c:set var="provCount" value="0" />
				<c:set var="sichuan" value="false" />
				<div style="border:1px solid; padding:5px;">
					<c:forEach items="${c.supplyProvInfo }" var="p" varStatus="idx">
						<c:if test="${p.paperFormat == 'SEPERATE' }">
							<c:set var="provCount" value="${provCount+1}" />
							<!-- 当四川和西藏同时存在时，只计算一次 -->
							<c:if test="${p.provCode == 51 }">
								<c:set var="sichuan" value="true" />				
							</c:if>
							<c:if test="${!sichuan || p.provCode != 54 }">
								<c:if test="${p.paperType == 'ACID'}">
									<c:set var="acidPaperCount" value="${acidPaperCount+1}" />
									<c:set var="blankPaperCount" value="${blankPaperCount+1}" />
									${p.provName }&nbsp;
								</c:if>
								<c:if test="${p.paperType == 'BLANK'  && p.provCode != 10}">
								  	<c:set var="blankPaperCount" value="${blankPaperCount+2}" /> 
									<span style='text-decoration: underline;color:red;'>${p.provName }</span>&nbsp;
								</c:if>
							</c:if>
							<c:if test="${sichuan && p.provCode == 54 }">
								<c:if test="${p.paperType == 'ACID'}">
									${p.provName }&nbsp;
								</c:if>
								<c:if test="${p.paperType == 'BLANK'}">
									<span style='text-decoration: underline;color:red;'>${p.provName }</span>&nbsp;
								</c:if>
							</c:if>
						</c:if>
					</c:forEach>
					<br />
					<br />
					<span class="text-center"><font color="gray">硫酸纸：${acidPaperCount } &nbsp;&nbsp; 白纸：${blankPaperCount } </font></span>
					<span class="text-right" style="float:right;">共计 ${provCount-1 } 省</span>
				</div>
			</div>
			<c:if test="${(s.index + 1)%7 == 0 || (s.index+1) == listSize}">
				<br/>
				<p class="text-right">第 <fmt:parseNumber value="${s.index/7 + 1}"  integerOnly="true"/> 页 / 共  <fmt:formatNumber value="${totalPageCount }" type="number" maxFractionDigits="0"/> 页</p>
				<div class="page-next"></div>
			</c:if>
			<!-- 
			<c:if test="${(s.index + 1)%7 != 0 && (s.index+1) == listSize}">
				<br/>
				<p class="text-right">第 <fmt:formatNumber value=" ${(s.index + 1)*2/7}" type="number" maxFractionDigits="0"/> 页 / 共  <fmt:formatNumber value="${totalPageCount }" type="number" maxFractionDigits="0"/> 页</p>
				<div class="page-next"></div>
			</c:if>
			 -->
		</c:forEach>
</body>
</html>
