%%5C^5C8^5C8ABD36%%user_list.html.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php /* Smarty version 2.6.17, created on 2018-05-26 11:58:06
  2. compiled from admin/backUser/user_list.html */ ?>
  3. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  4. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
  5. $this->_tpl_vars = $_smarty_tpl_vars;
  6. unset($_smarty_tpl_vars);
  7. ?>
  8. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  9. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
  10. $this->_tpl_vars = $_smarty_tpl_vars;
  11. unset($_smarty_tpl_vars);
  12. ?>
  13. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  14. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
  15. $this->_tpl_vars = $_smarty_tpl_vars;
  16. unset($_smarty_tpl_vars);
  17. ?>
  18. <style>
  19. .set-nav {
  20. margin: 0 auto;
  21. }
  22. .set-nav-hr {
  23. background-color: #ddd;
  24. height: 1px;
  25. position: relative;
  26. }
  27. .form-group label {
  28. font-weight: 600;
  29. }
  30. .checkbox-inline, .radio-inline {
  31. font-weight: 400!important;
  32. }
  33. .rowlabel {
  34. font-weight: 300!important;
  35. }
  36. .music_play_hide {
  37. display:none;
  38. }
  39. </style>
  40. <?php if (! $this->_tpl_vars['platfrom']): ?>
  41. 请先创建一个列表。进入<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  42. /?c=Admin_Platform_index&a=PageList">平台列表</a>
  43. <?php else: ?>
  44. <div class="panel panel-default col-md-7">
  45. <div class="panel-body">
  46. <table class="table">
  47. <thead>
  48. <tr>
  49. <th>UID</th>
  50. <th>用户名</th>
  51. <th>权限组</th>
  52. <th>权限设置</th>
  53. <th>平台列表</th>
  54. <th>密码修改</th>
  55. <th>删除</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <?php if (! $this->_tpl_vars['users']): ?>
  60. <tr><td colspan="4" align="center">暂无用户信息</td></tr>
  61. <?php endif; ?>
  62. <?php $_from = $this->_tpl_vars['users']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  63. foreach ($_from as $this->_tpl_vars['user']):
  64. ?>
  65. <tr>
  66. <td><?php echo $this->_tpl_vars['user']['uid']; ?>
  67. </td>
  68. <td><?php echo $this->_tpl_vars['user']['name']; ?>
  69. </td>
  70. <td><?php if ($this->_tpl_vars['user']['permission'] == 'admin'): ?> <span class="text-primary">管理员</span> <?php else: ?> 普通帐号 <?php endif; ?> </td>
  71. <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  72. /?c=admin_backUser&a=setPermission&uid=<?php echo $this->_tpl_vars['user']['uid']; ?>
  73. ">权限设置</a></td>
  74. <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  75. /?c=admin_backUser&a=SetPlatfrom&uid=<?php echo $this->_tpl_vars['user']['uid']; ?>
  76. ">平台列表</a>
  77. <td><a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  78. /?c=Admin_BackUser&a=MP&uid=<?php echo $this->_tpl_vars['user']['uid']; ?>
  79. ">密码修改</a></td>
  80. <td><a href="javascript:;" class="deleteUser" data-uid="<?php echo $this->_tpl_vars['user']['uid']; ?>
  81. ">删除</a></td>
  82. </tr>
  83. <?php endforeach; endif; unset($_from); ?>
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. <form id="create_user_form" action="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
  89. /?c=Admin_BackUser&a=CreateUser" method="post">
  90. <div class="col-md-5" style="padding-left: 30px;">
  91. <?php if ($this->_tpl_vars['errMsg']['ok']): ?>
  92. <div class="tip_message_success">创建成功</div>
  93. <?php endif; ?>
  94. <?php if (! $this->_tpl_vars['errMsg']['ok'] && $this->_tpl_vars['errMsg']['msg']): ?>
  95. <div class="tip_message_fail">创建失败,原因:<?php echo $this->_tpl_vars['errMsg']['msg']; ?>
  96. </div>
  97. <?php endif; ?>
  98. <?php if (! $this->_tpl_vars['errMsg'] || $this->_tpl_vars['errMsg']['msg']): ?>
  99. <div class="form-group">
  100. <label class="control-label">创建新帐号</label>
  101. </div>
  102. <div class="form-group">
  103. <label class="control-label rowlabel">用户名</label>
  104. <input name="name" type="text" class="form-control" value="<?php echo $this->_tpl_vars['submitData']['name']; ?>
  105. ">
  106. </div>
  107. <div class="form-group">
  108. <label class="control-label rowlabel">密码</label>
  109. <input name="password" type="password" class="form-control" value="<?php echo $this->_tpl_vars['submitData']['password']; ?>
  110. ">
  111. </div>
  112. <div class="form-group">
  113. <label><input name="auto_generate" type="checkbox" value="1" <?php if ($this->_tpl_vars['submitData']['auto_generate']): ?>checked<?php endif; ?>> 自动生成密码</label>
  114. </div>
  115. <div class="form-group">
  116. <label class="control-label rowlabel">平台列表</label>
  117. <div>
  118. <?php $_from = $this->_tpl_vars['platfrom']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  119. foreach ($_from as $this->_tpl_vars['item']):
  120. ?>
  121. <label class="checkbox-inline"><input name="platfrom[]" type="checkbox" value="<?php echo $this->_tpl_vars['item']['id']; ?>
  122. " > <?php echo $this->_tpl_vars['item']['name']; ?>
  123. </label>
  124. <?php endforeach; endif; unset($_from); ?>
  125. </div>
  126. </div>
  127. <div class="form-group">
  128. <label class="control-label rowlabel">邮箱</label>
  129. <input name="email" type="text" class="form-control" value="<?php echo $this->_tpl_vars['submitData']['email']; ?>
  130. ">
  131. </div>
  132. <div class="form-group">
  133. <label class="control-label rowlabel">部门</label>
  134. <input name="division" type="text" class="form-control" value="<?php echo $this->_tpl_vars['submitData']['division']; ?>
  135. ">
  136. </div>
  137. <div>
  138. <button id="add_platform_btn" class="button button-primary button-small">创建</button>
  139. </div>
  140. <?php endif; ?>
  141. <?php if ($this->_tpl_vars['errMsg']['ok']): ?>
  142. <div class="form-group">
  143. <label class="control-label rowlabel">用户名:</label>
  144. <?php echo $this->_tpl_vars['new_user']['name']; ?>
  145. </div>
  146. <div class="form-group">
  147. <label class="control-label rowlabel">密码:</label>
  148. <?php echo $this->_tpl_vars['new_user']['password']; ?>
  149. </div>
  150. <div class="form-group">
  151. <label class="control-label rowlabel">平台列表:</label>
  152. <?php $_from = $this->_tpl_vars['submitData']['platfrom']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
  153. foreach ($_from as $this->_tpl_vars['platfromId']):
  154. ?>
  155. <?php echo $this->_tpl_vars['platfrom'][$this->_tpl_vars['platfromId']]['name']; ?>
  156. &nbsp;
  157. <?php endforeach; endif; unset($_from); ?>
  158. </div>
  159. <div class="form-group">
  160. <label class="control-label rowlabel">邮箱:</label>
  161. <?php echo $this->_tpl_vars['new_user']['email']; ?>
  162. </div>
  163. <div class="form-group">
  164. <label class="control-label rowlabel">部门:</label>
  165. <?php echo $this->_tpl_vars['new_user']['division']; ?>
  166. </div>
  167. <?php endif; ?>
  168. </div>
  169. </form>
  170. <?php endif; ?>
  171. <script>
  172. KISSY.use('node, io', function (S, Node, IO) {
  173. var $ = S.all;
  174. $('#add_platform_btn').on('click', function () {
  175. var name = $('input[name=name]').val();
  176. if (S.trim(name) == '') {
  177. showError('姓名不能为空');
  178. return false;
  179. }
  180. });
  181. function showError($msg) {
  182. alert($msg);
  183. }
  184. $(".deleteUser").on('click', function () {
  185. var uid = $(this).attr('data-uid');
  186. if (!uid) {
  187. alert('无效uid');
  188. return false;
  189. }
  190. if (!confirm('确定要删除帐号?')) {
  191. return false;
  192. }
  193. new IO({
  194. type: "post"
  195. , url: VG.conf.root_domain + '/?c=admin_backUser&a=DeleteUser'
  196. , data: {'uid':uid}
  197. , success: function (data) {
  198. if (data.ok) { //ok
  199. alert('操作成功');
  200. location.reload();
  201. } else {
  202. alert('操作失败,原因:'+data.msg);
  203. }
  204. return false;
  205. }
  206. , error: function (NULL, textStatus) {
  207. alert("请求服务器失败,原因:"+textStatus);
  208. }
  209. , dataType: "json"
  210. });
  211. });
  212. });
  213. </script>
  214. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  215. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  216. $this->_tpl_vars = $_smarty_tpl_vars;
  217. unset($_smarty_tpl_vars);
  218. ?>