<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> 
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
</style>
<body>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/problem/schoolList.html}" method="post">
	<ul class="seachform">
		<li>
			<label>学校名字</label>
			<input name="name" type="text" class="scinput" th:value="${search.get('name')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
		<li>
				<ul class="toolbar">
					<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>选择</li>
				</ul>
		</li>
		
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th></th>
				<th style="width: 50px;">序号</th>
				<th>地区</th>
				<th>名称</th>
				<th>首字母拼音</th>
				<th>是否热门城市</th>
				<th>详细地址</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="cnArealist:${list}" >
				<td><input name="selectlist" type="radio" th:data-id="${cnArealist.get('id')}" /></td>
				<td th:text="${cnArealistStat.count}" ></td>
				<input  type="hidden" th:value="${cnArealist.get('id')}" class="id"/>
				<td th:text="${cnArealist.get('area')}" class="area"></td>
				<td th:text="${cnArealist.get('name')}" class="schoolName"></td>
				<td th:text="${cnArealist.get('py')}"></td>
				<td th:switch="${cnArealist.get('is_hotcity')}" >
					<span th:case="0">不是</span>
					<span th:case="1">是</span>
				</td>
				<td th:text="${cnArealist.get('school_address')}"></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">
$(function(){
	$('ul.toolbar li.click').click(function () {
		 $.each($('[name=selectlist]'), function () {
			 if ($(this).prop('checked')) {
			 var id= $(this).parent().siblings(".id").val();
			 var schoolName= $(this).parent().siblings(".schoolName").html();
			 var area = $(this).parent().siblings(".area").html();
			 window.opener.document.getElementById("schoolId").value=id;
			 window.opener.document.getElementById("schoolName").value=schoolName;
			 window.opener.document.getElementById("schoolName2").value=schoolName;
			 window.opener.document.getElementById("area").value=area;
			 }
         });
	        window.close();
	 });
	
	
	 $.each($('[name=selectlist]'), function () {
		 var id1= $(this).parent().siblings(".id").html();
		var id=window.opener.document.getElementById("schoolId").value;
		if(id1==id){
			  $(this).prop('checked', true);
		}
     });
})


</script>
</html>