人人商城

edit.html 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. {template 'common/header-gw'}
  2. <ol class="breadcrumb">
  3. <li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
  4. <li><a href="{url 'user/display'}">系统</a></li>
  5. <li><a href="{url 'user/display'}">用户列表</a></li>
  6. <li class="active">编辑用户</li>
  7. </ol>
  8. <ul class="nav nav-tabs">
  9. <li><a href="{php echo url('user/display');}">用户列表</a></li>
  10. <li><a href="{php echo url('user/create');}">添加用户</a></li>
  11. <li class="active"><a href="{php echo url('user/edit', array('uid' => $uid));}">编辑用户</a></li>
  12. <li><a href="{php echo url('user/permission', array('uid' => $uid));}">查看用户权限</a></li>
  13. </ul>
  14. <div class="clearfix">
  15. <form action="" method="post" class="form-horizontal" role="form" id="form1">
  16. <h5 class="page-header">编辑用户基本资料</h5>
  17. <div class="form-group">
  18. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">用户名</label>
  19. <div class="col-sm-10 col-xs-12">
  20. <span class="uneditable-input form-control">{$user['username']}</span>
  21. <span class="help-block">当前编辑的用户名</span>
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">新密码</label>
  26. <div class="col-sm-10 col-xs-12">
  27. <input id="password" name="password" type="password" class="form-control" autocomplete="off" value="" />
  28. <span class="help-block">请填写密码,最小长度为 8 个字符。如果不更改密码此处请留空</span>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">确认新密码</label>
  33. <div class="col-sm-10 col-xs-12">
  34. <input id="repassword" type="password" class="form-control" value="" autocomplete="off" />
  35. <span class="help-block">重复输入密码,确认正确输入。如果不更改密码此处请留空</span>
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">服务时间</label>
  40. <div class="col-sm-10 col-xs-12">
  41. <p class="form-control-static">
  42. <strong class="text-danger">
  43. 开始时间:{php echo date('Y-m-d', $user['starttime'])}
  44. ~~
  45. 到期时间:{if !$user['endtime']}永久有效{else}{php echo date('Y-m-d', $user['endtime'])}{/if}
  46. </strong>
  47. </p>
  48. <span class="help-block">重复输入密码,确认正确输入。如果不更改密码此处请留空</span>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">设置到期时间</label>
  53. <div class="col-sm-10 col-xs-12">
  54. <label class="radio-inline"><input class="" name="endtype" value="2" onclick="$(this).parent().parent().parent().next().show();" {if !empty($user['endtime'])}checked{/if} type="radio">设置期限</label>
  55. <label class="radio-inline"><input class="" name="endtype" value="1" onclick="$(this).parent().parent().parent().next().hide();" {if empty($user['endtime'])}checked{/if} type="radio">永久</label>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label"></label>
  60. <div class="col-sm-10 col-xs-12">
  61. {php echo tpl_form_field_date('endtime', $user['endtime']);}
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">所属用户组</label>
  66. <div class="col-sm-10 col-xs-12">
  67. <select name="groupid" class="form-control" id="groupid">
  68. <option value="0">请选择所属用户组</option>
  69. {loop $groups $row}
  70. <option value="{$row['id']}" {if $user['groupid'] == $row['id']}selected{/if}>{$row['name']}</option>
  71. {/loop}
  72. </select>
  73. <span class="help-block">分配用户所属用户组后,该用户会自动拥有此用户组内的模块操作权限</span>
  74. <span class="help-block"><strong class="text-danger">更改用户的所属会员组后,该用户的服务到期时间为:当前时间 + 更改用户组的服务有效期。</strong></span>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">备注</label>
  79. <div class="col-sm-10 col-xs-12">
  80. <textarea id="" name="remark" style="height:80px;" class="form-control">{$user['remark']}</textarea>
  81. <span class="help-block">方便注明此用户的身份</span>
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">上次登录时间</label>
  86. <div class="col-sm-10 col-xs-12">
  87. <span class="uneditable-input form-control">{php echo date('Y-m-d H:i:s', $user['lastvisit']);}</span>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">上次登录IP</label>
  92. <div class="col-sm-10 col-xs-12">
  93. <span class="uneditable-input form-control">{$user['lastip']}</span>
  94. </div>
  95. </div>
  96. {if !empty($extendfields)}
  97. <h5 class="page-header">编辑用户基本资料</h5>
  98. {if $extendfields}
  99. {loop $extendfields $item}
  100. {if $item['field']=='birthyear'}
  101. <div class="form-group">
  102. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">{$item['title']}:{if $item['required']}<span style="color:red">*</span>{/if}</label>
  103. <div class="col-sm-10 col-xs-12">
  104. {php echo tpl_fans_form($item['field'],$user['profile']['birth']);}
  105. </div>
  106. </div>
  107. {elseif $item['field']=='resideprovince'}
  108. <div class="form-group">
  109. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">{$item['title']}:{if $item['required']}<span style="color:red">*</span>{/if}</label>
  110. <div class="col-sm-10 col-xs-12">
  111. {php echo tpl_fans_form($item['field'],$user['profile']['reside']);}
  112. </div>
  113. </div>
  114. {else}
  115. <div class="form-group">
  116. <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">{$item['title']}:{if $item['required']}<span style="color:red">*</span>{/if}</label>
  117. <div class="col-sm-10 col-xs-12">
  118. {php echo tpl_fans_form($item['field'], $user['profile'][$item['field']]);}
  119. </div>
  120. </div>
  121. {/if}
  122. {/loop}
  123. {/if}
  124. {/if}
  125. <div class="form-group">
  126. <div class="col-sm-offset-2 col-md-offset-2 col-lg-offset-2 col-xs-12 col-sm-10 col-md-10 col-lg-10">
  127. <input type="submit" class="btn btn-primary" name="profile_submit" value="保存用户资料" /> &nbsp; &nbsp;
  128. <a class="btn btn-default" href="{url 'user/permission' array('uid' => $uid)}">查看当前用户操作权限</a>
  129. <input type="hidden" name="token" value="{$_W['token']}" />
  130. </div>
  131. </div>
  132. </form>
  133. </div>
  134. <script type="text/javascript">
  135. $(function () {
  136. if ($('[name="endtype"]:checked').val() == 1) {
  137. $('[name="endtime"]').parent().parent().hide();
  138. }
  139. });
  140. $('#form1').submit(function(){
  141. if($('#password').val().trim() != '') {
  142. if($('#password').val().length < 8) {
  143. util.message('密码长度不能小于8个字符.', '', 'error');
  144. return false;
  145. }
  146. if($('#password').val() != $('#repassword').val()) {
  147. util.message('两次输入的密码不一致.', '', 'error');
  148. return false;
  149. }
  150. }
  151. if($('#groupid option:selected').val() == 0) {
  152. util.message('请选择所属用户组.', '', 'error');
  153. return false;
  154. }
  155. if ($('[name="endtype"]:checked').val() == '1') {
  156. $('[name="endtime"]').val(0);
  157. }
  158. });
  159. </script>
  160. {template 'common/footer-gw'}