<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>管理员 - S2M Admin</title>

		<meta name="description" content="Static &amp; Dynamic Tables" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<#include "/admin/include/cssjs_up.html" encoding="UTF-8"/>
	</head>

	<body>
		<#assign adminMenuPosFlag="admin">
		<#include "/admin/include/head.html" encoding="UTF-8"/>
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "/admin/include/menu.html" encoding="UTF-8"/>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="/admin/">Home</a>
							</li>
							<li class="active">管理员</li>
						</ul><!-- .breadcrumb -->
					</div>

					<div class="page-content">
						<div class="page-header">
							<h1>
								列表
								<small>
									<i class="icon-double-angle-right"></i>
									管理员 数据列表
								</small>
							</h1>
							<div class="hr-18"></div>
							<button class="btn btn-primary" onclick="location.href='/admin/admin/add'">
								<i class="icon-plus align-top bigger-125"></i>
								添加
							</button>
						</div><!-- /.page-header -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->

								<div class="row">
									<div class="col-xs-12">
										<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>编号</th>
														<th>用户名</th>
														<th>最后登录时间</th>
														<th>登录IP</th>
														<th>姓名</th>
														<th>手机</th>
														<th>是否锁定</th>
														<th>操作</th>
													</tr>
												</thead>

												<tbody>
													<#list pageBean.result as bean>
													<tr>
														<td>
														${bean.id}
														</td>
														<td>
														${bean.username}
														</td>
														<td>
														<#if bean.dateLogin?exists>
														${bean.dateLogin?string("yyyy-MM-dd HH:mm:ss")}
														<#else>
														-
														</#if>
														</td>
														<td>
														${bean.ipLogin}
														</td>
														<td>
														${bean.realname}
														</td>
														<td>
														${bean.mobile}
														</td>
														<td>
															<#if !bean.isLock>&nbsp;&nbsp;
																<i class="icon-circle green"></i>
															<#else>&nbsp;&nbsp;
																<i class="icon-circle-blank red"></i>
															</#if>
														</td>
														<td>
															<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
																<a class="green" href="/admin/admin/add/?id=${bean.id}">
																	<i class="icon-edit bigger-120"></i>
																</a>
																<a class="red" href="javascript:" onclick="deleteMsg('${bean.id}')">
																	<i class="icon-trash bigger-120"></i>
																</a>
																<a class="red" href="javascript:" onclick="stopMsg('${bean.id}')">
																	<i class="icon-lock bigger-120"></i>
																</a>
															</div>
														</td>
													</tr>
													</#list>
												</tbody>
											</table>
											${pageBean.pageToolBar}
										</div><!-- /.table-responsive -->
									</div><!-- /span -->
								</div><!-- /row -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
			</div><!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<#include "/admin/include/cssjs_down.html" encoding="UTF-8"/>
		<script src="/assets/js/bootbox.min.js"></script>
		<script type="text/javascript">
		function deleteMsg(id){
			bootbox.confirm("确定要删除吗?", function(result) {
				if(result) {
					$.ajax({
						url:"/admin/admin/del/",
						type:"POST",
						data:{"id":id,"rnd":Math.random(),"token":"${token}"},
						success:function(a){
							if(a == "success"){
								location.reload();
							}else{
								alert("删除失败" + a);
							}
						}
					});
				}
			});
		}
		function stopMsg(id){
			bootbox.confirm("确定要停用吗?", function(result) {
				if(result) {
					$.ajax({
					url:"/admin/admin/stop/",
					type:"POST",
					data:{"id":id,"rnd":Math.random(),"token":"${token}"},
					success:function(a){
						if(a == "success"){
							location.reload();
						}else{
							alert("停用失败" + a);
						}
					}
				});
				}
			});
		}
		</script>
	</body>
</html>