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.

71 lines
2.3 KiB

7 years ago
  1. <div class="page-header">
  2. <h2 class="page-title">관리자 추가</h2>
  3. </div>
  4. <form class="form-flex" autocomplete="off">
  5. <div class="form-group">
  6. <label class="control-label control-label-sm">회원 검색</label>
  7. <div class="controls">
  8. <select class="form-control form-control-inline" name="scol">
  9. <option value="mem_nickname" <?=$scol=='mem_nickname'?'selected':''?>>닉네임 검색</option>
  10. <option value="mem_userid" <?=$scol=='mem_userid'?'selected':''?>>아이디 검색</option>
  11. </select>
  12. <input class="form-control form-control-inline" name="stxt" value="<?=$stxt?>">
  13. <button class="btn btn-lg btn-default">검색</button>
  14. </div>
  15. </div>
  16. </form>
  17. <div data-ax5grid>
  18. <table>
  19. <thead>
  20. <tr>
  21. <th>아이디</th>
  22. <th>닉네임</th>
  23. <th>권한레벨</th>
  24. <th>관리</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php if(count($lists) == 0) :?>
  29. <tr>
  30. <td colspan="4" class="empty">검색된 회원이 없습니다.</td>
  31. </tr>
  32. <?php endif;?>
  33. <?php foreach($lists as $row):?>
  34. <tr>
  35. <td class="text-center"><?=$row['mem_userid']?></td>
  36. <td class="text-center"><?=$row['mem_nickname']?></td>
  37. <td class="text-center"><?=$row['mem_auth']?></td>
  38. <td class="text-center">
  39. <button type="button" class="btn btn-primary" data-button="admin-add-ok" data-idx="<?=$row['mem_idx']?>">추가하기</button>
  40. </td>
  41. </tr>
  42. <?php endforeach;?>
  43. </tbody>
  44. </table>
  45. </div>
  46. <script>
  47. $(function(){
  48. $('[data-button="admin-add-ok"]').click(function(e){
  49. e.preventDefault();
  50. var idx = $(this).data('idx');
  51. if(! confirm('해당 회원을 관리자로 추가하시겠습니까?')) return false;
  52. $.ajax({
  53. url : '/ajax/members/admin',
  54. type : 'POST',
  55. async: false,
  56. cache: false,
  57. data : {
  58. mem_idx : idx
  59. },
  60. success:function() {
  61. alert('지정한 사용자를 관리자로 추가하였습니다.');
  62. location.reload();
  63. }
  64. })
  65. });
  66. });
  67. </script>