165 lines
5.9 KiB
PHP
165 lines
5.9 KiB
PHP
<?php
|
|
$sub_menu = "200950";
|
|
include_once('./_common.php');
|
|
|
|
auth_check_menu($auth, $sub_menu, 'r');
|
|
|
|
$g5['title'] = '휴지통';
|
|
include_once('./admin.head.php');
|
|
|
|
// 테이블 존재 여부 확인
|
|
if(!sql_query(" DESCRIBE g5_board_trash ", false)) {
|
|
echo '<div class="local_desc01 local_desc"><p>휴지통 테이블(g5_board_trash)이 존재하지 않습니다. DB 생성을 먼저 진행해주세요.</p></div>';
|
|
include_once('./admin.tail.php');
|
|
return;
|
|
}
|
|
|
|
$sql_common = " from g5_board_trash ";
|
|
|
|
$sql_search = " where (1) ";
|
|
if ($stx) {
|
|
$sql_search .= " and ( ";
|
|
switch ($sfl) {
|
|
case 'bo_table' :
|
|
$sql_search .= " ({$sfl} = '{$stx}') ";
|
|
break;
|
|
default :
|
|
$sql_search .= " ({$sfl} like '%{$stx}%') ";
|
|
break;
|
|
}
|
|
$sql_search .= " ) ";
|
|
}
|
|
|
|
if (!$sst) {
|
|
$sst = "tr_datetime";
|
|
$sod = "desc";
|
|
}
|
|
|
|
$sql_order = " order by {$sst} {$sod} ";
|
|
|
|
$sql = " select count(*) as cnt {$sql_common} {$sql_search} ";
|
|
$row = sql_fetch($sql);
|
|
$total_count = $row['cnt'];
|
|
|
|
$rows = $config['cf_page_rows'];
|
|
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
|
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
|
|
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
|
|
|
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
|
|
$result = sql_query($sql);
|
|
|
|
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
|
?>
|
|
|
|
<div class="local_ov01 local_ov">
|
|
<?php echo $listall ?>
|
|
<span class="btn_ov01"><span class="ov_txt">전체 </span><span class="ov_num"> <?php echo number_format($total_count) ?>건</span></span>
|
|
</div>
|
|
|
|
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
|
|
<div class="sch_last">
|
|
<label for="sfl" class="sound_only">검색대상</label>
|
|
<select name="sfl" id="sfl">
|
|
<option value="wr_subject"<?php echo get_selected($_GET['sfl'], "wr_subject"); ?>>제목</option>
|
|
<option value="wr_content"<?php echo get_selected($_GET['sfl'], "wr_content"); ?>>내용</option>
|
|
<option value="bo_table"<?php echo get_selected($_GET['sfl'], "bo_table"); ?>>게시판ID</option>
|
|
<option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원ID</option>
|
|
</select>
|
|
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
|
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="frm_input" size="20">
|
|
<input type="submit" value="검색" class="btn_submit">
|
|
</div>
|
|
</form>
|
|
|
|
<form name="ftrashlist" id="ftrashlist" action="./trash_list_update.php" onsubmit="return ftrashlist_submit(this);" method="post">
|
|
<input type="hidden" name="sst" value="<?php echo $sst ?>">
|
|
<input type="hidden" name="sod" value="<?php echo $sod ?>">
|
|
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
|
|
<input type="hidden" name="stx" value="<?php echo $stx ?>">
|
|
<input type="hidden" name="page" value="<?php echo $page ?>">
|
|
<input type="hidden" name="token" value="">
|
|
|
|
<div class="tbl_head01 tbl_wrap">
|
|
<table>
|
|
<caption><?php echo $g5['title']; ?> 목록</caption>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">
|
|
<label for="chkall" class="sound_only">현재 페이지 전체</label>
|
|
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
|
</th>
|
|
<th scope="col">게시판</th>
|
|
<th scope="col">제목</th>
|
|
<th scope="col">작성자</th>
|
|
<th scope="col">작성일</th>
|
|
<th scope="col">삭제일</th>
|
|
<th scope="col">관리</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
|
$bg = 'bg'.($i%2);
|
|
?>
|
|
<tr class="<?php echo $bg; ?>">
|
|
<td class="td_chk">
|
|
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['wr_subject']) ?></label>
|
|
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
|
<input type="hidden" name="tr_id[<?php echo $i ?>]" value="<?php echo $row['tr_id'] ?>">
|
|
</td>
|
|
<td class="td_category"><?php echo $row['bo_table']; ?></td>
|
|
<td class="td_left"><?php echo get_text($row['wr_subject']); ?></td>
|
|
<td class="td_mbname"><?php echo $row['wr_name']; ?></td>
|
|
<td class="td_datetime"><?php echo $row['wr_datetime']; ?></td>
|
|
<td class="td_datetime"><?php echo $row['tr_datetime']; ?></td>
|
|
<td class="td_mng">
|
|
<a href="./trash_list_update.php?w=r&tr_id=<?php echo $row['tr_id']; ?>" class="btn btn_03">복구</a>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
if ($i == 0)
|
|
echo '<tr><td colspan="7" class="empty_table">자료가 없습니다.</td></tr>';
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="btn_fixed_top">
|
|
<input type="submit" name="act_button" value="선택복구" onclick="document.pressed=this.value" class="btn btn_02">
|
|
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_02">
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
|
|
|
<script>
|
|
function ftrashlist_submit(f)
|
|
{
|
|
if (!is_checked("chk[]")) {
|
|
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
|
return false;
|
|
}
|
|
|
|
if(document.pressed == "선택복구") {
|
|
if(!confirm("선택한 게시물을 복구하시겠습니까?")) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if(document.pressed == "선택삭제") {
|
|
if(!confirm("선택한 게시물을 영구 삭제하시겠습니까?\n\n삭제 후에는 복구할 수 없습니다.")) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
</script>
|
|
|
|
<?php
|
|
include_once('./admin.tail.php');
|
|
?>
|