게시판 선택삭제, 선택수정 관련 스크립트 수정

This commit is contained in:
chicpro
2013-02-18 10:39:34 +09:00
parent 10c44b113a
commit 583ca2e75d
2 changed files with 27 additions and 19 deletions

View File

@ -65,11 +65,6 @@ include_once('./admin.head.php');
$colspan = 8;
?>
<script>
var list_update_php = 'board_list_update.php';
var list_delete_php = 'board_list_delete.php';
</script>
<form id="fsearch" name="fsearch" method="get">
<fieldset>
<legend>게시판 검색</legend>
@ -173,9 +168,9 @@ var list_delete_php = 'board_list_delete.php';
</table>
<div class="btn_list">
<input type="submit" name="btn_submit" onclick="document.pressed=this.value" value="선택수정">
<input type="submit" name="act_button" value="선택수정">
<?if ($is_admin == 'super') {?>
<input type="submit" name="btn_submit" onclick="document.pressed=this.value" value="선택삭제">
<input type="submit" name="act_button" value="선택삭제">
<a href="./board_form.php">게시판추가</a>
<?}?>
</div>
@ -186,21 +181,34 @@ var list_delete_php = 'board_list_delete.php';
<?=get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&amp;page=');?>
<script>
function fboardlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
}
$(function(){
$(".board_copy").click(function(){
window.open(this.href, "win_board_copy", "left=100,top=100,width=550,height=450");
return false;
});
$('input[name=act_button]').click(function(e) {
e.preventDefault();
var act = $(this).val();
var cnt = $('input[name^=chk]:checked').length;
if(act == "선택삭제") {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
if(cnt < 1) {
alert(act+'할 게시판을 1개 이상 선택해 주세요.');
return false;
}
}
} else if(act == "선택수정") {
if(cnt < 1) {
alert(act+'할 게시판그룹을 1개 이상 선택해 주세요.');
return false;
}
}
$('#fboardlist').submit();
});
});
</script>

View File

@ -8,7 +8,7 @@ if (!count($_POST['chk'])) {
alert($_POST['btn_submit']." 하실 항목을 하나 이상 체크하세요.");
}
if ($_POST['btn_submit'] == "선택수정") {
if ($_POST['act_button'] == "선택수정") {
auth_check($auth[$sub_menu], 'w');
@ -42,7 +42,7 @@ if ($_POST['btn_submit'] == "선택수정") {
sql_query($sql);
}
} else if ($_POST['btn_submit'] == "선택삭제") {
} else if ($_POST['act_button'] == "선택삭제") {
if ($is_admin != 'super')
alert('게시판 삭제는 최고관리자만 가능합니다.');