Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
gnuboard
2013-02-15 18:16:29 +09:00
5 changed files with 113 additions and 54 deletions

24
adm/mail_delete.php Normal file
View File

@ -0,0 +1,24 @@
<?php
$sub_menu = '200300';
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'd');
check_token();
$count = count($_POST['chk']);
if(!$count)
alert('삭제할 메일목록을 1개이상 선택해 주세요.');
for($i=0; $i<$count; $i++) {
$ma_id = $_POST['chk'][$i];
$sql = " delete from {$g4['mail_table']} where ma_id = '$ma_id' ";
sql_query($sql);
}
goto_url('./mail_list.php');
?>

View File

@ -33,6 +33,7 @@ $colspan = 6;
현재 등록된 메일은 총 <?=$total_count ?>건입니다.
</p>
<form id="fmaillist" name="fmaillist" method="post" action="./mail_delete.php">
<table>
<thead>
<tr>
@ -57,8 +58,7 @@ $colspan = 6;
<tr>
<td class="td_chk">
<input type="hidden" name="" value="">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$i?>" title="메일선택">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$row['ma_id']?>" title="메일선택">
</td>
<td class="td_num"><?=$num?></td>
<td><?=$row['ma_subject']?></td>
@ -78,34 +78,28 @@ $colspan = 6;
<div class="btn_list">
<button>선택삭제</button>
<input type="submit" name="btn_submit" value="선택삭제">
</div>
</form>
</section>
<script>
// POST 방식으로 삭제
function post_delete(action_url, val)
{
var f = document.fpost;
$(function() {
$('#fmaillist').submit(function() {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
var cnt = $('input[name^=chk]:checked').length;
if(cnt < 1) {
alert('삭제할 메일목록을 1개이상 선택해 주세요.');
return false;
}
if(confirm('한번 삭제한 자료는 복구할 방법이 없습니다. 정말 삭제하시겠습니까?')) {
f.ma_id.value = val;
f.action = action_url;
f.submit();
}
}
return true;
} else {
return false;
}
});
});
</script>
<form id="fpost" name="fpost" method="post">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="w" value='d'>
<input type="hidden" name="ma_id">
</form>
<?
include_once ('./admin.tail.php');
?>

27
adm/poll_delete.php Normal file
View File

@ -0,0 +1,27 @@
<?php
$sub_menu = "200900";
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'd');
check_token();
$count = count($_POST['chk']);
if(!$count)
alert('삭제할 투표목록을 1개이상 선택해 주세요.');
for($i=0; $i<$count; $i++) {
$po_id = $_POST['chk'][$i];
$sql = " delete from {$g4['poll_table']} where po_id = '$po_id' ";
sql_query($sql);
$sql = " delete from {$g4['poll_etc_table']} where po_id = '$po_id' ";
sql_query($sql);
}
goto_url('./poll_list.php?'.$qstr);
?>

View File

@ -76,6 +76,13 @@ $colspan = 6;
<section class="cbox">
<h2>투표목록</h2>
<form id="fpolllist" name="fpolllist" method="post" action="./poll_delete.php">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="token" value="<?=$token?>">
<table>
<thead>
<tr>
@ -101,8 +108,7 @@ $colspan = 6;
<tr>
<td class="td_chk">
<input type="hidden" name="" value="">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$i?>" title="투표선택">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$row['po_id']?>" title="투표선택">
</td>
<td class="td_num"><?=$row['po_id']?></td>
<td><?=cut_str(get_text($row['po_subject']),70)?></td>
@ -123,8 +129,8 @@ $colspan = 6;
<div class="btn_list">
<button>선택삭제</button>
<input type="submit" name="btn_submit" value="선택삭제">
</div>
</form>
</section>
<?=get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page=");?>
@ -135,30 +141,23 @@ if (isset($stx))
?>
<script>
// POST 방식으로 삭제
function post_delete(action_url, val)
{
var f = document.fpost;
$(function() {
$('#fpolllist').submit(function() {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
var cnt = $('input[name^=chk]:checked').length;
if(cnt < 1) {
alert('삭제할 투표목록을 1개이상 선택해 주세요.');
return false;
}
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
f.po_id.value = val;
f.action = action_url;
f.submit();
}
}
return true;
} else {
return false;
}
});
});
</script>
<form id="fpost" name="fpost" method="post">
<input type="hidden" name="sst" value="<?=$sst?>">
<input type="hidden" name="sod" value="<?=$sod?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="token" value="<?=$token?>">
<input type="hidden" name="w" value='d'>
<input type="hidden" name="po_id">
</form>
<?
include_once ('./admin.tail.php');
?>

View File

@ -6,11 +6,10 @@ auth_check($auth[$sub_menu], 'r');
// 체크된 자료 삭제
if (isset($_POST['chk']) && is_array($_POST['chk'])) {
for ($i=0; $i<count($chk); $i++) {
// 실제 번호를 넘김
$k = $chk[$i];
for ($i=0; $i<count($_POST['chk']); $i++) {
$pp_id = $_POST['chk'][$i];
sql_query(" delete from {$g4['popular_table']} where pp_id = '{$_POST['pp_id'][$k]}' ", true);
sql_query(" delete from {$g4['popular_table']} where pp_id = '$pp_id' ", true);
}
}
@ -117,8 +116,7 @@ var list_delete_php = 'popular_list.php';
<tr>
<td class="td_chk">
<input type="hidden" name="pp_id[<?=$i?>]" value="<?=$row['pp_id']?>">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$i?>" title="<?=$word?> 선택">
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$row['pp_id']?>" title="<?=$word?> 선택">
</td>
<td>&nbsp; <a href="<?=$_SERVER['PHP_SELF']?>?sfl=pp_word&amp;stx=<?=$word?>"><?=$word?></a></td>
<td><?=$row['pp_date']?></td>
@ -137,7 +135,6 @@ var list_delete_php = 'popular_list.php';
<?if ($is_admin == 'super'){ ?>
<div class="btn_list">
<button>선택삭제</button>
<button onclick="btn_check(this.form, 'delete')">선택삭제</button>
</div>
<?}?>
@ -151,6 +148,24 @@ if (isset($stx))
echo '<script>document.fsearch.sfl.value = \''.$sfl.'\';</script>';
?>
<script>
$(function() {
$('#fpopularlist').submit(function() {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
var cnt = $('input[name^=chk]:checked').length;
if(cnt < 1) {
alert('삭제할 검색어를 1개이상 선택해 주세요.');
return false;
}
return true;
} else {
return false;
}
});
});
</script>
<?
include_once('./admin.tail.php');
?>