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.

170 lines
7.0 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <div class="row">
  2. <div class="col-sm-4">
  3. <div class="ax-button-group">
  4. <div class="left">
  5. <h4>배너 분류</h4>
  6. </div>
  7. <div class="right">
  8. <button type="button" class="btn btn-default" data-button="btn-banner-group-form" data-idx=""><i class="fal fa-plus-circle"></i> 배너그룹 추가</button>
  9. </div>
  10. </div>
  11. <div class="grid">
  12. <table>
  13. <thead>
  14. <tr>
  15. <th class="W20"></th>
  16. <th>분류이름</th>
  17. <th class="W80">관리</th>
  18. </tr>
  19. </thead>
  20. <tbody data-toggle="sortable" data-key="bng_idx" data-sort="bng_sort" data-table="banner_group">
  21. <?php foreach($banner_group_list['list'] as $row) :?>
  22. <tr class="<?=isset($bng_key)&&$bng_key==$row['bng_key']?'active':''?>">
  23. <td class="text-center">
  24. <span class="move-grip"></span>
  25. <input type="hidden" name="bng_idx[]" value="<?=$row['bng_idx']?>">
  26. </td>
  27. <td><i class="fal <?=isset($bng_key)&&$bng_key==$row['bng_key']?'fa-folder-open':'fa-folder'?>"></i>&nbsp;<a href="<?=base_url('admin/management/banner/'.$row['bng_key'])?>"><?=$row['bng_name']?></a></td>
  28. <td class="text-center">
  29. <button type="button" class="btn btn-default btn-xs MR5" data-button="btn-banner-group-form" data-idx="<?=$row['bng_idx']?>"><i class="fal fa-pencil"></i></button>
  30. <button type="button" class="btn btn-danger btn-xs" data-button="btn-banner-group-delete" data-idx="<?=$row['bng_idx']?>"><i class="fal fa-trash"></i></button>
  31. </td>
  32. </tr>
  33. <?php endforeach;?>
  34. <?php if(count($banner_group_list['list']) == 0) :?>
  35. <tr>
  36. <td colspan="4" class="empty">등록된 배너 그룹이 없습니다.</td>
  37. </tr>
  38. <?php endif;?>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <div class="col-sm-8">
  44. <?php if($bng_key) :?>
  45. <div class="ax-button-group">
  46. <div class="left">
  47. <h4>[<?=$banner_group['bng_name']?>] 배너 관리</h4>
  48. </div>
  49. <div class="right">
  50. <button type="button" class="btn btn-default" data-button="btn-banner-form" data-bng-key="<?=$bng_key?>" data-idx=""><i class="fal fa-plus-circle"></i> 배너 추가</button>
  51. </div>
  52. </div>
  53. <p class="alert alert-info">한장만 표시되는 배너의 경우 가장 첫번째 순서의 배너를 가져옵니다.</p>
  54. <div class="grid">
  55. <table>
  56. <thead>
  57. <tr>
  58. <th class="W20"></th>
  59. <th class="W250">썸네일</th>
  60. <th>이름</th>
  61. <th class="W150">관리</th>
  62. </tr>
  63. </thead>
  64. <tbody data-toggle="sortable" data-key="ban_idx" data-sort="ban_sort" data-table="banner">
  65. <?php foreach($banner_list['list'] as $row) :?>
  66. <tr>
  67. <td class="text-center">
  68. <span class="move-grip"></span>
  69. <input type="hidden" name="ban_idx[]" value="<?=$row['ban_idx']?>">
  70. </td>
  71. <td><?=thumb_img($row['ban_filepath'],'img-thumbnail','style="max-width:250px"')?></td>
  72. <td><?=$row['ban_name']?></td>
  73. <td class="text-center W150">
  74. <button type="button" class="btn btn-default btn-xs MR5" data-button="btn-banner-form" data-bng-key="<?=$bng_key?>" data-idx="<?=$row['ban_idx']?>"><i class="fal fa-pencil"></i></button>
  75. <button type="button" class="btn btn-danger btn-xs" data-button="btn-banner-delete" data-idx="<?=$row['ban_idx']?>"><i class="fal fa-trash"></i></button>
  76. </td>
  77. </tr>
  78. <?php endforeach;?>
  79. <?php if(count($banner_list['list']) == 0) :?>
  80. <tr>
  81. <td colspan="4" class="empty">등록된 배너가 없습니다.</td>
  82. </tr>
  83. <?php endif;?>
  84. </tbody>
  85. </table>
  86. </div>
  87. <?php endif;?>
  88. </div>
  89. </div>
  90. <script>
  91. $(function(){
  92. $('[data-button="btn-banner-group-form"]').click(function(){
  93. var bng_idx = $(this).data('idx');
  94. APP.MODAL.open({
  95. iframe : {
  96. url : base_url + '/admin/management/banner_group_form',
  97. param : {
  98. bng_idx : bng_idx
  99. }
  100. },
  101. width: 500,
  102. height: 400,
  103. header : {
  104. title : '배너 그룹 정보'
  105. }
  106. });
  107. });
  108. $('[data-button="btn-banner-group-delete"]').click(function(){
  109. var idx= $(this).data('idx');
  110. if( typeof idx == 'undefined' || ! idx) {
  111. alert('잘못된 접근입니다.');
  112. return;
  113. }
  114. if(! confirm('선택하신 배너 그룹을 삭제하시겠습니까?')) {
  115. return;
  116. }
  117. location.href = base_url + "/admin/management/banner_group_delete/" + idx;
  118. });
  119. $('[data-button="btn-banner-form"]').click(function(){
  120. var ban_idx = $(this).data('idx');
  121. var bng_key = $(this).data('bng-key');
  122. if(typeof bng_key =='undefined' || ! bng_key) {
  123. alert('잘못된 접근입니다.');
  124. return;
  125. }
  126. APP.MODAL.open({
  127. iframe : {
  128. url : base_url + '/admin/management/banner_form',
  129. param : {
  130. bng_key : bng_key,
  131. ban_idx : ban_idx
  132. }
  133. },
  134. width: 500,
  135. height: 650,
  136. header : {
  137. title : '배너정보'
  138. }
  139. });
  140. });
  141. $('[data-button="btn-banner-delete"]').click(function(){
  142. var idx= $(this).data('idx');
  143. if( typeof idx == 'undefined' || ! idx) {
  144. alert('잘못된 접근입니다.');
  145. return;
  146. }
  147. if(! confirm('선택하신 배너를 삭제하시겠습니까?')) {
  148. return;
  149. }
  150. location.href = base_url + "/admin/management/banner_delete/" + idx;
  151. });
  152. });
  153. </script>