<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script>
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 70px;
	}
	.date_width{
	     width: 100px;
	}
	td div{
     word-break:break-all;
	}
	.imgtd{
		height: 100%;
		margin-top: 10px;
		margin-left:10px;
		align-content: center;
	}
	.imgshow{
		height: 100%;
		margin-top: 10px;
		margin-left:10px;
	}
</style>
<body>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/admin/curator/homeworkIndex.html}" method="post">
		<input id="libId" name="libId" type="hidden" th:value="${search.get('libId')}">
		<input id="reportType" name="reportType" type="hidden" value="3">
	<ul class="seachform">
		<li>
			<label>学生名称</label>
			<input name="searchValue" type="text" class="scinput" th:value="${search.get('searchValue')}"/>
		</li>
		<li>
			<label>作业开始日期</label>
			<input type="text" id="queryDate" name="queryDate" autocomplete="off"   onclick=" WdatePicker({ dateFmt: 'yyyy-MM-dd', isShowToday: false, isShowClear: false });" th:value="${search.queryDate }" class="scinput date_width " placeholder="作业开始日期">
		</li>
		<li>
			<label>作业结束日期</label>
			<input type="text" id="queryEndDate" name="queryEndDate" autocomplete="off"   onclick=" WdatePicker({ dateFmt: 'yyyy-MM-dd', isShowToday: false, isShowClear: false });" th:value="${search.queryEndDate }" class="scinput date_width " placeholder="作业结束日期">
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
			<input type="button" id="button" class="scbtn" value="导出" />
		</li>
        <li>
            <label>&nbsp;</label>
            <a href="javascript:;" th:href="@{/sys/admin/curator/index.html(libId=${search.get('libId')})}"><input type="button" class="scbtn" value="返回" /></a>
        </li>
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th style="width: 40px;">序号</th>
		        <th>学生姓名</th>
		        <th>年级</th>
				<th>学校</th>
		        <th>绑定校区</th>
		        <th>作业日期</th>
		        <th>上传作业份数</th>
				<th>语文作业份数</th>
				<th>数学作业份数</th>
				<th>英语作业份数</th>
				<th>批改作业份数</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count}" ></td>
					<td  th:text="${item.get('child_name')}">
					</td>
					<td th:text="${item.get('grade')}" ></td>
					<td th:text="${item.get('school')}" ></td>
					<td th:text="${item.get('league_name')}" ></td>
					<td th:text="${item.get('create_time')}" ></td>
					<td><a class="tablelink" href="javascript:;" th:onclick="'updateById(\''+${item.get('file_keys')}+'\')'">[[${item.get('pictureCount')}]]</a></td>
					<td>
						<a th:if="${item.get('count1') > 0}" th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='语文',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
							[[${item.get('count1')}]]
						</a>
						<a th:if="${item.get('count1') == 0}">
							[[${item.get('count1')}]]
						</a>
					</td>
					<td>
						<a th:if="${item.get('count2') > 0}"  th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='数学',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
							[[${item.get('count2')}]]
						</a>
						<a th:if="${item.get('count2') == 0}">
							[[${item.get('count2')}]]
						</a>
					</td>
					<td>
						<a th:if="${item.get('count3') > 0}" th:href="@{/sys/admin/curator/homeworkInfoVip.html(vipId=${item.get('vip_id')},subject='英语',queryDate=${item.get('create_time')},libId=${search.get('libId')},childName=${item.get('child_name')})}">
							[[${item.get('count3')}]]
						</a>
						<a th:if="${item.get('count3') == 0}">
							[[${item.get('count3')}]]
						</a>
					</td>
					<td><a class="tablelink" href="javascript:;" th:onclick="'updateById(\''+${item.get('corrected_keys')}+'\')'">[[${item.get('correctedCount')}]]</a></td>
			</tr>
		</tbody>
	</table>
	<div id="showDiv" style="text-align: center">

	</div>
	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>
</body>
<script type="text/javascript">
	var myImgUrl  = '[[${imgUrl}]]';
	function updateById(imgUrls){
		var list = imgUrls.split(',');
		var content="";
		for (i = 0; i < list.length; i++) {
			content +='<img class="imgtd" onclick="view(this)" src='+myImgUrl+list[i] + ''+' /><br>';
		}
		$("#showDiv").html(content);
		layer.open({
			type: 1,
			title: "图片查看",
			//offset: '100px',
			area: ['55%', '100%'],
			content: $("#showDiv")
		});
	}
	function view(obj) {
		var img = $(obj);
		var src = img.attr("src");
		var content='<div style="text-align: center"><img class="imgshow"  src='+src + ''+' /></div>';
		layer.open({
			type: 1,
			title: "图片查看",
			//offset: '100px',
			area: ['80%', '100%'],
			content: content
		});
	}
	$("#button").on('click',function(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/admin/curator/exportDetail";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]//sys/admin/curator/homeworkIndex.html";
		},3000);
	});
</script>
</html>