<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>KGCMS企业应用管理平台 - Powered by KGCMS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<!-- <meta http-equiv="cache-control" content="no-siteapp" /> -->
<link rel="stylesheet" href="{{kg['tpl_url']}}style/admin_manage.css">
<script src="{{kg['tpl_url']}}script/jquery.min.js"></script>
<script src="{{kg['server']['HTTP_HOST']}}/tools/amazeui/js/amazeui.min.js"></script>
<script src="{{kg['tpl_url']}}script/common.js"></script>
<script src="{{kg['tpl_url']}}script/admin_manage.js"></script>
</head>
<body data-type="generalComponents">
	{% include 'component_header.tpl' %}
	<div class="tpl-page-container tpl-page-header-fixed">
		<div class="scrollbar-wrap">
		{% include 'component_left.tpl' %}
		<div class="tpl-content-wrapper">
			<div class="tpl-content-page-title">
				后台账号管理
			</div>
			<ol class="am-breadcrumb">
				<li><a href="./" class="am-icon-home">首页</a></li>
				<li><a href="admin_manage">后台账号管理</a></li>
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title">
					<div class="caption font-green bold">
						<span class="am-icon-code"></span> 后台账号管理
					</div>
					<div class="tpl-portlet-input tpl-fz-ml am-no-margintop ">
						<div class="portlet-input input-small input-inline">
							<div class="input-icon right am-fr">
								<div class="am-btn-group am-btn-group-xs">
									<a class="am-btn am-btn-default am-btn-success" href="admin_update"><span class="am-icon-plus"></span> 新增</a>
									<a class="am-btn am-btn-default am-btn-secondary" href="log?type=6"><span class="am-icon-file-text"></span> 日志</a>
								</div>
							</div>
							<div class="am-cf"></div>
						</div>
					</div>
				</div>
				<div class="tpl-block">
					<div class="am-g">
						<div class="am-u-sm-12 ngco-No-paddingR">
							<form class="am-form">
								<table class="am-table am-table-striped am-table-hover table-main ngco-Esz-mgibdr">
									<thead>
										<tr>
											<th class="table-title">用户头像</th>
											<th class="table-title">登录账号</th>
											<th class="table-title">角色</th>
											<th class="table-type">状态</th>
											<th class="table-date am-hide-sm-only">登录次数</th>
											<th class="table-title am-hide-sm-only">创建时间/最近登录</th>
											<th class="table-title am-hide-sm-only">最近两次登录的IP</th>
											<th class="table-set">操作</th>
										</tr>
									</thead>
									<tbody>
										{% for row in admin_list %}
										<tr>
											<td class="tpl-header-list-user-ico"><img src="{{ row['image'] }}" alt="" class="user-img" /></td>
											<td class="td2">
												{% if row['username'] %}<span class="am-account-info zi-span"><span class="am-icon-user am-account"></span>{{ row['username'] }}</span><br/>{% endif %}
												{% if row['email'] %}<span class="am-account-info zi-span"><span class="am-icon-envelope-square am-account"></span>{{ row['email'] }}</span><br/>{% endif %}
												{% if row['phone'] %}<span class="am-account-info zi-span"><span class="am-icon-phone-square am-account"></span>{{ row['phone'] }}</span><br/>{% endif %}
											</td>
											<td>{{ row['role_name'] }}</td>
											<td class="">
												{% if row['allow'] != 1 %}<span class="am-icon-ban am-icon-sm am-forbid title2div" title="帐号已被禁用"></span>
												{% elif row['period'] and row['period'] < time %}<span class="am-icon-clock-o am-icon-sm am-past title2div" title="帐号已过期，过期时间：{{ row['period']|date }}"></span>
													{% elif row['period'] and row['period'] > time %}<span class="am-icon-clock-o am-icon-sm am-normal title2div" title="帐号已设定过期时间，过期时间：{{ row['period']|date }}"></span>
													{% else %}<span class="am-icon-check-circle am-icon-sm am-normal-forever title2div" title="帐号正常，永久有效"></span>
													{% endif %}
											</td>
											<td class="am-hide-sm-only">{{ row['frequency'] }}</td>
											<td class="am-hide-sm-only"><span>{{ row['addtime']|date }}</span><br/><span>{%if row['near']%}{{ row['near']|date }}{%else%}--{%endif%}</span></td>
											<td class="am-hide-sm-only"><span>{{row['login_ip'][0]}}</span><br/><span>{{row['login_ip'][1]}}</span></td>
											<td class="">
												<div class="am-btn-toolbar">
													<div class="am-btn-group am-btn-group-xs">
														<a href="admin_update?id={{ row['id'] }}" class="am-btn am-btn-default am-btn-xs am-text-default title2div" title="编辑后台账号">
															<span class="am-icon-pencil-square-o"></span>&nbsp;编辑
														</a>
														<a href="admin_manage?del={{ row['id'] }}" class="am-btn am-btn-default am-btn-xs am-text-danger title2div" title="删除后台账号" onclick="return confirm('确定删除该管理员？');">
															<span class="am-icon-trash-o"></span>&nbsp;删除
														</a>
														<a href="log?aid={{row['id']}}" class="am-btn am-btn-default am-btn-xs am-text-secondary title2div" title="查看系统日志">
															<span class="am-icon-file-text"></span>&nbsp;日志
														</a>
													</div>
												</div>
											</td>
										</tr>
										{% endfor %}
									</tbody>
								</table>
								{% if not admin_list %}<div class="no-data">
									<ul>没有相关数据</ul>
								</div>{% endif %}
							</form>
							<div class="am-alert am-alert-success success-info">
								<ul class="margin-bottom-none padding-left-lg">
									<li class="am-state-info">状态说明：</li>
									<li class="am-verify">
										<span class="am-icon-clock-o am-icon-sm am-past"></span>&nbsp;&nbsp;帐号已过有效期，用户无法登录<br />
										<span class="am-icon-clock-o am-icon-sm am-normal"></span>&nbsp;&nbsp;帐号有设置有效期，当前可以正常使用<br />
										<span class="am-icon-check-circle am-icon-sm am-normal-forever"></span>&nbsp;&nbsp;正常，且永久有效<br />
										<span class="am-icon-ban am-icon-sm am-forbid"></span>&nbsp;&nbsp;帐号已被禁用，用户无法登录
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<script>
	kg.title2div('title2div'); //调用此方法， 把该元素的title属性替换成div
	</script>
</body>
</html>