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.

116 lines
5.0 KiB

7 years ago
  1. <div class="page-header">
  2. <h1 class="page-title">FAQ 관리</h1>
  3. </div>
  4. <div class="row">
  5. <div class="col-sm-5">
  6. <div class="ax-button-group">
  7. <div class="left">
  8. <h4>FAQ 분류</h4>
  9. </div>
  10. <div class="right">
  11. <button type="button" class="btn btn-default" onclick="faq.category.form();"><i class="far fal fas fa-plus-circle"></i> 분류 추가</button>
  12. </div>
  13. </div>
  14. <div data-ax5grid>
  15. <table>
  16. <thead>
  17. <tr>
  18. <th class="W50">순서</th>
  19. <th>분류이름</th>
  20. <th class="W50">등록</th>
  21. <th class="W175">관리</th>
  22. </tr>
  23. </thead>
  24. <tbody id="faq-category-list">
  25. <?php foreach($faq_category['list'] as $row) :?>
  26. <tr>
  27. <td class="text-center W50"><i class="fal fas far fa-bars sort-handle-icon"></i><input type="hidden" name="fac_idx[]" value="<?=$row['fac_idx']?>"></td>
  28. <td class="<?=isset($fac_idx)&&$fac_idx==$row['fac_idx']?'active':''?>"><?=$row['fac_title']?></td>
  29. <td class="text-right W50"><?=number_format($row['fac_count'])?></td>
  30. <td class="text-center W175">
  31. <a href="<?=base_url('admin/management/faq/'.$row['fac_idx'])?>" class="btn btn-default btn-sm"><i class="fal fas far <?=isset($fac_idx)&&$fac_idx==$row['fac_idx']?'fa-folder-open':'fa-folder'?>"></i> 관리</a>
  32. <button type="button" class="btn btn-default btn-sm" onclick="faq.category.form('<?=$row['fac_idx']?>');"><i class="fal fas far fa-pencil"></i> 수정</button>
  33. <button type="button" class="btn btn-danger btn-sm" onclick="faq.category.remove('<?=$row['fac_idx']?>');"><i class="fal fas far fa-trash"></i> 삭제</button>
  34. </td>
  35. </tr>
  36. <?php endforeach;?>
  37. <?php if(count($faq_category['list']) == 0) :?>
  38. <tr>
  39. <td colspan="4" class="empty">등록된 FAQ 분류가 없습니다.</td>
  40. </tr>
  41. <?php endif;?>
  42. </tbody>
  43. </table>
  44. </div>
  45. </div>
  46. <div class="col-sm-7">
  47. <?php if($fac_idx) :?>
  48. <div class="ax-button-group">
  49. <div class="left">
  50. <h4>[<?=$faq_group['fac_title']?>] 내용 관리</h4>
  51. </div>
  52. <div class="right">
  53. <button type="button" class="btn btn-default" onclick="faq.form('<?=$fac_idx?>');"><i class="fal fas far fa-plus-circle"></i> FAQ 추가</button>
  54. </div>
  55. </div>
  56. <div data-ax5grid>
  57. <table>
  58. <thead>
  59. <tr>
  60. <th class="W50">순서</th>
  61. <th>FAQ 제목</th>
  62. <th class="W150">관리</th>
  63. </tr>
  64. </thead>
  65. <tbody id="faq-list">
  66. <?php foreach($faq_list['list'] as $row) :?>
  67. <tr>
  68. <td class="text-center W50"><i class="fal fas far fa-bars sort-handle-icon"></i><input type="hidden" name="faq_idx[]" value="<?=$row['faq_idx']?>"></td>
  69. <td><?=$row['faq_title']?></td>
  70. <td class="text-center W150">
  71. <button type="button" class="btn btn-default btn-sm" onclick="faq.form('<?=$row['fac_idx']?>','<?=$row['faq_idx']?>');"><i class="fal fas far fa-pencil"></i> 수정</button>
  72. <button type="button" class="btn btn-danger btn-sm" onclick="faq.remove('<?=$row['faq_idx']?>');"><i class="fal fas far fa-trash"></i> 삭제</button>
  73. </td>
  74. </tr>
  75. <?php endforeach;?>
  76. <?php if(count($faq_list['list']) == 0) :?>
  77. <tr>
  78. <td colspan="3" class="empty">등록된 FAQ가 없습니다.</td>
  79. </tr>
  80. <?php endif;?>
  81. </tbody>
  82. </table>
  83. </div>
  84. <?php endif;?>
  85. </div>
  86. </div>
  87. <script>
  88. $("#faq-category-list").sortable({
  89. handle : 'i.far.fa-bars',
  90. update: function(){
  91. var sort_array = [];
  92. $("#faq-category-list input[name='fac_idx[]']").each(function(){
  93. sort_array.push( $(this).val() );
  94. });
  95. $.post('/ajax/faq/category_sort',{sort_idx:sort_array});
  96. }
  97. });
  98. $("#faq-list").sortable({
  99. handle : 'i.far.fa-bars',
  100. update: function(){
  101. var sort_array = [];
  102. $("#faq-list input[name='faq_idx[]']").each(function(){
  103. sort_array.push( $(this).val() );
  104. });
  105. $.post('/ajax/faq/sort',{sort_idx:sort_array});
  106. }
  107. });
  108. </script>