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.

112 lines
4.9 KiB

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. <form class="form-inline pull-left MT15">
  62. <select class="form-control" name="scol">
  63. <option value="title" <?=$scol=='title'?'selected':''?>>제목</option>
  64. <option value="nickname" <?=$scol=='nickname'?'selected':''?>>작성자</option>
  65. </select>
  66. <input class="form-control" name="stxt" value="<?=$stxt?>" style="vertical-align: middle">
  67. <button class="btn btn-default btn-lg"><i class="far fa-search"></i> 검색</button>
  68. </form>
  69. <div class="pull-right">
  70. <?=$pagination?>
  71. </div>
  72. <div class="clearfix"></div>
  73. </div>
  74. <div class="MT10">
  75. <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="far fa-trash"></i> 선택 삭제</button>
  76. <div class="pull-right">
  77. <a class="btn btn-primary" href="<?=base_url("admin/board/write/{$board['brd_key']}")?>"><i class="far fa-pencil"></i> 작성</a>
  78. </div>
  79. <div class="clearfix"></div>
  80. </div>
  81. </div>
  82. <script>
  83. $('[data-button="btn-remove-posts"]').click(function(e){
  84. e.preventDefault();
  85. if( $('input[name="post_idx[]"]:checked').length <= 0 )
  86. {
  87. alert('삭제할 게시물을 선택해주세요');
  88. return;
  89. }
  90. if(! confirm( '선택한 ' + $('input[name="post_idx[]"]:checked').length + '개의 게시물을 삭제하시겠습니까?' ))
  91. return;
  92. var arr = [];
  93. $('input[name="post_idx[]"]:checked').each(function(){
  94. arr.push( $(this).val() );
  95. });
  96. $.ajax({
  97. url : '/ajax/board/posts',
  98. type : 'DELETE',
  99. data : {
  100. post_idx :arr
  101. },
  102. success:function(){
  103. location.reload();
  104. }
  105. })
  106. });
  107. </script>