<p class="text-success font-bold" ng-controller="UseBatchSummaryCtrl">{{batchSummary}}</p>
<div ng-controller="UseBatchStockCtrl">
	<ul class="nav nav-pills padder">
         <li ui-sref-active="active" ><a ui-sref="batch.info.use" >启用卷管理</a></li>
         <li ui-sref-active="active" ><a ui-sref="batch.info.useExtract">抽卷</a></li>
         <li ui-sref-active="active" class="active"><a ui-sref="batch.info.useStock">库存统计</a></li>
	</ul>
	<div class="panel panel-default">
		<div class="panel-body">
			<button ng-click="downloadToExcel()" class="btn btn-default">
				<i class="glyphicon glyphicon-export"> 导出至excel</i>
			</button>
			
			<table class="table table-striped">
				<thead>
					<tr>
						<th>课程代码</th>
						<th>课程名称</th>
						<th>教材名称</th>
						<th>编者</th>
						<th>出版社</th>
						<th>版次</th>
						<th>是否抽到</th>
						<th>剩余可抽卷数量</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="row in pageModel.array">
						<td>{{row.courseCode}}</td>
						<td title="{{row.courseName}}">{{row.courseName}}</td>
						<td title="{{row.bookName}}">{{row.bookName}}</td>
						<td title="{{row.bookAuthor}}">{{row.bookAuthor}}</td>
						<td title="{{row.bookPress}}">{{row.bookPress}}</td>
						<td title="{{row.bookPressYear}}">{{row.bookPressYear}}</td>
						<td class="{{row.relatedPaperId != null ? 'text-success' : 'text-danger'}}">{{row.relatedPaperId != null ? '是' : '否'}}</td>
						<td>{{row.formalCount}}</td>
					</tr>
				</tbody>
			</table>
			
			<nav ng-if="pageModel.totalPage > 1">
				<ul class="pagination">
					<li class="{{pageModel.curPage == 1 ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage - 1)">
						<a aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
			      	</li>
				    <li ng-repeat="i in [9,8,7,6,5,4,3,2,1]" ng-if="pageModel.curPage - i > 0" ng-click="goPage(pageModel.curPage - i)">
				    	<a>{{pageModel.curPage - i}}</a>
			    	</li>
				    <li class="active"><a href="#">{{pageModel.curPage}}</a></li>
				    <li ng-repeat="i in [1,2,3,4,5,6,7,8,9]" ng-if="pageModel.curPage + i <= pageModel.totalPage" ng-click="goPage(pageModel.curPage + i)">
				    	<a>{{pageModel.curPage + i}}</a>
			    	</li>
				    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
				      	<a aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
				    </li>
				</ul>
			</nav>
		</div>
	</div>
</div>
