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.

84 lines
2.8 KiB

7 years ago
  1. <div class="page-header">
  2. <h1 class="page-title">관리자 관리</h1>
  3. </div>
  4. <div class="row">
  5. <div class="col-lg-6 col-md-8 col-sm-10">
  6. <div class="ax-button-group">
  7. <div class="left">
  8. <h4>등록된 관리자 목록</h4>
  9. </div>
  10. <div class="right">
  11. <button type="button" class="btn btn-default" data-button="admin-add">관리자 추가</button>
  12. </div>
  13. </div>
  14. <div data-ax5grid>
  15. <table>
  16. <thead>
  17. <tr>
  18. <th>#</th>
  19. <th>아이디</th>
  20. <th>이름</th>
  21. <th>권한레벨</th>
  22. <th>관리</th>
  23. </tr>
  24. </thead>
  25. <tbody>
  26. <?php foreach($lists as $i=>$row) :?>
  27. <tr>
  28. <td class="text-center"><?=$i+1?></td>
  29. <td class="text-center"><?=$row['mem_userid']?></td>
  30. <td class="text-center"><?=$row['mem_nickname']?></td>
  31. <td class="text-center"><?=$row['mem_auth']?></td>
  32. <td class="text-center">
  33. <?php if($row['mem_idx'] != 1):?>
  34. <button type="button" class="btn btn-danger" data-button="admin-remove" data-idx="<?=$row['mem_idx']?>">삭제</button>
  35. <?php endif;?>
  36. </td>
  37. </tr>
  38. <?php endforeach;?>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. </div>
  44. <script>
  45. $(function(){
  46. $('[data-button="admin-add"]').click(function(e){
  47. APP.MODAL.callback = function() {
  48. location.reload();
  49. };
  50. APP.MODAL.open({
  51. iframe : {
  52. url : '/admin/setting/admin_add'
  53. },
  54. header : {
  55. title : '관리자 추가'
  56. },
  57. width: 800,
  58. height:600
  59. })
  60. });
  61. $('[data-button="admin-remove"]').click(function(e){
  62. e.preventDefault();
  63. var idx = $(this).data('idx');
  64. if(! confirm('해당 사용자의 관리자 권한을 제거하고, 권한레벨을 초기값으로 설정하시겠습니까?')) return;
  65. $.ajax({
  66. url : '/ajax/members/admin',
  67. type : 'DELETE',
  68. data : {
  69. mem_idx : idx
  70. },
  71. success:function(res) {
  72. alert('지정한 회원의 관리자 권한을 삭제하였습니다.');
  73. location.reload();
  74. }
  75. })
  76. });
  77. });
  78. </script>