| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 | 
							- <{include file="./admin/header.html"}>
 
- <{include file="./admin/left.html"}>
 
- <{include file="./admin/nav.html"}>
 
- <style>
 
- .set-nav {
 
- 	margin: 0 auto;
 
- }
 
- .set-nav-hr {
 
- 	background-color: #ddd;
 
-     height: 1px;
 
-     position: relative;
 
- }
 
- .form-group label {
 
- 	font-weight: 600;
 
- }
 
- .checkbox-inline, .radio-inline {
 
- 	font-weight: 400!important;
 
- }
 
- .rowlabel {
 
- 	font-weight: 300!important;
 
- }
 
- .music_play_hide {
 
- 	display:none;
 
- }
 
- </style>
 
- <{if !$platfrom}>
 
- 请先创建一个列表。进入<a href="<{$web_cfg.domain}>/?c=Admin_Platform_index&a=PageList">平台列表</a>
 
- <{else}>
 
- <div class="panel panel-default col-md-7">
 
- 	<div class="panel-body">
 
- 		<table class="table">
 
- 			<thead>
 
- 				<tr>
 
- 					<th>UID</th>
 
- 					<th>用户名</th>
 
- 					<th>权限组</th>
 
- 					<th>权限设置</th>
 
- 					<th>平台列表</th>
 
- 					<th>密码修改</th>
 
- 					<th>删除</th>
 
- 				</tr>
 
- 			</thead>
 
- 			<tbody>
 
- 				<{if !$users}>
 
- 				<tr><td colspan="4" align="center">暂无用户信息</td></tr>
 
- 				<{/if}>
 
- 				<{foreach from=$users item=user}>
 
- 				<tr>
 
- 					<td><{$user.uid}></td>
 
- 					<td><{$user.name}></td>
 
- 					<td><{if $user.permission == 'admin'}> <span class="text-primary">管理员</span> <{else}> 普通帐号 <{/if}> </td>
 
- 					<td><a href="<{$web_cfg.domain}>/?c=admin_backUser&a=setPermission&uid=<{$user.uid}>">权限设置</a></td>
 
- 					<td><a href="<{$web_cfg.domain}>/?c=admin_backUser&a=SetPlatfrom&uid=<{$user.uid}>">平台列表</a>
 
- 					<td><a href="<{$web_cfg.domain}>/?c=Admin_BackUser&a=MP&uid=<{$user.uid}>">密码修改</a></td>
 
- 					<td><a href="javascript:;" class="deleteUser" data-uid="<{$user.uid}>">删除</a></td>
 
- 				</tr>
 
- 				<{/foreach}>
 
- 			</tbody>
 
- 		</table>
 
- 	</div>
 
- </div>
 
- <form id="create_user_form" action="<{$web_cfg.domain}>/?c=Admin_BackUser&a=CreateUser" method="post">
 
- <div class="col-md-5" style="padding-left: 30px;">
 
- 	<{if $errMsg.ok}>
 
- 	<div class="tip_message_success">创建成功</div>
 
- 	<{/if}>
 
- 	<{if !$errMsg.ok && $errMsg.msg}>
 
- 	<div class="tip_message_fail">创建失败,原因:<{$errMsg.msg}></div>
 
- 	<{/if}>
 
- 	
 
- 	<{if !$errMsg || $errMsg.msg}>
 
- 	<div class="form-group">
 
- 		<label class="control-label">创建新帐号</label>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">用户名</label>
 
- 		<input name="name" type="text" class="form-control" value="<{$submitData.name}>">
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">密码</label>
 
- 		<input name="password" type="password" class="form-control" value="<{$submitData.password}>">
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label><input name="auto_generate" type="checkbox" value="1" <{if $submitData.auto_generate}>checked<{/if}>> 自动生成密码</label>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">平台列表</label>
 
- 		<div>
 
- 		<{foreach from=$platfrom item=item}>
 
- 		<label class="checkbox-inline"><input name="platfrom[]" type="checkbox" value="<{$item.id}>" > <{$item.name}></label>
 
- 		<{/foreach}>
 
- 		</div>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">邮箱</label>
 
- 		<input name="email" type="text" class="form-control" value="<{$submitData.email}>">
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">部门</label>
 
- 		<input name="division" type="text" class="form-control" value="<{$submitData.division}>">
 
- 	</div>
 
- 	
 
- 	<div>
 
- 		<button id="add_platform_btn" class="button button-primary button-small">创建</button>
 
- 	</div>
 
- 	<{/if}>
 
- 	<{if $errMsg.ok}>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">用户名:</label>
 
- 		<{$new_user.name}>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">密码:</label>
 
- 		<{$new_user.password}>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">平台列表:</label>
 
- 		<{foreach from=$submitData.platfrom item=platfromId}>
 
- 		<{$platfrom[$platfromId].name}> 
 
- 		<{/foreach}>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">邮箱:</label>
 
- 		<{$new_user.email}>
 
- 	</div>
 
- 	<div class="form-group">
 
- 		<label class="control-label rowlabel">部门:</label>
 
- 		<{$new_user.division}>
 
- 	</div>
 
- 	<{/if}>
 
- </div>
 
- </form>
 
- <{/if}>
 
- <script>
 
- KISSY.use('node, io', function (S, Node, IO) {
 
- 	var $ = S.all;
 
- 	$('#add_platform_btn').on('click', function () {
 
- 		var name = $('input[name=name]').val();
 
- 		if (S.trim(name) == '') {
 
- 		  showError('姓名不能为空');
 
- 		  return false;
 
- 		}
 
- 	});
 
-   
 
- 	function showError($msg) {
 
- 		alert($msg);
 
- 	}
 
- 	
 
- 	$(".deleteUser").on('click', function () {
 
- 		var uid = $(this).attr('data-uid');
 
- 		if (!uid) {
 
- 			alert('无效uid');
 
- 			return false;
 
- 		}
 
- 		
 
- 		if (!confirm('确定要删除帐号?')) {
 
- 			return false;
 
- 		}
 
- 		
 
- 		new IO({
 
- 			type: "post"
 
- 			, url: VG.conf.root_domain + '/?c=admin_backUser&a=DeleteUser'
 
- 			, data: {'uid':uid}
 
- 			, success: function (data) {
 
- 				if (data.ok) { //ok
 
- 					alert('操作成功');
 
- 					location.reload();
 
- 				} else {
 
- 					alert('操作失败,原因:'+data.msg);
 
- 				}
 
- 				return false;
 
- 			}
 
- 			, error: function (NULL, textStatus) {
 
- 				alert("请求服务器失败,原因:"+textStatus);
 
- 			}
 
- 			, dataType: "json"
 
- 		});
 
- 	});
 
- });
 
- </script>
 
- <{include file="./admin/bottom.html"}>
 
 
  |