心理咨询网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.html 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">用户列表</li>
  7. <li lay-id="t2">用户新增</li>
  8. </ul>
  9. <div class="layui-tab-content">
  10. <div class="layui-tab-item layui-show">
  11. <form action="{url./admin/User/index}" method="get" class="layui-form">
  12. <div class="layui-form-item nospace">
  13. <div class="layui-input-inline">
  14. {$pathinfo}
  15. <select name="field" lay-verify="required">
  16. <option value="ucode" {if(get('field')=='ucode')}selected="selected" {/if} >用户编码</option>
  17. <option value="username" {if(get('field')=='username')}selected="selected" {/if}>用户名</option>
  18. </select>
  19. </div>
  20. <div class="layui-input-inline">
  21. <input type="text" name="keyword" value="{$get.keyword}" placeholder="请输入搜索关键字" class="layui-input">
  22. </div>
  23. <div class="layui-input-inline">
  24. <button class="layui-btn" lay-submit>搜索</button>
  25. <a class="layui-btn layui-btn-primary" href="{url./admin/User/index}">清除搜索</a>
  26. </div>
  27. </div>
  28. </form>
  29. <table class="layui-table">
  30. <tr>
  31. <th>序号</th>
  32. <th>用户编码</th>
  33. <th>用户名</th>
  34. <th>真实名字</th>
  35. <th>状态</th>
  36. <th>用户角色</th>
  37. <th>登录次数</th>
  38. <th>最后登录IP</th>
  39. <th>最后登录时间</th>
  40. <th>操作</th>
  41. </tr>
  42. {foreach $users(key,value,num)}
  43. <tr>
  44. <td>[num]</td>
  45. <td>[value->ucode]</td>
  46. <td>[value->username]</td>
  47. <td>[value->realname]</td>
  48. <td>
  49. {if($value->ucode=='10001')}
  50. <i class='fa fa-toggle-on' title="超级管理员不可操作"></i>
  51. {else}
  52. {if($value->status)}
  53. <a href="{url./admin/'.C.'/mod/ucode/'.$value->ucode.'/field/status/value/0}"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
  54. {else}
  55. <a href="{url./admin/'.C.'/mod/ucode/'.$value->ucode.'/field/status/value/1}"><i class='fa fa-toggle-off' title="点击开启"></i></a>
  56. {/if}
  57. {/if}
  58. </td>
  59. <td>[value->rolename]</td>
  60. <td>[value->login_count]</td>
  61. <td>{fun=@long2ip($value->last_login_ip)}</td>
  62. <td>[value->update_time]</td>
  63. <td>
  64. {if($value->ucode=='10001')}
  65. 不可操作
  66. {else}
  67. {fun=get_btn_del($value->ucode,'ucode')}
  68. {fun=get_btn_mod($value->ucode,'ucode')}
  69. {/if}
  70. </td>
  71. </tr>
  72. {/foreach}
  73. </table>
  74. <div class="page">{$pagebar}</div>
  75. </div>
  76. <div class="layui-tab-item">
  77. <form action="{url./admin/User/add}" method="post" class="layui-form">
  78. <input type="hidden" name="formcheck" value="{$formcheck}" >
  79. <div class="layui-form-item">
  80. <label class="layui-form-label">用户账号</label>
  81. <div class="layui-input-block">
  82. <input type="text" name="username" required lay-verify="required" placeholder="请输入用户账号" class="layui-input">
  83. </div>
  84. </div>
  85. <div class="layui-form-item">
  86. <label class="layui-form-label">真实姓名</label>
  87. <div class="layui-input-block">
  88. <input type="text" name="realname" placeholder="请输入真实姓名" class="layui-input">
  89. </div>
  90. </div>
  91. <div class="layui-form-item">
  92. <label class="layui-form-label">用户密码</label>
  93. <div class="layui-input-block">
  94. <input type="password" name="password" required lay-verify="required" placeholder="请输入用户密码" autocomplete="off" class="layui-input">
  95. </div>
  96. </div>
  97. <div class="layui-form-item">
  98. <label class="layui-form-label">确认密码</label>
  99. <div class="layui-input-block">
  100. <input type="password" name="rpassword" required lay-verify="required" placeholder="请输入确认密码" autocomplete="off" class="layui-input">
  101. </div>
  102. </div>
  103. <div class="layui-form-item">
  104. <label class="layui-form-label">账号状态</label>
  105. <div class="layui-input-block">
  106. <input type="radio" name="status" value="1" title="启用" checked>
  107. <input type="radio" name="status" value="0" title="禁用">
  108. </div>
  109. </div>
  110. <div class="layui-form-item">
  111. <label class="layui-form-label">用户角色</label>
  112. <div class="layui-input-block">
  113. <select name="roles[]">
  114. {foreach $roles(key,value)}
  115. <option value="[value->rcode]">[value->name]</option>
  116. {/foreach}
  117. </select>
  118. </div>
  119. </div>
  120. <div class="layui-form-item">
  121. <div class="layui-input-block">
  122. <button class="layui-btn" lay-submit>立即提交</button>
  123. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  124. </div>
  125. </div>
  126. </form>
  127. </div>
  128. </div>
  129. </div>
  130. {/if}
  131. {if([$mod])}
  132. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  133. <ul class="layui-tab-title">
  134. <li class="layui-this">用户修改</li>
  135. </ul>
  136. <div class="layui-tab-content">
  137. <div class="layui-tab-item layui-show">
  138. <form action="{url./admin/User/mod/ucode/'.[$get.ucode].'}{$backurl}" method="post" class="layui-form">
  139. <input type="hidden" name="formcheck" value="{$formcheck}" >
  140. <div class="layui-form-item">
  141. <label class="layui-form-label">用户账号</label>
  142. <div class="layui-input-block">
  143. <input type="text" name="username" required lay-verify="required" value="{$user->username}" placeholder="请输入用户账号" class="layui-input">
  144. </div>
  145. </div>
  146. <div class="layui-form-item">
  147. <label class="layui-form-label">真实姓名</label>
  148. <div class="layui-input-block">
  149. <input type="text" name="realname" value="{$user->realname}" placeholder="请输入真实姓名" class="layui-input">
  150. </div>
  151. </div>
  152. <div class="layui-form-item">
  153. <label class="layui-form-label">用户密码</label>
  154. <div class="layui-input-block">
  155. <input type="password" name="password" placeholder="请输入用户密码" autocomplete="off" class="layui-input">
  156. </div>
  157. </div>
  158. <div class="layui-form-item">
  159. <label class="layui-form-label">确认密码</label>
  160. <div class="layui-input-block">
  161. <input type="password" name="rpassword" placeholder="请输入确认密码" autocomplete="off" class="layui-input">
  162. </div>
  163. </div>
  164. <div class="layui-form-item">
  165. <label class="layui-form-label">账号状态</label>
  166. <div class="layui-input-block">
  167. <input type="radio" name="status" value="1" title="启用" {if([$user->status]==1)}checked{/if}>
  168. <input type="radio" name="status" value="0" title="禁用" {if([$user->status]==0)}checked{/if}>
  169. </div>
  170. </div>
  171. <div class="layui-form-item">
  172. <label class="layui-form-label">用户角色</label>
  173. <div class="layui-input-block">
  174. <select name="roles[]">
  175. {foreach $roles(key,value)}
  176. <option value="[value->rcode]" {if(in_array($value->rcode,[$user->rcodes]))}selected{/if}>[value->name]</option>
  177. {/foreach}
  178. </select>
  179. </div>
  180. </div>
  181. <div class="layui-form-item">
  182. <div class="layui-input-block">
  183. <button class="layui-btn" lay-submit>立即提交</button>
  184. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  185. {fun=get_btn_back()}
  186. </div>
  187. </div>
  188. </form>
  189. </div>
  190. </div>
  191. </div>
  192. {/if}
  193. </div>
  194. {include file='common/foot.html'}