<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;
	}
</style>
<body>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/admin/curator/studentIndex.html}" method="post">
	 <input id="libId" name="libId" type="hidden" th:value="${search.get('libId')}">
		<input id="classId" name="classId" type="hidden" th:value="${search.get('classId')}">
		<input id="reportType" name="reportType" type="hidden" value="1">
	<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="startDate" name="startDate" autocomplete="off"   onclick=" WdatePicker({ dateFmt: 'yyyy-MM-dd', isShowToday: false, isShowClear: false });" th:value="${search.startDate }" class="scinput date_width " placeholder="开始日期">
		</li>
		<li>
			<label>结束月份</label>
			<input type="text" id="endDate" name="endDate" autocomplete="off"  onclick=" WdatePicker({ dateFmt: 'yyyy-MM-dd', isShowToday: false, isShowClear: false });" th:value="${search.endDate }" class="scinput date_width " placeholder="结束日期">
		</li>
		<li>
			<label>是否有效</label>
			<select class="scinput select_width" name="stat">
				<option value="">全部</option>
				<option value="1" th:selected="${search.get('stat') eq '1'}">有效</option>
				<option value="2" th:selected="${search.get('stat') eq '2'}">无效</option>
			</select>
		</li>
		<li>
			<label>服务类型</label>
			<select class="scinput select_width" name="serviceType">
				<option value="">全部</option>
				<option value="S009" th:selected="${search.get('serviceType') eq 'S009'}">内部用户</option>
				<option value="-1" th:selected="${search.get('serviceType') eq '-1'}">服务已关闭</option>
				<option value="0" th:selected="${search.get('serviceType') eq '0'}">无服务</option>
				<option value="1" th:selected="${search.get('serviceType') eq '1'}">平台服务(家长购买)</option>
				<option value="2" th:selected="${search.get('serviceType') eq '2'}">校区服务</option>
				<option value="4" th:selected="${search.get('serviceType') eq '4'}">平台服务(机构购买)</option>
				<option value="5" th:selected="${search.get('serviceType') eq '5'}">批改服务</option>
			</select>
		</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:if="${search.get('classId') ==''}" th:href="@{/sys/admin/curator/index.html(libId=${search.get('libId')})}"><input type="button" class="scbtn" value="返回" /></a>
			<a href="javascript:;" th:if="${search.get('classId') !=''}" th:href="@{/sys/admin/curator/classIndex.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>
					<table style="width: 100%;">
						<thead><tr><th style="width: 30%;">服务开始时间</th><th style="width: 30%;">服务结束时间</th><th style="width: 20%;">是否有效</th><th style="width: 20%;">服务类型</th></tr>
						</thead>
					</table>
				</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:text="${itemStat.count}" ></td>
					<td th:title="${item.get('childName')}" th:text="${item.get('childName')}">
					</td>
					<td th:text="${item.get('className')}" ></td>
					<td  class="imgtd">
							<img  th:if="${item.get('imgUrl')}!=null" th:src="${imgUrl}+''+${item.get('imgUrl')}" class="tablelink" style="width: 50px;height: 50px;" />
					</td>
					</td>
					<td th:text="${item.get('grade')}" ></td>
					<td th:text="${item.get('phone')}" ></td>
					<td>
						<table style="width: 100%;">
							<tbody>
							<tr th:each="item2:${item.get('serviceList')}" th:if="${item}">
								<td th:text="${item2.get('start_time')}" style="width: 30%;"></td>
								<td th:text="${item2.get('end_time')}" style="width: 30%;"></td>
								<td th:text="${item2.get('stat')}" style="width: 20%;"></td>
								<td th:text="${item2.get('correct_type')}" style="width:20%"></td>
							</tr>
							</tbody>
						</table>
					</td>
			</tr>
		</tbody>
	</table>
	<!-- 分页 -->
	<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">
	$("#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/studentIndex.html";
		},3000);
	});

</script>
</html>