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.

123 lines
5.1 KiB

7 years ago
7 years ago
7 years ago
7 years ago
  1. <div class="page-header" data-fit-aside>
  2. <h1 class="page-title"><?=$board['brd_title']?></h1>
  3. </div>
  4. <form data-grid-search onsubmit="grid.refresh(1);return false;" data-fit-aside autocomplete="off">
  5. <div data-ax-tbl>
  6. <div data-ax-tr>
  7. <div data-ax-td>
  8. <div data-ax-td-label>검색어 입력</div>
  9. <div data-ax-td-wrap>
  10. <select class="form-control form-control-inline" name="scol">
  11. <option value="title" <?=$scol=='title'?'selected':''?>>제목</option>
  12. <option value="nickname" <?=$scol=='nickname'?'selected':''?>>작성자</option>
  13. </select>
  14. </div>
  15. </div>
  16. <div data-ax-td>
  17. <div data-ax-td-wrap>
  18. <input class="form-control" name="stxt" value="<?=$stxt?>">
  19. </div>
  20. <div data-ax-td-wrap>
  21. <button class="btn btn-default btn-sm"><i class="fal fa-search"></i> 검색</button>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </form>
  27. <div class="H10"></div>
  28. <div class="grid">
  29. <table>
  30. <thead>
  31. <tr>
  32. <th class="W20 text-center"><label class="w-check margin-auto"><input type="checkbox" data-checkbox="post" data-checkbox-all="true"><span class="empty"></span></label></th>
  33. <th class="W60">#</th>
  34. <?php if($use_category) :?>
  35. <th class="W120">카테고리</th>
  36. <?php endif;?>
  37. <th>제목</th>
  38. <th class="W120">작성자</th>
  39. <th class="W120">작성일</th>
  40. <th class="W80">조회수</th>
  41. <th class="W60">모바일</th>
  42. <th class="W100">작성 IP</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <?php foreach($list['list'] as $row):?>
  47. <tr>
  48. <td class="text-center">
  49. <label class="w-check margin-auto"><input type="checkbox" data-checkbox="post" name="post_idx[]" value="<?=$row['post_idx']?>"><span class="empty"></span></label>
  50. </td>
  51. <td class="text-right"><?=number_format($row['nums'])?></td>
  52. <?php if($use_category) :?>
  53. <td><?=$row['post_category']?></td>
  54. <?php endif;?>
  55. <td>
  56. <?php if(strlen($row['post_reply']) >0) :?>
  57. <span style="display:inline-block;width:<?=((strlen($row['post_reply'])-1) * 16)?>px"></span>
  58. <img src="<?=base_url('assets/images/common/icon_reply.gif')?>">
  59. <?php endif;?>
  60. <a href="<?=base_url("admin/board/read/{$board['brd_key']}/{$row['post_idx']}/?").http_build_query($this->input->get()) ?>"><?=$row['post_title']?></a>
  61. <?php if($row['is_new']) :?><label class="label label-warning ML10">NEW</label><?php endif;?>
  62. <?php if($row['is_hot']) :?><label class="label label-danger ML10">HIT</label><?php endif;?>
  63. <?php if($row['post_count_comment']>0) :?><small>(<?=$row['post_count_comment']?>)</small><?php endif;?>
  64. <?php if($row['is_secret']) :?><i class="fal fa-lock"></i><?php endif;?>
  65. </td>
  66. <td class="text-center"><?=$row['post_nickname']?></td>
  67. <td class="text-center"><?=$row['post_datetime']?></td>
  68. <td class="text-right"><?=number_format($row['post_hit'])?></td>
  69. <td class="text-center"><?=$row['post_mobile']?></td>
  70. <td class="text-center"><?=long2ip((int)$row['post_ip'])?></td>
  71. </tr>
  72. <?php endforeach;?>
  73. <?php if(count($list['list']) <= 0) :?>
  74. <tr>
  75. <td colspan="10" class="empty">검색된 글이 없습니다.</td>
  76. </tr>
  77. <?php endif;?>
  78. </tbody>
  79. </table>
  80. </div>
  81. <div class="ax-button-group ax-button-group-bottom">
  82. <div class="left">
  83. <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 선택 삭제</button>
  84. </div>
  85. <div class="right">
  86. <a class="btn btn-primary" href="<?=base_url("admin/board/write/{$board['brd_key']}")?>"><i class="fal fa-pencil"></i> 작성</a>
  87. </div>
  88. </div>
  89. <script>
  90. $('[data-button="btn-remove-posts"]').click(function(e){
  91. e.preventDefault();
  92. if( $('input[name="post_idx[]"]:checked').length <= 0 )
  93. {
  94. alert('삭제할 게시물을 선택해주세요');
  95. return;
  96. }
  97. if(! confirm( '선택한 ' + $('input[name="post_idx[]"]:checked').length + '개의 게시물을 삭제하시겠습니까?' ))
  98. return;
  99. var arr = [];
  100. $('input[name="post_idx[]"]:checked').each(function(){
  101. arr.push( $(this).val() );
  102. });
  103. $.ajax({
  104. url : '/ajax/board/posts',
  105. type : 'DELETE',
  106. data : {
  107. post_idx :arr
  108. },
  109. success:function(){
  110. location.reload();
  111. }
  112. })
  113. });
  114. </script>