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.

174 lines
8.8 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
  1. <div class="page-header">
  2. <h1 class="page-title">메뉴 관리</h1>
  3. </div>
  4. <?=form_open("admin/management/menu_multi_update")?>
  5. <div class="ax-button-group">
  6. <div class="left">
  7. <button type="button" class="btn btn-default" onclick="menu_form(0);"><i class="fal fa-plus-circle"></i> 대메뉴 등록</button>
  8. </div>
  9. <div class="right">
  10. <button class="btn btn-primary"><i class="fal fa-save"></i> 저장하기</button>
  11. </div>
  12. </div>
  13. <div class="grid">
  14. <table>
  15. <thead>
  16. <tr>
  17. <th colspan="3">메뉴 이름</th>
  18. <th>메뉴 링크</th>
  19. <th class="W80">메뉴 순서</th>
  20. <th class="W100">새창보기</th>
  21. <th class="W80">PC보기</th>
  22. <th class="W80">모바일보기</th>
  23. <th>Active </th>
  24. <th class="W160">관리</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. <?php foreach($menu_list as $row):?>
  29. <tr>
  30. <td colspan="3">
  31. <input type="hidden" name="mnu_idx[]" value="<?=$row['mnu_idx']?>" required>
  32. <input class="form-control" name="mnu_name[]" value="<?=$row['mnu_name']?>" required>
  33. </td>
  34. <td>
  35. <input class="form-control" name="mnu_link[]" value="<?=$row['mnu_link']?>" required>
  36. </td>
  37. <td>
  38. <input type="number" class="form-control" name="mnu_order[]" value="<?=$row['mnu_order']?>">
  39. </td>
  40. <td>
  41. <select class="form-control" name="mnu_newtab[]">
  42. <option value="N" <?=$row['mnu_newtab']=='N'?'selected':''?>>아니오</option>
  43. <option value="Y" <?=$row['mnu_newtab']=='Y'?'selected':''?>>새창열기</option>
  44. </select>
  45. </td>
  46. <td>
  47. <select class="form-control" name="mnu_desktop[]">
  48. <option value="Y" <?=$row['mnu_desktop']=='Y'?'selected':''?>>표시</option>
  49. <option value="N" <?=$row['mnu_desktop']=='N'?'selected':''?>>미표시</option>
  50. </select>
  51. </td>
  52. <td>
  53. <select class="form-control" name="mnu_mobile[]">
  54. <option value="Y" <?=$row['mnu_mobile']=='Y'?'selected':''?>>표시</option>
  55. <option value="N" <?=$row['mnu_mobile']=='N'?'selected':''?>>미표시</option>
  56. </select>
  57. </td>
  58. <td>
  59. <input class="form-control" name="mnu_active_key[]" value="<?=$row['mnu_active_key']?>">
  60. </td>
  61. <td>
  62. <button type="button" class="btn btn-default btn-sm MR5" onclick="menu_form('<?=$row['mnu_idx']?>');"><i class="fal fa-plus-circle"></i> 하위메뉴 등록</button>
  63. <a class="btn btn-danger btn-sm" href="<?=base_url('admin/management/menu_delete/'.$row['mnu_idx'])?>" onclick="return confirm('메뉴를 삭제하시겠습니까?');">삭제</a>
  64. </td>
  65. </tr>
  66. <?php foreach($row['children'] as $row2) :?>
  67. <tr>
  68. <td class="text-right W20"></td>
  69. <td colspan="2">
  70. <input type="hidden" name="mnu_idx[]" value="<?=$row2['mnu_idx']?>" required>
  71. <input class="form-control" name="mnu_name[]" value="<?=$row2['mnu_name']?>" required>
  72. </td>
  73. <td>
  74. <input class="form-control" name="mnu_link[]" value="<?=$row2['mnu_link']?>" required>
  75. </td>
  76. <td>
  77. <input type="number" class="form-control" name="mnu_order[]" value="<?=$row2['mnu_order']?>">
  78. </td>
  79. <td>
  80. <select class="form-control" name="mnu_newtab[]">
  81. <option value="N" <?=$row2['mnu_newtab']=='N'?'selected':''?>>아니오</option>
  82. <option value="Y" <?=$row2['mnu_newtab']=='Y'?'selected':''?>>새창열기</option>
  83. </select>
  84. </td>
  85. <td>
  86. <select class="form-control" name="mnu_desktop[]">
  87. <option value="Y" <?=$row2['mnu_desktop']=='Y'?'selected':''?>>표시</option>
  88. <option value="N" <?=$row2['mnu_desktop']=='N'?'selected':''?>>미표시</option>
  89. </select>
  90. </td>
  91. <td>
  92. <select class="form-control" name="mnu_mobile[]">
  93. <option value="Y" <?=$row2['mnu_mobile']=='Y'?'selected':''?>>표시</option>
  94. <option value="N" <?=$row2['mnu_mobile']=='N'?'selected':''?>>미표시</option>
  95. </select>
  96. </td>
  97. <td>
  98. <input class="form-control" name="mnu_active_key[]" value="<?=$row2['mnu_active_key']?>">
  99. </td>
  100. <td>
  101. <button type="button" class="btn btn-default btn-sm MR5" onclick="menu_form('<?=$row2['mnu_idx']?>');"><i class="fal fa-plus-circle"></i> 하위메뉴 등록</button>
  102. <a class="btn btn-danger btn-sm" href="<?=base_url('admin/management/menu_delete/'.$row2['mnu_idx'])?>" onclick="return confirm('메뉴를 삭제하시겠습니까?');">삭제</a>
  103. </td>
  104. </tr>
  105. <?php foreach($row2['children'] as $row3) :?>
  106. <tr>
  107. <td class="W20"></td>
  108. <td class="text-right W20"></td>
  109. <td>
  110. <input type="hidden" name="mnu_idx[]" value="<?=$row3['mnu_idx']?>" required>
  111. <input class="form-control" name="mnu_name[]" value="<?=$row3['mnu_name']?>" required>
  112. </td>
  113. <td>
  114. <input class="form-control" name="mnu_link[]" value="<?=$row3['mnu_link']?>" required>
  115. </td>
  116. <td>
  117. <input type="number" class="form-control" name="mnu_order[]" value="<?=$row3['mnu_order']?>">
  118. </td>
  119. <td>
  120. <select class="form-control" name="mnu_newtab[]">
  121. <option value="N" <?=$row3['mnu_newtab']=='N'?'selected':''?>>아니오</option>
  122. <option value="Y" <?=$row3['mnu_newtab']=='Y'?'selected':''?>>새창열기</option>
  123. </select>
  124. </td>
  125. <td>
  126. <select class="form-control" name="mnu_desktop[]">
  127. <option value="Y" <?=$row3['mnu_desktop']=='Y'?'selected':''?>>표시</option>
  128. <option value="N" <?=$row3['mnu_desktop']=='N'?'selected':''?>>미표시</option>
  129. </select>
  130. </td>
  131. <td>
  132. <select class="form-control" name="mnu_mobile[]">
  133. <option value="Y" <?=$row3['mnu_mobile']=='Y'?'selected':''?>>표시</option>
  134. <option value="N" <?=$row3['mnu_mobile']=='N'?'selected':''?>>미표시</option>
  135. </select>
  136. </td>
  137. <td>
  138. <input class="form-control" name="mnu_active_key[]" value="<?=$row3['mnu_active_key']?>">
  139. </td>
  140. <td>
  141. <a class="btn btn-danger btn-sm" href="<?=base_url('admin/management/menu_delete/'.$row3['mnu_idx'])?>" onclick="return confirm('메뉴를 삭제하시겠습니까?');">삭제</a>
  142. </td>
  143. </tr>
  144. <?php endforeach;?>
  145. <?php endforeach;?>
  146. <?php endforeach;?>
  147. </tbody>
  148. </table>
  149. </div>
  150. <?=form_close()?>
  151. <script>
  152. function menu_form(mnu_parent, mnu_idx)
  153. {
  154. mnu_parent = typeof mnu_parent != 'undefied' && mnu_parent ? mnu_parent : 0;
  155. mnu_idx = typeof mnu_idx != 'undefined' && mnu_idx ? mnu_idx : null;
  156. APP.MODAL.close = function(){
  157. location.reload();
  158. };
  159. APP.MODAL.open({
  160. iframe : {
  161. url : '/admin/management/menu_form',
  162. param : {
  163. mnu_parent : mnu_parent
  164. }
  165. },
  166. header : {
  167. title : '메뉴 정보 입력'
  168. },
  169. width : 450,
  170. height : 600
  171. });
  172. }
  173. </script>