AvocadoAmber/AvocadoEdition_Light/bbs/move.php

162 lines
5.3 KiB
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
2024-09-23 11:07:19 +09:00
include_once "./_common.php";
2022-09-17 20:50:50 +09:00
if ($sw == 'move')
2024-09-19 20:57:39 +09:00
$act = '이동';
2022-09-17 20:50:50 +09:00
else if ($sw == 'copy')
2024-09-19 20:57:39 +09:00
$act = '복사';
2022-09-17 20:50:50 +09:00
else
2024-09-19 20:57:39 +09:00
alert('sw 값이 제대로 넘어오지 않았습니다.');
2022-09-17 20:50:50 +09:00
// 게시판 관리자 이상 복사, 이동 가능
if ($is_admin != 'board' && $is_admin != 'group' && $is_admin != 'super')
2024-09-19 20:57:39 +09:00
alert_close("게시판 관리자 이상 접근이 가능합니다.");
2022-09-17 20:50:50 +09:00
$g5['title'] = '게시물 ' . $act;
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/head.sub.php');
2022-09-17 20:50:50 +09:00
$wr_id_list = '';
if ($wr_id)
2024-09-19 20:57:39 +09:00
$wr_id_list = $wr_id;
2022-09-17 20:50:50 +09:00
else {
2024-09-19 20:57:39 +09:00
$comma = '';
for ($i = 0; $i < count($_POST['chk_wr_id']); $i++) {
$wr_id_list .= $comma . $_POST['chk_wr_id'][$i];
$comma = ',';
}
2022-09-17 20:50:50 +09:00
}
//$sql = " select * from {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id and bo_table <> '$bo_table' ";
// 원본 게시판을 선택 할 수 있도록 함.
$sql = " select * from {$g5['board_table']} a, {$g5['group_table']} b where a.gr_id = b.gr_id ";
if ($is_admin == 'group')
2024-09-19 20:57:39 +09:00
$sql .= " and b.gr_admin = '{$member['mb_id']}' ";
2022-09-17 20:50:50 +09:00
else if ($is_admin == 'board')
2024-09-19 20:57:39 +09:00
$sql .= " and a.bo_admin = '{$member['mb_id']}' ";
2022-09-17 20:50:50 +09:00
$sql .= " order by a.gr_id, a.bo_order, a.bo_table ";
$result = sql_query($sql);
2024-09-19 20:57:39 +09:00
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$list[$i] = $row;
2022-09-17 20:50:50 +09:00
}
?>
<div id="copymove" class="new_win">
2024-09-19 20:57:39 +09:00
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
<form name="fboardmoveall" method="post" action="./move_update.php" onsubmit="return fboardmoveall_submit(this);">
2022-09-17 20:50:50 +09:00
<input type="hidden" name="sw" value="<?php echo $sw ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id_list" value="<?php echo $wr_id_list ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="act" value="<?php echo $act ?>">
<input type="hidden" name="url" value="<?php echo get_text(clean_xss_tags($_SERVER['HTTP_REFERER'])); ?>">
<div class="tbl_head01 tbl_wrap">
2024-09-19 20:57:39 +09:00
<table>
2022-09-17 20:50:50 +09:00
<caption><?php echo $act ?>할 게시판을 한개 이상 선택하여 주십시오.</caption>
<thead>
2024-09-19 20:57:39 +09:00
<tr>
2022-09-17 20:50:50 +09:00
<th scope="col">
2024-09-19 20:57:39 +09:00
<label for="chkall" class="sound_only">현재 페이지 게시판 전체</label>
<input type="checkbox" id="chkall"
onclick="if (this.checked) all_checked(true); else all_checked(false);">
2022-09-17 20:50:50 +09:00
</th>
<th scope="col">게시판</th>
2024-09-19 20:57:39 +09:00
</tr>
2022-09-17 20:50:50 +09:00
</thead>
<tbody>
2024-09-19 20:57:39 +09:00
<?php for ($i = 0; $i < count($list); $i++) {
2022-09-17 20:50:50 +09:00
$atc_mark = '';
$atc_bg = '';
if ($list[$i]['bo_table'] == $bo_table) { // 게시물이 현재 속해 있는 게시판이라면
2024-09-19 20:57:39 +09:00
$atc_mark = '<span class="copymove_current">현재<span class="sound_only">게시판</span></span>';
$atc_bg = 'copymove_currentbg';
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
?>
<tr class="<?php echo $atc_bg; ?>">
<td class="td_chk">
2022-09-17 20:50:50 +09:00
<label for="chk<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['bo_table'] ?></label>
2024-09-19 20:57:39 +09:00
<input type="checkbox" value="<?php echo $list[$i]['bo_table'] ?>" id="chk<?php echo $i ?>"
name="chk_bo_table[]">
</td>
<td>
2022-09-17 20:50:50 +09:00
<label for="chk<?php echo $i ?>">
2024-09-19 20:57:39 +09:00
<?php
echo $list[$i]['gr_subject'] . ' &gt; ';
$save_gr_subject = $list[$i]['gr_subject'];
?>
<?php echo $list[$i]['bo_subject'] ?> (<?php echo $list[$i]['bo_table'] ?>)
<?php echo $atc_mark; ?>
2022-09-17 20:50:50 +09:00
</label>
2024-09-19 20:57:39 +09:00
</td>
</tr>
<?php } ?>
2022-09-17 20:50:50 +09:00
</tbody>
2024-09-19 20:57:39 +09:00
</table>
2022-09-17 20:50:50 +09:00
</div>
<div class="win_btn">
2024-09-19 20:57:39 +09:00
<input type="submit" value="<?php echo $act ?>" id="btn_submit" class="btn_submit">
2022-09-17 20:50:50 +09:00
</div>
2024-09-19 20:57:39 +09:00
</form>
2022-09-17 20:50:50 +09:00
</div>
<script>
2024-09-19 20:57:39 +09:00
$(function () {
2022-09-17 20:50:50 +09:00
$(".win_btn").append("<button type=\"button\" class=\"btn_cancel\">창닫기</button>");
2024-09-19 20:57:39 +09:00
$(".win_btn button").click(function () {
window.close();
2022-09-17 20:50:50 +09:00
});
2024-09-19 20:57:39 +09:00
});
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
function all_checked(sw) {
2022-09-17 20:50:50 +09:00
var f = document.fboardmoveall;
2024-09-19 20:57:39 +09:00
for (var i = 0; i < f.length; i++) {
if (f.elements[i].name == "chk_bo_table[]")
f.elements[i].checked = sw;
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
}
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
function fboardmoveall_submit(f) {
2022-09-17 20:50:50 +09:00
var check = false;
2024-09-19 20:57:39 +09:00
if (typeof (f.elements['chk_bo_table[]']) == 'undefined')
;
2022-09-17 20:50:50 +09:00
else {
2024-09-19 20:57:39 +09:00
if (typeof (f.elements['chk_bo_table[]'].length) == 'undefined') {
if (f.elements['chk_bo_table[]'].checked)
check = true;
} else {
for (i = 0; i < f.elements['chk_bo_table[]'].length; i++) {
if (f.elements['chk_bo_table[]'][i].checked) {
check = true;
break;
}
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
}
2022-09-17 20:50:50 +09:00
}
if (!check) {
2024-09-19 20:57:39 +09:00
alert('게시물을 ' + f.act.value + '할 게시판을 한개 이상 선택해 주십시오.');
return false;
2022-09-17 20:50:50 +09:00
}
document.getElementById('btn_submit').disabled = true;
f.action = './move_update.php';
return true;
2024-09-19 20:57:39 +09:00
}
2022-09-17 20:50:50 +09:00
</script>
<?php
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/tail.sub.php');
2022-09-17 20:50:50 +09:00
?>