<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;}
</style>
<body>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/bookList/adminlist.html}" method="post">
	<ul class="seachform">
		<li>
			<label>登录名/用户呢称</label>
			<input name="nickName" type="text" class="scinput" th:value="${search.get('nickName')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</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 style="width: 50px;">序号</th>
		        <th>登录用户名</th>
		        <th>用户呢称</th>
		        <th>状态</th>
		        <th>创建时间</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td><input name="selectlist" type="radio" th:data-id="${item.get('id')}" /></td>
				<td th:text="${item.login_name}" class="loginName"></td>
				<td th:text="${item.nick_name}" ></td>
				<td th:text="${item.status == 1 } ? '有效' : '停用' " ></td>
				<td th:text="${#calendars.format(item.create_time,'yyyy-MM-dd HH:mm:ss')}" ></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>
<script type="text/javascript">

	$(function(){
		$('ul.toolbar li.click').click(function () {
			$.each($('[name=selectlist]'), function () {
				if ($(this).prop('checked')) {
					var loginName= $(this).parent().siblings(".loginName").html();
					window.parent.document.getElementById("adminName").value=loginName;
					window.parent.document.getElementById("adminId").value=loginName;
					//children.window.close();
					//window.close();
					parent.location.reload();
					parent.layer.close(parent.layer.getFrameIndex(window.name));
				}
			});

		});


		$.each($('[name=selectlist]'), function () {
			var loginName= $(this).parent().siblings(".loginName").html();
			var loginName2=window.parent.document.getElementById("adminName").value;
			if(loginName==loginName2){
				$(this).prop('checked', true);
			}
		});
	})
</script>
</body>
</html>