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.

105 lines
4.3 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. <div class="container">
  2. <div class="ax-button-group">
  3. <div class="left">
  4. <h2><?=$board['brd_title']?></h2>
  5. </div>
  6. </div>
  7. <div data-ax5grid>
  8. <table>
  9. <thead>
  10. <tr>
  11. <th><input type="checkbox" data-checkbox="post" data-checkbox-all="true"></th>
  12. <th>#</th>
  13. <th class="col-xs-6">제목</th>
  14. <th>작성자</th>
  15. <th>작성일</th>
  16. <th>조회수</th>
  17. <?php if($board['brd_use_assign'] == 'Y'):?>
  18. <th>승인상태</th>
  19. <?php endif;?>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <?php foreach($list['list'] as $row):?>
  24. <tr>
  25. <td class="text-center"><input type="checkbox" data-checkbox="post" name="post_idx[]" value="<?=$row['post_idx']?>"></td>
  26. <td class="text-center"><?=number_format($row['nums'])?></td>
  27. <td>
  28. <?php if(strlen($row['post_reply']) >0) :?>
  29. <span style="display:inline-block;width:<?=((strlen($row['post_reply'])-1) * 16)?>px"></span>
  30. <img src="<?=base_url('assets/images/common/icon_reply.gif')?>">
  31. <?php endif;?>
  32. <a href="<?=base_url("admin/board/read/{$board['brd_key']}/{$row['post_idx']}/?").http_build_query($this->input->get()) ?>"><?=$row['post_title']?></a>
  33. <?php if($row['is_new']) :?><label class="label label-warning ML10">NEW</label><?php endif;?>
  34. <?php if($row['is_hot']) :?><label class="label label-danger ML10">HIT</label><?php endif;?>
  35. <?php if($row['post_count_comment']>0) :?><small>(<?=$row['post_count_comment']?>)</small><?php endif;?>
  36. <?php if($row['is_secret']) :?><i class="far fa-lock"></i><?php endif;?>
  37. </td>
  38. <td class="text-center"><?=$row['mem_nickname']?></td>
  39. <td class="text-center"><?=$row['post_regtime']?></td>
  40. <td class="text-center"><?=number_format($row['post_hit'])?></td>
  41. <?php if($board['brd_use_assign'] == 'Y'):?>
  42. <td class="text-center">
  43. <?php if($row['post_assign'] == 'Y'):?>
  44. <label class="label label-success">승인</label>
  45. <?php else :?>
  46. <label class="label label-default">미승인</label>
  47. <?php endif;?>
  48. </td>
  49. <?php endif;?>
  50. </tr>
  51. <?php endforeach;?>
  52. <?php if(count($list['list']) <= 0) :?>
  53. <tr>
  54. <td colspan="10" class="empty">검색된 글이 없습니다.</td>
  55. </tr>
  56. <?php endif;?>
  57. </tbody>
  58. </table>
  59. </div>
  60. <div class="MT10">
  61. <div class="pull-right">
  62. </div>
  63. <div class="clearfix"></div>
  64. </div>
  65. <div class="MT10">
  66. <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="far fa-trash"></i> 선택 삭제</button>
  67. <div class="pull-right">
  68. <a class="btn btn-primary" href="<?=base_url("admin/board/write/{$board['brd_key']}")?>"><i class="far fa-pencil"></i> 작성</a>
  69. </div>
  70. <div class="clearfix"></div>
  71. </div>
  72. </div>
  73. <script>
  74. $('[data-button="btn-remove-posts"]').click(function(e){
  75. e.preventDefault();
  76. if( $('input[name="post_idx[]"]:checked').length <= 0 )
  77. {
  78. alert('삭제할 게시물을 선택해주세요');
  79. return;
  80. }
  81. if(! confirm( '선택한 ' + $('input[name="post_idx[]"]:checked').length + '개의 게시물을 삭제하시겠습니까?' ))
  82. return;
  83. var arr = [];
  84. $('input[name="post_idx[]"]:checked').each(function(){
  85. arr.push( $(this).val() );
  86. });
  87. $.ajax({
  88. url : '/ajax/board/posts',
  89. type : 'DELETE',
  90. data : {
  91. post_idx :arr
  92. },
  93. success:function(){
  94. location.reload();
  95. }
  96. })
  97. });
  98. </script>