<!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_update.css">
<script src="{{kg['tpl_url']}}script/jquery.min.js"></script>
<script src="{{kg['tpl_url']}}script/cropper.min.js"></script>
<script src="{{kg['tpl_url']}}script/amazeui.datetimepicker.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_update.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">
				{% if action=='add' %}添加管理员{% else %}修改管理员{% endif %}
			</div>
			<ol class="am-breadcrumb">
				<li><a href="/" class="am-icon-home">首页</a></li>
				<li><a href="admin_manage">系统角色管理</a></li>
				<li class="am-active">{% if action=='add' %}添加管理员{% else %}修改管理员{% endif %}</li>
			</ol>
			<div class="tpl-portlet-components">
				<div class="portlet-title">
					<div class="caption font-green bold">
						<span class="am-icon-code"></span>&nbsp;{% if action=='add' %}添加管理员{% else %}修改管理员{% endif %}
					</div>
					<div class="tpl-portlet-input tpl-fz-ml ngco-No-marginT">
						<div class="role-management portlet-input input-small input-inline">
							<div class="input-icon right">
								<div class="am-btn-group am-btn-group-xs">
									<a href="admin_manage" class="addUser am-btn am-btn-default am-btn-success"><span class="am-icon-cog"></span>&nbsp;&nbsp;管理</a>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="am-panel am-panel-danger" id="erro-box">
					<div class="am-panel-hd"><span class="am-icon-times-circle"></span><span class="erro-txt"></span><span class="am-icon-times"></span></div>
				</div>
				<div class="tpl-block ">
					<div class="am-g tpl-amazeui-form">
						<div class="am-u-sm-12 am-u-md-12 am-u-bg-9">
							<form class="am-form am-form-horizontal" action="#" method="post">
								<div class="am-form-group  am-form-icon am-form-feedback">
									<label for="user-name" class="am-u-sm-3 am-u-md-4 am-u-lg-3 am-form-label">用户名 / UserName</label>
									<div class="am-u-sm-9 am-u-md-8 am-u-lg-9">
										<input type="text" id="user-name" placeholder="用户名由5 - 20个字符组成，只能使用数字、字母和下划线组成，且必须以字母开头" value="{{ user['username'] }}" name="username" class="am-form-field">
										<span class=""></span>
									</div>
								</div>
								<div class="am-form-group am-form-icon am-form-feedback">
									<label for="phone" class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">电话 / Phone</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<input type="text" id="phone" placeholder="请输入手机号" name="phone" value="{{ user['phone'] }}" class="am-form-field"/>
										<span class=""></span>
									</div>
								</div>
								<div class="am-form-group am-form-icon am-form-feedback">
									<label for="email" class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">邮箱 / Email</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<input type="text" id="email" value="{{ user['email'] }}" placeholder="5 - 20个字符组成，只能使用数字、字母和下划线" name="email" class="am-form-field"/>
										<span class=""></span>
									</div>
								</div>
								<div class="am-form-group am-form-icon am-form-feedback">
									<label for="password" class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">密码 / Password</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										{% if action == 'add' %}
										{% set wd1 = '5 - 20个字符组成，只能使用数字、字母和下划线' %}
										{% set wd2 = '请再次输入一次密码' %}
										{% else %}
										{% set wd1 = '不修改密码时请勿填写' %}
										{% set wd2 = '不修改密码时请勿填写' %}
										{% endif %}
										<input type="password" id="password" placeholder="{{ wd1 }}" name="password" class="am-form-field">
										<span class=""></span>
									</div>
								</div>
								<div class="am-form-group am-form-icon am-form-feedback">
									<label for="password_" class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">确认密码 / Confirm</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<input type="password" id="password_" placeholder="{{ wd2 }}" value name="password2" class="am-form-field">
										<span class=""></span>
									</div>
								</div>
								<!-- 上传头像 -->
								<div class="am-form-group">
									<label class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">头像 / <span class="tpl-form-line-small-title">Images</span></label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<div class="am-form-group am-form-file">
											<div class="tpl-form-file-img">
												<img src="{{ user['image'] }}" alt="" id="finalImg">
											</div>
											<button type="button" class="am-btn am-btn-danger am-btn-sm title2div" title="未选择任何图片" id="replaceImg">
												<i class="am-icon-cloud-upload"></i>上传头像</button>
											<!--图片裁剪框 start-->
											<div style="display: none" class="tailoring-container">
												<div class="black-cloth" onclick="closeTailor(this)"></div>
												<div class="tailoring-content">
													<div class="tailoring-content-one">
														<label title="上传图片" for="chooseImg" class="l-btn choose-btn">
															<input type="file" name="filename" accept="image/*" id="chooseImg" class="hidden" onchange="selectImg(this)">
															选择图片
															<input type="hidden" name="image" id="imgUpdate" value='' />
														</label>
														<div class="close-tailoring" onclick="closeTailor(this)">×</div>
													</div>
													<div class="tailoring-content-two">
														<div class="tailoring-box-parcel">
															<img id="tailoringImg" src="/" alt=""/>
														</div>
														<div class="preview-box-parcel">
															<p>图片预览：</p>
															<div class="square previewImg"></div>
															<div class="circular previewImg"></div>
														</div>
													</div>
													<div class="tailoring-content-three">
														<button class="l-btn cropper-reset-btn" type="button">复位</button>
														<button class="l-btn cropper-rotate-btn" type="button">旋转</button>
														<button class="l-btn cropper-scaleX-btn" type="button">换向</button>
														<button class="l-btn sureCut" id="sureCut" type="button">确定</button>
													</div>
												</div>
											</div>
											<!--图片裁剪框 end-->
										</div>
									</div>
								</div>
								<div class="am-form-group">
									<label class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">是否允许登录 / Allowed</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<div class="tpl-switch">
											{% if user['allow']==1 %}
											<input name="allow" type="checkbox" class="ios-switch bigswitch tpl-switch-btn" checked="checked">
											{% else %}
											<input name="allow" type="checkbox" class="ios-switch bigswitch tpl-switch-btn">
											{% endif %}
											<div class="tpl-switch-btn-view ngad-M6-marginT">
												<div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<!-- 角色 -->
								<div class="am-form-group">
									<label class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">角色 / <span class="tpl-form-line-small-title">Role</span></label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9 am-select-hover ng-xiaoshi-bdr">
										<div style="display: inline-block;">
											<select class="border-xia" name="role" data-am-selected="{searchBox: 1}" style="display: none;">
												{% for r in role %}
												<option value="{{ r['id'] }}" {% if user['role']==r['id'] %}selected{% endif %}>{{ r['name'] }}</option>
												{% endfor %}
											</select>
											<a class="add am-btn am-btn-default am-hover ngco-Ladd-flaotR" href="">添加</a>
										</div>
									</div>
								</div>
								<div class="am-form-group">
									<label class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">账号有效期 / Validity</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<div class="tpl-switch role-select" id="dateBox">
											{% if user['period']==0 %}
											<input name="period" type="checkbox" class="ios-switch bigswitch tpl-switch-btn" checked="checked">
											{% set wd='永久有效' %}
											{% else %}
											<input name="period" type="checkbox" class="ios-switch bigswitch tpl-switch-btn">
											{% set wd=user['period'] %}
											{% endif %}
											<div class="tpl-switch-btn-view" id="switch">
												<div>
												</div> 
											</div> 
										</div>
										<input name="period_time" type="text" id="datetimepicker" class="form-datetime-lang am-form-field" disabled="disabled" value='{{ wd }}'>
									</div>
								</div>
								<div class="am-form-group">
									<label for="user-intro" class="am-u-lg-3 am-u-md-4 am-u-sm-3 am-form-label">备注 / Notes</label>
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9">
										<textarea class="" rows="2" id="user-intro" placeholder="管理员备注信息" name="notes">{{ user['notes'] }}</textarea>
										<small></small>
									</div>
								</div>
								<div class="am-form-group">
									<div class="am-u-lg-9 am-u-md-8 am-u-sm-9 am-u-sm-push-4 am-u-lg-push-3">
										<button type="submit" class="am-btn am-btn-primary ngad-click-panduan" id="submit">
											{% if action=='add' %}立即添加{% else %}保存修改{% endif %}
										</button>
									</div>
								</div>
								<input type="hidden" name="action" value="submit" />
							</form>
						</div>
					</div>
				</div>
				<div class="am-alert am-alert-warning">
					<h4><i class="am-icon-warning"></i> Warning!</h4>Apparently, Adblock Plus can remove Font Awesome brand icons with their "Remove Social Media Buttons" setting. We will not use hacks to force them to display. Please <a href="https://adblockplus.org/en/bugs" class="alert-link">report an issue with Adblock Plus</a> if you believe this to be an error. To work around this, you'll need to modify the social icon class names.
				</div>
				<div class="am-alert am-alert-success">
					<ul class="margin-bottom-none padding-left-lg">
						<li>All brand icons are trademarks of their respective owners.</li>
						<li>The use of these trademarks does not indicate endorsement of the trademark holder by Font Awesome, nor vice versa.</li>
					</ul>
				</div>
			</div>
			{% include 'component_footer.tpl' %}
		</div>
		</div><!-- /.scrollbar-wrap -->
	</div>
	<script>
	kg.title2div('title2div'); //调用此方法， 把该元素的title属性替换成div
	</script>
</body>
</html>