Checked PSR-1 / PHP 8.1 Undefiend Varialbe, type error

This commit is contained in:
kjh
2022-05-30 08:30:08 +00:00
parent b1640d7b76
commit 993e689800
27 changed files with 2694 additions and 2621 deletions

View File

@ -1,99 +1,97 @@
<?php <?php
$sub_menu = '300700'; $sub_menu = '300700';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
$g5['title'] = 'FAQ 상세관리'; $g5['title'] = 'FAQ 상세관리';
if (isset($_REQUEST['fm_subject'])){ if (isset($_REQUEST['fm_subject'])) {
$fm_subject = clean_xss_tags($_REQUEST['fm_subject'], 1, 1, 255); $fm_subject = clean_xss_tags($_REQUEST['fm_subject'], 1, 1, 255);
$g5['title'] .= ' : '.$fm_subject; $g5['title'] .= ' : ' . $fm_subject;
} }
$fm_id = (int) $fm_id; $fm_id = isset($fm_id) ? (int) $fm_id : 0;
include_once (G5_ADMIN_PATH.'/admin.head.php'); require_once G5_ADMIN_PATH . '/admin.head.php';
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' "; $sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
$fm = sql_fetch($sql); $fm = sql_fetch($sql);
$sql_common = " from {$g5['faq_table']} where fm_id = '$fm_id' "; $sql_common = " from {$g5['faq_table']} where fm_id = '$fm_id' ";
// 테이블의 전체 레코드수만 얻음 // 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common; $sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = $row['cnt'];
$sql = "select * $sql_common order by fa_order , fa_id "; $sql = "select * $sql_common order by fa_order , fa_id ";
$result = sql_query($sql); $result = sql_query($sql);
?> ?>
<div class="local_ov01 local_ov"> <div class="local_ov01 local_ov">
<span class="btn_ov01"><span class="ov_txt"> 등록된 FAQ 상세내용</span><span class="ov_num"> <?php echo $total_count; ?>건</span></span> <span class="btn_ov01"><span class="ov_txt"> 등록된 FAQ 상세내용</span><span class="ov_num"> <?php echo $total_count; ?>건</span></span>
</div> </div>
<div class="local_desc01 local_desc"> <div class="local_desc01 local_desc">
<ol> <ol>
<li>FAQ는 무제한으로 등록할 수 있습니다</li> <li>FAQ는 무제한으로 등록할 수 있습니다</li>
<li><strong>FAQ 상세내용 추가</strong>를 눌러 자주하는 질문과 답변을 입력합니다.</li> <li><strong>FAQ 상세내용 추가</strong>를 눌러 자주하는 질문과 답변을 입력합니다.</li>
</ol> </ol>
</div> </div>
<div class="btn_fixed_top"> <div class="btn_fixed_top">
<a href="./faqmasterlist.php" class="btn btn_02">FAQ 관리</a> <a href="./faqmasterlist.php" class="btn btn_02">FAQ 관리</a>
<a href="./faqform.php?fm_id=<?php echo $fm['fm_id']; ?>" class="btn btn_01">FAQ 상세내용 추가</a> <a href="./faqform.php?fm_id=<?php echo $fm['fm_id']; ?>" class="btn btn_01">FAQ 상세내용 추가</a>
</div> </div>
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?> 목록</caption> <caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">번호</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> <th scope="col">관리</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{ $row1 = sql_fetch(" select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' ");
$row1 = sql_fetch(" select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' "); $cnt = $row1['cnt'];
$cnt = $row1['cnt'];
$s_mod = icon("수정", "");
$s_mod = icon("수정", ""); $s_del = icon("삭제", "");
$s_del = icon("삭제", "");
$num = $i + 1;
$num = $i + 1;
$bg = 'bg' . ($i % 2);
$bg = 'bg'.($i%2);
$fa_subject = conv_content($row['fa_subject'], 1);
$fa_subject = conv_content($row['fa_subject'], 1); ?>
?>
<tr class="<?php echo $bg; ?>">
<tr class="<?php echo $bg; ?>"> <td class="td_num"><?php echo $num; ?></td>
<td class="td_num"><?php echo $num; ?></td> <td class="td_left"><?php echo $fa_subject; ?></td>
<td class="td_left"><?php echo $fa_subject; ?></td> <td class="td_num"><?php echo $row['fa_order']; ?></td>
<td class="td_num"><?php echo $row['fa_order']; ?></td> <td class="td_mng td_mng_m">
<td class="td_mng td_mng_m"> <a href="./faqform.php?w=u&amp;fm_id=<?php echo $row['fm_id']; ?>&amp;fa_id=<?php echo $row['fa_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo $fa_subject; ?> </span>수정</a>
<a href="./faqform.php?w=u&amp;fm_id=<?php echo $row['fm_id']; ?>&amp;fa_id=<?php echo $row['fa_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo $fa_subject; ?> </span>수정</a> <a href="./faqformupdate.php?w=d&amp;fm_id=<?php echo $row['fm_id']; ?>&amp;fa_id=<?php echo $row['fa_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo $fa_subject; ?> </span>삭제</a>
<a href="./faqformupdate.php?w=d&amp;fm_id=<?php echo $row['fm_id']; ?>&amp;fa_id=<?php echo $row['fa_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo $fa_subject; ?> </span>삭제</a> </td>
</td> </tr>
</tr> <?php
}
<?php
} if ($i == 0) {
echo '<tr><td colspan="4" class="empty_table">자료가 없습니다.</td></tr>';
if ($i == 0) { }
echo '<tr><td colspan="4" class="empty_table">자료가 없습니다.</td></tr>'; ?>
} </tbody>
?> </table>
</tbody>
</table> </div>
</div>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');

View File

@ -1,167 +1,175 @@
<?php <?php
$sub_menu = '300700'; $sub_menu = '300700';
include_once('./_common.php'); require_once './_common.php';
include_once(G5_EDITOR_LIB); require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, "w"); auth_check_menu($auth, $sub_menu, "w");
$html_title = 'FAQ'; $html_title = 'FAQ';
$fm_id = isset($_GET['fm_id']) ? preg_replace('/[^0-9]/', '', $_GET['fm_id']) : 0; $fm_id = isset($_GET['fm_id']) ? strval(preg_replace('/[^0-9]/', '', $_GET['fm_id'])) : 0;
if ($w == "u") if ($w == "u") {
{ $html_title .= ' 수정';
$html_title .= ' 수정'; $readonly = ' readonly';
$readonly = ' readonly';
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' "; $fm = sql_fetch($sql);
$fm = sql_fetch($sql); if (!$fm['fm_id']) {
if (!$fm['fm_id']) alert('등록된 자료가 없습니다.'); alert('등록된 자료가 없습니다.');
} }
else } else {
{ $html_title .= ' 입력';
$html_title .= ' 입력'; $fm = array('fm_order' => '', 'fm_subject' => '', 'fm_id' => 0, 'fm_head_html' => '', 'fm_tail_html' => '', 'fm_mobile_head_html' => '', 'fm_mobile_tail_html' => '');
$fm = array('fm_order'=>'', 'fm_subject'=>'', 'fm_id'=>0, 'fm_head_html'=> '', 'fm_tail_html'=> '', 'fm_mobile_head_html' => '', 'fm_mobile_tail_html' => ''); }
}
$g5['title'] = $html_title . ' 관리';
$g5['title'] = $html_title.' 관리';
// 모바일 상하단 내용 필드추가
// 모바일 상하단 내용 필드추가 if (!sql_query(" select fm_mobile_head_html from {$g5['faq_master_table']} limit 1 ", false)) {
if(!sql_query(" select fm_mobile_head_html from {$g5['faq_master_table']} limit 1 ", false)) { sql_query(
sql_query(" ALTER TABLE `{$g5['faq_master_table']}` " ALTER TABLE `{$g5['faq_master_table']}`
ADD `fm_mobile_head_html` text NOT NULL AFTER `fm_tail_html`, ADD `fm_mobile_head_html` text NOT NULL AFTER `fm_tail_html`,
ADD `fm_mobile_tail_html` text NOT NULL AFTER `fm_mobile_head_html` ", true); ADD `fm_mobile_tail_html` text NOT NULL AFTER `fm_mobile_head_html` ",
} true
);
include_once (G5_ADMIN_PATH.'/admin.head.php'); }
?>
require_once G5_ADMIN_PATH . '/admin.head.php';
<form name="frmfaqmasterform" action="./faqmasterformupdate.php" onsubmit="return frmfaqmasterform_check(this);" method="post" enctype="MULTIPART/FORM-DATA"> ?>
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="fm_id" value="<?php echo $fm_id; ?>"> <form name="frmfaqmasterform" action="./faqmasterformupdate.php" onsubmit="return frmfaqmasterform_check(this);" method="post" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value=""> <input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="fm_id" value="<?php echo $fm_id; ?>">
<div class="tbl_frm01 tbl_wrap"> <input type="hidden" name="token" value="">
<table>
<caption><?php echo $g5['title']; ?></caption> <div class="tbl_frm01 tbl_wrap">
<colgroup> <table>
<col class="grid_4"> <caption><?php echo $g5['title']; ?></caption>
<col> <colgroup>
</colgroup> <col class="grid_4">
<tbody> <col>
<tr> </colgroup>
<th scope="row"><label for="fm_order">출력순서</label></th> <tbody>
<td> <tr>
<?php echo help('숫자가 작을수록 FAQ 분류에서 먼저 출력됩니다.'); ?> <th scope="row"><label for="fm_order">출력순서</label></th>
<input type="text" name="fm_order" value="<?php echo $fm['fm_order']; ?>" id="fm_order" class="frm_input" maxlength="10" size="10"> <td>
</td> <?php echo help('숫자가 작을수록 FAQ 분류에서 먼저 출력됩니다.'); ?>
</tr> <input type="text" name="fm_order" value="<?php echo $fm['fm_order']; ?>" id="fm_order" class="frm_input" maxlength="10" size="10">
<tr> </td>
<th scope="row"><label for="fm_subject">제목</label></th> </tr>
<td> <tr>
<input type="text" value="<?php echo get_text($fm['fm_subject']); ?>" name="fm_subject" id="fm_subject" required class="frm_input required" size="70"> <th scope="row"><label for="fm_subject">제목</label></th>
<?php if ($w == 'u') { ?> <td>
<a href="<?php echo G5_BBS_URL; ?>/faq.php?fm_id=<?php echo $fm_id; ?>" class="btn_frmline">보기</a> <input type="text" value="<?php echo get_text($fm['fm_subject']); ?>" name="fm_subject" id="fm_subject" required class="frm_input required" size="70">
<a href="./faqlist.php?fm_id=<?php echo $fm_id; ?>" class="btn_frmline">상세보기</a> <?php if ($w == 'u') { ?>
<?php } ?> <a href="<?php echo G5_BBS_URL; ?>/faq.php?fm_id=<?php echo $fm_id; ?>" class="btn_frmline">보기</a>
</td> <a href="./faqlist.php?fm_id=<?php echo $fm_id; ?>" class="btn_frmline">상세보기</a>
</tr> <?php } ?>
<tr> </td>
<th scope="row"><label for="fm_himg">상단이미지</label></th> </tr>
<td> <tr>
<input type="file" name="fm_himg" id="fm_himg"> <th scope="row"><label for="fm_himg">상단이미지</label></th>
<?php <td>
$himg = G5_DATA_PATH.'/faq/'.$fm['fm_id'].'_h'; <input type="file" name="fm_himg" id="fm_himg">
$himg_str = ''; <?php
if (file_exists($himg)) { $himg = G5_DATA_PATH . '/faq/' . $fm['fm_id'] . '_h';
$size = @getimagesize($himg); $himg_str = '';
if($size[0] && $size[0] > 750) $width = 0;
$width = 750; if (file_exists($himg)) {
else $size = @getimagesize($himg);
$width = $size[0]; if ($size) {
if ($size[0] && $size[0] > 750) {
echo '<input type="checkbox" name="fm_himg_del" value="1" id="fm_himg_del"> <label for="fm_himg_del">삭제</label>'; $width = 750;
$himg_str = '<img src="'.G5_DATA_URL.'/faq/'.$fm['fm_id'].'_h" width="'.$width.'" alt="">'; } else {
} $width = $size[0];
if ($himg_str) { }
echo '<div class="banner_or_img">'; }
echo $himg_str; echo '<input type="checkbox" name="fm_himg_del" value="1" id="fm_himg_del"> <label for="fm_himg_del">삭제</label>';
echo '</div>'; $himg_str = '<img src="' . G5_DATA_URL . '/faq/' . $fm['fm_id'] . '_h" width="' . $width . '" alt="">';
} }
?> if ($himg_str) {
</td> echo '<div class="banner_or_img">';
</tr> echo $himg_str;
<tr> echo '</div>';
<th scope="row"><label for="fm_timg">하단이미지</label></th> }
<td> ?>
<input type="file" name="fm_timg" id="fm_timg"> </td>
<?php </tr>
$timg = G5_DATA_PATH.'/faq/'.$fm['fm_id'].'_t'; <tr>
$timg_str = ''; <th scope="row"><label for="fm_timg">하단이미지</label></th>
if (file_exists($timg)) { <td>
$size = @getimagesize($timg); <input type="file" name="fm_timg" id="fm_timg">
if($size[0] && $size[0] > 750) <?php
$width = 750; $timg = G5_DATA_PATH . '/faq/' . $fm['fm_id'] . '_t';
else $timg_str = '';
$width = $size[0]; $width = 0;
if (file_exists($timg)) {
echo '<input type="checkbox" name="fm_timg_del" value="1" id="fm_timg_del"><label for="fm_timg_del">삭제</label>'; $size = @getimagesize($timg);
$timg_str = '<img src="'.G5_DATA_URL.'/faq/'.$fm['fm_id'].'_t" width="'.$width.'" alt="">'; if ($size) {
} if ($size[0] && $size[0] > 750) {
if ($timg_str) { $width = 750;
echo '<div class="banner_or_img">'; } else {
echo $timg_str; $width = $size[0];
echo '</div>'; }
} }
?>
</td> echo '<input type="checkbox" name="fm_timg_del" value="1" id="fm_timg_del"><label for="fm_timg_del">삭제</label>';
</tr> $timg_str = '<img src="' . G5_DATA_URL . '/faq/' . $fm['fm_id'] . '_t" width="' . $width . '" alt="">';
<tr> }
<th scope="row">상단 내용</th> if ($timg_str) {
<td> echo '<div class="banner_or_img">';
<?php echo editor_html('fm_head_html', get_text(html_purifier($fm['fm_head_html']), 0)); ?> echo $timg_str;
</td> echo '</div>';
</tr> }
<tr> ?>
<th scope="row">하단 내용</th> </td>
<td> </tr>
<?php echo editor_html('fm_tail_html', get_text(html_purifier($fm['fm_tail_html']), 0)); ?> <tr>
</td> <th scope="row">상단 내용</th>
</tr> <td>
<tr> <?php echo editor_html('fm_head_html', get_text(html_purifier($fm['fm_head_html']), 0)); ?>
<th scope="row">모바일상단 내용</th> </td>
<td> </tr>
<?php echo editor_html('fm_mobile_head_html', get_text(html_purifier($fm['fm_mobile_head_html']), 0)); ?> <tr>
</td> <th scope="row">하단 내용</th>
</tr> <td>
<tr> <?php echo editor_html('fm_tail_html', get_text(html_purifier($fm['fm_tail_html']), 0)); ?>
<th scope="row">모바일하단 내용</th> </td>
<td> </tr>
<?php echo editor_html('fm_mobile_tail_html', get_text(html_purifier($fm['fm_mobile_tail_html']), 0)); ?> <tr>
</td> <th scope="row">모바일상단 내용</th>
</tr> <td>
</tbody> <?php echo editor_html('fm_mobile_head_html', get_text(html_purifier($fm['fm_mobile_head_html']), 0)); ?>
</table> </td>
</div> </tr>
<tr>
<div class="btn_fixed_top"> <th scope="row">모바일하단 내용</th>
<a href="./faqmasterlist.php" class="btn btn_02">목록</a> <td>
<input type="submit" value="확인" class="btn_submit btn" accesskey="s"> <?php echo editor_html('fm_mobile_tail_html', get_text(html_purifier($fm['fm_mobile_tail_html']), 0)); ?>
</div> </td>
</tr>
</form> </tbody>
</table>
<script> </div>
function frmfaqmasterform_check(f)
{ <div class="btn_fixed_top">
<?php echo get_editor_js('fm_head_html'); ?> <a href="./faqmasterlist.php" class="btn btn_02">목록</a>
<?php echo get_editor_js('fm_tail_html'); ?> <input type="submit" value="확인" class="btn_submit btn" accesskey="s">
<?php echo get_editor_js('fm_mobile_head_html'); ?> </div>
<?php echo get_editor_js('fm_mobile_tail_html'); ?>
} </form>
// document.frmfaqmasterform.fm_subject.focus(); <script>
</script> function frmfaqmasterform_check(f) {
<?php echo get_editor_js('fm_head_html'); ?>
<?php <?php echo get_editor_js('fm_tail_html'); ?>
include_once (G5_ADMIN_PATH.'/admin.tail.php'); <?php echo get_editor_js('fm_mobile_head_html'); ?>
<?php echo get_editor_js('fm_mobile_tail_html'); ?>
}
// document.frmfaqmasterform.fm_subject.focus();
</script>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';

View File

@ -1,83 +1,83 @@
<?php <?php
$sub_menu = '300700'; $sub_menu = '300700';
include_once('./_common.php'); require_once './_common.php';
if ($w == "u" || $w == "d") if ($w == "u" || $w == "d") {
check_demo(); check_demo();
}
if ($w == 'd')
auth_check_menu($auth, $sub_menu, "d"); if ($w == 'd') {
else auth_check_menu($auth, $sub_menu, "d");
auth_check_menu($auth, $sub_menu, "w"); } else {
auth_check_menu($auth, $sub_menu, "w");
check_admin_token(); }
@mkdir(G5_DATA_PATH."/faq", G5_DIR_PERMISSION); check_admin_token();
@chmod(G5_DATA_PATH."/faq", G5_DIR_PERMISSION);
@mkdir(G5_DATA_PATH . "/faq", G5_DIR_PERMISSION);
$fm_id = isset($_REQUEST['fm_id']) ? (int) $_REQUEST['fm_id'] : 0; @chmod(G5_DATA_PATH . "/faq", G5_DIR_PERMISSION);
$fm_himg_del = isset($_POST['fm_himg_del']) ? (int) $_POST['fm_himg_del'] : 0;
$fm_timg_del = isset($_POST['fm_timg_del']) ? (int) $_POST['fm_timg_del'] : 0; $fm_id = isset($_REQUEST['fm_id']) ? (int) $_REQUEST['fm_id'] : 0;
$fm_subject = isset($_POST['fm_subject']) ? strip_tags(clean_xss_attributes($_POST['fm_subject'])) : ''; $fm_himg_del = isset($_POST['fm_himg_del']) ? (int) $_POST['fm_himg_del'] : 0;
$fm_head_html = isset($_POST['fm_head_html']) ? $_POST['fm_head_html'] : ''; $fm_timg_del = isset($_POST['fm_timg_del']) ? (int) $_POST['fm_timg_del'] : 0;
$fm_tail_html = isset($_POST['fm_tail_html']) ? $_POST['fm_tail_html'] : ''; $fm_subject = isset($_POST['fm_subject']) ? strip_tags(clean_xss_attributes($_POST['fm_subject'])) : '';
$fm_mobile_head_html = isset($_POST['fm_mobile_head_html']) ? $_POST['fm_mobile_head_html'] : ''; $fm_head_html = isset($_POST['fm_head_html']) ? $_POST['fm_head_html'] : '';
$fm_mobile_tail_html = isset($_POST['fm_mobile_tail_html']) ? $_POST['fm_mobile_tail_html'] : ''; $fm_tail_html = isset($_POST['fm_tail_html']) ? $_POST['fm_tail_html'] : '';
$fm_order = isset($_POST['fm_order']) ? (int) $_POST['fm_order'] : 0; $fm_mobile_head_html = isset($_POST['fm_mobile_head_html']) ? $_POST['fm_mobile_head_html'] : '';
$fm_mobile_tail_html = isset($_POST['fm_mobile_tail_html']) ? $_POST['fm_mobile_tail_html'] : '';
if ($fm_himg_del) @unlink(G5_DATA_PATH."/faq/{$fm_id}_h"); $fm_order = isset($_POST['fm_order']) ? (int) $_POST['fm_order'] : 0;
if ($fm_timg_del) @unlink(G5_DATA_PATH."/faq/{$fm_id}_t");
if ($fm_himg_del) {
$sql_common = " set fm_subject = '$fm_subject', @unlink(G5_DATA_PATH . "/faq/{$fm_id}_h");
fm_head_html = '$fm_head_html', }
fm_tail_html = '$fm_tail_html', if ($fm_timg_del) {
fm_mobile_head_html = '$fm_mobile_head_html', @unlink(G5_DATA_PATH . "/faq/{$fm_id}_t");
fm_mobile_tail_html = '$fm_mobile_tail_html', }
fm_order = '$fm_order' ";
$sql_common = " set fm_subject = '$fm_subject',
if ($w == "") fm_head_html = '$fm_head_html',
{ fm_tail_html = '$fm_tail_html',
$sql = " alter table {$g5['faq_master_table']} auto_increment=1 "; fm_mobile_head_html = '$fm_mobile_head_html',
sql_query($sql); fm_mobile_tail_html = '$fm_mobile_tail_html',
fm_order = '$fm_order' ";
$sql = " insert {$g5['faq_master_table']} $sql_common ";
sql_query($sql); if ($w == "") {
$sql = " alter table {$g5['faq_master_table']} auto_increment=1 ";
$fm_id = sql_insert_id(); sql_query($sql);
}
else if ($w == "u") $sql = " insert {$g5['faq_master_table']} $sql_common ";
{ sql_query($sql);
$sql = " update {$g5['faq_master_table']} $sql_common where fm_id = '$fm_id' ";
sql_query($sql); $fm_id = sql_insert_id();
} } elseif ($w == "u") {
else if ($w == "d") $sql = " update {$g5['faq_master_table']} $sql_common where fm_id = '$fm_id' ";
{ sql_query($sql);
@unlink(G5_DATA_PATH."/faq/{$fm_id}_h"); } elseif ($w == "d") {
@unlink(G5_DATA_PATH."/faq/{$fm_id}_t"); @unlink(G5_DATA_PATH . "/faq/{$fm_id}_h");
@unlink(G5_DATA_PATH . "/faq/{$fm_id}_t");
// FAQ삭제
$sql = " delete from {$g5['faq_master_table']} where fm_id = '$fm_id' "; // FAQ삭제
sql_query($sql); $sql = " delete from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
sql_query($sql);
// FAQ상세삭제
$sql = " delete from {$g5['faq_table']} where fm_id = '$fm_id' "; // FAQ상세삭제
sql_query($sql); $sql = " delete from {$g5['faq_table']} where fm_id = '$fm_id' ";
} sql_query($sql);
}
if ($w == "" || $w == "u")
{ if ($w == "" || $w == "u") {
if ($_FILES['fm_himg']['name']){ if ($_FILES['fm_himg']['name']) {
$dest_path = G5_DATA_PATH."/faq/".$fm_id."_h"; $dest_path = G5_DATA_PATH . "/faq/" . $fm_id . "_h";
@move_uploaded_file($_FILES['fm_himg']['tmp_name'], $dest_path); @move_uploaded_file($_FILES['fm_himg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION); @chmod($dest_path, G5_FILE_PERMISSION);
} }
if ($_FILES['fm_timg']['name']){ if ($_FILES['fm_timg']['name']) {
$dest_path = G5_DATA_PATH."/faq/".$fm_id."_t"; $dest_path = G5_DATA_PATH . "/faq/" . $fm_id . "_t";
@move_uploaded_file($_FILES['fm_timg']['tmp_name'], $dest_path); @move_uploaded_file($_FILES['fm_timg']['tmp_name'], $dest_path);
@chmod($dest_path, G5_FILE_PERMISSION); @chmod($dest_path, G5_FILE_PERMISSION);
} }
goto_url("./faqmasterform.php?w=u&amp;fm_id=$fm_id"); goto_url("./faqmasterform.php?w=u&amp;fm_id=$fm_id");
} } else {
else goto_url("./faqmasterlist.php");
goto_url("./faqmasterlist.php"); }

View File

@ -1,127 +1,137 @@
<?php <?php
$sub_menu = '300700'; $sub_menu = '300700';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
//dbconfig파일에 $g5['faq_table'] , $g5['faq_master_table'] 배열변수가 있는지 체크 //dbconfig파일에 $g5['faq_table'] , $g5['faq_master_table'] 배열변수가 있는지 체크
if( !isset($g5['faq_table']) || !isset($g5['faq_master_table']) ){ if (!isset($g5['faq_table']) || !isset($g5['faq_master_table'])) {
die('<meta charset="utf-8">/data/dbconfig.php 파일에 <br ><strong>$g5[\'faq_table\'] = G5_TABLE_PREFIX.\'faq\';</strong><br ><strong>$g5[\'faq_master_table\'] = G5_TABLE_PREFIX.\'faq_master\';</strong><br > 를 추가해 주세요.'); die('<meta charset="utf-8">/data/dbconfig.php 파일에 <br ><strong>$g5[\'faq_table\'] = G5_TABLE_PREFIX.\'faq\';</strong><br ><strong>$g5[\'faq_master_table\'] = G5_TABLE_PREFIX.\'faq_master\';</strong><br > 를 추가해 주세요.');
} }
//자주하시는 질문 마스터 테이블이 있는지 검사한다. //자주하시는 질문 마스터 테이블이 있는지 검사한다.
if(!sql_query(" DESCRIBE {$g5['faq_master_table']} ", false)) { if (!sql_query(" DESCRIBE {$g5['faq_master_table']} ", false)) {
if(sql_query(" DESCRIBE {$g5['g5_shop_faq_master_table']} ", false)) { if (sql_query(" DESCRIBE {$g5['g5_shop_faq_master_table']} ", false)) {
sql_query(" ALTER TABLE {$g5['g5_shop_faq_master_table']} RENAME TO `{$g5['faq_master_table']}` ;", false); sql_query(" ALTER TABLE {$g5['g5_shop_faq_master_table']} RENAME TO `{$g5['faq_master_table']}` ;", false);
} else { } else {
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['faq_master_table']}` ( $query_cp = sql_query(
`fm_id` int(11) NOT NULL AUTO_INCREMENT, " CREATE TABLE IF NOT EXISTS `{$g5['faq_master_table']}` (
`fm_subject` varchar(255) NOT NULL DEFAULT '', `fm_id` int(11) NOT NULL AUTO_INCREMENT,
`fm_head_html` text NOT NULL, `fm_subject` varchar(255) NOT NULL DEFAULT '',
`fm_tail_html` text NOT NULL, `fm_head_html` text NOT NULL,
`fm_order` int(11) NOT NULL DEFAULT '0', `fm_tail_html` text NOT NULL,
PRIMARY KEY (`fm_id`) `fm_order` int(11) NOT NULL DEFAULT '0',
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true); PRIMARY KEY (`fm_id`)
} ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
// FAQ Master true
sql_query(" insert into `{$g5['faq_master_table']}` set fm_id = '1', fm_subject = '자주하시는 질문' ", false); );
} }
// FAQ Master
//자주하시는 질문 테이블이 있는지 검사한다. sql_query(" insert into `{$g5['faq_master_table']}` set fm_id = '1', fm_subject = '자주하시는 질문' ", false);
if(!sql_query(" DESCRIBE {$g5['faq_table']} ", false)) { }
if(sql_query(" DESCRIBE {$g5['g5_shop_faq_table']} ", false)) {
sql_query(" ALTER TABLE {$g5['g5_shop_faq_table']} RENAME TO `{$g5['faq_table']}` ;", false); //자주하시는 질문 테이블이 있는지 검사한다.
} else { if (!sql_query(" DESCRIBE {$g5['faq_table']} ", false)) {
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['faq_table']}` ( if (sql_query(" DESCRIBE {$g5['g5_shop_faq_table']} ", false)) {
`fa_id` int(11) NOT NULL AUTO_INCREMENT, sql_query(" ALTER TABLE {$g5['g5_shop_faq_table']} RENAME TO `{$g5['faq_table']}` ;", false);
`fm_id` int(11) NOT NULL DEFAULT '0', } else {
`fa_subject` text NOT NULL, $query_cp = sql_query(
`fa_content` text NOT NULL, " CREATE TABLE IF NOT EXISTS `{$g5['faq_table']}` (
`fa_order` int(11) NOT NULL DEFAULT '0', `fa_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`fa_id`), `fm_id` int(11) NOT NULL DEFAULT '0',
KEY `fm_id` (`fm_id`) `fa_subject` text NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true); `fa_content` text NOT NULL,
} `fa_order` int(11) NOT NULL DEFAULT '0',
} PRIMARY KEY (`fa_id`),
KEY `fm_id` (`fm_id`)
$g5['title'] = 'FAQ관리'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
include_once (G5_ADMIN_PATH.'/admin.head.php'); true
);
$sql_common = " from {$g5['faq_master_table']} "; }
}
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common; $g5['title'] = 'FAQ관리';
$row = sql_fetch($sql); require_once G5_ADMIN_PATH . '/admin.head.php';
$total_count = $row['cnt'];
$sql_common = " from {$g5['faq_master_table']} ";
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 // 테이블의 전체 레코드수만 얻음
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $sql = " select count(*) as cnt " . $sql_common;
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = "select * $sql_common order by fm_order, fm_id limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql); $rows = $config['cf_page_rows'];
?> $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) {
<div class="local_ov01 local_ov"> $page = 1;
<?php if ($page > 1) {?><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>">처음으로</a><?php } ?> } // 페이지가 없으면 첫 페이지 (1 페이지)
<span class="btn_ov01"><span class="ov_txt"> 전체 FAQ </span><span class="ov_num"> <?php echo $total_count; ?>건</span></span> $from_record = ($page - 1) * $rows; // 시작 열을 구함
</div>
$sql = "select * $sql_common order by fm_order, fm_id limit $from_record, {$config['cf_page_rows']} ";
<div class="local_desc01 local_desc"> $result = sql_query($sql);
<ol> ?>
<li>FAQ는 무제한으로 등록할 수 있습니다</li>
<li><strong>FAQ추가</strong>를 눌러 FAQ Master를 생성합니다. (하나의 FAQ 타이틀 생성 : 자주하시는 질문, 이용안내..등 )</li> <div class="local_ov01 local_ov">
<li>생성한 FAQ Master 의 <strong>제목</strong>을 눌러 세부 내용을 관리할 수 있습니다.</li> <?php if ($page > 1) { ?>
</ol> <a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>">처음으로</a>
</div> <?php } ?>
<span class="btn_ov01"><span class="ov_txt"> 전체 FAQ </span><span class="ov_num"> <?php echo $total_count; ?>건</span></span>
<div class="btn_fixed_top"> </div>
<a href="./faqmasterform.php" class="btn_01 btn">FAQ추가</a>
</div> <div class="local_desc01 local_desc">
<ol>
<div class="tbl_head01 tbl_wrap"> <li>FAQ는 무제한으로 등록할 수 있습니다</li>
<table> <li><strong>FAQ추가</strong>를 눌러 FAQ Master를 생성합니다. (하나의 FAQ 타이틀 생성 : 자주하시는 질문, 이용안내..등 )</li>
<caption><?php echo $g5['title']; ?> 목록</caption> <li>생성한 FAQ Master 의 <strong>제목</strong>을 눌러 세부 내용을 관리할 수 있습니다.</li>
<thead> </ol>
<tr> </div>
<th scope="col">ID</th>
<th scope="col">제목</th> <div class="btn_fixed_top">
<th scope="col">FAQ수</th> <a href="./faqmasterform.php" class="btn_01 btn">FAQ추가</a>
<th scope="col">순서</th> </div>
<th scope="col">관리</th>
</tr> <div class="tbl_head01 tbl_wrap">
</thead> <table>
<tbody> <caption><?php echo $g5['title']; ?> 목록</caption>
<?php for ($i=0; $row=sql_fetch_array($result); $i++) { <thead>
$sql1 = " select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' "; <tr>
$row1 = sql_fetch($sql1); <th scope="col">ID</th>
$cnt = $row1['cnt']; <th scope="col">제목</th>
$bg = 'bg'.($i%2); <th scope="col">FAQ수</th>
?> <th scope="col">순서</th>
<tr class="<?php echo $bg; ?>"> <th scope="col">관리</th>
<td class="td_num"><?php echo $row['fm_id']; ?></td> </tr>
<td class="td_left"><a href="./faqlist.php?fm_id=<?php echo $row['fm_id']; ?>&amp;fm_subject=<?php echo $row['fm_subject']; ?>"><?php echo stripslashes($row['fm_subject']); ?></a></td> </thead>
<td class="td_num"><?php echo $cnt; ?></td> <tbody>
<td class="td_num"><?php echo $row['fm_order']?></td> <?php for ($i = 0; $row = sql_fetch_array($result); $i++) {
<td class="td_mng td_mng_l"> $sql1 = " select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' ";
<a href="./faqmasterform.php?w=u&amp;fm_id=<?php echo $row['fm_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>수정</a> $row1 = sql_fetch($sql1);
<a href="<?php echo G5_BBS_URL; ?>/faq.php?fm_id=<?php echo $row['fm_id']; ?>" class="btn btn_02"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>보기</a> $cnt = $row1['cnt'];
<a href="./faqmasterformupdate.php?w=d&amp;fm_id=<?php echo $row['fm_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>삭제</a> $bg = 'bg' . ($i % 2);
</td> ?>
</tr> <tr class="<?php echo $bg; ?>">
<?php <td class="td_num"><?php echo $row['fm_id']; ?></td>
} <td class="td_left"><a href="./faqlist.php?fm_id=<?php echo $row['fm_id']; ?>&amp;fm_subject=<?php echo $row['fm_subject']; ?>"><?php echo stripslashes($row['fm_subject']); ?></a></td>
<td class="td_num"><?php echo $cnt; ?></td>
if ($i == 0){ <td class="td_num"><?php echo $row['fm_order'] ?></td>
echo '<tr><td colspan="5" class="empty_table"><span>자료가 한건도 없습니다.</span></td></tr>'; <td class="td_mng td_mng_l">
} <a href="./faqmasterform.php?w=u&amp;fm_id=<?php echo $row['fm_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>수정</a>
?> <a href="<?php echo G5_BBS_URL; ?>/faq.php?fm_id=<?php echo $row['fm_id']; ?>" class="btn btn_02"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>보기</a>
</tbody> <a href="./faqmasterformupdate.php?w=d&amp;fm_id=<?php echo $row['fm_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>삭제</a>
</table> </td>
</div> </tr>
<?php
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?> }
<?php if ($i == 0) {
include_once (G5_ADMIN_PATH.'/admin.tail.php'); echo '<tr><td colspan="5" class="empty_table"><span>자료가 한건도 없습니다.</span></td></tr>';
}
?>
</tbody>
</table>
</div>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';

View File

@ -1,14 +1,14 @@
<?php <?php
$sub_menu = '100000'; $sub_menu = '100000';
include_once('./_common.php'); require_once './_common.php';
@include_once('./safe_check.php'); @require_once './safe_check.php';
if(function_exists('social_log_file_delete')){ if (function_exists('social_log_file_delete')) {
social_log_file_delete(86400); //소셜로그인 디버그 파일 24시간 지난것은 삭제 social_log_file_delete(86400); //소셜로그인 디버그 파일 24시간 지난것은 삭제
} }
$g5['title'] = '관리자메인'; $g5['title'] = '관리자메인';
include_once ('./admin.head.php'); require_once './admin.head.php';
$new_member_rows = 5; $new_member_rows = 5;
$new_point_rows = 5; $new_point_rows = 5;
@ -18,8 +18,9 @@ $sql_common = " from {$g5['member_table']} ";
$sql_search = " where (1) "; $sql_search = " where (1) ";
if ($is_admin != 'super') if ($is_admin != 'super') {
$sql_search .= " and mb_level <= '{$member['mb_level']}' "; $sql_search .= " and mb_level <= '{$member['mb_level']}' ";
}
if (!$sst) { if (!$sst) {
$sst = "mb_datetime"; $sst = "mb_datetime";
@ -56,69 +57,69 @@ $colspan = 12;
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption>신규가입회원</caption> <caption>신규가입회원</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">회원아이디</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> <th scope="col">권한</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>
<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> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{ // 접근가능한 그룹수
// 접근가능한 그룹수 $sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' "; $row2 = sql_fetch($sql2);
$row2 = sql_fetch($sql2); $group = "";
$group = ""; if ($row2['cnt']) {
if ($row2['cnt']) $group = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">' . $row2['cnt'] . '</a>';
$group = '<a href="./boardgroupmember_form.php?mb_id='.$row['mb_id'].'">'.$row2['cnt'].'</a>'; }
if ($is_admin == 'group') if ($is_admin == 'group') {
{ $s_mod = '';
$s_mod = ''; $s_del = '';
$s_del = ''; } else {
} $s_mod = '<a href="./member_form.php?$qstr&amp;w=u&amp;mb_id=' . $row['mb_id'] . '">수정</a>';
else $s_del = '<a href="./member_delete.php?' . $qstr . '&amp;w=d&amp;mb_id=' . $row['mb_id'] . '&amp;url=' . $_SERVER['SCRIPT_NAME'] . '" onclick="return delete_confirm(this);">삭제</a>';
{ }
$s_mod = '<a href="./member_form.php?$qstr&amp;w=u&amp;mb_id='.$row['mb_id'].'">수정</a>'; $s_grp = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">그룹</a>';
$s_del = '<a href="./member_delete.php?'.$qstr.'&amp;w=d&amp;mb_id='.$row['mb_id'].'&amp;url='.$_SERVER['SCRIPT_NAME'].'" onclick="return delete_confirm(this);">삭제</a>';
}
$s_grp = '<a href="./boardgroupmember_form.php?mb_id='.$row['mb_id'].'">그룹</a>';
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME); $leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date("Ymd", G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME); $intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date("Ymd", G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']); $mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id']; $mb_id = $row['mb_id'];
?> ?>
<tr> <tr>
<td class="td_mbid"><?php echo $mb_id ?></td> <td class="td_mbid"><?php echo $mb_id ?></td>
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td> <td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td class="td_mbname sv_use"><div><?php echo $mb_nick ?></div></td> <td class="td_mbname sv_use">
<td class="td_num"><?php echo $row['mb_level'] ?></td> <div><?php echo $mb_nick ?></div>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td> </td>
<td class="td_boolean"><?php echo $row['mb_mailling']?'예':'아니오'; ?></td> <td class="td_num"><?php echo $row['mb_level'] ?></td>
<td class="td_boolean"><?php echo $row['mb_open']?'예':'아니오'; ?></td> <td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td>
<td class="td_boolean"><?php echo preg_match('/[1-9]/', $row['mb_email_certify'])?'예':'아니오'; ?></td> <td class="td_boolean"><?php echo $row['mb_mailling'] ? '예' : '아니오'; ?></td>
<td class="td_boolean"><?php echo $row['mb_intercept_date']?'예':'아니오'; ?></td> <td class="td_boolean"><?php echo $row['mb_open'] ? '예' : '아니오'; ?></td>
<td class="td_category"><?php echo $group ?></td> <td class="td_boolean"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '예' : '아니오'; ?></td>
</tr> <td class="td_boolean"><?php echo $row['mb_intercept_date'] ? '예' : '아니오'; ?></td>
<?php <td class="td_category"><?php echo $group ?></td>
} </tr>
if ($i == 0) <?php
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>'; }
?> if ($i == 0) {
</tbody> echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table> </table>
</div> </div>
@ -131,13 +132,15 @@ $colspan = 12;
<?php <?php
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b, {$g5['group_table']} c where a.bo_table = b.bo_table and b.gr_id = c.gr_id "; $sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b, {$g5['group_table']} c where a.bo_table = b.bo_table and b.gr_id = c.gr_id ";
if ($gr_id) if ($gr_id) {
$sql_common .= " and b.gr_id = '$gr_id' "; $sql_common .= " and b.gr_id = '$gr_id' ";
}
if (isset($view) && $view) { if (isset($view) && $view) {
if ($view == 'w') if ($view == 'w') {
$sql_common .= " and a.wr_id = a.wr_parent "; $sql_common .= " and a.wr_id = a.wr_parent ";
else if ($view == 'c') } elseif ($view == 'c') {
$sql_common .= " and a.wr_id <> a.wr_parent "; $sql_common .= " and a.wr_id <> a.wr_parent ";
}
} }
$sql_order = " order by a.bn_id desc "; $sql_order = " order by a.bn_id desc ";
@ -153,72 +156,74 @@ $colspan = 5;
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption>최근게시물</caption> <caption>최근게시물</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">그룹</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> <th scope="col">이름</th>
<th scope="col">일시</th> <th scope="col">일시</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id {$sql_common} {$sql_order} limit {$new_write_rows} "; $sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id {$sql_common} {$sql_order} limit {$new_write_rows} ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{ $tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
$tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
if ($row['wr_id'] == $row['wr_parent']) // 원글 // 원글
{ if ($row['wr_id'] == $row['wr_parent']) {
$comment = ""; $comment = "";
$comment_link = ""; $comment_link = "";
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '{$row['wr_id']}' "); $row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '{$row['wr_id']}' ");
$name = get_sideview($row2['mb_id'], get_text(cut_str($row2['wr_name'], $config['cf_cut_name'])), $row2['wr_email'], $row2['wr_homepage']); $name = get_sideview($row2['mb_id'], get_text(cut_str($row2['wr_name'], $config['cf_cut_name'])), $row2['wr_email'], $row2['wr_homepage']);
// 당일인 경우 시간으로 표시함 // 당일인 경우 시간으로 표시함
$datetime = substr($row2['wr_datetime'],0,10); $datetime = substr($row2['wr_datetime'], 0, 10);
$datetime2 = $row2['wr_datetime']; $datetime2 = $row2['wr_datetime'];
if ($datetime == G5_TIME_YMD) if ($datetime == G5_TIME_YMD) {
$datetime2 = substr($datetime2,11,5); $datetime2 = substr($datetime2, 11, 5);
else } else {
$datetime2 = substr($datetime2,5,5); $datetime2 = substr($datetime2, 5, 5);
}
} else // 코멘트
{
$comment = '댓글. ';
$comment_link = '#c_' . $row['wr_id'];
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' ");
$row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
} $name = get_sideview($row3['mb_id'], get_text(cut_str($row3['wr_name'], $config['cf_cut_name'])), $row3['wr_email'], $row3['wr_homepage']);
else // 코멘트 // 당일인 경우 시간으로 표시함
{ $datetime = substr($row3['wr_datetime'], 0, 10);
$comment = '댓글. '; $datetime2 = $row3['wr_datetime'];
$comment_link = '#c_'.$row['wr_id']; if ($datetime == G5_TIME_YMD) {
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_parent']}' "); $datetime2 = substr($datetime2, 11, 5);
$row3 = sql_fetch(" select mb_id, wr_name, wr_email, wr_homepage, wr_datetime from {$tmp_write_table} where wr_id = '{$row['wr_id']}' "); } else {
$datetime2 = substr($datetime2, 5, 5);
}
}
?>
$name = get_sideview($row3['mb_id'], get_text(cut_str($row3['wr_name'], $config['cf_cut_name'])), $row3['wr_email'], $row3['wr_homepage']); <tr>
// 당일인 경우 시간으로 표시함 <td class="td_category"><a href="<?php echo G5_BBS_URL ?>/new.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo cut_str($row['gr_subject'], 10) ?></a></td>
$datetime = substr($row3['wr_datetime'],0,10); <td class="td_category"><a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo cut_str($row['bo_subject'], 20) ?></a></td>
$datetime2 = $row3['wr_datetime']; <td><a href="<?php echo get_pretty_url($row['bo_table'], $row2['wr_id']); ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td>
if ($datetime == G5_TIME_YMD) <td class="td_mbname">
$datetime2 = substr($datetime2,11,5); <div><?php echo $name ?></div>
else </td>
$datetime2 = substr($datetime2,5,5); <td class="td_datetime"><?php echo $datetime ?></td>
} </tr>
?>
<tr> <?php
<td class="td_category"><a href="<?php echo G5_BBS_URL ?>/new.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo cut_str($row['gr_subject'],10) ?></a></td> }
<td class="td_category"><a href="<?php echo get_pretty_url($row['bo_table']) ?>"><?php echo cut_str($row['bo_subject'],20) ?></a></td> if ($i == 0) {
<td><a href="<?php echo get_pretty_url($row['bo_table'], $row2['wr_id']); ?><?php echo $comment_link ?>"><?php echo $comment ?><?php echo conv_subject($row2['wr_subject'], 100) ?></a></td> echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
<td class="td_mbname"><div><?php echo $name ?></div></td> }
<td class="td_datetime"><?php echo $datetime ?></td> ?>
</tr> </tbody>
<?php
}
if ($i == 0)
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table> </table>
</div> </div>
@ -250,56 +255,56 @@ $colspan = 7;
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption>최근 포인트 발생내역</caption> <caption>최근 포인트 발생내역</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">회원아이디</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> <th scope="col">일시</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> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$row2['mb_id'] = ''; $row2['mb_id'] = '';
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{ if ($row2['mb_id'] != $row['mb_id']) {
if ($row2['mb_id'] != $row['mb_id']) $sql2 = " select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_point from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
{ $row2 = sql_fetch($sql2);
$sql2 = " select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_point from {$g5['member_table']} where mb_id = '{$row['mb_id']}' "; }
$row2 = sql_fetch($sql2);
}
$mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']); $mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']);
$link1 = $link2 = ""; $link1 = $link2 = "";
if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table']) if (!preg_match("/^\@/", $row['po_rel_table']) && $row['po_rel_table']) {
{ $link1 = '<a href="' . get_pretty_url($row['po_rel_table'], $row['po_rel_id']) . '" target="_blank">';
$link1 = '<a href="'.get_pretty_url($row['po_rel_table'], $row['po_rel_id']).'" target="_blank">'; $link2 = '</a>';
$link2 = '</a>'; }
} ?>
?>
<tr> <tr>
<td class="td_mbid"><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td> <td class="td_mbid"><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_mbname"><?php echo get_text($row2['mb_name']); ?></td> <td class="td_mbname"><?php echo get_text($row2['mb_name']); ?></td>
<td class="td_name sv_use"><div><?php echo $mb_nick ?></div></td> <td class="td_name sv_use">
<td class="td_datetime"><?php echo $row['po_datetime'] ?></td> <div><?php echo $mb_nick ?></div>
<td><?php echo $link1.$row['po_content'].$link2 ?></td> </td>
<td class="td_numbig"><?php echo number_format($row['po_point']) ?></td> <td class="td_datetime"><?php echo $row['po_datetime'] ?></td>
<td class="td_numbig"><?php echo number_format($row['po_mb_point']) ?></td> <td><?php echo $link1 . $row['po_content'] . $link2 ?></td>
</tr> <td class="td_numbig"><?php echo number_format($row['po_point']) ?></td>
<td class="td_numbig"><?php echo number_format($row['po_mb_point']) ?></td>
</tr>
<?php <?php
} }
if ($i == 0) if ($i == 0) {
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>'; echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
?> }
</tbody> ?>
</tbody>
</table> </table>
</div> </div>
@ -309,4 +314,4 @@ $colspan = 7;
</section> </section>
<?php <?php
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = '200300'; $sub_menu = '200300';
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
@ -10,14 +10,15 @@ check_admin_token();
$post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0; $post_count_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
if(! $post_count_chk) if (!$post_count_chk) {
alert('삭제할 메일목록을 1개이상 선택해 주세요.'); alert('삭제할 메일목록을 1개이상 선택해 주세요.');
}
for($i=0; $i<$post_count_chk; $i++) { for ($i = 0; $i < $post_count_chk; $i++) {
$ma_id = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0; $ma_id = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$sql = " delete from {$g5['mail_table']} where ma_id = '$ma_id' "; $sql = " delete from {$g5['mail_table']} where ma_id = '$ma_id' ";
sql_query($sql); sql_query($sql);
} }
goto_url('./mail_list.php'); goto_url('./mail_list.php');

View File

@ -1,86 +1,88 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
include_once(G5_EDITOR_LIB); require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
$html_title = '회원메일'; $html_title = '회원메일';
$ma_id = isset($_GET['ma_id']) ? (int) $_GET['ma_id'] : 0; $ma_id = isset($_GET['ma_id']) ? (int) $_GET['ma_id'] : 0;
$ma = array('ma_id'=>0, 'ma_subject'=>'', 'ma_content'=>''); $ma = array('ma_id' => 0, 'ma_subject' => '', 'ma_content' => '');
if ($w == 'u') { if ($w == 'u') {
$html_title .= '수정'; $html_title .= '수정';
$readonly = ' readonly'; $readonly = ' readonly';
$sql = " select * from {$g5['mail_table']} where ma_id = '{$ma_id}' "; $sql = " select * from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
$ma = sql_fetch($sql); $ma = sql_fetch($sql);
if (!$ma['ma_id']) if (!$ma['ma_id']) {
alert('등록된 자료가 없습니다.'); alert('등록된 자료가 없습니다.');
} else { }
$html_title .= '입력'; } else {
} $html_title .= '입력';
}
$g5['title'] = $html_title;
include_once('./admin.head.php'); $g5['title'] = $html_title;
?> require_once './admin.head.php';
?>
<div class="local_desc"><p>메일 내용에 {이름} , {닉네임} , {회원아이디} , {이메일} 처럼 내용에 삽입하면 해당 내용에 맞게 변환하여 메일을 발송합니다.</p></div>
<div class="local_desc">
<form name="fmailform" id="fmailform" action="./mail_update.php" onsubmit="return fmailform_check(this);" method="post"> <p>메일 내용에 {이름} , {닉네임} , {회원아이디} , {이메일} 처럼 내용에 삽입하면 해당 내용에 맞게 변환하여 메일을 발송합니다.</p>
<input type="hidden" name="w" value="<?php echo $w ?>" id="w"> </div>
<input type="hidden" name="ma_id" value="<?php echo $ma['ma_id'] ?>" id="ma_id">
<input type="hidden" name="token" value="" id="token"> <form name="fmailform" id="fmailform" action="./mail_update.php" onsubmit="return fmailform_check(this);" method="post">
<input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<div class="tbl_frm01 tbl_wrap"> <input type="hidden" name="ma_id" value="<?php echo $ma['ma_id'] ?>" id="ma_id">
<table> <input type="hidden" name="token" value="" id="token">
<caption><?php echo $g5['title']; ?></caption>
<colgroup> <div class="tbl_frm01 tbl_wrap">
<col class="grid_4"> <table>
<col> <caption><?php echo $g5['title']; ?></caption>
</colgroup> <colgroup>
<tbody> <col class="grid_4">
<tr> <col>
<th scope="row"><label for="ma_subject">메일 제목<strong class="sound_only">필수</strong></label></th> </colgroup>
<td><input type="text" name="ma_subject" value="<?php echo get_sanitize_input($ma['ma_subject']); ?>" id="ma_subject" required class="required frm_input" size="100"></td> <tbody>
</tr> <tr>
<tr> <th scope="row"><label for="ma_subject">메일 제목<strong class="sound_only">필수</strong></label></th>
<th scope="row"><label for="ma_content">메일 내용<strong class="sound_only">필수</strong></label></th> <td><input type="text" name="ma_subject" value="<?php echo get_sanitize_input($ma['ma_subject']); ?>" id="ma_subject" required class="required frm_input" size="100"></td>
<td><?php echo editor_html("ma_content", get_text(html_purifier($ma['ma_content']), 0)); ?></td> </tr>
</tr> <tr>
</tbody> <th scope="row"><label for="ma_content">메일 내용<strong class="sound_only">필수</strong></label></th>
</table> <td><?php echo editor_html("ma_content", get_text(html_purifier($ma['ma_content']), 0)); ?></td>
</div> </tr>
</tbody>
<div class="btn_fixed_top "> </table>
<input type="submit" class="btn_submit btn" accesskey="s" value="확인"> </div>
</div>
</form> <div class="btn_fixed_top ">
<input type="submit" class="btn_submit btn" accesskey="s" value="확인">
<script> </div>
function fmailform_check(f) </form>
{
errmsg = ""; <script>
errfld = ""; function fmailform_check(f) {
errmsg = "";
check_field(f.ma_subject, "제목을 입력하세요."); errfld = "";
//check_field(f.ma_content, "내용을 입력하세요.");
check_field(f.ma_subject, "제목을 입력하세요.");
if (errmsg != "") { //check_field(f.ma_content, "내용을 입력하세요.");
alert(errmsg);
errfld.focus(); if (errmsg != "") {
return false; alert(errmsg);
} errfld.focus();
return false;
<?php echo get_editor_js("ma_content"); ?> }
<?php echo chk_editor_js("ma_content"); ?>
<?php echo get_editor_js("ma_content"); ?>
return true; <?php echo chk_editor_js("ma_content"); ?>
}
return true;
document.fmailform.ma_subject.focus(); }
</script>
document.fmailform.ma_subject.focus();
<?php </script>
include_once('./admin.tail.php');
<?php
require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = '200300'; $sub_menu = '200300';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -17,7 +17,7 @@ $sql = " select * {$sql_common} order by ma_id desc ";
$result = sql_query($sql); $result = sql_query($sql);
$g5['title'] = '회원메일발송'; $g5['title'] = '회원메일발송';
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 7; $colspan = 7;
?> ?>
@ -32,73 +32,74 @@ $colspan = 7;
<form name="fmaillist" id="fmaillist" action="./mail_delete.php" method="post"> <form name="fmaillist" id="fmaillist" action="./mail_delete.php" method="post">
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?> 목록</caption> <caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <thead>
<tr> <tr>
<th scope="col"><input type="checkbox" name="chkall" value="1" id="chkall" title="현재 페이지 목록 전체선택" onclick="check_all(this.form)"></th> <th scope="col"><input type="checkbox" name="chkall" value="1" id="chkall" title="현재 페이지 목록 전체선택" 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>
<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> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
$s_vie = '<a href="./mail_preview.php?ma_id='.$row['ma_id'].'" target="_blank" class="btn btn_03">미리보기</a>'; $s_vie = '<a href="./mail_preview.php?ma_id=' . $row['ma_id'] . '" target="_blank" class="btn btn_03">미리보기</a>';
$num = number_format($total_count - ($page - 1) * $config['cf_page_rows'] - $i); $num = number_format($total_count - ($page - 1) * $config['cf_page_rows'] - $i);
$bg = 'bg'.($i%2); $bg = 'bg' . ($i % 2);
?> ?>
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
<td class="td_chk"> <td class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['ma_subject']; ?> 메일</label> <label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $row['ma_subject']; ?> 메일</label>
<input type="checkbox" id="chk_<?php echo $i ?>" name="chk[]" value="<?php echo $row['ma_id'] ?>"> <input type="checkbox" id="chk_<?php echo $i ?>" name="chk[]" value="<?php echo $row['ma_id'] ?>">
</td> </td>
<td class="td_num_c"><?php echo $num ?></td> <td class="td_num_c"><?php echo $num ?></td>
<td class="td_left"><a href="./mail_form.php?w=u&amp;ma_id=<?php echo $row['ma_id'] ?>"><?php echo $row['ma_subject'] ?></a></td> <td class="td_left"><a href="./mail_form.php?w=u&amp;ma_id=<?php echo $row['ma_id'] ?>"><?php echo $row['ma_subject'] ?></a></td>
<td class="td_datetime"><?php echo $row['ma_time'] ?></td> <td class="td_datetime"><?php echo $row['ma_time'] ?></td>
<td class="td_test"><a href="./mail_test.php?ma_id=<?php echo $row['ma_id'] ?>">테스트</a></td> <td class="td_test"><a href="./mail_test.php?ma_id=<?php echo $row['ma_id'] ?>">테스트</a></td>
<td class="td_send"><a href="./mail_select_form.php?ma_id=<?php echo $row['ma_id'] ?>">보내기</a></td> <td class="td_send"><a href="./mail_select_form.php?ma_id=<?php echo $row['ma_id'] ?>">보내기</a></td>
<td class="td_mng"><?php echo $s_vie ?></td> <td class="td_mng"><?php echo $s_vie ?></td>
</tr> </tr>
<?php <?php
} }
if (!$i) if (!$i) {
echo "<tr><td colspan=\"".$colspan."\" class=\"empty_table\">자료가 없습니다.</td></tr>"; echo "<tr><td colspan=\"" . $colspan . "\" class=\"empty_table\">자료가 없습니다.</td></tr>";
?> }
</tbody> ?>
</table> </tbody>
</div> </table>
<div class="btn_fixed_top"> </div>
<input type="submit" value="선택삭제" class="btn btn_02"> <div class="btn_fixed_top">
<a href="./mail_form.php" id="mail_add" class="btn btn_01">메일내용추가</a> <input type="submit" value="선택삭제" class="btn btn_02">
</div> <a href="./mail_form.php" id="mail_add" class="btn btn_01">메일내용추가</a>
</div>
</form> </form>
<script> <script>
$(function() { $(function() {
$('#fmaillist').submit(function() { $('#fmaillist').submit(function() {
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) { if (confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
if (!is_checked("chk[]")) { if (!is_checked("chk[]")) {
alert("선택삭제 하실 항목을 하나 이상 선택하세요."); alert("선택삭제 하실 항목을 하나 이상 선택하세요.");
return false;
}
return true;
} else {
return false; return false;
} }
});
return true;
} else {
return false;
}
}); });
});
</script> </script>
<?php <?php
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,7 +1,7 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
include_once(G5_LIB_PATH.'/mailer.lib.php'); require_once G5_LIB_PATH . '/mailer.lib.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -10,27 +10,23 @@ $ma_id = isset($_REQUEST['ma_id']) ? (int) $_REQUEST['ma_id'] : 0;
$se = sql_fetch("select ma_subject, ma_content from {$g5['mail_table']} where ma_id = '{$ma_id}' "); $se = sql_fetch("select ma_subject, ma_content from {$g5['mail_table']} where ma_id = '{$ma_id}' ");
$subject = $se['ma_subject']; $subject = $se['ma_subject'];
$content = conv_content($se['ma_content'], 1) . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='".G5_BBS_URL."/email_stop.php?mb_id=***&amp;mb_md5=***' target='_blank'>수신거부</a>] 해 주십시오.</span></p>"; $content = conv_content($se['ma_content'], 1) . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='" . G5_BBS_URL . "/email_stop.php?mb_id=***&amp;mb_md5=***' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
?> ?>
<!doctype html> <!doctype html>
<html lang="ko"> <html lang="ko">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title><?php echo G5_VERSION ?> 메일발송 테스트</title> <title><?php echo G5_VERSION ?> 메일발송 테스트</title>
</head> </head>
<body> <body>
<h1><?php echo $subject; ?></h1>
<h1><?php echo $subject; ?></h1> <p><?php echo $content; ?></p>
<p>
<p> <strong>주의!</strong> 이 화면에 보여지는 디자인은 실제 내용이 발송되었을 때 디자인과 다를 수 있습니다.
<?php echo $content; ?> </p>
</p>
<p>
<strong>주의!</strong> 이 화면에 보여지는 디자인은 실제 내용이 발송되었을 때 디자인과 다를 수 있습니다.
</p>
</body> </body>
</html> </html>

View File

@ -1,127 +1,139 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
if (!$config['cf_email_use']) if (!$config['cf_email_use']) {
alert('환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.'); alert('환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.');
}
auth_check_menu($auth, $sub_menu, 'r');
auth_check_menu($auth, $sub_menu, 'r');
$ma_id = isset($_GET['ma_id']) ? (int) $_GET['ma_id'] : 0;
$ma_id = isset($_GET['ma_id']) ? (int) $_GET['ma_id'] : 0;
$sql = " select * from {$g5['mail_table']} where ma_id = '$ma_id' ";
$ma = sql_fetch($sql); $sql = " select * from {$g5['mail_table']} where ma_id = '$ma_id' ";
if (!$ma['ma_id']) $ma = sql_fetch($sql);
alert('보내실 내용을 선택하여 주십시오.'); if (!$ma['ma_id']) {
alert('보내실 내용을 선택하여 주십시오.');
// 전체회원수 }
$sql = " select COUNT(*) as cnt from {$g5['member_table']} ";
$row = sql_fetch($sql); // 전체회원수
$tot_cnt = $row['cnt']; $sql = " select COUNT(*) as cnt from {$g5['member_table']} ";
$row = sql_fetch($sql);
// 탈퇴대기회원수 $tot_cnt = $row['cnt'];
$sql = " select COUNT(*) as cnt from {$g5['member_table']} where mb_leave_date <> '' ";
$row = sql_fetch($sql); // 탈퇴대기회원수
$finish_cnt = $row['cnt']; $sql = " select COUNT(*) as cnt from {$g5['member_table']} where mb_leave_date <> '' ";
$row = sql_fetch($sql);
$last_option = explode('||', $ma['ma_last_option']); $finish_cnt = $row['cnt'];
for ($i=0; $i<count($last_option); $i++) {
$option = explode('=', $last_option[$i]); $last_option = explode('||', $ma['ma_last_option']);
// 동적변수 for ($i = 0; $i < count($last_option); $i++) {
$var = isset($option[0]) ? $option[0] : ''; $option = explode('=', $last_option[$i]);
if( isset($option[1]) ) $$var = $option[1]; // 동적변수
} $var = isset($option[0]) ? $option[0] : '';
if (isset($option[1])) {
if (!isset($mb_id1)) $mb_id1 = 1; $$var = $option[1];
if (!isset($mb_level_from)) $mb_level_from = 1; }
if (!isset($mb_level_to)) $mb_level_to = 10; }
if (!isset($mb_mailling)) $mb_mailling = 1;
if (!isset($mb_id1)) {
$mb_id1_from = isset($mb_id1_from) ? clean_xss_tags($mb_id1_from, 1, 1, 30) : ''; $mb_id1 = 1;
$mb_id1_to = isset($mb_id1_to) ? clean_xss_tags($mb_id1_to, 1, 1, 30) : ''; }
$mb_email = isset($mb_email) ? clean_xss_tags($mb_email, 1, 1, 100) : ''; if (!isset($mb_level_from)) {
$mb_level_from = 1;
$g5['title'] = '회원메일발송'; }
include_once('./admin.head.php'); if (!isset($mb_level_to)) {
?> $mb_level_to = 10;
}
<div class="local_ov01 local_ov"> if (!isset($mb_mailling)) {
전체회원 <?php echo number_format($tot_cnt) ?>명 , 탈퇴대기회원 <?php echo number_format($finish_cnt) ?>명, 정상회원 <?php echo number_format($tot_cnt - $finish_cnt) ?>명 중 메일 발송 대상 선택 $mb_mailling = 1;
</div> }
<form name="frmsendmailselectform" id="frmsendmailselectform" action="./mail_select_list.php" method="post" autocomplete="off"> $mb_id1_from = isset($mb_id1_from) ? clean_xss_tags($mb_id1_from, 1, 1, 30) : '';
<input type="hidden" name="ma_id" value="<?php echo $ma_id ?>"> $mb_id1_to = isset($mb_id1_to) ? clean_xss_tags($mb_id1_to, 1, 1, 30) : '';
$mb_email = isset($mb_email) ? clean_xss_tags($mb_email, 1, 1, 100) : '';
<div class="tbl_frm01 tbl_wrap">
<table> $g5['title'] = '회원메일발송';
<caption><?php echo $g5['title']; ?> 대상선택</caption> require_once './admin.head.php';
<tbody> ?>
<tr>
<th scope="row">회원 ID</th> <div class="local_ov01 local_ov">
<td> 전체회원 <?php echo number_format($tot_cnt) ?>명 , 탈퇴대기회원 <?php echo number_format($finish_cnt) ?>명, 정상회원 <?php echo number_format($tot_cnt - $finish_cnt) ?>명 중 메일 발송 대상 선택
<input type="radio" name="mb_id1" value="1" id="mb_id1_all" <?php echo $mb_id1?"checked":""; ?>> <label for="mb_id1_all">전체</label> </div>
<input type="radio" name="mb_id1" value="0" id="mb_id1_section" <?php echo !$mb_id1?"checked":""; ?>> <label for="mb_id1_section">구간</label>
<input type="text" name="mb_id1_from" value="<?php echo get_sanitize_input($mb_id1_from); ?>" id="mb_id1_from" title="시작구간" class="frm_input"> 에서 <form name="frmsendmailselectform" id="frmsendmailselectform" action="./mail_select_list.php" method="post" autocomplete="off">
<input type="text" name="mb_id1_to" value="<?php echo get_sanitize_input($mb_id1_to); ?>" id="mb_id1_to" title="종료구간" class="frm_input"> 까지 <input type="hidden" name="ma_id" value="<?php echo $ma_id ?>">
</td>
</tr> <div class="tbl_frm01 tbl_wrap">
<tr> <table>
<th scope="row"><label for="mb_email">E-mail</label></th> <caption><?php echo $g5['title']; ?> 대상선택</caption>
<td> <tbody>
<?php echo help("메일 주소에 단어 포함 (예 : @".preg_replace('#^(www[^\.]*\.){1}#', '', $_SERVER['HTTP_HOST']).")") ?> <tr>
<input type="text" name="mb_email" value="<?php echo get_sanitize_input($mb_email); ?>" id="mb_email" class="frm_input" size="50"> <th scope="row">회원 ID</th>
</td> <td>
</tr> <input type="radio" name="mb_id1" value="1" id="mb_id1_all" <?php echo $mb_id1 ? "checked" : ""; ?>> <label for="mb_id1_all">전체</label>
<tr> <input type="radio" name="mb_id1" value="0" id="mb_id1_section" <?php echo !$mb_id1 ? "checked" : ""; ?>> <label for="mb_id1_section">구간</label>
<th scope="row"><label for="mb_mailling">메일링</label></th> <input type="text" name="mb_id1_from" value="<?php echo get_sanitize_input($mb_id1_from); ?>" id="mb_id1_from" title="시작구간" class="frm_input"> 에서
<td> <input type="text" name="mb_id1_to" value="<?php echo get_sanitize_input($mb_id1_to); ?>" id="mb_id1_to" title="종료구간" class="frm_input"> 까지
<select name="mb_mailling" id="mb_mailling"> </td>
<option value="1">수신동의한 회원만 </tr>
<option value="">전체 <tr>
</select> <th scope="row"><label for="mb_email">E-mail</label></th>
</td> <td>
</tr> <?php echo help("메일 주소에 단어 포함 (예 : @" . preg_replace('#^(www[^\.]*\.){1}#', '', $_SERVER['HTTP_HOST']) . ")") ?>
<tr> <input type="text" name="mb_email" value="<?php echo get_sanitize_input($mb_email); ?>" id="mb_email" class="frm_input" size="50">
<th scope="row">권한</th> </td>
<td> </tr>
<label for="mb_level_from" class="sound_only">최소권한</label> <tr>
<select name="mb_level_from" id="mb_level_from"> <th scope="row"><label for="mb_mailling">메일링</label></th>
<?php for ($i=1; $i<=10; $i++) { ?> <td>
<option value="<?php echo $i ?>"><?php echo $i ?></option> <select name="mb_mailling" id="mb_mailling">
<?php } ?> <option value="1">수신동의한 회원만
</select> 에서 <option value="">전체
<label for="mb_level_to" class="sound_only">최대권한</label> </select>
<select name="mb_level_to" id="mb_level_to"> </td>
<?php for ($i=1; $i<=10; $i++) { ?> </tr>
<option value="<?php echo $i ?>"<?php echo $i==10 ? " selected" : ""; ?>><?php echo $i ?></option> <tr>
<?php } ?> <th scope="row">권한</th>
</select> 까지 <td>
</td> <label for="mb_level_from" class="sound_only">최소권한</label>
</tr> <select name="mb_level_from" id="mb_level_from">
<tr> <?php for ($i = 1; $i <= 10; $i++) { ?>
<th scope="row"><label for="gr_id">게시판그룹회원</label></th> <option value="<?php echo $i ?>"><?php echo $i ?></option>
<td> <?php } ?>
<select name="gr_id" id="gr_id"> </select> 에서
<option value=''>전체</option> <label for="mb_level_to" class="sound_only">최대권한</label>
<?php <select name="mb_level_to" id="mb_level_to">
$sql = " select gr_id, gr_subject from {$g5['group_table']} order by gr_subject "; <?php for ($i = 1; $i <= 10; $i++) { ?>
$result = sql_query($sql); <option value="<?php echo $i ?>" <?php echo $i == 10 ? " selected" : ""; ?>><?php echo $i ?></option>
for ($i=0; $row=sql_fetch_array($result); $i++) { <?php } ?>
echo '<option value="'.$row['gr_id'].'">'.$row['gr_subject'].'</option>'; </select> 까지
} </td>
?> </tr>
</select> <tr>
</td> <th scope="row"><label for="gr_id">게시판그룹회원</label></th>
</tr> <td>
</tbody> <select name="gr_id" id="gr_id">
</table> <option value=''>전체</option>
</div> <?php
$sql = " select gr_id, gr_subject from {$g5['group_table']} order by gr_subject ";
<div class="btn_confirm01 btn_confirm"> $result = sql_query($sql);
<input type="submit" value="확인" class="btn_submit"> for ($i = 0; $row = sql_fetch_array($result); $i++) {
<a href="./mail_list.php">목록 </a> echo '<option value="' . $row['gr_id'] . '">' . $row['gr_subject'] . '</option>';
</div> }
</form> ?>
</select>
<?php </td>
include_once('./admin.tail.php'); </tr>
</tbody>
</table>
</div>
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit">
<a href="./mail_list.php">목록 </a>
</div>
</form>
<?php
require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -9,17 +9,28 @@ $ma_last_option = "";
$sql_common = " from {$g5['member_table']} "; $sql_common = " from {$g5['member_table']} ";
$sql_where = " where (1) "; $sql_where = " where (1) ";
$mb_id1 = isset($_POST['mb_id1']) ? $_POST['mb_id1'] : 1;
$mb_id1_from = isset($_POST['mb_id1_from']) ? clean_xss_tags($_POST['mb_id1_from'], 1, 1, 30) : '';
$mb_id1_to = isset($_POST['mb_id1_to']) ? clean_xss_tags($_POST['mb_id1_to'], 1, 1, 30) : '';
$mb_email = isset($_POST['mb_email']) ? clean_xss_tags($_POST['mb_email'], 1, 1, 100) : '';
$mb_mailling = isset($_POST['mb_mailling']) ? clean_xss_tags($_POST['mb_mailling'], 1, 1, 100) : '';
$mb_level_from = isset($_POST['mb_level_from'])? $_POST['mb_level_from'] : 1;
$mb_level_to = isset($_POST['mb_level_to']) ? $_POST['mb_level_to'] : 10;
// 회원ID ..에서 ..까지 // 회원ID ..에서 ..까지
if ($mb_id1 != 1) if ($mb_id1 != 1) {
$sql_where .= " and mb_id between '{$mb_id1_from}' and '{$mb_id1_to}' "; $sql_where .= " and mb_id between '{$mb_id1_from}' and '{$mb_id1_to}' ";
}
// E-mail에 특정 단어 포함 // E-mail에 특정 단어 포함
if ($mb_email != "") if ($mb_email != "") {
$sql_where .= " and mb_email like '%{$mb_email}%' "; $sql_where .= " and mb_email like '%{$mb_email}%' ";
}
// 메일링 // 메일링
if ($mb_mailling != "") if ($mb_mailling != "") {
$sql_where .= " and mb_mailling = '{$mb_mailling}' "; $sql_where .= " and mb_mailling = '{$mb_mailling}' ";
}
// 권한 // 권한
$sql_where .= " and mb_level between '{$mb_level_from}' and '{$mb_level_to}' "; $sql_where .= " and mb_level between '{$mb_level_from}' and '{$mb_level_to}' ";
@ -30,13 +41,14 @@ if ($gr_id) {
$comma = ""; $comma = "";
$sql2 = " select mb_id from {$g5['group_member_table']} where gr_id = '{$gr_id}' order by mb_id "; $sql2 = " select mb_id from {$g5['group_member_table']} where gr_id = '{$gr_id}' order by mb_id ";
$result2 = sql_query($sql2); $result2 = sql_query($sql2);
for ($k=0; $row2=sql_fetch_array($result2); $k++) { for ($k = 0; $row2 = sql_fetch_array($result2); $k++) {
$group_member .= "{$comma}'{$row2['mb_id']}'"; $group_member .= "{$comma}'{$row2['mb_id']}'";
$comma = ","; $comma = ",";
} }
if (!$group_member) if (!$group_member) {
alert('선택하신 게시판 그룹회원이 한명도 없습니다.'); alert('선택하신 게시판 그룹회원이 한명도 없습니다.');
}
$sql_where .= " and mb_id in ($group_member) "; $sql_where .= " and mb_id in ($group_member) ";
} }
@ -47,8 +59,9 @@ $sql_where .= " and mb_leave_date = '' and mb_intercept_date = '' ";
$sql = " select COUNT(*) as cnt {$sql_common} {$sql_where} "; $sql = " select COUNT(*) as cnt {$sql_common} {$sql_where} ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$cnt = $row['cnt']; $cnt = $row['cnt'];
if ($cnt == 0) if ($cnt == 0) {
alert('선택하신 내용으로는 해당되는 회원자료가 없습니다.'); alert('선택하신 내용으로는 해당되는 회원자료가 없습니다.');
}
// 마지막 옵션을 저장합니다. // 마지막 옵션을 저장합니다.
$ma_last_option .= "mb_id1={$mb_id1}"; $ma_last_option .= "mb_id1={$mb_id1}";
@ -63,58 +76,58 @@ $ma_last_option .= "||gr_id={$gr_id}";
sql_query(" update {$g5['mail_table']} set ma_last_option = '{$ma_last_option}' where ma_id = '{$ma_id}' "); sql_query(" update {$g5['mail_table']} set ma_last_option = '{$ma_last_option}' where ma_id = '{$ma_id}' ");
$g5['title'] = "메일발송 대상 회원"; $g5['title'] = "메일발송 대상 회원";
include_once('./admin.head.php'); require_once './admin.head.php';
?> ?>
<form name="fmailselectlist" id="fmailselectlist" method="post" action="./mail_select_update.php"> <form name="fmailselectlist" id="fmailselectlist" method="post" action="./mail_select_update.php">
<input type="hidden" name="token" value=""> <input type="hidden" name="token" value="">
<input type="hidden" name="ma_id" value="<?php echo $ma_id ?>"> <input type="hidden" name="ma_id" value="<?php echo $ma_id ?>">
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?> 목록</caption> <caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">번호</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> <th scope="col">닉네임</th>
<th scope="col">E-mail</th> <th scope="col">E-mail</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$sql = " select mb_id, mb_name, mb_nick, mb_email, mb_datetime $sql_common $sql_where order by mb_id "; $sql = " select mb_id, mb_name, mb_nick, mb_email, mb_datetime $sql_common $sql_where order by mb_id ";
$result = sql_query($sql); $result = sql_query($sql);
$i=0; $i = 0;
$ma_list = ""; $ma_list = "";
$cr = ""; $cr = "";
while ($row=sql_fetch_array($result)) { while ($row = sql_fetch_array($result)) {
$i++; $i++;
$ma_list .= $cr . $row['mb_email'] . "||" . $row['mb_id'] . "||" . get_text($row['mb_name']) . "||" . $row['mb_nick'] . "||" . $row['mb_datetime']; $ma_list .= $cr . $row['mb_email'] . "||" . $row['mb_id'] . "||" . get_text($row['mb_name']) . "||" . $row['mb_nick'] . "||" . $row['mb_datetime'];
$cr = "\n"; $cr = "\n";
$bg = 'bg'.($i%2); $bg = 'bg' . ($i % 2);
?> ?>
<tr class="<?php echo $bg; ?>"> <tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $i ?></td> <td class="td_num"><?php echo $i ?></td>
<td class="td_mbid"><?php echo $row['mb_id'] ?></td> <td class="td_mbid"><?php echo $row['mb_id'] ?></td>
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td> <td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td class="td_mbname"><?php echo $row['mb_nick'] ?></td> <td class="td_mbname"><?php echo $row['mb_nick'] ?></td>
<td><?php echo $row['mb_email'] ?></td> <td><?php echo $row['mb_email'] ?></td>
</tr> </tr>
<?php } ?> <?php } ?>
</tbody> </tbody>
</table> </table>
<textarea name="ma_list" style="display:none"><?php echo $ma_list?></textarea> <textarea name="ma_list" style="display:none"><?php echo $ma_list ?></textarea>
</div> </div>
<div class="btn_confirm01 btn_confirm"> <div class="btn_confirm01 btn_confirm">
<input type="submit" value="메일보내기" class="btn_submit"> <input type="submit" value="메일보내기" class="btn_submit">
<a href="./mail_select_form.php?ma_id=<?php echo $ma_id ?>">뒤로</a> <a href="./mail_select_form.php?ma_id=<?php echo $ma_id ?>">뒤로</a>
</div> </div>
</form> </form>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -10,8 +10,8 @@ check_demo();
check_admin_token(); check_admin_token();
include_once('./admin.head.php'); require_once './admin.head.php';
include_once(G5_LIB_PATH.'/mailer.lib.php'); require_once G5_LIB_PATH . '/mailer.lib.php';
$countgap = 10; // 몇건씩 보낼지 설정 $countgap = 10; // 몇건씩 보낼지 설정
$maxscreen = 500; // 몇건씩 화면에 보여줄건지? $maxscreen = 500; // 몇건씩 화면에 보여줄건지?
@ -25,7 +25,7 @@ echo "</span>";
<span id="cont"></span> <span id="cont"></span>
<?php <?php
include_once('./admin.tail.php'); require_once './admin.tail.php';
flush(); flush();
ob_flush(); ob_flush();
@ -43,25 +43,23 @@ $ma = sql_fetch($sql);
$subject = $ma['ma_subject']; $subject = $ma['ma_subject'];
$cnt = 0; $cnt = 0;
for ($i=0; $i<count($member_list); $i++) for ($i = 0; $i < count($member_list); $i++) {
{
list($to_email, $mb_id, $name, $nick, $datetime) = explode("||", trim($member_list[$i])); list($to_email, $mb_id, $name, $nick, $datetime) = explode("||", trim($member_list[$i]));
$sw = preg_match("/[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*/", $to_email); $sw = preg_match("/[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*/", $to_email);
// 올바른 메일 주소만 // 올바른 메일 주소만
if ($sw == true) if ($sw == true) {
{
$cnt++; $cnt++;
$mb_md5 = md5($mb_id.$to_email.$datetime); $mb_md5 = md5($mb_id . $to_email . $datetime);
$content = $ma['ma_content']; $content = $ma['ma_content'];
$content = preg_replace("/{이름}/", $name, $content); $content = preg_replace("/{이름}/", $name, (string)$content);
$content = preg_replace("/{닉네임}/", $nick, $content); $content = preg_replace("/{닉네임}/", $nick, (string)$content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content); $content = preg_replace("/{회원아이디}/", $mb_id, (string)$content);
$content = preg_replace("/{이메일}/", $to_email, $content); $content = preg_replace("/{이메일}/", $to_email, (string)$content);
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='".G5_BBS_URL."/email_stop.php?mb_id={$mb_id}&amp;mb_md5={$mb_md5}' target='_blank'>수신거부</a>] 해 주십시오.</span></p>"; $content = $content . "<hr size=0><p><span style='font-size:9pt; font-family:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='" . G5_BBS_URL . "/email_stop.php?mb_id={$mb_id}&amp;mb_md5={$mb_md5}' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $to_email, $subject, $content, 1); mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $to_email, $subject, $content, 1);
@ -71,15 +69,18 @@ for ($i=0; $i<count($member_list); $i++)
ob_flush(); ob_flush();
ob_end_flush(); ob_end_flush();
usleep($sleepsec); usleep($sleepsec);
if ($cnt % $countgap == 0) if ($cnt % $countgap == 0) {
{
echo "<script> document.all.cont.innerHTML += '<br>'; document.body.scrollTop += 1000; </script>\n"; echo "<script> document.all.cont.innerHTML += '<br>'; document.body.scrollTop += 1000; </script>\n";
} }
// 화면을 지운다... 부하를 줄임 // 화면을 지운다... 부하를 줄임
if ($cnt % $maxscreen == 0) if ($cnt % $maxscreen == 0) {
echo "<script> document.all.cont.innerHTML = ''; document.body.scrollTop += 1000; </script>\n"; echo "<script> document.all.cont.innerHTML = ''; document.body.scrollTop += 1000; </script>\n";
}
} }
} }
?> ?>
<script> document.all.cont.innerHTML += "<br><br>총 <?php echo number_format($cnt) ?>건 발송<br><br><font color=crimson><b>[끝]</b></font>"; document.body.scrollTop += 1000; </script> <script>
document.all.cont.innerHTML += "<br><br>총 <?php echo number_format($cnt) ?>건 발송<br><br><font color=crimson><b>[끝]</b></font>";
document.body.scrollTop += 1000;
</script>

View File

@ -1,11 +1,12 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
if (!$config['cf_email_use']) if (!$config['cf_email_use']) {
alert('환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.'); alert('환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.');
}
include_once(G5_LIB_PATH.'/mailer.lib.php'); require_once G5_LIB_PATH . '/mailer.lib.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -25,15 +26,15 @@ $ma = sql_fetch($sql);
$subject = $ma['ma_subject']; $subject = $ma['ma_subject'];
$content = $ma['ma_content']; $content = $ma['ma_content'];
$content = preg_replace("/{이름}/", $name, $content); $content = preg_replace("/{이름}/", $name, (string)$content);
$content = preg_replace("/{닉네임}/", $nick, $content); $content = preg_replace("/{닉네임}/", $nick, (string)$content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content); $content = preg_replace("/{회원아이디}/", $mb_id, (string)$content);
$content = preg_replace("/{이메일}/", $email, $content); $content = preg_replace("/{이메일}/", $email, (string)$content);
$mb_md5 = md5($member['mb_id'].$member['mb_email'].$member['mb_datetime']); $mb_md5 = md5($member['mb_id'] . $member['mb_email'] . $member['mb_datetime']);
$content = $content . '<p>더 이상 정보 수신을 원치 않으시면 [<a href="'.G5_BBS_URL.'/email_stop.php?mb_id='.$mb_id.'&amp;mb_md5='.$mb_md5.'" target="_blank">수신거부</a>] 해 주십시오.</p>'; $content = $content . '<p>더 이상 정보 수신을 원치 않으시면 [<a href="' . G5_BBS_URL . '/email_stop.php?mb_id=' . $mb_id . '&amp;mb_md5=' . $mb_md5 . '" target="_blank">수신거부</a>] 해 주십시오.</p>';
mailer($config['cf_title'], $member['mb_email'], $member['mb_email'], $subject, $content, 1); mailer($config['cf_title'], $member['mb_email'], $member['mb_email'], $subject, $content, 1);
alert($member['mb_nick'].'('.$member['mb_email'].')님께 테스트 메일을 발송하였습니다. 확인하여 주십시오.'); alert($member['mb_nick'] . '(' . $member['mb_email'] . ')님께 테스트 메일을 발송하였습니다. 확인하여 주십시오.');

View File

@ -1,9 +1,10 @@
<?php <?php
$sub_menu = "200300"; $sub_menu = "200300";
include_once('./_common.php'); require_once './_common.php';
if ($w == 'u' || $w == 'd') if ($w == 'u' || $w == 'd') {
check_demo(); check_demo();
}
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -13,29 +14,24 @@ $ma_id = isset($_POST['ma_id']) ? (int) $_POST['ma_id'] : 0;
$ma_subject = isset($_POST['ma_subject']) ? strip_tags(clean_xss_attributes($_POST['ma_subject'])) : ''; $ma_subject = isset($_POST['ma_subject']) ? strip_tags(clean_xss_attributes($_POST['ma_subject'])) : '';
$ma_content = isset($_POST['ma_content']) ? $_POST['ma_content'] : ''; $ma_content = isset($_POST['ma_content']) ? $_POST['ma_content'] : '';
if ($w == '') if ($w == '') {
{
$sql = " insert {$g5['mail_table']} $sql = " insert {$g5['mail_table']}
set ma_subject = '{$ma_subject}', set ma_subject = '{$ma_subject}',
ma_content = '{$ma_content}', ma_content = '{$ma_content}',
ma_time = '".G5_TIME_YMDHIS."', ma_time = '" . G5_TIME_YMDHIS . "',
ma_ip = '{$_SERVER['REMOTE_ADDR']}' "; ma_ip = '{$_SERVER['REMOTE_ADDR']}' ";
sql_query($sql); sql_query($sql);
} } elseif ($w == 'u') {
else if ($w == 'u')
{
$sql = " update {$g5['mail_table']} $sql = " update {$g5['mail_table']}
set ma_subject = '{$ma_subject}', set ma_subject = '{$ma_subject}',
ma_content = '{$ma_content}', ma_content = '{$ma_content}',
ma_time = '".G5_TIME_YMDHIS."', ma_time = '" . G5_TIME_YMDHIS . "',
ma_ip = '{$_SERVER['REMOTE_ADDR']}' ma_ip = '{$_SERVER['REMOTE_ADDR']}'
where ma_id = '{$ma_id}' "; where ma_id = '{$ma_id}' ";
sql_query($sql); sql_query($sql);
} } elseif ($w == 'd') {
else if ($w == 'd') $sql = " delete from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
{
$sql = " delete from {$g5['mail_table']} where ma_id = '{$ma_id}' ";
sql_query($sql); sql_query($sql);
} }
goto_url('./mail_list.php'); goto_url('./mail_list.php');

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once("./_common.php"); require_once "./_common.php";
check_demo(); check_demo();
@ -8,21 +8,23 @@ auth_check_menu($auth, $sub_menu, "d");
$mb = isset($_POST['mb_id']) ? get_member($_POST['mb_id']) : array(); $mb = isset($_POST['mb_id']) ? get_member($_POST['mb_id']) : array();
if (! (isset($mb['mb_id']) && $mb['mb_id'])) if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
alert("회원자료가 존재하지 않습니다."); alert("회원자료가 존재하지 않습니다.");
else if ($member['mb_id'] == $mb['mb_id']) } elseif ($member['mb_id'] == $mb['mb_id']) {
alert("로그인 중인 관리자는 삭제 할 수 없습니다."); alert("로그인 중인 관리자는 삭제 할 수 없습니다.");
else if (is_admin($mb['mb_id']) == "super") } elseif (is_admin($mb['mb_id']) == "super") {
alert("최고 관리자는 삭제할 수 없습니다."); alert("최고 관리자는 삭제할 수 없습니다.");
else if ($mb['mb_level'] >= $member['mb_level']) } elseif ($mb['mb_level'] >= $member['mb_level']) {
alert("자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다."); alert("자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다.");
}
check_admin_token(); check_admin_token();
// 회원자료 삭제 // 회원자료 삭제
member_delete($mb['mb_id']); member_delete($mb['mb_id']);
if ($url) if (isset($url)) {
goto_url("{$url}?$qstr&amp;w=u&amp;mb_id=$mb_id"); goto_url("{$url}?$qstr&amp;w=u&amp;mb_id=" . $mb['mb_id']);
else } else {
goto_url("./member_list.php?$qstr"); goto_url("./member_list.php?$qstr");
}

View File

@ -1,50 +1,51 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
$mb = array( $mb = array(
'mb_certify' => null, 'mb_certify' => null,
'mb_adult' => null, 'mb_adult' => null,
'mb_sms' => null, 'mb_sms' => null,
'mb_intercept_date' => null, 'mb_intercept_date' => null,
'mb_id' => null, 'mb_id' => null,
'mb_name' => null, 'mb_name' => null,
'mb_nick' => null, 'mb_nick' => null,
'mb_point' => null, 'mb_point' => null,
'mb_email' => null, 'mb_email' => null,
'mb_homepage' => null, 'mb_homepage' => null,
'mb_hp' => null, 'mb_hp' => null,
'mb_tel' => null, 'mb_tel' => null,
'mb_zip1' => null, 'mb_zip1' => null,
'mb_zip2' => null, 'mb_zip2' => null,
'mb_addr1' => null, 'mb_addr1' => null,
'mb_addr2' => null, 'mb_addr2' => null,
'mb_addr3' => null, 'mb_addr3' => null,
'mb_addr_jibeon' => null, 'mb_addr_jibeon' => null,
'mb_signature' => null, 'mb_signature' => null,
'mb_profile' => null, 'mb_profile' => null,
'mb_memo' => null, 'mb_memo' => null,
'mb_leave_date' => null, 'mb_leave_date' => null,
'mb_1' => null, 'mb_1' => null,
'mb_2' => null, 'mb_2' => null,
'mb_3' => null, 'mb_3' => null,
'mb_4' => null, 'mb_4' => null,
'mb_5' => null, 'mb_5' => null,
'mb_6' => null, 'mb_6' => null,
'mb_7' => null, 'mb_7' => null,
'mb_8' => null, 'mb_8' => null,
'mb_9' => null, 'mb_9' => null,
'mb_10' => null, 'mb_10' => null,
); );
$sound_only = ''; $sound_only = '';
$required_mb_id = '';
$required_mb_id_class = ''; $required_mb_id_class = '';
$required_mb_password = ''; $required_mb_password = '';
$html_title = '';
if ($w == '') if ($w == '') {
{
$required_mb_id = 'required'; $required_mb_id = 'required';
$required_mb_id_class = 'required alnum_'; $required_mb_id_class = 'required alnum_';
$required_mb_password = 'required'; $required_mb_password = 'required';
@ -54,15 +55,15 @@ if ($w == '')
$mb['mb_open'] = 1; $mb['mb_open'] = 1;
$mb['mb_level'] = $config['cf_register_level']; $mb['mb_level'] = $config['cf_register_level'];
$html_title = '추가'; $html_title = '추가';
} } elseif ($w == 'u') {
else if ($w == 'u')
{
$mb = get_member($mb_id); $mb = get_member($mb_id);
if (!$mb['mb_id']) if (!$mb['mb_id']) {
alert('존재하지 않는 회원자료입니다.'); alert('존재하지 않는 회원자료입니다.');
}
if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) {
alert('자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.'); alert('자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.');
}
$required_mb_id = 'readonly'; $required_mb_id = 'readonly';
$html_title = '수정'; $html_title = '수정';
@ -90,12 +91,12 @@ else if ($w == 'u')
$mb['mb_8'] = get_text($mb['mb_8']); $mb['mb_8'] = get_text($mb['mb_8']);
$mb['mb_9'] = get_text($mb['mb_9']); $mb['mb_9'] = get_text($mb['mb_9']);
$mb['mb_10'] = get_text($mb['mb_10']); $mb['mb_10'] = get_text($mb['mb_10']);
} } else {
else
alert('제대로 된 값이 넘어오지 않았습니다.'); alert('제대로 된 값이 넘어오지 않았습니다.');
}
// 본인확인방법 // 본인확인방법
switch($mb['mb_certify']) { switch ($mb['mb_certify']) {
case 'simple': case 'simple':
$mb_certify_case = '간편인증'; $mb_certify_case = '간편인증';
$mb_certify_val = 'simple'; $mb_certify_val = 'simple';
@ -147,39 +148,40 @@ if (isset($mb['mb_certify'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_certify` TINYINT(4) NOT NULL DEFAULT '0' AFTER `mb_hp` ", false); sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_certify` TINYINT(4) NOT NULL DEFAULT '0' AFTER `mb_hp` ", false);
} }
if(isset($mb['mb_adult'])) { if (isset($mb['mb_adult'])) {
sql_query(" ALTER TABLE `{$g5['member_table']}` CHANGE `mb_adult` `mb_adult` TINYINT(4) NOT NULL DEFAULT '0' ", false); sql_query(" ALTER TABLE `{$g5['member_table']}` CHANGE `mb_adult` `mb_adult` TINYINT(4) NOT NULL DEFAULT '0' ", false);
} else { } else {
sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_adult` TINYINT NOT NULL DEFAULT '0' AFTER `mb_certify` ", false); sql_query(" ALTER TABLE `{$g5['member_table']}` ADD `mb_adult` TINYINT NOT NULL DEFAULT '0' AFTER `mb_certify` ", false);
} }
// 지번주소 필드추가 // 지번주소 필드추가
if(!isset($mb['mb_addr_jibeon'])) { if (!isset($mb['mb_addr_jibeon'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr_jibeon` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false); sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr_jibeon` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false);
} }
// 건물명필드추가 // 건물명필드추가
if(!isset($mb['mb_addr3'])) { if (!isset($mb['mb_addr3'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr3` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false); sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_addr3` varchar(255) NOT NULL DEFAULT '' AFTER `mb_addr2` ", false);
} }
// 중복가입 확인필드 추가 // 중복가입 확인필드 추가
if(!isset($mb['mb_dupinfo'])) { if (!isset($mb['mb_dupinfo'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false); sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false);
} }
// 이메일인증 체크 필드추가 // 이메일인증 체크 필드추가
if(!isset($mb['mb_email_certify2'])) { if (!isset($mb['mb_email_certify2'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_email_certify2` varchar(255) NOT NULL DEFAULT '' AFTER `mb_email_certify` ", false); sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_email_certify2` varchar(255) NOT NULL DEFAULT '' AFTER `mb_email_certify` ", false);
} }
// 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의 // 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의
if( !isset($g5['member_cert_history']) ){ if (!isset($g5['member_cert_history'])) {
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history'; $g5['member_cert_history_table'] = G5_TABLE_PREFIX . 'member_cert_history';
} }
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성 // 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) { if (isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
`ch_id` int(11) NOT NULL auto_increment, `ch_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(20) NOT NULL DEFAULT '', `mb_id` varchar(20) NOT NULL DEFAULT '',
`ch_name` varchar(255) NOT NULL DEFAULT '', `ch_name` varchar(255) NOT NULL DEFAULT '',
@ -189,7 +191,9 @@ if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cer
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00', `ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ch_id`), PRIMARY KEY (`ch_id`),
KEY `mb_id` (`mb_id`) KEY `mb_id` (`mb_id`)
) ", true); ) ",
true
);
} }
$mb_cert_history = ''; $mb_cert_history = '';
@ -198,389 +202,390 @@ if (isset($mb_id) && $mb_id) {
$mb_cert_history = sql_query($sql); $mb_cert_history = sql_query($sql);
} }
if ($mb['mb_intercept_date']) $g5['title'] = "차단된 "; if ($mb['mb_intercept_date']) {
else $g5['title'] .= ""; $g5['title'] = "차단된 ";
$g5['title'] .= '회원 '.$html_title; } else {
include_once('./admin.head.php'); $g5['title'] .= "";
}
$g5['title'] .= '회원 ' . $html_title;
require_once './admin.head.php';
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨 // add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
?> ?>
<form name="fmember" id="fmember" action="./member_form_update.php" onsubmit="return fmember_submit(this);" method="post" enctype="multipart/form-data"> <form name="fmember" id="fmember" action="./member_form_update.php" onsubmit="return fmember_submit(this);" method="post" enctype="multipart/form-data">
<input type="hidden" name="w" value="<?php echo $w ?>"> <input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>"> <input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>"> <input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value=""> <input type="hidden" name="token" value="">
<div class="tbl_frm01 tbl_wrap"> <div class="tbl_frm01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?></caption> <caption><?php echo $g5['title']; ?></caption>
<colgroup> <colgroup>
<col class="grid_4"> <col class="grid_4">
<col> <col>
<col class="grid_4"> <col class="grid_4">
<col> <col>
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<th scope="row"><label for="mb_id">아이디<?php echo $sound_only ?></label></th> <th scope="row"><label for="mb_id">아이디<?php echo $sound_only ?></label></th>
<td> <td>
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" maxlength="20"> <input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" maxlength="20">
<?php if ($w=='u'){ ?><a href="./boardgroupmember_form.php?mb_id=<?php echo $mb['mb_id'] ?>" class="btn_frmline">접근가능그룹보기</a><?php } ?> <?php if ($w == 'u') { ?><a href="./boardgroupmember_form.php?mb_id=<?php echo $mb['mb_id'] ?>" class="btn_frmline">접근가능그룹보기</a><?php } ?>
</td> </td>
<th scope="row"><label for="mb_password">비밀번호<?php echo $sound_only ?></label></th> <th scope="row"><label for="mb_password">비밀번호<?php echo $sound_only ?></label></th>
<td><input type="password" name="mb_password" id="mb_password" <?php echo $required_mb_password ?> class="frm_input <?php echo $required_mb_password ?>" size="15" maxlength="20"></td> <td><input type="password" name="mb_password" id="mb_password" <?php echo $required_mb_password ?> class="frm_input <?php echo $required_mb_password ?>" size="15" maxlength="20"></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="mb_name">이름(실명)<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="mb_name">이름(실명)<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input" size="15" maxlength="20"></td> <td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input" size="15" maxlength="20"></td>
<th scope="row"><label for="mb_nick">닉네임<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="mb_nick">닉네임<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input" size="15" maxlength="20"></td> <td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input" size="15" maxlength="20"></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="mb_level">회원 권한</label></th> <th scope="row"><label for="mb_level">회원 권한</label></th>
<td><?php echo get_member_level_select('mb_level', 1, $member['mb_level'], $mb['mb_level']) ?></td> <td><?php echo get_member_level_select('mb_level', 1, $member['mb_level'], $mb['mb_level']) ?></td>
<th scope="row">포인트</th> <th scope="row">포인트</th>
<td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format($mb['mb_point']) ?></a> 점</td> <td><a href="./point_list.php?sfl=mb_id&amp;stx=<?php echo $mb['mb_id'] ?>" target="_blank"><?php echo number_format($mb['mb_point']) ?></a> 점</td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="mb_email">E-mail<strong class="sound_only">필수</strong></label></th> <th scope="row"><label for="mb_email">E-mail<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_email" value="<?php echo $mb['mb_email'] ?>" id="mb_email" maxlength="100" required class="required frm_input email" size="30"></td> <td><input type="text" name="mb_email" value="<?php echo $mb['mb_email'] ?>" id="mb_email" maxlength="100" required class="required frm_input email" size="30"></td>
<th scope="row"><label for="mb_homepage">홈페이지</label></th> <th scope="row"><label for="mb_homepage">홈페이지</label></th>
<td><input type="text" name="mb_homepage" value="<?php echo $mb['mb_homepage'] ?>" id="mb_homepage" class="frm_input" maxlength="255" size="15"></td> <td><input type="text" name="mb_homepage" value="<?php echo $mb['mb_homepage'] ?>" id="mb_homepage" class="frm_input" maxlength="255" size="15"></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="mb_hp">휴대폰번호</label></th> <th scope="row"><label for="mb_hp">휴대폰번호</label></th>
<td><input type="text" name="mb_hp" value="<?php echo $mb['mb_hp'] ?>" id="mb_hp" class="frm_input" size="15" maxlength="20"></td> <td><input type="text" name="mb_hp" value="<?php echo $mb['mb_hp'] ?>" id="mb_hp" class="frm_input" size="15" maxlength="20"></td>
<th scope="row"><label for="mb_tel">전화번호</label></th> <th scope="row"><label for="mb_tel">전화번호</label></th>
<td><input type="text" name="mb_tel" value="<?php echo $mb['mb_tel'] ?>" id="mb_tel" class="frm_input" size="15" maxlength="20"></td> <td><input type="text" name="mb_tel" value="<?php echo $mb['mb_tel'] ?>" id="mb_tel" class="frm_input" size="15" maxlength="20"></td>
</tr> </tr>
<tr> <tr>
<th scope="row">본인확인방법</th> <th scope="row">본인확인방법</th>
<td colspan="3"> <td colspan="3">
<input type="radio" name="mb_certify_case" value="simple" id="mb_certify_sa" <?php if($mb['mb_certify'] == 'simple') echo 'checked="checked"'; ?>> <input type="radio" name="mb_certify_case" value="simple" id="mb_certify_sa" <?php if ($mb['mb_certify'] == 'simple') { echo 'checked="checked"'; } ?>>
<label for="mb_certify_sa">간편인증</label> <label for="mb_certify_sa">간편인증</label>
<input type="radio" name="mb_certify_case" value="hp" id="mb_certify_hp" <?php if($mb['mb_certify'] == 'hp') echo 'checked="checked"'; ?>> <input type="radio" name="mb_certify_case" value="hp" id="mb_certify_hp" <?php if ($mb['mb_certify'] == 'hp') { echo 'checked="checked"'; } ?>>
<label for="mb_certify_hp">휴대폰</label> <label for="mb_certify_hp">휴대폰</label>
<input type="radio" name="mb_certify_case" value="ipin" id="mb_certify_ipin" <?php if($mb['mb_certify'] == 'ipin') echo 'checked="checked"'; ?>> <input type="radio" name="mb_certify_case" value="ipin" id="mb_certify_ipin" <?php if ($mb['mb_certify'] == 'ipin') { echo 'checked="checked"'; } ?>>
<label for="mb_certify_ipin">아이핀</label> <label for="mb_certify_ipin">아이핀</label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row">본인확인</th> <th scope="row">본인확인</th>
<td> <td>
<input type="radio" name="mb_certify" value="1" id="mb_certify_yes" <?php echo $mb_certify_yes; ?>> <input type="radio" name="mb_certify" value="1" id="mb_certify_yes" <?php echo $mb_certify_yes; ?>>
<label for="mb_certify_yes">예</label> <label for="mb_certify_yes">예</label>
<input type="radio" name="mb_certify" value="" id="mb_certify_no" <?php echo $mb_certify_no; ?>> <input type="radio" name="mb_certify" value="0" id="mb_certify_no" <?php echo $mb_certify_no; ?>>
<label for="mb_certify_no">아니오</label> <label for="mb_certify_no">아니오</label>
</td> </td>
<th scope="row">성인인증</th> <th scope="row">성인인증</th>
<td> <td>
<input type="radio" name="mb_adult" value="1" id="mb_adult_yes" <?php echo $mb_adult_yes; ?>> <input type="radio" name="mb_adult" value="1" id="mb_adult_yes" <?php echo $mb_adult_yes; ?>>
<label for="mb_adult_yes">예</label> <label for="mb_adult_yes">예</label>
<input type="radio" name="mb_adult" value="0" id="mb_adult_no" <?php echo $mb_adult_no; ?>> <input type="radio" name="mb_adult" value="0" id="mb_adult_no" <?php echo $mb_adult_no; ?>>
<label for="mb_adult_no">아니오</label> <label for="mb_adult_no">아니오</label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row">주소</th> <th scope="row">주소</th>
<td colspan="3" class="td_addr_line"> <td colspan="3" class="td_addr_line">
<label for="mb_zip" class="sound_only">우편번호</label> <label for="mb_zip" class="sound_only">우편번호</label>
<input type="text" name="mb_zip" value="<?php echo $mb['mb_zip1'].$mb['mb_zip2']; ?>" id="mb_zip" class="frm_input readonly" size="5" maxlength="6"> <input type="text" name="mb_zip" value="<?php echo $mb['mb_zip1'] . $mb['mb_zip2']; ?>" id="mb_zip" class="frm_input readonly" size="5" maxlength="6">
<button type="button" class="btn_frmline" onclick="win_zip('fmember', 'mb_zip', 'mb_addr1', 'mb_addr2', 'mb_addr3', 'mb_addr_jibeon');">주소 검색</button><br> <button type="button" class="btn_frmline" onclick="win_zip('fmember', 'mb_zip', 'mb_addr1', 'mb_addr2', 'mb_addr3', 'mb_addr_jibeon');">주소 검색</button><br>
<input type="text" name="mb_addr1" value="<?php echo $mb['mb_addr1'] ?>" id="mb_addr1" class="frm_input readonly" size="60"> <input type="text" name="mb_addr1" value="<?php echo $mb['mb_addr1'] ?>" id="mb_addr1" class="frm_input readonly" size="60">
<label for="mb_addr1">기본주소</label><br> <label for="mb_addr1">기본주소</label><br>
<input type="text" name="mb_addr2" value="<?php echo $mb['mb_addr2'] ?>" id="mb_addr2" class="frm_input" size="60"> <input type="text" name="mb_addr2" value="<?php echo $mb['mb_addr2'] ?>" id="mb_addr2" class="frm_input" size="60">
<label for="mb_addr2">상세주소</label> <label for="mb_addr2">상세주소</label>
<br> <br>
<input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60"> <input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60">
<label for="mb_addr3">참고항목</label> <label for="mb_addr3">참고항목</label>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br> <input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="mb_icon">회원아이콘</label></th> <th scope="row"><label for="mb_icon">회원아이콘</label></th>
<td colspan="3"> <td colspan="3">
<?php echo help('이미지 크기는 <strong>넓이 '.$config['cf_member_icon_width'].'픽셀 높이 '.$config['cf_member_icon_height'].'픽셀</strong>로 해주세요.') ?> <?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_icon_width'] . '픽셀 높이 ' . $config['cf_member_icon_height'] . '픽셀</strong>로 해주세요.') ?>
<input type="file" name="mb_icon" id="mb_icon"> <input type="file" name="mb_icon" id="mb_icon">
<?php <?php
$mb_dir = substr($mb['mb_id'],0,2); $mb_dir = substr($mb['mb_id'], 0, 2);
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.get_mb_icon_name($mb['mb_id']).'.gif'; $icon_file = G5_DATA_PATH . '/member/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
if (file_exists($icon_file)) { if (file_exists($icon_file)) {
$icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file); $icon_url = str_replace(G5_DATA_PATH, G5_DATA_URL, $icon_file);
$icon_filemtile = (defined('G5_USE_MEMBER_IMAGE_FILETIME') && G5_USE_MEMBER_IMAGE_FILETIME) ? '?'.filemtime($icon_file) : ''; $icon_filemtile = (defined('G5_USE_MEMBER_IMAGE_FILETIME') && G5_USE_MEMBER_IMAGE_FILETIME) ? '?' . filemtime($icon_file) : '';
echo '<img src="'.$icon_url.$icon_filemtile.'" alt="">'; echo '<img src="' . $icon_url . $icon_filemtile . '" alt="">';
echo '<input type="checkbox" id="del_mb_icon" name="del_mb_icon" value="1">삭제'; echo '<input type="checkbox" id="del_mb_icon" name="del_mb_icon" value="1">삭제';
}
?>
</td>
</tr>
<tr>
<th scope="row"><label for="mb_img">회원이미지</label></th>
<td colspan="3">
<?php echo help('이미지 크기는 <strong>넓이 '.$config['cf_member_img_width'].'픽셀 높이 '.$config['cf_member_img_height'].'픽셀</strong>로 해주세요.') ?>
<input type="file" name="mb_img" id="mb_img">
<?php
$mb_dir = substr($mb['mb_id'],0,2);
$icon_file = G5_DATA_PATH.'/member_image/'.$mb_dir.'/'.get_mb_icon_name($mb['mb_id']).'.gif';
if (file_exists($icon_file)) {
echo get_member_profile_img($mb['mb_id']);
echo '<input type="checkbox" id="del_mb_img" name="del_mb_img" value="1">삭제';
}
?>
</td>
</tr>
<tr>
<th scope="row">메일 수신</th>
<td>
<input type="radio" name="mb_mailling" value="1" id="mb_mailling_yes" <?php echo $mb_mailling_yes; ?>>
<label for="mb_mailling_yes">예</label>
<input type="radio" name="mb_mailling" value="0" id="mb_mailling_no" <?php echo $mb_mailling_no; ?>>
<label for="mb_mailling_no">아니오</label>
</td>
<th scope="row"><label for="mb_sms_yes">SMS 수신</label></th>
<td>
<input type="radio" name="mb_sms" value="1" id="mb_sms_yes" <?php echo $mb_sms_yes; ?>>
<label for="mb_sms_yes">예</label>
<input type="radio" name="mb_sms" value="0" id="mb_sms_no" <?php echo $mb_sms_no; ?>>
<label for="mb_sms_no">아니오</label>
</td>
</tr>
<tr>
<th scope="row">정보 공개</th>
<td colspan="3">
<input type="radio" name="mb_open" value="1" id="mb_open_yes" <?php echo $mb_open_yes; ?>>
<label for="mb_open_yes">예</label>
<input type="radio" name="mb_open" value="0" id="mb_open_no" <?php echo $mb_open_no; ?>>
<label for="mb_open_no">아니오</label>
</td>
</tr>
<tr>
<th scope="row"><label for="mb_signature">서명</label></th>
<td colspan="3"><textarea name="mb_signature" id="mb_signature"><?php echo $mb['mb_signature'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_profile">자기 소개</label></th>
<td colspan="3"><textarea name="mb_profile" id="mb_profile"><?php echo $mb['mb_profile'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_memo">메모</label></th>
<td colspan="3"><textarea name="mb_memo" id="mb_memo"><?php echo $mb['mb_memo'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_cert_history">본인인증 내역</label></th>
<td colspan="3">
<?php
$cnt = 0;
while ($row = sql_fetch_array($mb_cert_history)) {
$cnt++;
switch($row['ch_type']){
case 'simple':
$cert_type = '간편인증';
break;
case 'hp':
$cert_type = '휴대폰';
break;
case 'ipin':
$cert_type = '아이핀';
break;
}
?>
<div>
[<?php echo $row['ch_datetime']; ?>]
<?php echo $row['mb_id']; ?> /
<?php echo $row['ch_name']; ?> /
<?php echo $row['ch_hp']; ?> /
<?php echo $cert_type; ?>
</div>
<?php } ?>
<?php if ($cnt == 0) { ?>
본인인증 내역이 없습니다.
<?php } ?>
</td>
</tr>
<?php if ($w == 'u') { ?>
<tr>
<th scope="row">회원가입일</th>
<td><?php echo $mb['mb_datetime'] ?></td>
<th scope="row">최근접속일</th>
<td><?php echo $mb['mb_today_login'] ?></td>
</tr>
<tr>
<th scope="row">IP</th>
<td colspan="3"><?php echo $mb['mb_ip'] ?></td>
</tr>
<?php if ($config['cf_use_email_certify']) { ?>
<tr>
<th scope="row">인증일시</th>
<td colspan="3">
<?php if ($mb['mb_email_certify'] == '0000-00-00 00:00:00') { ?>
<?php echo help('회원님이 메일을 수신할 수 없는 경우 등에 직접 인증처리를 하실 수 있습니다.') ?>
<input type="checkbox" name="passive_certify" id="passive_certify">
<label for="passive_certify">수동인증</label>
<?php } else { ?>
<?php echo $mb['mb_email_certify'] ?>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php } ?>
<?php if ($config['cf_use_recommend']) { // 추천인 사용 ?>
<tr>
<th scope="row">추천인</th>
<td colspan="3"><?php echo ($mb['mb_recommend'] ? get_text($mb['mb_recommend']) : '없음'); // 081022 : CSRF 보안 결함으로 인한 코드 수정 ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="mb_leave_date">탈퇴일자</label></th>
<td>
<input type="text" name="mb_leave_date" value="<?php echo $mb['mb_leave_date'] ?>" id="mb_leave_date" class="frm_input" maxlength="8">
<input type="checkbox" value="<?php echo date("Ymd"); ?>" id="mb_leave_date_set_today" onclick="if (this.form.mb_leave_date.value==this.form.mb_leave_date.defaultValue) {
this.form.mb_leave_date.value=this.value; } else { this.form.mb_leave_date.value=this.form.mb_leave_date.defaultValue; }">
<label for="mb_leave_date_set_today">탈퇴일을 오늘로 지정</label>
</td>
<th scope="row">접근차단일자</th>
<td>
<input type="text" name="mb_intercept_date" value="<?php echo $mb['mb_intercept_date'] ?>" id="mb_intercept_date" class="frm_input" maxlength="8">
<input type="checkbox" value="<?php echo date("Ymd"); ?>" id="mb_intercept_date_set_today" onclick="if
(this.form.mb_intercept_date.value==this.form.mb_intercept_date.defaultValue) { this.form.mb_intercept_date.value=this.value; } else {
this.form.mb_intercept_date.value=this.form.mb_intercept_date.defaultValue; }">
<label for="mb_intercept_date_set_today">접근차단일을 오늘로 지정</label>
</td>
</tr>
<?php
//소셜계정이 있다면
if(function_exists('social_login_link_account') && $mb['mb_id'] ){
if( $my_social_accounts = social_login_link_account($mb['mb_id'], false, 'get_data') ){ ?>
<tr>
<th>소셜계정목록</th>
<td colspan="3">
<ul class="social_link_box">
<li class="social_login_container">
<h4>연결된 소셜 계정 목록</h4>
<?php foreach($my_social_accounts as $account){ //반복문
if( empty($account) ) continue;
$provider = strtolower($account['provider']);
$provider_name = social_get_provider_service_name($provider);
?>
<div class="account_provider" data-mpno="social_<?php echo $account['mp_no'];?>" >
<div class="sns-wrap-32 sns-wrap-over">
<span class="sns-icon sns-<?php echo $provider; ?>" title="<?php echo $provider_name; ?>">
<span class="ico"></span>
<span class="txt"><?php echo $provider_name; ?></span>
</span>
<span class="provider_name"><?php echo $provider_name; //서비스이름?> ( <?php echo $account['displayname']; ?> )</span>
<span class="account_hidden" style="display:none"><?php echo $account['mb_id']; ?></span>
</div>
<div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL.'/unlink.php?mp_no='.$account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no'];?>" >연동해제</a> <span class="sound_only"><?php echo substr($account['mp_register_day'], 2, 14); ?></span></div>
</div>
<?php } //end foreach ?>
</li>
</ul>
<script>
jQuery(function($){
$(".account_provider").on("click", ".social_unlink", function(e){
e.preventDefault();
if (!confirm('정말 이 계정 연결을 삭제하시겠습니까?')) {
return false;
}
var ajax_url = "<?php echo G5_SOCIAL_LOGIN_URL.'/unlink.php' ?>";
var mb_id = '',
mp_no = $(this).attr("data-provider"),
$mp_el = $(this).parents(".account_provider");
mb_id = $mp_el.find(".account_hidden").text();
if( ! mp_no ){
alert('잘못된 요청! mp_no 값이 없습니다.');
return;
}
$.ajax({
url: ajax_url,
type: 'POST',
data: {
'mp_no': mp_no,
'mb_id': mb_id
},
dataType: 'json',
async: false,
success: function(data, textStatus) {
if (data.error) {
alert(data.error);
return false;
} else {
alert("연결이 해제 되었습니다.");
$mp_el.fadeOut("normal", function() {
$(this).remove();
});
} }
} ?>
}); </td>
</tr>
<tr>
<th scope="row"><label for="mb_img">회원이미지</label></th>
<td colspan="3">
<?php echo help('이미지 크기는 <strong>넓이 ' . $config['cf_member_img_width'] . '픽셀 높이 ' . $config['cf_member_img_height'] . '픽셀</strong>로 해주세요.') ?>
<input type="file" name="mb_img" id="mb_img">
<?php
$mb_dir = substr($mb['mb_id'], 0, 2);
$icon_file = G5_DATA_PATH . '/member_image/' . $mb_dir . '/' . get_mb_icon_name($mb['mb_id']) . '.gif';
if (file_exists($icon_file)) {
echo get_member_profile_img($mb['mb_id']);
echo '<input type="checkbox" id="del_mb_img" name="del_mb_img" value="1">삭제';
}
?>
</td>
</tr>
<tr>
<th scope="row">메일 수신</th>
<td>
<input type="radio" name="mb_mailling" value="1" id="mb_mailling_yes" <?php echo $mb_mailling_yes; ?>>
<label for="mb_mailling_yes">예</label>
<input type="radio" name="mb_mailling" value="0" id="mb_mailling_no" <?php echo $mb_mailling_no; ?>>
<label for="mb_mailling_no">아니오</label>
</td>
<th scope="row"><label for="mb_sms_yes">SMS 수신</label></th>
<td>
<input type="radio" name="mb_sms" value="1" id="mb_sms_yes" <?php echo $mb_sms_yes; ?>>
<label for="mb_sms_yes">예</label>
<input type="radio" name="mb_sms" value="0" id="mb_sms_no" <?php echo $mb_sms_no; ?>>
<label for="mb_sms_no">아니오</label>
</td>
</tr>
<tr>
<th scope="row">정보 공개</th>
<td colspan="3">
<input type="radio" name="mb_open" value="1" id="mb_open_yes" <?php echo $mb_open_yes; ?>>
<label for="mb_open_yes">예</label>
<input type="radio" name="mb_open" value="0" id="mb_open_no" <?php echo $mb_open_no; ?>>
<label for="mb_open_no">아니오</label>
</td>
</tr>
<tr>
<th scope="row"><label for="mb_signature">서명</label></th>
<td colspan="3"><textarea name="mb_signature" id="mb_signature"><?php echo $mb['mb_signature'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_profile">자기 소개</label></th>
<td colspan="3"><textarea name="mb_profile" id="mb_profile"><?php echo $mb['mb_profile'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_memo">메모</label></th>
<td colspan="3"><textarea name="mb_memo" id="mb_memo"><?php echo $mb['mb_memo'] ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="mb_cert_history">본인인증 내역</label></th>
<td colspan="3">
<?php
$cnt = 0;
while ($row = sql_fetch_array($mb_cert_history)) {
$cnt++;
$cert_type = '';
switch ($row['ch_type']) {
case 'simple':
$cert_type = '간편인증';
break;
case 'hp':
$cert_type = '휴대폰';
break;
case 'ipin':
$cert_type = '아이핀';
break;
}
?>
<div>
[<?php echo $row['ch_datetime']; ?>]
<?php echo $row['mb_id']; ?> /
<?php echo $row['ch_name']; ?> /
<?php echo $row['ch_hp']; ?> /
<?php echo $cert_type; ?>
</div>
<?php } ?>
return; <?php if ($cnt == 0) { ?>
}); 본인인증 내역이 없습니다.
}); <?php } ?>
</script> </td>
</tr>
</td> <?php if ($w == 'u') { ?>
</tr> <tr>
<th scope="row">회원가입일</th>
<td><?php echo $mb['mb_datetime'] ?></td>
<th scope="row">최근접속일</th>
<td><?php echo $mb['mb_today_login'] ?></td>
</tr>
<tr>
<th scope="row">IP</th>
<td colspan="3"><?php echo $mb['mb_ip'] ?></td>
</tr>
<?php if ($config['cf_use_email_certify']) { ?>
<tr>
<th scope="row">인증일시</th>
<td colspan="3">
<?php if ($mb['mb_email_certify'] == '0000-00-00 00:00:00') { ?>
<?php echo help('회원님이 메일을 수신할 수 없는 경우 등에 직접 인증처리를 하실 수 있습니다.') ?>
<input type="checkbox" name="passive_certify" id="passive_certify">
<label for="passive_certify">수동인증</label>
<?php } else { ?>
<?php echo $mb['mb_email_certify'] ?>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php } ?>
<?php <?php if ($config['cf_use_recommend']) { // 추천인 사용 ?>
} //end if <tr>
} //end if <th scope="row">추천인</th>
<td colspan="3"><?php echo ($mb['mb_recommend'] ? get_text($mb['mb_recommend']) : '없음'); // 081022 : CSRF 보안 결함으로 인한 코드 수정 ?></td>
</tr>
<?php } ?>
run_event('admin_member_form_add', $mb, $w, 'table'); <tr>
?> <th scope="row"><label for="mb_leave_date">탈퇴일자</label></th>
<td>
<input type="text" name="mb_leave_date" value="<?php echo $mb['mb_leave_date'] ?>" id="mb_leave_date" class="frm_input" maxlength="8">
<input type="checkbox" value="<?php echo date("Ymd"); ?>" id="mb_leave_date_set_today" onclick="if (this.form.mb_leave_date.value==this.form.mb_leave_date.defaultValue) { this.form.mb_leave_date.value=this.value; } else { this.form.mb_leave_date.value=this.form.mb_leave_date.defaultValue; }">
<label for="mb_leave_date_set_today">탈퇴일을 오늘로 지정</label>
</td>
<th scope="row">접근차단일자</th>
<td>
<input type="text" name="mb_intercept_date" value="<?php echo $mb['mb_intercept_date'] ?>" id="mb_intercept_date" class="frm_input" maxlength="8">
<input type="checkbox" value="<?php echo date("Ymd"); ?>" id="mb_intercept_date_set_today" onclick="if (this.form.mb_intercept_date.value==this.form.mb_intercept_date.defaultValue) { this.form.mb_intercept_date.value=this.value; } else { this.form.mb_intercept_date.value=this.form.mb_intercept_date.defaultValue; }">
<label for="mb_intercept_date_set_today">접근차단일을 오늘로 지정</label>
</td>
</tr>
<?php for ($i=1; $i<=10; $i++) { ?> <?php
<tr> //소셜계정이 있다면
<th scope="row"><label for="mb_<?php echo $i ?>">여분 필드 <?php echo $i ?></label></th> if (function_exists('social_login_link_account') && $mb['mb_id']) {
<td colspan="3"><input type="text" name="mb_<?php echo $i ?>" value="<?php echo $mb['mb_'.$i] ?>" id="mb_<?php echo $i ?>" class="frm_input" size="30" maxlength="255"></td> if ($my_social_accounts = social_login_link_account($mb['mb_id'], false, 'get_data')) { ?>
</tr> <tr>
<?php } ?> <th>소셜계정목록</th>
<td colspan="3">
<ul class="social_link_box">
<li class="social_login_container">
<h4>연결된 소셜 계정 목록</h4>
<?php foreach ($my_social_accounts as $account) { //반복문
if (empty($account)) {
continue;
}
</tbody> $provider = strtolower($account['provider']);
</table> $provider_name = social_get_provider_service_name($provider);
</div> ?>
<div class="account_provider" data-mpno="social_<?php echo $account['mp_no']; ?>">
<div class="sns-wrap-32 sns-wrap-over">
<span class="sns-icon sns-<?php echo $provider; ?>" title="<?php echo $provider_name; ?>">
<span class="ico"></span>
<span class="txt"><?php echo $provider_name; ?></span>
</span>
<div class="btn_fixed_top"> <span class="provider_name"><?php echo $provider_name; //서비스이름 ?> ( <?php echo $account['displayname']; ?> )</span>
<a href="./member_list.php?<?php echo $qstr ?>" class="btn btn_02">목록</a> <span class="account_hidden" style="display:none"><?php echo $account['mb_id']; ?></span>
<input type="submit" value="확인" class="btn_submit btn" accesskey='s'> </div>
</div> <div class="btn_info"><a href="<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php?mp_no=' . $account['mp_no'] ?>" class="social_unlink" data-provider="<?php echo $account['mp_no']; ?>">연동해제</a> <span class="sound_only"><?php echo substr($account['mp_register_day'], 2, 14); ?></span></div>
</div>
<?php } //end foreach ?>
</li>
</ul>
<script>
jQuery(function($) {
$(".account_provider").on("click", ".social_unlink", function(e) {
e.preventDefault();
if (!confirm('정말 이 계정 연결을 삭제하시겠습니까?')) {
return false;
}
var ajax_url = "<?php echo G5_SOCIAL_LOGIN_URL . '/unlink.php' ?>";
var mb_id = '',
mp_no = $(this).attr("data-provider"),
$mp_el = $(this).parents(".account_provider");
mb_id = $mp_el.find(".account_hidden").text();
if (!mp_no) {
alert('잘못된 요청! mp_no 값이 없습니다.');
return;
}
$.ajax({
url: ajax_url,
type: 'POST',
data: {
'mp_no': mp_no,
'mb_id': mb_id
},
dataType: 'json',
async: false,
success: function(data, textStatus) {
if (data.error) {
alert(data.error);
return false;
} else {
alert("연결이 해제 되었습니다.");
$mp_el.fadeOut("normal", function() {
$(this).remove();
});
}
}
});
return;
});
});
</script>
</td>
</tr>
<?php
} //end if
} //end if
run_event('admin_member_form_add', $mb, $w, 'table');
?>
<?php for ($i = 1; $i <= 10; $i++) { ?>
<tr>
<th scope="row"><label for="mb_<?php echo $i ?>">여분 필드 <?php echo $i ?></label></th>
<td colspan="3"><input type="text" name="mb_<?php echo $i ?>" value="<?php echo $mb['mb_' . $i] ?>" id="mb_<?php echo $i ?>" class="frm_input" size="30" maxlength="255"></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<a href="./member_list.php?<?php echo $qstr ?>" class="btn btn_02">목록</a>
<input type="submit" value="확인" class="btn_submit btn" accesskey='s'>
</div>
</form> </form>
<script> <script>
function fmember_submit(f) function fmember_submit(f) {
{ if (!f.mb_icon.value.match(/\.(gif|jpe?g|png)$/i) && f.mb_icon.value) {
if (!f.mb_icon.value.match(/\.(gif|jpe?g|png)$/i) && f.mb_icon.value) { alert('아이콘은 이미지 파일만 가능합니다.');
alert('아이콘은 이미지 파일만 가능합니다.'); return false;
return false; }
}
if (!f.mb_img.value.match(/\.(gif|jpe?g|png)$/i) && f.mb_img.value) { if (!f.mb_img.value.match(/\.(gif|jpe?g|png)$/i) && f.mb_img.value) {
alert('회원이미지는 이미지 파일만 가능합니다.'); alert('회원이미지는 이미지 파일만 가능합니다.');
return false; return false;
} }
return true; return true;
} }
</script> </script>
<?php <?php
run_event('admin_member_form_after', $mb, $w); run_event('admin_member_form_after', $mb, $w);
include_once('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,33 +1,36 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once("./_common.php"); require_once "./_common.php";
include_once(G5_LIB_PATH."/register.lib.php"); require_once G5_LIB_PATH . "/register.lib.php";
include_once(G5_LIB_PATH.'/thumbnail.lib.php'); require_once G5_LIB_PATH . '/thumbnail.lib.php';
if ($w == 'u') if ($w == 'u') {
check_demo(); check_demo();
}
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
check_admin_token(); check_admin_token();
$mb_id = isset($_POST['mb_id']) ? trim($_POST['mb_id']) : ''; $mb_id = isset($_POST['mb_id']) ? trim($_POST['mb_id']) : '';
$mb_password = isset($_POST['mb_password']) ? trim($_POST['mb_password']) : '';
$mb_certify_case = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify_case']) : ''; $mb_certify_case = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify_case']) : '';
$mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify']) : ''; $mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify']) : '';
$mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : ''; $mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : '';
// 휴대폰번호 체크 // 휴대폰번호 체크
$mb_hp = hyphen_hp_number($_POST['mb_hp']); $mb_hp = hyphen_hp_number($_POST['mb_hp']);
if($mb_hp) { if ($mb_hp) {
$result = exist_mb_hp($mb_hp, $mb_id); $result = exist_mb_hp($mb_hp, $mb_id);
if ($result) if ($result) {
alert($result); alert($result);
}
} }
// 인증정보처리 // 인증정보처리
if($mb_certify_case && $mb_certify) { if ($mb_certify_case && $mb_certify) {
$mb_certify = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify_case']) : ''; $mb_certify = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/i', '', (string)$_POST['mb_certify_case']) : '';
$mb_adult = isset($_POST['mb_adult']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_adult']) : ''; $mb_adult = isset($_POST['mb_adult']) ? preg_replace('/[^0-9a-z_]/i', '', (string)$_POST['mb_adult']) : '';
} else { } else {
$mb_certify = ''; $mb_certify = '';
$mb_adult = 0; $mb_adult = 0;
@ -39,32 +42,34 @@ $mb_zip2 = substr($mb_zip, 3);
$mb_email = isset($_POST['mb_email']) ? get_email_address(trim($_POST['mb_email'])) : ''; $mb_email = isset($_POST['mb_email']) ? get_email_address(trim($_POST['mb_email'])) : '';
$mb_nick = isset($_POST['mb_nick']) ? trim(strip_tags($_POST['mb_nick'])) : ''; $mb_nick = isset($_POST['mb_nick']) ? trim(strip_tags($_POST['mb_nick'])) : '';
if ($msg = valid_mb_nick($mb_nick)) alert($msg, "", true, true); if ($msg = valid_mb_nick($mb_nick)) {
alert($msg, "", true, true);
}
$posts = array(); $posts = array();
$check_keys = array( $check_keys = array(
'mb_name', 'mb_name',
'mb_homepage', 'mb_homepage',
'mb_tel', 'mb_tel',
'mb_addr1', 'mb_addr1',
'mb_addr2', 'mb_addr2',
'mb_addr3', 'mb_addr3',
'mb_addr_jibeon', 'mb_addr_jibeon',
'mb_signature', 'mb_signature',
'mb_leave_date', 'mb_leave_date',
'mb_intercept_date', 'mb_intercept_date',
'mb_mailling', 'mb_mailling',
'mb_sms', 'mb_sms',
'mb_open', 'mb_open',
'mb_profile', 'mb_profile',
'mb_level' 'mb_level'
); );
for($i=1;$i<=10;$i++){ for ($i = 1; $i <= 10; $i++) {
$check_keys[] = 'mb_'.$i; $check_keys[] = 'mb_' . $i;
} }
foreach( $check_keys as $key ){ foreach ($check_keys as $key) {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : ''; $posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : '';
} }
@ -104,63 +109,70 @@ $sql_common = " mb_name = '{$posts['mb_name']}',
mb_9 = '{$posts['mb_9']}', mb_9 = '{$posts['mb_9']}',
mb_10 = '{$posts['mb_10']}' "; mb_10 = '{$posts['mb_10']}' ";
if ($w == '') if ($w == '') {
{
$mb = get_member($mb_id); $mb = get_member($mb_id);
if (isset($mb['mb_id']) && $mb['mb_id']) if (isset($mb['mb_id']) && $mb['mb_id']) {
alert('이미 존재하는 회원아이디입니다.\\n : '.$mb['mb_id'].'\\n이름 : '.$mb['mb_name'].'\\n닉네임 : '.$mb['mb_nick'].'\\n메일 : '.$mb['mb_email']); alert('이미 존재하는 회원아이디입니다.\\n : ' . $mb['mb_id'] . '\\n이름 : ' . $mb['mb_name'] . '\\n닉네임 : ' . $mb['mb_nick'] . '\\n메일 : ' . $mb['mb_email']);
}
// 닉네임중복체크 // 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' "; $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (isset($row['mb_id']) && $row['mb_id']) if (isset($row['mb_id']) && $row['mb_id']) {
alert('이미 존재하는 닉네임입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']); alert('이미 존재하는 닉네임입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
}
// 이메일중복체크 // 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' "; $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (isset($row['mb_id']) && $row['mb_id']) if (isset($row['mb_id']) && $row['mb_id']) {
alert('이미 존재하는 이메일입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']); alert('이미 존재하는 이메일입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
}
sql_query(" insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '".get_encrypt_string($mb_password)."', mb_datetime = '".G5_TIME_YMDHIS."', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '".G5_TIME_YMDHIS."', {$sql_common} "); sql_query(" insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '" . get_encrypt_string($mb_password) . "', mb_datetime = '" . G5_TIME_YMDHIS . "', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '" . G5_TIME_YMDHIS . "', {$sql_common} ");
} } elseif ($w == 'u') {
else if ($w == 'u')
{
$mb = get_member($mb_id); $mb = get_member($mb_id);
if (! (isset($mb['mb_id']) && $mb['mb_id'])) if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
alert('존재하지 않는 회원자료입니다.'); alert('존재하지 않는 회원자료입니다.');
}
if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) {
alert('자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.'); alert('자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.');
}
if ($is_admin !== 'super' && is_admin($mb['mb_id']) === 'super' ) { if ($is_admin !== 'super' && is_admin($mb['mb_id']) === 'super') {
alert('최고관리자의 비밀번호를 수정할수 없습니다.'); alert('최고관리자의 비밀번호를 수정할수 없습니다.');
} }
if ($mb_id === $member['mb_id'] && $_POST['mb_level'] != $mb['mb_level']) if ($mb_id === $member['mb_id'] && $_POST['mb_level'] != $mb['mb_level']) {
alert($mb['mb_id'].' : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.'); alert($mb['mb_id'] . ' : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.');
}
// 닉네임중복체크 // 닉네임중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' and mb_id <> '$mb_id' "; $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_nick = '{$mb_nick}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (isset($row['mb_id']) && $row['mb_id']) if (isset($row['mb_id']) && $row['mb_id']) {
alert('이미 존재하는 닉네임입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']); alert('이미 존재하는 닉네임입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
}
// 이메일중복체크 // 이메일중복체크
$sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' and mb_id <> '$mb_id' "; $sql = " select mb_id, mb_name, mb_nick, mb_email from {$g5['member_table']} where mb_email = '{$mb_email}' and mb_id <> '$mb_id' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
if (isset($row['mb_id']) && $row['mb_id']) if (isset($row['mb_id']) && $row['mb_id']) {
alert('이미 존재하는 이메일입니다.\\n : '.$row['mb_id'].'\\n이름 : '.$row['mb_name'].'\\n닉네임 : '.$row['mb_nick'].'\\n메일 : '.$row['mb_email']); alert('이미 존재하는 이메일입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
}
if ($mb_password) if ($mb_password) {
$sql_password = " , mb_password = '".get_encrypt_string($mb_password)."' "; $sql_password = " , mb_password = '" . get_encrypt_string($mb_password) . "' ";
else } else {
$sql_password = ""; $sql_password = "";
}
if (isset($passive_certify) && $passive_certify) if (isset($passive_certify) && $passive_certify) {
$sql_certify = " , mb_email_certify = '".G5_TIME_YMDHIS."' "; $sql_certify = " , mb_email_certify = '" . G5_TIME_YMDHIS . "' ";
else } else {
$sql_certify = ""; $sql_certify = "";
}
$sql = " update {$g5['member_table']} $sql = " update {$g5['member_table']}
set {$sql_common} set {$sql_common}
@ -168,18 +180,18 @@ else if ($w == 'u')
{$sql_certify} {$sql_certify}
where mb_id = '{$mb_id}' "; where mb_id = '{$mb_id}' ";
sql_query($sql); sql_query($sql);
} } else {
else
alert('제대로 된 값이 넘어오지 않았습니다.'); alert('제대로 된 값이 넘어오지 않았습니다.');
}
if( $w == '' || $w == 'u' ){ if ($w == '' || $w == 'u') {
$mb_dir = substr($mb_id, 0, 2);
$mb_dir = substr($mb_id,0,2); $mb_icon_img = get_mb_icon_name($mb_id) . '.gif';
$mb_icon_img = get_mb_icon_name($mb_id).'.gif';
// 회원 아이콘 삭제 // 회원 아이콘 삭제
if (isset($del_mb_icon) && $del_mb_icon) if (isset($del_mb_icon) && $del_mb_icon) {
@unlink(G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_icon_img); @unlink(G5_DATA_PATH . '/member/' . $mb_dir . '/' . $mb_icon_img);
}
$image_regex = "/(\.(gif|jpe?g|png))$/i"; $image_regex = "/(\.(gif|jpe?g|png))$/i";
@ -190,77 +202,82 @@ if( $w == '' || $w == 'u' ){
} }
if (preg_match($image_regex, $_FILES['mb_icon']['name'])) { if (preg_match($image_regex, $_FILES['mb_icon']['name'])) {
$mb_icon_dir = G5_DATA_PATH.'/member/'.$mb_dir; $mb_icon_dir = G5_DATA_PATH . '/member/' . $mb_dir;
@mkdir($mb_icon_dir, G5_DIR_PERMISSION); @mkdir($mb_icon_dir, G5_DIR_PERMISSION);
@chmod($mb_icon_dir, G5_DIR_PERMISSION); @chmod($mb_icon_dir, G5_DIR_PERMISSION);
$dest_path = $mb_icon_dir.'/'.$mb_icon_img; $dest_path = $mb_icon_dir . '/' . $mb_icon_img;
move_uploaded_file($_FILES['mb_icon']['tmp_name'], $dest_path); move_uploaded_file($_FILES['mb_icon']['tmp_name'], $dest_path);
chmod($dest_path, G5_FILE_PERMISSION); chmod($dest_path, G5_FILE_PERMISSION);
if (file_exists($dest_path)) { if (file_exists($dest_path)) {
$size = @getimagesize($dest_path); $size = @getimagesize($dest_path);
if ($size[0] > $config['cf_member_icon_width'] || $size[1] > $config['cf_member_icon_height']) { if ($size) {
$thumb = null; if ($size[0] > $config['cf_member_icon_width'] || $size[1] > $config['cf_member_icon_height']) {
if($size[2] === 2 || $size[2] === 3) { $thumb = null;
//jpg 또는 png 파일 적용 if ($size[2] === 2 || $size[2] === 3) {
$thumb = thumbnail($mb_icon_img, $mb_icon_dir, $mb_icon_dir, $config['cf_member_icon_width'], $config['cf_member_icon_height'], true, true); //jpg 또는 png 파일 적용
if($thumb) { $thumb = thumbnail($mb_icon_img, $mb_icon_dir, $mb_icon_dir, $config['cf_member_icon_width'], $config['cf_member_icon_height'], true, true);
@unlink($dest_path); if ($thumb) {
rename($mb_icon_dir.'/'.$thumb, $dest_path); @unlink($dest_path);
rename($mb_icon_dir . '/' . $thumb, $dest_path);
}
}
if (!$thumb) {
// 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제
@unlink($dest_path);
} }
}
if( !$thumb ){
// 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제
@unlink($dest_path);
} }
} }
} }
} }
} }
$mb_img_dir = G5_DATA_PATH.'/member_image/'; $mb_img_dir = G5_DATA_PATH . '/member_image/';
if( !is_dir($mb_img_dir) ){ if (!is_dir($mb_img_dir)) {
@mkdir($mb_img_dir, G5_DIR_PERMISSION); @mkdir($mb_img_dir, G5_DIR_PERMISSION);
@chmod($mb_img_dir, G5_DIR_PERMISSION); @chmod($mb_img_dir, G5_DIR_PERMISSION);
} }
$mb_img_dir .= substr($mb_id,0,2); $mb_img_dir .= substr($mb_id, 0, 2);
// 회원 이미지 삭제 // 회원 이미지 삭제
if (isset($del_mb_img) && $del_mb_img) if (isset($del_mb_img) && $del_mb_img) {
@unlink($mb_img_dir.'/'.$mb_icon_img); @unlink($mb_img_dir . '/' . $mb_icon_img);
}
// 아이콘 업로드 // 아이콘 업로드
if (isset($_FILES['mb_img']) && is_uploaded_file($_FILES['mb_img']['tmp_name'])) { if (isset($_FILES['mb_img']) && is_uploaded_file($_FILES['mb_img']['tmp_name'])) {
if (!preg_match($image_regex, $_FILES['mb_img']['name'])) { if (!preg_match($image_regex, $_FILES['mb_img']['name'])) {
alert($_FILES['mb_img']['name'] . '은(는) 이미지 파일이 아닙니다.'); alert($_FILES['mb_img']['name'] . '은(는) 이미지 파일이 아닙니다.');
} }
if (preg_match($image_regex, $_FILES['mb_img']['name'])) { if (preg_match($image_regex, $_FILES['mb_img']['name'])) {
@mkdir($mb_img_dir, G5_DIR_PERMISSION); @mkdir($mb_img_dir, G5_DIR_PERMISSION);
@chmod($mb_img_dir, G5_DIR_PERMISSION); @chmod($mb_img_dir, G5_DIR_PERMISSION);
$dest_path = $mb_img_dir.'/'.$mb_icon_img; $dest_path = $mb_img_dir . '/' . $mb_icon_img;
move_uploaded_file($_FILES['mb_img']['tmp_name'], $dest_path); move_uploaded_file($_FILES['mb_img']['tmp_name'], $dest_path);
chmod($dest_path, G5_FILE_PERMISSION); chmod($dest_path, G5_FILE_PERMISSION);
if (file_exists($dest_path)) { if (file_exists($dest_path)) {
$size = @getimagesize($dest_path); $size = @getimagesize($dest_path);
if ($size[0] > $config['cf_member_img_width'] || $size[1] > $config['cf_member_img_height']) { if ($size) {
$thumb = null; if ($size[0] > $config['cf_member_img_width'] || $size[1] > $config['cf_member_img_height']) {
if($size[2] === 2 || $size[2] === 3) { $thumb = null;
//jpg 또는 png 파일 적용 if ($size[2] === 2 || $size[2] === 3) {
$thumb = thumbnail($mb_icon_img, $mb_img_dir, $mb_img_dir, $config['cf_member_img_width'], $config['cf_member_img_height'], true, true); //jpg 또는 png 파일 적용
if($thumb) { $thumb = thumbnail($mb_icon_img, $mb_img_dir, $mb_img_dir, $config['cf_member_img_width'], $config['cf_member_img_height'], true, true);
@unlink($dest_path); if ($thumb) {
rename($mb_img_dir.'/'.$thumb, $dest_path); @unlink($dest_path);
rename($mb_img_dir . '/' . $thumb, $dest_path);
}
}
if (!$thumb) {
// 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제
@unlink($dest_path);
} }
}
if( !$thumb ){
// 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제
@unlink($dest_path);
} }
} }
} }
@ -270,4 +287,4 @@ if( $w == '' || $w == 'u' ){
run_event('admin_member_form_update', $w, $mb_id); run_event('admin_member_form_update', $w, $mb_id);
goto_url('./member_form.php?'.$qstr.'&amp;w=u&amp;mb_id='.$mb_id, false); goto_url('./member_form.php?' . $qstr . '&amp;w=u&amp;mb_id=' . $mb_id, false);

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, 'r'); auth_check_menu($auth, $sub_menu, 'r');
@ -10,25 +10,26 @@ $sql_search = " where (1) ";
if ($stx) { if ($stx) {
$sql_search .= " and ( "; $sql_search .= " and ( ";
switch ($sfl) { switch ($sfl) {
case 'mb_point' : case 'mb_point':
$sql_search .= " ({$sfl} >= '{$stx}') "; $sql_search .= " ({$sfl} >= '{$stx}') ";
break; break;
case 'mb_level' : case 'mb_level':
$sql_search .= " ({$sfl} = '{$stx}') "; $sql_search .= " ({$sfl} = '{$stx}') ";
break; break;
case 'mb_tel' : case 'mb_tel':
case 'mb_hp' : case 'mb_hp':
$sql_search .= " ({$sfl} like '%{$stx}') "; $sql_search .= " ({$sfl} like '%{$stx}') ";
break; break;
default : default:
$sql_search .= " ({$sfl} like '{$stx}%') "; $sql_search .= " ({$sfl} like '{$stx}%') ";
break; break;
} }
$sql_search .= " ) "; $sql_search .= " ) ";
} }
if ($is_admin != 'super') if ($is_admin != 'super') {
$sql_search .= " and mb_level <= '{$member['mb_level']}' "; $sql_search .= " and mb_level <= '{$member['mb_level']}' ";
}
if (!$sst) { if (!$sst) {
$sst = "mb_datetime"; $sst = "mb_datetime";
@ -43,7 +44,9 @@ $total_count = $row['cnt'];
$rows = $config['cf_page_rows']; $rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지) if ($page < 1) {
$page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
}
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $from_record = ($page - 1) * $rows; // 시작 열을 구함
// 탈퇴회원수 // 탈퇴회원수
@ -56,10 +59,10 @@ $sql = " select count(*) as cnt {$sql_common} {$sql_search} and mb_intercept_dat
$row = sql_fetch($sql); $row = sql_fetch($sql);
$intercept_count = $row['cnt']; $intercept_count = $row['cnt'];
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>'; $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체목록</a>';
$g5['title'] = '회원관리'; $g5['title'] = '회원관리';
include_once('./admin.head.php'); require_once './admin.head.php';
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} "; $sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
$result = sql_query($sql); $result = sql_query($sql);
@ -71,28 +74,28 @@ $colspan = 16;
<?php echo $listall ?> <?php echo $listall ?>
<span class="btn_ov01"><span class="ov_txt">총회원수 </span><span class="ov_num"> <?php echo number_format($total_count) ?>명 </span></span> <span class="btn_ov01"><span class="ov_txt">총회원수 </span><span class="ov_num"> <?php echo number_format($total_count) ?>명 </span></span>
<a href="?sst=mb_intercept_date&amp;sod=desc&amp;sfl=<?php echo $sfl ?>&amp;stx=<?php echo $stx ?>" class="btn_ov01" data-tooltip-text="차단된 순으로 정렬합니다.&#xa;전체 데이터를 출력합니다."> <span class="ov_txt">차단 </span><span class="ov_num"><?php echo number_format($intercept_count) ?>명</span></a> <a href="?sst=mb_intercept_date&amp;sod=desc&amp;sfl=<?php echo $sfl ?>&amp;stx=<?php echo $stx ?>" class="btn_ov01" data-tooltip-text="차단된 순으로 정렬합니다.&#xa;전체 데이터를 출력합니다."> <span class="ov_txt">차단 </span><span class="ov_num"><?php echo number_format($intercept_count) ?>명</span></a>
<a href="?sst=mb_leave_date&amp;sod=desc&amp;sfl=<?php echo $sfl ?>&amp;stx=<?php echo $stx ?>" class="btn_ov01" data-tooltip-text="탈퇴된 순으로 정렬합니다.&#xa;전체 데이터를 출력합니다."> <span class="ov_txt">탈퇴 </span><span class="ov_num"><?php echo number_format($leave_count) ?>명</span></a> <a href="?sst=mb_leave_date&amp;sod=desc&amp;sfl=<?php echo $sfl ?>&amp;stx=<?php echo $stx ?>" class="btn_ov01" data-tooltip-text="탈퇴된 순으로 정렬합니다.&#xa;전체 데이터를 출력합니다."> <span class="ov_txt">탈퇴 </span><span class="ov_num"><?php echo number_format($leave_count) ?>명</span></a>
</div> </div>
<form id="fsearch" name="fsearch" class="local_sch01 local_sch" method="get"> <form id="fsearch" name="fsearch" class="local_sch01 local_sch" method="get">
<label for="sfl" class="sound_only">검색대상</label> <label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl"> <select name="sfl" id="sfl">
<option value="mb_id"<?php echo get_selected($sfl, "mb_id"); ?>>회원아이디</option> <option value="mb_id" <?php echo get_selected($sfl, "mb_id"); ?>>회원아이디</option>
<option value="mb_nick"<?php echo get_selected($sfl, "mb_nick"); ?>>닉네임</option> <option value="mb_nick" <?php echo get_selected($sfl, "mb_nick"); ?>>닉네임</option>
<option value="mb_name"<?php echo get_selected($sfl, "mb_name"); ?>>이름</option> <option value="mb_name" <?php echo get_selected($sfl, "mb_name"); ?>>이름</option>
<option value="mb_level"<?php echo get_selected($sfl, "mb_level"); ?>>권한</option> <option value="mb_level" <?php echo get_selected($sfl, "mb_level"); ?>>권한</option>
<option value="mb_email"<?php echo get_selected($sfl, "mb_email"); ?>>E-MAIL</option> <option value="mb_email" <?php echo get_selected($sfl, "mb_email"); ?>>E-MAIL</option>
<option value="mb_tel"<?php echo get_selected($sfl, "mb_tel"); ?>>전화번호</option> <option value="mb_tel" <?php echo get_selected($sfl, "mb_tel"); ?>>전화번호</option>
<option value="mb_hp"<?php echo get_selected($sfl, "mb_hp"); ?>>휴대폰번호</option> <option value="mb_hp" <?php echo get_selected($sfl, "mb_hp"); ?>>휴대폰번호</option>
<option value="mb_point"<?php echo get_selected($sfl, "mb_point"); ?>>포인트</option> <option value="mb_point" <?php echo get_selected($sfl, "mb_point"); ?>>포인트</option>
<option value="mb_datetime"<?php echo get_selected($sfl, "mb_datetime"); ?>>가입일시</option> <option value="mb_datetime" <?php echo get_selected($sfl, "mb_datetime"); ?>>가입일시</option>
<option value="mb_ip"<?php echo get_selected($sfl, "mb_ip"); ?>>IP</option> <option value="mb_ip" <?php echo get_selected($sfl, "mb_ip"); ?>>IP</option>
<option value="mb_recommend"<?php echo get_selected($sfl, "mb_recommend"); ?>>추천인</option> <option value="mb_recommend" <?php echo get_selected($sfl, "mb_recommend"); ?>>추천인</option>
</select> </select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label> <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="required frm_input"> <input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" class="btn_submit" value="검색"> <input type="submit" class="btn_submit" value="검색">
</form> </form>
@ -104,236 +107,243 @@ $colspan = 16;
<form name="fmemberlist" id="fmemberlist" action="./member_list_update.php" onsubmit="return fmemberlist_submit(this);" method="post"> <form name="fmemberlist" id="fmemberlist" action="./member_list_update.php" onsubmit="return fmemberlist_submit(this);" method="post">
<input type="hidden" name="sst" value="<?php echo $sst ?>"> <input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>"> <input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>"> <input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="page" value="<?php echo $page ?>"> <input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value=""> <input type="hidden" name="token" value="">
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?> 목록</caption> <caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <thead>
<tr> <tr>
<th scope="col" id="mb_list_chk" rowspan="2" > <th scope="col" id="mb_list_chk" rowspan="2">
<label for="chkall" class="sound_only">회원 전체</label> <label for="chkall" class="sound_only">회원 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)"> <input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th> </th>
<th scope="col" id="mb_list_id" colspan="2"><?php echo subject_sort_link('mb_id') ?>아이디</a></th> <th scope="col" id="mb_list_id" colspan="2"><?php echo subject_sort_link('mb_id') ?>아이디</a></th>
<th scope="col" rowspan="2" id="mb_list_cert"><?php echo subject_sort_link('mb_certify', '', 'desc') ?>본인확인</a></th> <th scope="col" rowspan="2" id="mb_list_cert"><?php echo subject_sort_link('mb_certify', '', 'desc') ?>본인확인</a></th>
<th scope="col" id="mb_list_mailc"><?php echo subject_sort_link('mb_email_certify', '', 'desc') ?>메일인증</a></th> <th scope="col" id="mb_list_mailc"><?php echo subject_sort_link('mb_email_certify', '', 'desc') ?>메일인증</a></th>
<th scope="col" id="mb_list_open"><?php echo subject_sort_link('mb_open', '', 'desc') ?>정보공개</a></th> <th scope="col" id="mb_list_open"><?php echo subject_sort_link('mb_open', '', 'desc') ?>정보공개</a></th>
<th scope="col" id="mb_list_mailr"><?php echo subject_sort_link('mb_mailling', '', 'desc') ?>메일수신</a></th> <th scope="col" id="mb_list_mailr"><?php echo subject_sort_link('mb_mailling', '', 'desc') ?>메일수신</a></th>
<th scope="col" id="mb_list_auth">상태</th> <th scope="col" id="mb_list_auth">상태</th>
<th scope="col" id="mb_list_mobile">휴대폰</th> <th scope="col" id="mb_list_mobile">휴대폰</th>
<th scope="col" id="mb_list_lastcall"><?php echo subject_sort_link('mb_today_login', '', 'desc') ?>최종접속</a></th> <th scope="col" id="mb_list_lastcall"><?php echo subject_sort_link('mb_today_login', '', 'desc') ?>최종접속</a></th>
<th scope="col" id="mb_list_grp">접근그룹</th> <th scope="col" id="mb_list_grp">접근그룹</th>
<th scope="col" rowspan="2" id="mb_list_mng">관리</th> <th scope="col" rowspan="2" id="mb_list_mng">관리</th>
</tr> </tr>
<tr> <tr>
<th scope="col" id="mb_list_name"><?php echo subject_sort_link('mb_name') ?>이름</a></th> <th scope="col" id="mb_list_name"><?php echo subject_sort_link('mb_name') ?>이름</a></th>
<th scope="col" id="mb_list_nick"><?php echo subject_sort_link('mb_nick') ?>닉네임</a></th> <th scope="col" id="mb_list_nick"><?php echo subject_sort_link('mb_nick') ?>닉네임</a></th>
<th scope="col" id="mb_list_sms"><?php echo subject_sort_link('mb_sms', '', 'desc') ?>SMS수신</a></th> <th scope="col" id="mb_list_sms"><?php echo subject_sort_link('mb_sms', '', 'desc') ?>SMS수신</a></th>
<th scope="col" id="mb_list_adultc"><?php echo subject_sort_link('mb_adult', '', 'desc') ?>성인인증</a></th> <th scope="col" id="mb_list_adultc"><?php echo subject_sort_link('mb_adult', '', 'desc') ?>성인인증</a></th>
<th scope="col" id="mb_list_auth"><?php echo subject_sort_link('mb_intercept_date', '', 'desc') ?>접근차단</a></th> <th scope="col" id="mb_list_auth"><?php echo subject_sort_link('mb_intercept_date', '', 'desc') ?>접근차단</a></th>
<th scope="col" id="mb_list_deny"><?php echo subject_sort_link('mb_level', '', 'desc') ?>권한</a></th> <th scope="col" id="mb_list_deny"><?php echo subject_sort_link('mb_level', '', 'desc') ?>권한</a></th>
<th scope="col" id="mb_list_tel">전화번호</th> <th scope="col" id="mb_list_tel">전화번호</th>
<th scope="col" id="mb_list_join"><?php echo subject_sort_link('mb_datetime', '', 'desc') ?>가입일</a></th> <th scope="col" id="mb_list_join"><?php echo subject_sort_link('mb_datetime', '', 'desc') ?>가입일</a></th>
<th scope="col" id="mb_list_point"><?php echo subject_sort_link('mb_point', '', 'desc') ?> 포인트</a></th> <th scope="col" id="mb_list_point"><?php echo subject_sort_link('mb_point', '', 'desc') ?> 포인트</a></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
// 접근가능한 그룹수 // 접근가능한 그룹수
$sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' "; $sql2 = " select count(*) as cnt from {$g5['group_member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2); $row2 = sql_fetch($sql2);
$group = ''; $group = '';
if ($row2['cnt']) if ($row2['cnt']) {
$group = '<a href="./boardgroupmember_form.php?mb_id='.$row['mb_id'].'">'.$row2['cnt'].'</a>'; $group = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '">' . $row2['cnt'] . '</a>';
if ($is_admin == 'group') {
$s_mod = '';
} else {
$s_mod = '<a href="./member_form.php?'.$qstr.'&amp;w=u&amp;mb_id='.$row['mb_id'].'" class="btn btn_03">수정</a>';
}
$s_grp = '<a href="./boardgroupmember_form.php?mb_id='.$row['mb_id'].'" class="btn btn_02">그룹</a>';
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date('Ymd', G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date('Ymd', G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
$leave_msg = '';
$intercept_msg = '';
$intercept_title = '';
if ($row['mb_leave_date']) {
$mb_id = $mb_id;
$leave_msg = '<span class="mb_leave_msg">탈퇴함</span>';
}
else if ($row['mb_intercept_date']) {
$mb_id = $mb_id;
$intercept_msg = '<span class="mb_intercept_msg">차단됨</span>';
$intercept_title = '차단해제';
}
if ($intercept_title == '')
$intercept_title = '차단하기';
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3'], $row['mb_addr_jibeon']) : '';
$bg = 'bg'.($i%2);
switch($row['mb_certify']) {
case 'hp':
$mb_certify_case = '휴대폰';
$mb_certify_val = 'hp';
break;
case 'ipin':
$mb_certify_case = '아이핀';
$mb_certify_val = '';
break;
case 'simple':
$mb_certify_case = '간편인증';
$mb_certify_val = '';
break;
case 'admin':
$mb_certify_case = '관리자';
$mb_certify_val = 'admin';
break;
default:
$mb_certify_case = '&nbsp;';
$mb_certify_val = 'admin';
break;
}
?>
<tr class="<?php echo $bg; ?>">
<td headers="mb_list_chk" class="td_chk" rowspan="2">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>" id="mb_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['mb_name']); ?> <?php echo get_text($row['mb_nick']); ?>님</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td headers="mb_list_id" colspan="2" class="td_name sv_use">
<?php echo $mb_id ?>
<?php
//소셜계정이 있다면
if(function_exists('social_login_link_account')){
if( $my_social_accounts = social_login_link_account($row['mb_id'], false, 'get_data') ){
echo '<div class="member_social_provider sns-wrap-over sns-wrap-32">';
foreach( (array) $my_social_accounts as $account){ //반복문
if( empty($account) || empty($account['provider']) ) continue;
$provider = strtolower($account['provider']);
$provider_name = social_get_provider_service_name($provider);
echo '<span class="sns-icon sns-'.$provider.'" title="'.$provider_name.'">';
echo '<span class="ico"></span>';
echo '<span class="txt">'.$provider_name.'</span>';
echo '</span>';
} }
echo '</div>';
if ($is_admin == 'group') {
$s_mod = '';
} else {
$s_mod = '<a href="./member_form.php?' . $qstr . '&amp;w=u&amp;mb_id=' . $row['mb_id'] . '" class="btn btn_03">수정</a>';
}
$s_grp = '<a href="./boardgroupmember_form.php?mb_id=' . $row['mb_id'] . '" class="btn btn_02">그룹</a>';
$leave_date = $row['mb_leave_date'] ? $row['mb_leave_date'] : date('Ymd', G5_SERVER_TIME);
$intercept_date = $row['mb_intercept_date'] ? $row['mb_intercept_date'] : date('Ymd', G5_SERVER_TIME);
$mb_nick = get_sideview($row['mb_id'], get_text($row['mb_nick']), $row['mb_email'], $row['mb_homepage']);
$mb_id = $row['mb_id'];
$leave_msg = '';
$intercept_msg = '';
$intercept_title = '';
if ($row['mb_leave_date']) {
$mb_id = $mb_id;
$leave_msg = '<span class="mb_leave_msg">탈퇴함</span>';
} elseif ($row['mb_intercept_date']) {
$mb_id = $mb_id;
$intercept_msg = '<span class="mb_intercept_msg">차단됨</span>';
$intercept_title = '차단해제';
}
if ($intercept_title == '') {
$intercept_title = '차단하기';
}
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3'], $row['mb_addr_jibeon']) : '';
$bg = 'bg' . ($i % 2);
switch ($row['mb_certify']) {
case 'hp':
$mb_certify_case = '휴대폰';
$mb_certify_val = 'hp';
break;
case 'ipin':
$mb_certify_case = '아이핀';
$mb_certify_val = '';
break;
case 'simple':
$mb_certify_case = '간편인증';
$mb_certify_val = '';
break;
case 'admin':
$mb_certify_case = '관리자';
$mb_certify_val = 'admin';
break;
default:
$mb_certify_case = '&nbsp;';
$mb_certify_val = 'admin';
break;
}
?>
<tr class="<?php echo $bg; ?>">
<td headers="mb_list_chk" class="td_chk" rowspan="2">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>" id="mb_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['mb_name']); ?> <?php echo get_text($row['mb_nick']); ?>님</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td headers="mb_list_id" colspan="2" class="td_name sv_use">
<?php echo $mb_id ?>
<?php
//소셜계정이 있다면
if (function_exists('social_login_link_account')) {
if ($my_social_accounts = social_login_link_account($row['mb_id'], false, 'get_data')) {
echo '<div class="member_social_provider sns-wrap-over sns-wrap-32">';
foreach ((array) $my_social_accounts as $account) { //반복문
if (empty($account) || empty($account['provider'])) {
continue;
}
$provider = strtolower($account['provider']);
$provider_name = social_get_provider_service_name($provider);
echo '<span class="sns-icon sns-' . $provider . '" title="' . $provider_name . '">';
echo '<span class="ico"></span>';
echo '<span class="txt">' . $provider_name . '</span>';
echo '</span>';
}
echo '</div>';
}
}
?>
</td>
<td headers="mb_list_cert" rowspan="2" class="td_mbcert">
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="simple" id="mb_certify_sa_<?php echo $i; ?>" <?php echo $row['mb_certify'] == 'simple' ? 'checked' : ''; ?>>
<label for="mb_certify_sa_<?php echo $i; ?>">간편인증</label><br>
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="hp" id="mb_certify_hp_<?php echo $i; ?>" <?php echo $row['mb_certify'] == 'hp' ? 'checked' : ''; ?>>
<label for="mb_certify_hp_<?php echo $i; ?>">휴대폰</label><br>
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="ipin" id="mb_certify_ipin_<?php echo $i; ?>" <?php echo $row['mb_certify'] == 'ipin' ? 'checked' : ''; ?>>
<label for="mb_certify_ipin_<?php echo $i; ?>">아이핀</label>
</td>
<td headers="mb_list_mailc"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '<span class="txt_true">Yes</span>' : '<span class="txt_false">No</span>'; ?></td>
<td headers="mb_list_open">
<label for="mb_open_<?php echo $i; ?>" class="sound_only">정보공개</label>
<input type="checkbox" name="mb_open[<?php echo $i; ?>]" <?php echo $row['mb_open'] ? 'checked' : ''; ?> value="1" id="mb_open_<?php echo $i; ?>">
</td>
<td headers="mb_list_mailr">
<label for="mb_mailling_<?php echo $i; ?>" class="sound_only">메일수신</label>
<input type="checkbox" name="mb_mailling[<?php echo $i; ?>]" <?php echo $row['mb_mailling'] ? 'checked' : ''; ?> value="1" id="mb_mailling_<?php echo $i; ?>">
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php
if ($leave_msg || $intercept_msg) {
echo $leave_msg . ' ' . $intercept_msg;
} else {
echo "정상";
}
?>
</td>
<td headers="mb_list_mobile" class="td_tel"><?php echo get_text($row['mb_hp']); ?></td>
<td headers="mb_list_lastcall" class="td_date"><?php echo substr($row['mb_today_login'], 2, 8); ?></td>
<td headers="mb_list_grp" class="td_numsmall"><?php echo $group ?></td>
<td headers="mb_list_mng" rowspan="2" class="td_mng td_mng_s"><?php echo $s_mod ?><?php echo $s_grp ?></td>
</tr>
<tr class="<?php echo $bg; ?>">
<td headers="mb_list_name" class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td headers="mb_list_nick" class="td_name sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td headers="mb_list_sms">
<label for="mb_sms_<?php echo $i; ?>" class="sound_only">SMS수신</label>
<input type="checkbox" name="mb_sms[<?php echo $i; ?>]" <?php echo $row['mb_sms'] ? 'checked' : ''; ?> value="1" id="mb_sms_<?php echo $i; ?>">
</td>
<td headers="mb_list_adultc">
<label for="mb_adult_<?php echo $i; ?>" class="sound_only">성인인증</label>
<input type="checkbox" name="mb_adult[<?php echo $i; ?>]" <?php echo $row['mb_adult'] ? 'checked' : ''; ?> value="1" id="mb_adult_<?php echo $i; ?>">
</td>
<td headers="mb_list_deny">
<?php if (empty($row['mb_leave_date'])) { ?>
<input type="checkbox" name="mb_intercept_date[<?php echo $i; ?>]" <?php echo $row['mb_intercept_date'] ? 'checked' : ''; ?> value="<?php echo $intercept_date ?>" id="mb_intercept_date_<?php echo $i ?>" title="<?php echo $intercept_title ?>">
<label for="mb_intercept_date_<?php echo $i; ?>" class="sound_only">접근차단</label>
<?php } ?>
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php echo get_member_level_select("mb_level[$i]", 1, $member['mb_level'], $row['mb_level']) ?>
</td>
<td headers="mb_list_tel" class="td_tel"><?php echo get_text($row['mb_tel']); ?></td>
<td headers="mb_list_join" class="td_date"><?php echo substr($row['mb_datetime'], 2, 8); ?></td>
<td headers="mb_list_point" class="td_num"><a href="point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td>
</tr>
<?php
} }
} if ($i == 0) {
?> echo "<tr><td colspan=\"" . $colspan . "\" class=\"empty_table\">자료가 없습니다.</td></tr>";
</td> }
<td headers="mb_list_cert" rowspan="2" class="td_mbcert"> ?>
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="simple" id="mb_certify_sa_<?php echo $i; ?>" <?php echo $row['mb_certify']=='simple'?'checked':''; ?>> </tbody>
<label for="mb_certify_sa_<?php echo $i; ?>">간편인증</label><br> </table>
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="hp" id="mb_certify_hp_<?php echo $i; ?>" <?php echo $row['mb_certify']=='hp'?'checked':''; ?>> </div>
<label for="mb_certify_hp_<?php echo $i; ?>">휴대폰</label><br>
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="ipin" id="mb_certify_ipin_<?php echo $i; ?>" <?php echo $row['mb_certify']=='ipin'?'checked':''; ?>>
<label for="mb_certify_ipin_<?php echo $i; ?>">아이핀</label>
</td>
<td headers="mb_list_mailc"><?php echo preg_match('/[1-9]/', $row['mb_email_certify'])?'<span class="txt_true">Yes</span>':'<span class="txt_false">No</span>'; ?></td>
<td headers="mb_list_open">
<label for="mb_open_<?php echo $i; ?>" class="sound_only">정보공개</label>
<input type="checkbox" name="mb_open[<?php echo $i; ?>]" <?php echo $row['mb_open']?'checked':''; ?> value="1" id="mb_open_<?php echo $i; ?>">
</td>
<td headers="mb_list_mailr">
<label for="mb_mailling_<?php echo $i; ?>" class="sound_only">메일수신</label>
<input type="checkbox" name="mb_mailling[<?php echo $i; ?>]" <?php echo $row['mb_mailling']?'checked':''; ?> value="1" id="mb_mailling_<?php echo $i; ?>">
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php
if ($leave_msg || $intercept_msg) echo $leave_msg.' '.$intercept_msg;
else echo "정상";
?>
</td>
<td headers="mb_list_mobile" class="td_tel"><?php echo get_text($row['mb_hp']); ?></td>
<td headers="mb_list_lastcall" class="td_date"><?php echo substr($row['mb_today_login'],2,8); ?></td>
<td headers="mb_list_grp" class="td_numsmall"><?php echo $group ?></td>
<td headers="mb_list_mng" rowspan="2" class="td_mng td_mng_s"><?php echo $s_mod ?><?php echo $s_grp ?></td>
</tr>
<tr class="<?php echo $bg; ?>">
<td headers="mb_list_name" class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
<td headers="mb_list_nick" class="td_name sv_use"><div><?php echo $mb_nick ?></div></td>
<td headers="mb_list_sms">
<label for="mb_sms_<?php echo $i; ?>" class="sound_only">SMS수신</label>
<input type="checkbox" name="mb_sms[<?php echo $i; ?>]" <?php echo $row['mb_sms']?'checked':''; ?> value="1" id="mb_sms_<?php echo $i; ?>">
</td>
<td headers="mb_list_adultc">
<label for="mb_adult_<?php echo $i; ?>" class="sound_only">성인인증</label>
<input type="checkbox" name="mb_adult[<?php echo $i; ?>]" <?php echo $row['mb_adult']?'checked':''; ?> value="1" id="mb_adult_<?php echo $i; ?>">
</td>
<td headers="mb_list_deny">
<?php if(empty($row['mb_leave_date'])){ ?>
<input type="checkbox" name="mb_intercept_date[<?php echo $i; ?>]" <?php echo $row['mb_intercept_date']?'checked':''; ?> value="<?php echo $intercept_date ?>" id="mb_intercept_date_<?php echo $i ?>" title="<?php echo $intercept_title ?>">
<label for="mb_intercept_date_<?php echo $i; ?>" class="sound_only">접근차단</label>
<?php } ?>
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php echo get_member_level_select("mb_level[$i]", 1, $member['mb_level'], $row['mb_level']) ?>
</td>
<td headers="mb_list_tel" class="td_tel"><?php echo get_text($row['mb_tel']); ?></td>
<td headers="mb_list_join" class="td_date"><?php echo substr($row['mb_datetime'],2,8); ?></td>
<td headers="mb_list_point" class="td_num"><a href="point_list.php?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo number_format($row['mb_point']) ?></a></td>
</tr> <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">
<?php if ($is_admin == 'super') { ?>
<a href="./member_form.php" id="member_add" class="btn btn_01">회원추가</a>
<?php } ?>
<?php </div>
}
if ($i == 0)
echo "<tr><td colspan=\"".$colspan."\" 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">
<?php if ($is_admin == 'super') { ?>
<a href="./member_form.php" id="member_add" class="btn btn_01">회원추가</a>
<?php } ?>
</div>
</form> </form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, '?'.$qstr.'&amp;page='); ?> <?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, '?' . $qstr . '&amp;page='); ?>
<script> <script>
function fmemberlist_submit(f) function fmemberlist_submit(f) {
{ if (!is_checked("chk[]")) {
if (!is_checked("chk[]")) { alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false; return false;
} }
}
return true; if (document.pressed == "선택삭제") {
} if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script> </script>
<?php <?php
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,6 +1,6 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once("./_common.php"); require_once "./_common.php";
check_demo(); check_demo();
@ -9,8 +9,7 @@ auth_check_menu($auth, $sub_menu, "d");
check_admin_token(); check_admin_token();
$msg = ""; $msg = "";
for ($i=0; $i<count($chk); $i++) for ($i = 0; $i < count($chk); $i++) {
{
// 실제 번호를 넘김 // 실제 번호를 넘김
$k = $_POST['chk'][$i]; $k = $_POST['chk'][$i];
@ -18,11 +17,11 @@ for ($i=0; $i<count($chk); $i++)
if (!$mb['mb_id']) { if (!$mb['mb_id']) {
$msg .= "{$mb['mb_id']} : 회원자료가 존재하지 않습니다.\\n"; $msg .= "{$mb['mb_id']} : 회원자료가 존재하지 않습니다.\\n";
} else if ($member['mb_id'] == $mb['mb_id']) { } elseif ($member['mb_id'] == $mb['mb_id']) {
$msg .= "{$mb['mb_id']} : 로그인 중인 관리자는 삭제 할 수 없습니다.\\n"; $msg .= "{$mb['mb_id']} : 로그인 중인 관리자는 삭제 할 수 없습니다.\\n";
} else if (is_admin($mb['mb_id']) == "super") { } elseif (is_admin($mb['mb_id']) == "super") {
$msg .= "{$mb['mb_id']} : 최고 관리자는 삭제할 수 없습니다.\\n"; $msg .= "{$mb['mb_id']} : 최고 관리자는 삭제할 수 없습니다.\\n";
} else if ($is_admin != "super" && $mb['mb_level'] >= $member['mb_level']) { } elseif ($is_admin != "super" && $mb['mb_level'] >= $member['mb_level']) {
$msg .= "{$mb['mb_id']} : 자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다.\\n"; $msg .= "{$mb['mb_id']} : 자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다.\\n";
} else { } else {
// 회원자료 삭제 // 회원자료 삭제
@ -30,7 +29,8 @@ for ($i=0; $i<count($chk); $i++)
} }
} }
if ($msg) if ($msg) {
echo "<script type='text/javascript'> alert('$msg'); </script>"; echo "<script type='text/javascript'> alert('$msg'); </script>";
}
goto_url("./member_list.php?$qstr"); goto_url("./member_list.php?$qstr");

View File

@ -1,11 +1,11 @@
<?php <?php
$sub_menu = "200100"; $sub_menu = "200100";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
if (! (isset($_POST['chk']) && is_array($_POST['chk']))) { if (!(isset($_POST['chk']) && is_array($_POST['chk']))) {
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요."); alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요.");
} }
auth_check_menu($auth, $sub_menu, 'w'); auth_check_menu($auth, $sub_menu, 'w');
@ -16,12 +16,10 @@ $mb_datas = array();
$msg = ''; $msg = '';
if ($_POST['act_button'] == "선택수정") { if ($_POST['act_button'] == "선택수정") {
for ($i = 0; $i < count($_POST['chk']); $i++) {
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김 // 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0; $k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$post_mb_certify = (isset($_POST['mb_certify'][$k]) && $_POST['mb_certify'][$k]) ? clean_xss_tags($_POST['mb_certify'][$k], 1, 1, 20) : ''; $post_mb_certify = (isset($_POST['mb_certify'][$k]) && $_POST['mb_certify'][$k]) ? clean_xss_tags($_POST['mb_certify'][$k], 1, 1, 20) : '';
$post_mb_level = isset($_POST['mb_level'][$k]) ? (int) $_POST['mb_level'][$k] : 0; $post_mb_level = isset($_POST['mb_level'][$k]) ? (int) $_POST['mb_level'][$k] : 0;
$post_mb_intercept_date = (isset($_POST['mb_intercept_date'][$k]) && $_POST['mb_intercept_date'][$k]) ? clean_xss_tags($_POST['mb_intercept_date'][$k], 1, 1, 8) : ''; $post_mb_intercept_date = (isset($_POST['mb_intercept_date'][$k]) && $_POST['mb_intercept_date'][$k]) ? clean_xss_tags($_POST['mb_intercept_date'][$k], 1, 1, 8) : '';
@ -31,48 +29,46 @@ if ($_POST['act_button'] == "선택수정") {
$mb_datas[] = $mb = get_member($_POST['mb_id'][$k]); $mb_datas[] = $mb = get_member($_POST['mb_id'][$k]);
if (! (isset($mb['mb_id']) && $mb['mb_id'])) { if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
$msg .= $mb['mb_id'].' : 회원자료가 존재하지 않습니다.\\n'; $msg .= $mb['mb_id'] . ' : 회원자료가 존재하지 않습니다.\\n';
} else if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) { } elseif ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) {
$msg .= $mb['mb_id'].' : 자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.\\n'; $msg .= $mb['mb_id'] . ' : 자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.\\n';
} else if ($member['mb_id'] == $mb['mb_id']) { } elseif ($member['mb_id'] == $mb['mb_id']) {
$msg .= $mb['mb_id'].' : 로그인 중인 관리자는 수정 할 수 없습니다.\\n'; $msg .= $mb['mb_id'] . ' : 로그인 중인 관리자는 수정 할 수 없습니다.\\n';
} else { } else {
if($post_mb_certify) if ($post_mb_certify) {
$mb_adult = isset($_POST['mb_adult'][$k]) ? (int) $_POST['mb_adult'][$k] : 0; $mb_adult = isset($_POST['mb_adult'][$k]) ? (int) $_POST['mb_adult'][$k] : 0;
else } else {
$mb_adult = 0; $mb_adult = 0;
}
$sql = " update {$g5['member_table']} $sql = " update {$g5['member_table']}
set mb_level = '".$post_mb_level."', set mb_level = '" . $post_mb_level . "',
mb_intercept_date = '".sql_real_escape_string($post_mb_intercept_date)."', mb_intercept_date = '" . sql_real_escape_string($post_mb_intercept_date) . "',
mb_mailling = '".$post_mb_mailling."', mb_mailling = '" . $post_mb_mailling . "',
mb_sms = '".$post_mb_sms."', mb_sms = '" . $post_mb_sms . "',
mb_open = '".$post_mb_open."', mb_open = '" . $post_mb_open . "',
mb_certify = '".sql_real_escape_string($post_mb_certify)."', mb_certify = '" . sql_real_escape_string($post_mb_certify) . "',
mb_adult = '{$mb_adult}' mb_adult = '{$mb_adult}'
where mb_id = '".sql_real_escape_string($mb['mb_id'])."' "; where mb_id = '" . sql_real_escape_string($mb['mb_id']) . "' ";
sql_query($sql); sql_query($sql);
} }
} }
} elseif ($_POST['act_button'] == "선택삭제") {
} else if ($_POST['act_button'] == "선택삭제") { for ($i = 0; $i < count($_POST['chk']); $i++) {
for ($i=0; $i<count($_POST['chk']); $i++)
{
// 실제 번호를 넘김 // 실제 번호를 넘김
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0; $k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
$mb_datas[] = $mb = get_member($_POST['mb_id'][$k]); $mb_datas[] = $mb = get_member($_POST['mb_id'][$k]);
if (!$mb['mb_id']) { if (!$mb['mb_id']) {
$msg .= $mb['mb_id'].' : 회원자료가 존재하지 않습니다.\\n'; $msg .= $mb['mb_id'] . ' : 회원자료가 존재하지 않습니다.\\n';
} else if ($member['mb_id'] == $mb['mb_id']) { } elseif ($member['mb_id'] == $mb['mb_id']) {
$msg .= $mb['mb_id'].' : 로그인 중인 관리자는 삭제 할 수 없습니다.\\n'; $msg .= $mb['mb_id'] . ' : 로그인 중인 관리자는 삭제 할 수 없습니다.\\n';
} else if (is_admin($mb['mb_id']) == 'super') { } elseif (is_admin($mb['mb_id']) == 'super') {
$msg .= $mb['mb_id'].' : 최고 관리자는 삭제할 수 없습니다.\\n'; $msg .= $mb['mb_id'] . ' : 최고 관리자는 삭제할 수 없습니다.\\n';
} else if ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) { } elseif ($is_admin != 'super' && $mb['mb_level'] >= $member['mb_level']) {
$msg .= $mb['mb_id'].' : 자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다.\\n'; $msg .= $mb['mb_id'] . ' : 자신보다 권한이 높거나 같은 회원은 삭제할 수 없습니다.\\n';
} else { } else {
// 회원자료 삭제 // 회원자료 삭제
member_delete($mb['mb_id']); member_delete($mb['mb_id']);
@ -80,10 +76,11 @@ if ($_POST['act_button'] == "선택수정") {
} }
} }
if ($msg) if ($msg) {
//echo '<script> alert("'.$msg.'"); </script>'; //echo '<script> alert("'.$msg.'"); </script>';
alert($msg); alert($msg);
}
run_event('admin_member_list_update', $_POST['act_button'], $mb_datas); run_event('admin_member_list_update', $_POST['act_button'], $mb_datas);
goto_url('./member_list.php?'.$qstr); goto_url('./member_list.php?' . $qstr);

View File

@ -1,22 +1,24 @@
<?php <?php
$sub_menu = "100290"; $sub_menu = "100290";
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert_close('최고관리자만 접근 가능합니다.'); alert_close('최고관리자만 접근 가능합니다.');
}
$g5['title'] = '메뉴 추가'; $g5['title'] = '메뉴 추가';
include_once(G5_PATH.'/head.sub.php'); require_once G5_PATH . '/head.sub.php';
$new = isset($_GET['new']) ? clean_xss_tags($_GET['new'], 1, 1) : ''; $new = isset($_GET['new']) ? clean_xss_tags($_GET['new'], 1, 1) : '';
$code = isset($_GET['code']) ? preg_replace('/[^0-9a-zA-Z]/', '', $_GET['code']) : ''; $code = isset($_GET['code']) ? (string)preg_replace('/[^0-9a-zA-Z]/', '', $_GET['code']) : '';
// 코드 // 코드
if($new == 'new' || !$code) { if ($new == 'new' || !$code) {
$code = base_convert(substr($code,0, 2), 36, 10); $code = (int)base_convert(substr($code, 0, 2), 36, 10);
$code += 36; $code += 36;
$code = base_convert($code, 10, 36); $code = base_convert((string)$code, 10, 36);
} }
?> ?>
<div id="menu_frm" class="new_win"> <div id="menu_frm" class="new_win">
@ -24,174 +26,174 @@ if($new == 'new' || !$code) {
<form name="fmenuform" id="fmenuform" class="new_win_con"> <form name="fmenuform" id="fmenuform" class="new_win_con">
<div class="new_win_desc"> <div class="new_win_desc">
<label for="me_type">대상선택</label> <label for="me_type">대상선택</label>
<select name="me_type" id="me_type"> <select name="me_type" id="me_type">
<option value="">직접입력</option> <option value="">직접입력</option>
<option value="group">게시판그룹</option> <option value="group">게시판그룹</option>
<option value="board">게시판</option> <option value="board">게시판</option>
<option value="content">내용관리</option> <option value="content">내용관리</option>
</select> </select>
</div> </div>
<div id="menu_result"></div> <div id="menu_result"></div>
</form> </form>
</div> </div>
<script> <script>
$(function() { $(function() {
$("#menu_result").load( $("#menu_result").load(
"./menu_form_search.php" "./menu_form_search.php"
);
function link_checks_all_chage(){
var $links = $(opener.document).find("#menulist input[name='me_link[]']"),
$o_link = $(".td_mngsmall input[name='link[]']"),
hrefs = [],
menu_exist = false;
if( $links.length ){
$links.each(function( index ) {
hrefs.push( $(this).val() );
});
$o_link.each(function( index ) {
if( $.inArray( $(this).val(), hrefs ) != -1 ){
$(this).closest("tr").find("td:eq( 0 )").addClass("exist_menu_link");
menu_exist = true;
}
});
}
if( menu_exist ){
$(".menu_exists_tip").show();
} else {
$(".menu_exists_tip").hide();
}
}
function menu_result_change( type ){
var dfd = new $.Deferred();
$("#menu_result").empty().load(
"./menu_form_search.php",
{ type : type },
function(){
dfd.resolve('Finished');
}
); );
return dfd.promise(); function link_checks_all_chage() {
}
$("#me_type").on("change", function() { var $links = $(opener.document).find("#menulist input[name='me_link[]']"),
var type = $(this).val(); $o_link = $(".td_mngsmall input[name='link[]']"),
hrefs = [],
menu_exist = false;
var promise = menu_result_change( type ); if ($links.length) {
$links.each(function(index) {
hrefs.push($(this).val());
});
$o_link.each(function(index) {
if ($.inArray($(this).val(), hrefs) != -1) {
$(this).closest("tr").find("td:eq( 0 )").addClass("exist_menu_link");
menu_exist = true;
}
});
}
if (menu_exist) {
$(".menu_exists_tip").show();
} else {
$(".menu_exists_tip").hide();
}
}
function menu_result_change(type) {
var dfd = new $.Deferred();
$("#menu_result").empty().load(
"./menu_form_search.php", {
type: type
},
function() {
dfd.resolve('Finished');
}
);
return dfd.promise();
}
$("#me_type").on("change", function() {
var type = $(this).val();
var promise = menu_result_change(type);
promise.done(function(message) {
link_checks_all_chage(type);
});
promise.done(function(message) {
link_checks_all_chage(type);
}); });
$(document).on("click", "#add_manual", function() {
var me_name = $.trim($("#me_name").val());
var me_link = $.trim($("#me_link").val());
add_menu_list(me_name, me_link, "<?php echo $code; ?>");
});
$(document).on("click", ".add_select", function() {
var me_name = $.trim($(this).siblings("input[name='subject[]']").val());
var me_link = $.trim($(this).siblings("input[name='link[]']").val());
add_menu_list(me_name, me_link, "<?php echo $code; ?>");
});
}); });
$(document).on("click", "#add_manual", function() { function add_menu_list(name, link, code) {
var me_name = $.trim($("#me_name").val()); var $menulist = $("#menulist", opener.document);
var me_link = $.trim($("#me_link").val()); var ms = new Date().getTime();
var sub_menu_class;
<?php if ($new == 'new') { ?>
sub_menu_class = " class=\"td_category\"";
<?php } else { ?>
sub_menu_class = " class=\"td_category sub_menu_class\"";
<?php } ?>
add_menu_list(me_name, me_link, "<?php echo $code; ?>"); var list = "<tr class=\"menu_list menu_group_<?php echo $code; ?>\">";
}); list += "<td" + sub_menu_class + ">";
list += "<label for=\"me_name_" + ms + "\" class=\"sound_only\">메뉴<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"hidden\" name=\"code[]\" value=\"<?php echo $code; ?>\">";
list += "<input type=\"text\" name=\"me_name[]\" value=\"" + name + "\" id=\"me_name_" + ms + "\" required class=\"required frm_input full_input\">";
list += "</td>";
list += "<td>";
list += "<label for=\"me_link_" + ms + "\" class=\"sound_only\">링크<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"text\" name=\"me_link[]\" value=\"" + link + "\" id=\"me_link_" + ms + "\" required class=\"required frm_input full_input\">";
list += "</td>";
list += "<td class=\"td_mng\">";
list += "<label for=\"me_target_" + ms + "\" class=\"sound_only\">새창</label>";
list += "<select name=\"me_target[]\" id=\"me_target_" + ms + "\">";
list += "<option value=\"self\">사용안함</option>";
list += "<option value=\"blank\">사용함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_numsmall\">";
list += "<label for=\"me_order_" + ms + "\" class=\"sound_only\">순서<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"text\" name=\"me_order[]\" value=\"0\" id=\"me_order_" + ms + "\" required class=\"required frm_input\" size=\"5\">";
list += "</td>";
list += "<td class=\"td_mngsmall\">";
list += "<label for=\"me_use_" + ms + "\" class=\"sound_only\">PC사용</label>";
list += "<select name=\"me_use[]\" id=\"me_use_" + ms + "\">";
list += "<option value=\"1\">사용함</option>";
list += "<option value=\"0\">사용안함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_mngsmall\">";
list += "<label for=\"me_mobile_use_" + ms + "\" class=\"sound_only\">모바일사용</label>";
list += "<select name=\"me_mobile_use[]\" id=\"me_mobile_use_" + ms + "\">";
list += "<option value=\"1\">사용함</option>";
list += "<option value=\"0\">사용안함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_mng\">";
<?php if ($new == 'new') { ?>
list += "<button type=\"button\" class=\"btn_add_submenu btn_03\">추가</button>\n";
<?php } ?>
list += "<button type=\"button\" class=\"btn_del_menu btn_02\">삭제</button>";
list += "</td>";
list += "</tr>";
$(document).on("click", ".add_select", function() { var $menu_last = null;
var me_name = $.trim($(this).siblings("input[name='subject[]']").val());
var me_link = $.trim($(this).siblings("input[name='link[]']").val());
add_menu_list(me_name, me_link, "<?php echo $code; ?>"); if (code)
}); $menu_last = $menulist.find("tr.menu_group_" + code + ":last");
}); else
$menu_last = $menulist.find("tr.menu_list:last");
function add_menu_list(name, link, code) if ($menu_last.length > 0) {
{ $menu_last.after(list);
var $menulist = $("#menulist", opener.document); } else {
var ms = new Date().getTime(); if ($menulist.find("#empty_menu_list").length > 0)
var sub_menu_class; $menulist.find("#empty_menu_list").remove();
<?php if($new == 'new') { ?>
sub_menu_class = " class=\"td_category\"";
<?php } else { ?>
sub_menu_class = " class=\"td_category sub_menu_class\"";
<?php } ?>
var list = "<tr class=\"menu_list menu_group_<?php echo $code; ?>\">"; $menulist.find("table tbody").append(list);
list += "<td"+sub_menu_class+">"; }
list += "<label for=\"me_name_"+ms+"\" class=\"sound_only\">메뉴<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"hidden\" name=\"code[]\" value=\"<?php echo $code; ?>\">";
list += "<input type=\"text\" name=\"me_name[]\" value=\""+name+"\" id=\"me_name_"+ms+"\" required class=\"required frm_input full_input\">";
list += "</td>";
list += "<td>";
list += "<label for=\"me_link_"+ms+"\" class=\"sound_only\">링크<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"text\" name=\"me_link[]\" value=\""+link+"\" id=\"me_link_"+ms+"\" required class=\"required frm_input full_input\">";
list += "</td>";
list += "<td class=\"td_mng\">";
list += "<label for=\"me_target_"+ms+"\" class=\"sound_only\">새창</label>";
list += "<select name=\"me_target[]\" id=\"me_target_"+ms+"\">";
list += "<option value=\"self\">사용안함</option>";
list += "<option value=\"blank\">사용함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_numsmall\">";
list += "<label for=\"me_order_"+ms+"\" class=\"sound_only\">순서<strong class=\"sound_only\"> 필수</strong></label>";
list += "<input type=\"text\" name=\"me_order[]\" value=\"0\" id=\"me_order_"+ms+"\" required class=\"required frm_input\" size=\"5\">";
list += "</td>";
list += "<td class=\"td_mngsmall\">";
list += "<label for=\"me_use_"+ms+"\" class=\"sound_only\">PC사용</label>";
list += "<select name=\"me_use[]\" id=\"me_use_"+ms+"\">";
list += "<option value=\"1\">사용함</option>";
list += "<option value=\"0\">사용안함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_mngsmall\">";
list += "<label for=\"me_mobile_use_"+ms+"\" class=\"sound_only\">모바일사용</label>";
list += "<select name=\"me_mobile_use[]\" id=\"me_mobile_use_"+ms+"\">";
list += "<option value=\"1\">사용함</option>";
list += "<option value=\"0\">사용안함</option>";
list += "</select>";
list += "</td>";
list += "<td class=\"td_mng\">";
<?php if($new == 'new') { ?>
list += "<button type=\"button\" class=\"btn_add_submenu btn_03\">추가</button>\n";
<?php } ?>
list += "<button type=\"button\" class=\"btn_del_menu btn_02\">삭제</button>";
list += "</td>";
list += "</tr>";
var $menu_last = null; $menulist.find("tr.menu_list").each(function(index) {
$(this).removeClass("bg0 bg1")
.addClass("bg" + (index % 2));
});
if(code) window.close();
$menu_last = $menulist.find("tr.menu_group_"+code+":last");
else
$menu_last = $menulist.find("tr.menu_list:last");
if($menu_last.length > 0) {
$menu_last.after(list);
} else {
if($menulist.find("#empty_menu_list").length > 0)
$menulist.find("#empty_menu_list").remove();
$menulist.find("table tbody").append(list);
} }
$menulist.find("tr.menu_list").each(function(index) {
$(this).removeClass("bg0 bg1")
.addClass("bg"+(index % 2));
});
window.close();
}
</script> </script>
<?php <?php
include_once(G5_PATH.'/tail.sub.php'); require_once G5_PATH . '/tail.sub.php';

View File

@ -1,12 +1,13 @@
<?php <?php
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
die('최고관리자만 접근 가능합니다.'); die('최고관리자만 접근 가능합니다.');
}
$type = isset($_REQUEST['type']) ? preg_replace('/[^0-9a-z_]/i', '', $_REQUEST['type']) : ''; $type = isset($_REQUEST['type']) ? preg_replace('/[^0-9a-z_]/i', '', $_REQUEST['type']) : '';
switch($type) { switch ($type) {
case 'group': case 'group':
$sql = " select gr_id as id, gr_subject as subject $sql = " select gr_id as id, gr_subject as subject
from {$g5['group_table']} from {$g5['group_table']}
@ -27,32 +28,31 @@ switch($type) {
break; break;
} }
if($sql) { if ($sql) {
$result = sql_query($sql); $result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
if($i == 0) { if ($i == 0) {
$bbs_subject_title = ($type == 'board') ? '게시판제목' : '제목';
$bbs_subject_title = ($type == 'board') ? '게시판제목' : '제목'; ?>
?>
<div class="tbl_head01 tbl_wrap"> <div class="tbl_head01 tbl_wrap">
<table> <table>
<thead> <thead>
<tr> <tr>
<th scope="col"><?php echo $bbs_subject_title; ?></th> <th scope="col"><?php echo $bbs_subject_title; ?></th>
<?php if($type == 'board'){ ?> <?php if ($type == 'board') { ?>
<th scope="col">게시판 그룹</th> <th scope="col">게시판 그룹</th>
<?php } ?> <?php } ?>
<th scope="col">선택</th> <th scope="col">선택</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php } <?php }
switch($type) { switch ($type) {
case 'group': case 'group':
$link = G5_BBS_URL.'/group.php?gr_id='.$row['id']; $link = G5_BBS_URL . '/group.php?gr_id=' . $row['id'];
break; break;
case 'board': case 'board':
$link = get_pretty_url($row['id']); $link = get_pretty_url($row['id']);
@ -64,26 +64,26 @@ if($sql) {
$link = ''; $link = '';
break; break;
} }
?>
<tr>
<td><?php echo $row['subject']; ?></td>
<?php
if($type == 'board'){
$group = get_call_func_cache('get_group', array($row['gr_id']));
?> ?>
<td><?php echo $group['gr_subject']; ?></td>
<?php } ?>
<td class="td_mngsmall">
<input type="hidden" name="subject[]" value="<?php echo preg_replace('/[\'\"]/', '', $row['subject']); ?>">
<input type="hidden" name="link[]" value="<?php echo $link; ?>">
<button type="button" class="add_select btn btn_03"><span class="sound_only"><?php echo $row['subject']; ?> </span>선택</button>
</td>
</tr>
<?php } ?> <tr>
<td><?php echo $row['subject']; ?></td>
<?php
if ($type == 'board') {
$group = get_call_func_cache('get_group', array($row['gr_id']));
?>
<td><?php echo $group['gr_subject']; ?></td>
<?php } ?>
<td class="td_mngsmall">
<input type="hidden" name="subject[]" value="<?php echo preg_replace('/[\'\"]/', '', $row['subject']); ?>">
<input type="hidden" name="link[]" value="<?php echo $link; ?>">
<button type="button" class="add_select btn btn_03"><span class="sound_only"><?php echo $row['subject']; ?> </span>선택</button>
</td>
</tr>
</tbody> <?php } ?>
</tbody>
</table> </table>
</div> </div>
@ -96,26 +96,25 @@ if($sql) {
</div> </div>
<?php } else { ?> <?php } else { ?>
<div class="tbl_frm01 tbl_wrap"> <div class="tbl_frm01 tbl_wrap">
<table> <table>
<colgroup> <colgroup>
<col class="grid_2"> <col class="grid_2">
<col> <col>
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<th scope="row"><label for="me_name">메뉴<strong class="sound_only"> 필수</strong></label></th> <th scope="row"><label for="me_name">메뉴<strong class="sound_only"> 필수</strong></label></th>
<td><input type="text" name="me_name" id="me_name" required class="frm_input required"></td> <td><input type="text" name="me_name" id="me_name" required class="frm_input required"></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="me_link">링크<strong class="sound_only"> 필수</strong></label></th> <th scope="row"><label for="me_link">링크<strong class="sound_only"> 필수</strong></label></th>
<td> <td>
<?php echo help('링크는 http://를 포함해서 입력해 주세요.'); ?> <?php echo help('링크는 http://를 포함해서 입력해 주세요.'); ?>
<input type="text" name="me_link" id="me_link" required class="frm_input full_input required"> <input type="text" name="me_link" id="me_link" required class="frm_input full_input required">
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -1,17 +1,19 @@
<?php <?php
$sub_menu = "100290"; $sub_menu = "100290";
include_once('./_common.php'); require_once './_common.php';
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
// 메뉴테이블 생성 // 메뉴테이블 생성
if( !isset($g5['menu_table']) ){ if (!isset($g5['menu_table'])) {
die('<meta charset="utf-8">dbconfig.php 파일에 <strong>$g5[\'menu_table\'] = G5_TABLE_PREFIX.\'menu\';</strong> 를 추가해 주세요.'); die('<meta charset="utf-8">dbconfig.php 파일에 <strong>$g5[\'menu_table\'] = G5_TABLE_PREFIX.\'menu\';</strong> 를 추가해 주세요.');
} }
if(!sql_query(" DESCRIBE {$g5['menu_table']} ", false)) { if (!sql_query(" DESCRIBE {$g5['menu_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['menu_table']}` ( sql_query(
" CREATE TABLE IF NOT EXISTS `{$g5['menu_table']}` (
`me_id` int(11) NOT NULL AUTO_INCREMENT, `me_id` int(11) NOT NULL AUTO_INCREMENT,
`me_code` varchar(255) NOT NULL DEFAULT '', `me_code` varchar(255) NOT NULL DEFAULT '',
`me_name` varchar(255) NOT NULL DEFAULT '', `me_name` varchar(255) NOT NULL DEFAULT '',
@ -21,14 +23,16 @@ if(!sql_query(" DESCRIBE {$g5['menu_table']} ", false)) {
`me_use` tinyint(4) NOT NULL DEFAULT '0', `me_use` tinyint(4) NOT NULL DEFAULT '0',
`me_mobile_use` tinyint(4) NOT NULL DEFAULT '0', `me_mobile_use` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`me_id`) PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true); ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
true
);
} }
$sql = " select * from {$g5['menu_table']} order by me_id "; $sql = " select * from {$g5['menu_table']} order by me_id ";
$result = sql_query($sql); $result = sql_query($sql);
$g5['title'] = "메뉴설정"; $g5['title'] = "메뉴설정";
include_once('./admin.head.php'); require_once './admin.head.php';
$colspan = 7; $colspan = 7;
$sub_menu_info = ''; $sub_menu_info = '';
@ -39,181 +43,178 @@ $sub_menu_info = '';
</div> </div>
<form name="fmenulist" id="fmenulist" method="post" action="./menu_list_update.php" onsubmit="return fmenulist_submit(this);"> <form name="fmenulist" id="fmenulist" method="post" action="./menu_list_update.php" onsubmit="return fmenulist_submit(this);">
<input type="hidden" name="token" value=""> <input type="hidden" name="token" value="">
<div id="menulist" class="tbl_head01 tbl_wrap"> <div id="menulist" class="tbl_head01 tbl_wrap">
<table> <table>
<caption><?php echo $g5['title']; ?> 목록</caption> <caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <thead>
<tr> <tr>
<th scope="col">메뉴</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> <th scope="col">순서</th>
<th scope="col">PC사용</th> <th scope="col">PC사용</th>
<th scope="col">모바일사용</th> <th scope="col">모바일사용</th>
<th scope="col">관리</th> <th scope="col">관리</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) for ($i = 0; $row = sql_fetch_array($result); $i++) {
{ $bg = 'bg' . ($i % 2);
$bg = 'bg'.($i%2); $sub_menu_class = '';
$sub_menu_class = ''; if (strlen($row['me_code']) == 4) {
if(strlen($row['me_code']) == 4) { $sub_menu_class = ' sub_menu_class';
$sub_menu_class = ' sub_menu_class'; $sub_menu_info = '<span class="sound_only">' . $row['me_name'] . '의 서브</span>';
$sub_menu_info = '<span class="sound_only">'.$row['me_name'].'의 서브</span>'; $sub_menu_ico = '<span class="sub_menu_ico"></span>';
$sub_menu_ico = '<span class="sub_menu_ico"></span>'; }
}
$search = array('"', "'"); $search = array('"', "'");
$replace = array('&#034;', '&#039;'); $replace = array('&#034;', '&#039;');
$me_name = str_replace($search, $replace, $row['me_name']); $me_name = str_replace($search, $replace, $row['me_name']);
?> ?>
<tr class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>"> <tr class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>">
<td class="td_category<?php echo $sub_menu_class; ?>"> <td class="td_category<?php echo $sub_menu_class; ?>">
<input type="hidden" name="code[]" value="<?php echo substr($row['me_code'], 0, 2) ?>"> <input type="hidden" name="code[]" value="<?php echo substr($row['me_code'], 0, 2) ?>">
<label for="me_name_<?php echo $i; ?>" class="sound_only"><?php echo $sub_menu_info; ?> 메뉴<strong class="sound_only"> 필수</strong></label> <label for="me_name_<?php echo $i; ?>" class="sound_only"><?php echo $sub_menu_info; ?> 메뉴<strong class="sound_only"> 필수</strong></label>
<input type="text" name="me_name[]" value="<?php echo get_sanitize_input($me_name); ?>" id="me_name_<?php echo $i; ?>" required class="required tbl_input full_input"> <input type="text" name="me_name[]" value="<?php echo get_sanitize_input($me_name); ?>" id="me_name_<?php echo $i; ?>" required class="required tbl_input full_input">
</td> </td>
<td> <td>
<label for="me_link_<?php echo $i; ?>" class="sound_only">링크<strong class="sound_only"> 필수</strong></label> <label for="me_link_<?php echo $i; ?>" class="sound_only">링크<strong class="sound_only"> 필수</strong></label>
<input type="text" name="me_link[]" value="<?php echo $row['me_link'] ?>" id="me_link_<?php echo $i; ?>" required class="required tbl_input full_input"> <input type="text" name="me_link[]" value="<?php echo $row['me_link'] ?>" id="me_link_<?php echo $i; ?>" required class="required tbl_input full_input">
</td> </td>
<td class="td_mng"> <td class="td_mng">
<label for="me_target_<?php echo $i; ?>" class="sound_only">새창</label> <label for="me_target_<?php echo $i; ?>" class="sound_only">새창</label>
<select name="me_target[]" id="me_target_<?php echo $i; ?>"> <select name="me_target[]" id="me_target_<?php echo $i; ?>">
<option value="self"<?php echo get_selected($row['me_target'], 'self', true); ?>>사용안함</option> <option value="self" <?php echo get_selected($row['me_target'], 'self', true); ?>>사용안함</option>
<option value="blank"<?php echo get_selected($row['me_target'], 'blank', true); ?>>사용함</option> <option value="blank" <?php echo get_selected($row['me_target'], 'blank', true); ?>>사용함</option>
</select> </select>
</td> </td>
<td class="td_num"> <td class="td_num">
<label for="me_order_<?php echo $i; ?>" class="sound_only">순서</label> <label for="me_order_<?php echo $i; ?>" class="sound_only">순서</label>
<input type="text" name="me_order[]" value="<?php echo $row['me_order'] ?>" id="me_order_<?php echo $i; ?>" class="tbl_input" size="5"> <input type="text" name="me_order[]" value="<?php echo $row['me_order'] ?>" id="me_order_<?php echo $i; ?>" class="tbl_input" size="5">
</td> </td>
<td class="td_mng"> <td class="td_mng">
<label for="me_use_<?php echo $i; ?>" class="sound_only">PC사용</label> <label for="me_use_<?php echo $i; ?>" class="sound_only">PC사용</label>
<select name="me_use[]" id="me_use_<?php echo $i; ?>"> <select name="me_use[]" id="me_use_<?php echo $i; ?>">
<option value="1"<?php echo get_selected($row['me_use'], '1', true); ?>>사용함</option> <option value="1" <?php echo get_selected($row['me_use'], '1', true); ?>>사용함</option>
<option value="0"<?php echo get_selected($row['me_use'], '0', true); ?>>사용안함</option> <option value="0" <?php echo get_selected($row['me_use'], '0', true); ?>>사용안함</option>
</select> </select>
</td> </td>
<td class="td_mng"> <td class="td_mng">
<label for="me_mobile_use_<?php echo $i; ?>" class="sound_only">모바일사용</label> <label for="me_mobile_use_<?php echo $i; ?>" class="sound_only">모바일사용</label>
<select name="me_mobile_use[]" id="me_mobile_use_<?php echo $i; ?>"> <select name="me_mobile_use[]" id="me_mobile_use_<?php echo $i; ?>">
<option value="1"<?php echo get_selected($row['me_mobile_use'], '1', true); ?>>사용함</option> <option value="1" <?php echo get_selected($row['me_mobile_use'], '1', true); ?>>사용함</option>
<option value="0"<?php echo get_selected($row['me_mobile_use'], '0', true); ?>>사용안함</option> <option value="0" <?php echo get_selected($row['me_mobile_use'], '0', true); ?>>사용안함</option>
</select> </select>
</td> </td>
<td class="td_mng"> <td class="td_mng">
<?php if(strlen($row['me_code']) == 2) { ?> <?php if (strlen($row['me_code']) == 2) { ?>
<button type="button" class="btn_add_submenu btn_03 ">추가</button> <button type="button" class="btn_add_submenu btn_03 ">추가</button>
<?php } ?> <?php } ?>
<button type="button" class="btn_del_menu btn_02">삭제</button> <button type="button" class="btn_del_menu btn_02">삭제</button>
</td> </td>
</tr> </tr>
<?php <?php
} }
if ($i==0) if ($i == 0) {
echo '<tr id="empty_menu_list"><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>'; echo '<tr id="empty_menu_list"><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
?> }
</tbody> ?>
</table> </tbody>
</div> </table>
</div>
<div class="btn_fixed_top"> <div class="btn_fixed_top">
<button type="button" onclick="return add_menu();" class="btn btn_02">메뉴추가<span class="sound_only"> 새창</span></button> <button type="button" onclick="return add_menu();" class="btn btn_02">메뉴추가<span class="sound_only"> 새창</span></button>
<input type="submit" name="act_button" value="확인" class="btn_submit btn "> <input type="submit" name="act_button" value="확인" class="btn_submit btn ">
</div> </div>
</form> </form>
<script> <script>
$(function() { $(function() {
$(document).on("click", ".btn_add_submenu", function() { $(document).on("click", ".btn_add_submenu", function() {
var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
add_submenu(code);
});
$(document).on("click", ".btn_del_menu", function() {
if(!confirm("메뉴를 삭제하시겠습니까?\n메뉴 삭제후 메뉴설정의 확인 버튼을 눌러 메뉴를 저장해 주세요."))
return false;
var $tr = $(this).closest("tr");
if($tr.find("td.sub_menu_class").length > 0) {
$tr.remove();
} else {
var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2); var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
$("tr.menu_group_"+code).remove(); add_submenu(code);
} });
if($("#menulist tr.menu_list").length < 1) { $(document).on("click", ".btn_del_menu", function() {
var list = "<tr id=\"empty_menu_list\"><td colspan=\"<?php echo $colspan; ?>\" class=\"empty_table\">자료가 없습니다.</td></tr>\n"; if (!confirm("메뉴를 삭제하시겠습니까?\n메뉴 삭제후 메뉴설정의 확인 버튼을 눌러 메뉴를 저장해 주세요."))
$("#menulist table tbody").append(list); return false;
} else {
$("#menulist tr.menu_list").each(function(index) {
$(this).removeClass("bg0 bg1")
.addClass("bg"+(index % 2));
});
}
});
});
function add_menu() var $tr = $(this).closest("tr");
{ if ($tr.find("td.sub_menu_class").length > 0) {
var max_code = base_convert(0, 10, 36); $tr.remove();
$("#menulist tr.menu_list").each(function() { } else {
var me_code = $(this).find("input[name='code[]']").val().substr(0, 2); var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
if(max_code < me_code) $("tr.menu_group_" + code).remove();
max_code = me_code; }
if ($("#menulist tr.menu_list").length < 1) {
var list = "<tr id=\"empty_menu_list\"><td colspan=\"<?php echo $colspan; ?>\" class=\"empty_table\">자료가 없습니다.</td></tr>\n";
$("#menulist table tbody").append(list);
} else {
$("#menulist tr.menu_list").each(function(index) {
$(this).removeClass("bg0 bg1")
.addClass("bg" + (index % 2));
});
}
});
}); });
var url = "./menu_form.php?code="+max_code+"&new=new"; function add_menu() {
window.open(url, "add_menu", "left=100,top=100,width=550,height=650,scrollbars=yes,resizable=yes"); var max_code = base_convert(0, 10, 36);
return false; $("#menulist tr.menu_list").each(function() {
} var me_code = $(this).find("input[name='code[]']").val().substr(0, 2);
if (max_code < me_code)
max_code = me_code;
});
function add_submenu(code) var url = "./menu_form.php?code=" + max_code + "&new=new";
{ window.open(url, "add_menu", "left=100,top=100,width=550,height=650,scrollbars=yes,resizable=yes");
var url = "./menu_form.php?code="+code; return false;
window.open(url, "add_menu", "left=100,top=100,width=550,height=650,scrollbars=yes,resizable=yes");
return false;
}
function base_convert(number, frombase, tobase) {
// discuss at: http://phpjs.org/functions/base_convert/
// original by: Philippe Baumann
// improved by: Rafał Kukawski (http://blog.kukawski.pl)
// example 1: base_convert('A37334', 16, 2);
// returns 1: '101000110111001100110100'
return parseInt(number + '', frombase | 0)
.toString(tobase | 0);
}
function fmenulist_submit(f)
{
var me_links = document.getElementsByName('me_link[]');
var reg = /^javascript/;
for (i=0; i<me_links.length; i++){
if( reg.test(me_links[i].value) ){
alert('링크에 자바스크립트문을 입력할수 없습니다.');
me_links[i].focus();
return false;
}
} }
return true; function add_submenu(code) {
} var url = "./menu_form.php?code=" + code;
window.open(url, "add_menu", "left=100,top=100,width=550,height=650,scrollbars=yes,resizable=yes");
return false;
}
function base_convert(number, frombase, tobase) {
// discuss at: http://phpjs.org/functions/base_convert/
// original by: Philippe Baumann
// improved by: Rafał Kukawski (http://blog.kukawski.pl)
// example 1: base_convert('A37334', 16, 2);
// returns 1: '101000110111001100110100'
return parseInt(number + '', frombase | 0)
.toString(tobase | 0);
}
function fmenulist_submit(f) {
var me_links = document.getElementsByName('me_link[]');
var reg = /^javascript/;
for (i = 0; i < me_links.length; i++) {
if (reg.test(me_links[i].value)) {
alert('링크에 자바스크립트문을 입력할수 없습니다.');
me_links[i].focus();
return false;
}
}
return true;
}
</script> </script>
<?php <?php
include_once ('./admin.tail.php'); require_once './admin.tail.php';

View File

@ -1,11 +1,12 @@
<?php <?php
$sub_menu = "100290"; $sub_menu = "100290";
include_once('./_common.php'); require_once './_common.php';
check_demo(); check_demo();
if ($is_admin != 'super') if ($is_admin != 'super') {
alert('최고관리자만 접근 가능합니다.'); alert('최고관리자만 접근 가능합니다.');
}
check_admin_token(); check_admin_token();
@ -17,11 +18,10 @@ $group_code = null;
$primary_code = null; $primary_code = null;
$count = isset($_POST['code']) ? count($_POST['code']) : 0; $count = isset($_POST['code']) ? count($_POST['code']) : 0;
for ($i=0; $i<$count; $i++) for ($i = 0; $i < $count; $i++) {
{
$_POST = array_map_deep('trim', $_POST); $_POST = array_map_deep('trim', $_POST);
if(preg_match('/^javascript/i', preg_replace('/[ ]{1,}|[\t]/', '', $_POST['me_link'][$i]))){ if (preg_match('/^javascript/i', preg_replace('/[ ]{1,}|[\t]/', '', $_POST['me_link'][$i]))) {
$_POST['me_link'][$i] = G5_URL; $_POST['me_link'][$i] = G5_URL;
} }
@ -31,31 +31,32 @@ for ($i=0; $i<$count; $i++)
$code = is_array($_POST['code']) ? strip_tags($_POST['code'][$i]) : ''; $code = is_array($_POST['code']) ? strip_tags($_POST['code'][$i]) : '';
$me_name = is_array($_POST['me_name']) ? strip_tags($_POST['me_name'][$i]) : ''; $me_name = is_array($_POST['me_name']) ? strip_tags($_POST['me_name'][$i]) : '';
$me_link = (preg_match('/^javascript/i', $_POST['me_link'][$i]) || preg_match('/script:/i', $_POST['me_link'][$i])) ? G5_URL : strip_tags(clean_xss_attributes($_POST['me_link'][$i])); $me_link = (preg_match('/^javascript/i', $_POST['me_link'][$i]) || preg_match('/script:/i', $_POST['me_link'][$i])) ? G5_URL : strip_tags(clean_xss_attributes($_POST['me_link'][$i]));
if(!$code || !$me_name || !$me_link) if (!$code || !$me_name || !$me_link) {
continue; continue;
}
$sub_code = ''; $sub_code = '';
if($group_code == $code) { if ($group_code == $code) {
$sql = " select MAX(SUBSTRING(me_code,3,2)) as max_me_code $sql = " select MAX(SUBSTRING(me_code,3,2)) as max_me_code
from {$g5['menu_table']} from {$g5['menu_table']}
where SUBSTRING(me_code,1,2) = '$primary_code' "; where SUBSTRING(me_code,1,2) = '$primary_code' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$sub_code = base_convert($row['max_me_code'], 36, 10); $sub_code = (int)base_convert($row['max_me_code'], 36, 10);
$sub_code += 36; $sub_code += 36;
$sub_code = base_convert($sub_code, 10, 36); $sub_code = base_convert((string)$sub_code, 10, 36);
$me_code = $primary_code.$sub_code; $me_code = $primary_code . $sub_code;
} else { } else {
$sql = " select MAX(SUBSTRING(me_code,1,2)) as max_me_code $sql = " select MAX(SUBSTRING(me_code,1,2)) as max_me_code
from {$g5['menu_table']} from {$g5['menu_table']}
where LENGTH(me_code) = '2' "; where LENGTH(me_code) = '2' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$me_code = base_convert($row['max_me_code'], 36, 10); $me_code = (int)base_convert($row['max_me_code'], 36, 10);
$me_code += 36; $me_code += 36;
$me_code = base_convert($me_code, 10, 36); $me_code = base_convert((string)$me_code, 10, 36);
$group_code = $code; $group_code = $code;
$primary_code = $me_code; $primary_code = $me_code;
@ -63,16 +64,16 @@ for ($i=0; $i<$count; $i++)
// 메뉴 등록 // 메뉴 등록
$sql = " insert into {$g5['menu_table']} $sql = " insert into {$g5['menu_table']}
set me_code = '".$me_code."', set me_code = '" . $me_code . "',
me_name = '".$me_name."', me_name = '" . $me_name . "',
me_link = '".$me_link."', me_link = '" . $me_link . "',
me_target = '".sql_real_escape_string(strip_tags($_POST['me_target'][$i]))."', me_target = '" . sql_real_escape_string(strip_tags($_POST['me_target'][$i])) . "',
me_order = '".sql_real_escape_string(strip_tags($_POST['me_order'][$i]))."', me_order = '" . sql_real_escape_string(strip_tags($_POST['me_order'][$i])) . "',
me_use = '".sql_real_escape_string(strip_tags($_POST['me_use'][$i]))."', me_use = '" . sql_real_escape_string(strip_tags($_POST['me_use'][$i])) . "',
me_mobile_use = '".sql_real_escape_string(strip_tags($_POST['me_mobile_use'][$i]))."' "; me_mobile_use = '" . sql_real_escape_string(strip_tags($_POST['me_mobile_use'][$i])) . "' ";
sql_query($sql); sql_query($sql);
} }
run_event('admin_menu_list_update'); run_event('admin_menu_list_update');
goto_url('./menu_list.php'); goto_url('./menu_list.php');

View File

@ -1,174 +1,172 @@
<?php <?php
$sub_menu = '100310'; $sub_menu = '100310';
include_once('./_common.php'); require_once './_common.php';
include_once(G5_EDITOR_LIB); require_once G5_EDITOR_LIB;
auth_check_menu($auth, $sub_menu, "w"); auth_check_menu($auth, $sub_menu, "w");
$nw_id = isset($_REQUEST['nw_id']) ? preg_replace('/[^0-9]/', '', $_REQUEST['nw_id']) : 0; $nw_id = isset($_REQUEST['nw_id']) ? (string)preg_replace('/[^0-9]/', '', $_REQUEST['nw_id']) : 0;
$nw = array( $nw = array(
'nw_begin_time'=>'', 'nw_begin_time' => '',
'nw_end_time'=>'', 'nw_end_time' => '',
'nw_subject'=>'', 'nw_subject' => '',
'nw_content'=>'', 'nw_content' => '',
'nw_division'=>'', 'nw_division' => '',
); );
$html_title = "팝업레이어"; $html_title = "팝업레이어";
// 팝업레이어 테이블에 쇼핑몰, 커뮤니티 인지 구분하는 여부 필드 추가 // 팝업레이어 테이블에 쇼핑몰, 커뮤니티 인지 구분하는 여부 필드 추가
$sql = " ALTER TABLE `{$g5['new_win_table']}` ADD `nw_division` VARCHAR(10) NOT NULL DEFAULT 'both' "; $sql = " ALTER TABLE `{$g5['new_win_table']}` ADD `nw_division` VARCHAR(10) NOT NULL DEFAULT 'both' ";
sql_query($sql, false); sql_query($sql, false);
if ($w == "u") if ($w == "u") {
{ $html_title .= " 수정";
$html_title .= " 수정"; $sql = " select * from {$g5['new_win_table']} where nw_id = '$nw_id' ";
$sql = " select * from {$g5['new_win_table']} where nw_id = '$nw_id' "; $nw = sql_fetch($sql);
$nw = sql_fetch($sql); if (!(isset($nw['nw_id']) && $nw['nw_id'])) {
if (! (isset($nw['nw_id']) && $nw['nw_id'])) alert("등록된 자료가 없습니다."); alert("등록된 자료가 없습니다.");
} }
else } else {
{ $html_title .= " 입력";
$html_title .= " 입력"; $nw['nw_device'] = 'both';
$nw['nw_device'] = 'both'; $nw['nw_disable_hours'] = 24;
$nw['nw_disable_hours'] = 24; $nw['nw_left'] = 10;
$nw['nw_left'] = 10; $nw['nw_top'] = 10;
$nw['nw_top'] = 10; $nw['nw_width'] = 450;
$nw['nw_width'] = 450; $nw['nw_height'] = 500;
$nw['nw_height'] = 500; $nw['nw_content_html'] = 2;
$nw['nw_content_html'] = 2; }
}
$g5['title'] = $html_title;
$g5['title'] = $html_title; require_once G5_ADMIN_PATH . '/admin.head.php';
include_once (G5_ADMIN_PATH.'/admin.head.php'); ?>
?>
<form name="frmnewwin" action="./newwinformupdate.php" onsubmit="return frmnewwin_check(this);" method="post">
<form name="frmnewwin" action="./newwinformupdate.php" onsubmit="return frmnewwin_check(this);" method="post"> <input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="w" value="<?php echo $w; ?>"> <input type="hidden" name="nw_id" value="<?php echo $nw_id; ?>">
<input type="hidden" name="nw_id" value="<?php echo $nw_id; ?>"> <input type="hidden" name="token" value="">
<input type="hidden" name="token" value="">
<div class="local_desc01 local_desc">
<div class="local_desc01 local_desc"> <p>초기화면 접속 시 자동으로 뜰 팝업레이어를 설정합니다.</p>
<p>초기화면 접속 시 자동으로 뜰 팝업레이어를 설정합니다.</p> </div>
</div>
<div class="tbl_frm01 tbl_wrap">
<div class="tbl_frm01 tbl_wrap"> <table>
<table> <caption><?php echo $g5['title']; ?></caption>
<caption><?php echo $g5['title']; ?></caption> <colgroup>
<colgroup> <col class="grid_4">
<col class="grid_4"> <col>
<col> </colgroup>
</colgroup> <tbody>
<tbody> <tr>
<tr> <th scope="row"><label for="nw_division">구분</label></th>
<th scope="row"><label for="nw_division">구분</label></th> <td>
<td> <?php echo help("커뮤니티에 표시될 것인지 쇼핑몰에 표시될 것인지를 설정합니다."); ?>
<?php echo help("커뮤니티에 표시될 것인지 쇼핑몰에 표시될 것인지를 설정합니다."); ?> <select name="nw_division" id="nw_division">
<select name="nw_division" id="nw_division"> <option value="comm" <?php echo get_selected($nw['nw_division'], 'comm'); ?>>커뮤니티</option>
<option value="comm"<?php echo get_selected($nw['nw_division'], 'comm'); ?>>커뮤니티</option> <?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?> <option value="both" <?php echo get_selected($nw['nw_division'], 'both', true); ?>>커뮤니티와 쇼핑몰</option>
<option value="both"<?php echo get_selected($nw['nw_division'], 'both', true); ?>>커뮤니티와 쇼핑몰</option> <option value="shop" <?php echo get_selected($nw['nw_division'], 'shop'); ?>>쇼핑몰</option>
<option value="shop"<?php echo get_selected($nw['nw_division'], 'shop'); ?>>쇼핑몰</option> <?php } ?>
<?php } ?> </select>
</select> </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_device">접속기기</label></th>
<th scope="row"><label for="nw_device">접속기기</label></th> <td>
<td> <?php echo help("팝업레이어가 표시될 접속기기를 설정합니다."); ?>
<?php echo help("팝업레이어가 표시될 접속기기를 설정합니다."); ?> <select name="nw_device" id="nw_device">
<select name="nw_device" id="nw_device"> <option value="both" <?php echo get_selected($nw['nw_device'], 'both', true); ?>>PC와 모바일</option>
<option value="both"<?php echo get_selected($nw['nw_device'], 'both', true); ?>>PC와 모바일</option> <option value="pc" <?php echo get_selected($nw['nw_device'], 'pc'); ?>>PC</option>
<option value="pc"<?php echo get_selected($nw['nw_device'], 'pc'); ?>>PC</option> <option value="mobile" <?php echo get_selected($nw['nw_device'], 'mobile'); ?>>모바일</option>
<option value="mobile"<?php echo get_selected($nw['nw_device'], 'mobile'); ?>>모바일</option> </select>
</select> </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_disable_hours">시간<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_disable_hours">시간<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <?php echo help("고객이 다시 보지 않음을 선택할 시 몇 시간동안 팝업레이어를 보여주지 않을지 설정합니다."); ?>
<?php echo help("고객이 다시 보지 않음을 선택할 시 몇 시간동안 팝업레이어를 보여주지 않을지 설정합니다."); ?> <input type="text" name="nw_disable_hours" value="<?php echo $nw['nw_disable_hours']; ?>" id="nw_disable_hours" required class="frm_input required" size="5"> 시간
<input type="text" name="nw_disable_hours" value="<?php echo $nw['nw_disable_hours']; ?>" id="nw_disable_hours" required class="frm_input required" size="5"> 시간 </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_begin_time">시작일시<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_begin_time">시작일시<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_begin_time" value="<?php echo $nw['nw_begin_time']; ?>" id="nw_begin_time" required class="frm_input required" size="21" maxlength="19">
<input type="text" name="nw_begin_time" value="<?php echo $nw['nw_begin_time']; ?>" id="nw_begin_time" required class="frm_input required" size="21" maxlength="19"> <input type="checkbox" name="nw_begin_chk" value="<?php echo date("Y-m-d 00:00:00", G5_SERVER_TIME); ?>" id="nw_begin_chk" onclick="if (this.checked == true) this.form.nw_begin_time.value=this.form.nw_begin_chk.value; else this.form.nw_begin_time.value = this.form.nw_begin_time.defaultValue;">
<input type="checkbox" name="nw_begin_chk" value="<?php echo date("Y-m-d 00:00:00", G5_SERVER_TIME); ?>" id="nw_begin_chk" onclick="if (this.checked == true) this.form.nw_begin_time.value=this.form.nw_begin_chk.value; else this.form.nw_begin_time.value = this.form.nw_begin_time.defaultValue;"> <label for="nw_begin_chk">시작일시를 오늘로</label>
<label for="nw_begin_chk">시작일시를 오늘로</label> </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_end_time">종료일시<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_end_time">종료일시<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_end_time" value="<?php echo $nw['nw_end_time']; ?>" id="nw_end_time" required class="frm_input required" size="21" maxlength="19">
<input type="text" name="nw_end_time" value="<?php echo $nw['nw_end_time']; ?>" id="nw_end_time" required class="frm_input required" size="21" maxlength="19"> <input type="checkbox" name="nw_end_chk" value="<?php echo date("Y-m-d 23:59:59", G5_SERVER_TIME + (60 * 60 * 24 * 7)); ?>" id="nw_end_chk" onclick="if (this.checked == true) this.form.nw_end_time.value=this.form.nw_end_chk.value; else this.form.nw_end_time.value = this.form.nw_end_time.defaultValue;">
<input type="checkbox" name="nw_end_chk" value="<?php echo date("Y-m-d 23:59:59", G5_SERVER_TIME+(60*60*24*7)); ?>" id="nw_end_chk" onclick="if (this.checked == true) this.form.nw_end_time.value=this.form.nw_end_chk.value; else this.form.nw_end_time.value = this.form.nw_end_time.defaultValue;"> <label for="nw_end_chk">종료일시를 오늘로부터 7일 후로</label>
<label for="nw_end_chk">종료일시를 오늘로부터 7일 후로</label> </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_left">팝업레이어 좌측 위치<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_left">팝업레이어 좌측 위치<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_left" value="<?php echo $nw['nw_left']; ?>" id="nw_left" required class="frm_input required" size="5"> px
<input type="text" name="nw_left" value="<?php echo $nw['nw_left']; ?>" id="nw_left" required class="frm_input required" size="5"> px </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_top">팝업레이어 상단 위치<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_top">팝업레이어 상단 위치<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_top" value="<?php echo $nw['nw_top']; ?>" id="nw_top" required class="frm_input required" size="5"> px
<input type="text" name="nw_top" value="<?php echo $nw['nw_top']; ?>" id="nw_top" required class="frm_input required" size="5"> px </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_width">팝업레이어 넓이<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_width">팝업레이어 넓이<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_width" value="<?php echo $nw['nw_width'] ?>" id="nw_width" required class="frm_input required" size="5"> px
<input type="text" name="nw_width" value="<?php echo $nw['nw_width'] ?>" id="nw_width" required class="frm_input required" size="5"> px </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_height">팝업레이어 높이<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_height">팝업레이어 높이<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_height" value="<?php echo $nw['nw_height'] ?>" id="nw_height" required class="frm_input required" size="5"> px
<input type="text" name="nw_height" value="<?php echo $nw['nw_height'] ?>" id="nw_height" required class="frm_input required" size="5"> px </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_subject">팝업 제목<strong class="sound_only"> 필수</strong></label></th>
<th scope="row"><label for="nw_subject">팝업 제목<strong class="sound_only"> 필수</strong></label></th> <td>
<td> <input type="text" name="nw_subject" value="<?php echo get_sanitize_input($nw['nw_subject']); ?>" id="nw_subject" required class="frm_input required" size="80">
<input type="text" name="nw_subject" value="<?php echo get_sanitize_input($nw['nw_subject']); ?>" id="nw_subject" required class="frm_input required" size="80"> </td>
</td> </tr>
</tr> <tr>
<tr> <th scope="row"><label for="nw_content">내용</label></th>
<th scope="row"><label for="nw_content">내용</label></th> <td><?php echo editor_html('nw_content', get_text(html_purifier($nw['nw_content']), 0)); ?></td>
<td><?php echo editor_html('nw_content', get_text(html_purifier($nw['nw_content']), 0)); ?></td> </tr>
</tr> </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="btn_fixed_top">
<div class="btn_fixed_top"> <a href="./newwinlist.php" class=" btn btn_02">목록</a>
<a href="./newwinlist.php" class=" btn btn_02">목록</a> <input type="submit" value="확인" class="btn_submit btn" accesskey="s">
<input type="submit" value="확인" class="btn_submit btn" accesskey="s"> </div>
</div> </form>
</form>
<script>
<script> function frmnewwin_check(f) {
function frmnewwin_check(f) errmsg = "";
{ errfld = "";
errmsg = "";
errfld = ""; <?php echo get_editor_js('nw_content'); ?>
<?php echo get_editor_js('nw_content'); ?> check_field(f.nw_subject, "제목을 입력하세요.");
check_field(f.nw_subject, "제목을 입력하세요."); if (errmsg != "") {
alert(errmsg);
if (errmsg != "") { errfld.focus();
alert(errmsg); return false;
errfld.focus(); }
return false; return true;
} }
return true; </script>
}
</script> <?php
require_once G5_ADMIN_PATH . '/admin.tail.php';
<?php
include_once (G5_ADMIN_PATH.'/admin.tail.php');

View File

@ -1,82 +1,76 @@
<?php <?php
$sub_menu = '100310'; $sub_menu = '100310';
include_once('./_common.php'); require_once './_common.php';
$nw_id = isset($_REQUEST['nw_id']) ? preg_replace('/[^0-9]/', '', $_REQUEST['nw_id']) : 0; $nw_id = isset($_REQUEST['nw_id']) ? (string)preg_replace('/[^0-9]/', '', $_REQUEST['nw_id']) : 0;
if ($w == "u" || $w == "d") if ($w == "u" || $w == "d") {
check_demo(); check_demo();
}
if ($w == 'd')
auth_check_menu($auth, $sub_menu, "d"); if ($w == 'd') {
else auth_check_menu($auth, $sub_menu, "d");
auth_check_menu($auth, $sub_menu, "w"); } else {
auth_check_menu($auth, $sub_menu, "w");
check_admin_token(); }
$nw_subject = isset($_POST['nw_subject']) ? strip_tags(clean_xss_attributes($_POST['nw_subject'])) : ''; check_admin_token();
$posts = array();
$nw_subject = isset($_POST['nw_subject']) ? strip_tags(clean_xss_attributes($_POST['nw_subject'])) : '';
$check_keys = array( $posts = array();
'nw_device'=>'str',
'nw_division'=>'str', $check_keys = array(
'nw_begin_time'=>'str', 'nw_device' => 'str',
'nw_end_time'=>'str', 'nw_division' => 'str',
'nw_disable_hours'=>'int', 'nw_begin_time' => 'str',
'nw_left'=>'int', 'nw_end_time' => 'str',
'nw_top'=>'int', 'nw_disable_hours' => 'int',
'nw_height'=>'int', 'nw_left' => 'int',
'nw_width'=>'int', 'nw_top' => 'int',
'nw_content'=>'text', 'nw_height' => 'int',
'nw_content_html'=>'text', 'nw_width' => 'int',
); 'nw_content' => 'text',
'nw_content_html' => 'text',
foreach($check_keys as $key=>$val){ );
if($val === 'int'){
$posts[$key] = isset($_POST[$key]) ? (int) $_POST[$key] : 0; foreach ($check_keys as $key => $val) {
} else if ($val === 'str') { if ($val === 'int') {
$posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : 0; $posts[$key] = isset($_POST[$key]) ? (int) $_POST[$key] : 0;
} else { } elseif ($val === 'str') {
$posts[$key] = isset($_POST[$key]) ? trim($_POST[$key]) : 0; $posts[$key] = isset($_POST[$key]) ? clean_xss_tags($_POST[$key], 1, 1) : 0;
} } else {
} $posts[$key] = isset($_POST[$key]) ? trim($_POST[$key]) : 0;
}
$sql_common = " nw_device = '{$posts['nw_device']}', }
nw_division = '{$posts['nw_division']}',
nw_begin_time = '{$posts['nw_begin_time']}', $sql_common = " nw_device = '{$posts['nw_device']}',
nw_end_time = '{$posts['nw_end_time']}', nw_division = '{$posts['nw_division']}',
nw_disable_hours = '{$posts['nw_disable_hours']}', nw_begin_time = '{$posts['nw_begin_time']}',
nw_left = '{$posts['nw_left']}', nw_end_time = '{$posts['nw_end_time']}',
nw_top = '{$posts['nw_top']}', nw_disable_hours = '{$posts['nw_disable_hours']}',
nw_height = '{$posts['nw_height']}', nw_left = '{$posts['nw_left']}',
nw_width = '{$posts['nw_width']}', nw_top = '{$posts['nw_top']}',
nw_subject = '{$nw_subject}', nw_height = '{$posts['nw_height']}',
nw_content = '{$posts['nw_content']}', nw_width = '{$posts['nw_width']}',
nw_content_html = '{$posts['nw_content_html']}' "; nw_subject = '{$nw_subject}',
nw_content = '{$posts['nw_content']}',
if($w == "") nw_content_html = '{$posts['nw_content_html']}' ";
{
$sql = " insert {$g5['new_win_table']} set $sql_common "; if ($w == "") {
sql_query($sql); $sql = " insert {$g5['new_win_table']} set $sql_common ";
sql_query($sql);
$nw_id = sql_insert_id();
} $nw_id = sql_insert_id();
else if ($w == "u") } elseif ($w == "u") {
{ $sql = " update {$g5['new_win_table']} set $sql_common where nw_id = '$nw_id' ";
$sql = " update {$g5['new_win_table']} set $sql_common where nw_id = '$nw_id' "; sql_query($sql);
sql_query($sql); } elseif ($w == "d") {
} $sql = " delete from {$g5['new_win_table']} where nw_id = '$nw_id' ";
else if ($w == "d") sql_query($sql);
{ }
$sql = " delete from {$g5['new_win_table']} where nw_id = '$nw_id' ";
sql_query($sql); if ($w == "d") {
} goto_url('./newwinlist.php');
} else {
if ($w == "d") goto_url("./newwinform.php?w=u&amp;nw_id=$nw_id");
{ }
goto_url('./newwinlist.php');
}
else
{
goto_url("./newwinform.php?w=u&amp;nw_id=$nw_id");
}

View File

@ -1,118 +1,121 @@
<?php <?php
$sub_menu = '100310'; $sub_menu = '100310';
include_once('./_common.php'); require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r"); auth_check_menu($auth, $sub_menu, "r");
if( !isset($g5['new_win_table']) ){ if (!isset($g5['new_win_table'])) {
die('<meta charset="utf-8">/data/dbconfig.php 파일에 <strong>$g5[\'new_win_table\'] = G5_TABLE_PREFIX.\'new_win\';</strong> 를 추가해 주세요.'); die('<meta charset="utf-8">/data/dbconfig.php 파일에 <strong>$g5[\'new_win_table\'] = G5_TABLE_PREFIX.\'new_win\';</strong> 를 추가해 주세요.');
} }
//내용(컨텐츠)정보 테이블이 있는지 검사한다. //내용(컨텐츠)정보 테이블이 있는지 검사한다.
if(!sql_query(" DESCRIBE {$g5['new_win_table']} ", false)) { if (!sql_query(" DESCRIBE {$g5['new_win_table']} ", false)) {
if(sql_query(" DESCRIBE {$g5['g5_shop_new_win_table']} ", false)) { if (sql_query(" DESCRIBE {$g5['g5_shop_new_win_table']} ", false)) {
sql_query(" ALTER TABLE {$g5['g5_shop_new_win_table']} RENAME TO `{$g5['new_win_table']}` ;", false); sql_query(" ALTER TABLE {$g5['g5_shop_new_win_table']} RENAME TO `{$g5['new_win_table']}` ;", false);
} else { } else {
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['new_win_table']}` ( $query_cp = sql_query(
`nw_id` int(11) NOT NULL AUTO_INCREMENT, " CREATE TABLE IF NOT EXISTS `{$g5['new_win_table']}` (
`nw_division` varchar(10) NOT NULL DEFAULT 'both', `nw_id` int(11) NOT NULL AUTO_INCREMENT,
`nw_device` varchar(10) NOT NULL DEFAULT 'both', `nw_division` varchar(10) NOT NULL DEFAULT 'both',
`nw_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `nw_device` varchar(10) NOT NULL DEFAULT 'both',
`nw_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `nw_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`nw_disable_hours` int(11) NOT NULL DEFAULT '0', `nw_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`nw_left` int(11) NOT NULL DEFAULT '0', `nw_disable_hours` int(11) NOT NULL DEFAULT '0',
`nw_top` int(11) NOT NULL DEFAULT '0', `nw_left` int(11) NOT NULL DEFAULT '0',
`nw_height` int(11) NOT NULL DEFAULT '0', `nw_top` int(11) NOT NULL DEFAULT '0',
`nw_width` int(11) NOT NULL DEFAULT '0', `nw_height` int(11) NOT NULL DEFAULT '0',
`nw_subject` text NOT NULL, `nw_width` int(11) NOT NULL DEFAULT '0',
`nw_content` text NOT NULL, `nw_subject` text NOT NULL,
`nw_content_html` tinyint(4) NOT NULL DEFAULT '0', `nw_content` text NOT NULL,
PRIMARY KEY (`nw_id`) `nw_content_html` tinyint(4) NOT NULL DEFAULT '0',
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true); PRIMARY KEY (`nw_id`)
} ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ",
} true
);
$g5['title'] = '팝업레이어 관리'; }
include_once (G5_ADMIN_PATH.'/admin.head.php'); }
$sql_common = " from {$g5['new_win_table']} "; $g5['title'] = '팝업레이어 관리';
require_once G5_ADMIN_PATH . '/admin.head.php';
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common; $sql_common = " from {$g5['new_win_table']} ";
$row = sql_fetch($sql);
$total_count = $row['cnt']; // 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$sql = "select * $sql_common order by nw_id desc "; $row = sql_fetch($sql);
$result = sql_query($sql); $total_count = $row['cnt'];
?>
$sql = "select * $sql_common order by nw_id desc ";
<div class="local_ov01 local_ov"><span class="btn_ov01"><span class="ov_txt">전체 </span><span class="ov_num"> <?php echo $total_count; ?>건</span></span></div> $result = sql_query($sql);
?>
<div class="btn_fixed_top ">
<a href="./newwinform.php" class="btn btn_01">새창관리추가</a> <div class="local_ov01 local_ov"><span class="btn_ov01"><span class="ov_txt">전체 </span><span class="ov_num"> <?php echo $total_count; ?>건</span></span></div>
</div>
<div class="btn_fixed_top ">
<div class="tbl_head01 tbl_wrap"> <a href="./newwinform.php" class="btn btn_01">새창관리추가</a>
<table> </div>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead> <div class="tbl_head01 tbl_wrap">
<tr> <table>
<th scope="col">번호</th> <caption><?php echo $g5['title']; ?> 목록</caption>
<th scope="col">제목</th> <thead>
<th scope="col">접속기기</th> <tr>
<th scope="col">시작일시</th> <th scope="col">번호</th>
<th scope="col">종료일시</th> <th scope="col">제목</th>
<th scope="col">시간</th> <th scope="col">접속기기</th>
<th scope="col">Left</th> <th scope="col">시작일시</th>
<th scope="col">Top</th> <th scope="col">종료일시</th>
<th scope="col">Width</th> <th scope="col">시간</th>
<th scope="col">Height</th> <th scope="col">Left</th>
<th scope="col">관리</th> <th scope="col">Top</th>
</tr> <th scope="col">Width</th>
</thead> <th scope="col">Height</th>
<tbody> <th scope="col">관리</th>
<?php </tr>
for ($i=0; $row=sql_fetch_array($result); $i++) { </thead>
$bg = 'bg'.($i%2); <tbody>
<?php
switch($row['nw_device']) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
case 'pc': $bg = 'bg' . ($i % 2);
$nw_device = 'PC';
break; switch ($row['nw_device']) {
case 'mobile': case 'pc':
$nw_device = '모바일'; $nw_device = 'PC';
break; break;
default: case 'mobile':
$nw_device = '모'; $nw_device = '모바일';
break; break;
} default:
?> $nw_device = '모두';
<tr class="<?php echo $bg; ?>"> break;
<td class="td_num"><?php echo $row['nw_id']; ?></td> }
<td class="td_left"><?php echo $row['nw_subject']; ?></td> ?>
<td class="td_device"><?php echo $nw_device; ?></td> <tr class="<?php echo $bg; ?>">
<td class="td_datetime"><?php echo substr($row['nw_begin_time'],2,14); ?></td> <td class="td_num"><?php echo $row['nw_id']; ?></td>
<td class="td_datetime"><?php echo substr($row['nw_end_time'],2,14); ?></td> <td class="td_left"><?php echo $row['nw_subject']; ?></td>
<td class="td_num"><?php echo $row['nw_disable_hours']; ?>시간</td> <td class="td_device"><?php echo $nw_device; ?></td>
<td class="td_num"><?php echo $row['nw_left']; ?>px</td> <td class="td_datetime"><?php echo substr($row['nw_begin_time'], 2, 14); ?></td>
<td class="td_num"><?php echo $row['nw_top']; ?>px</td> <td class="td_datetime"><?php echo substr($row['nw_end_time'], 2, 14); ?></td>
<td class="td_num"><?php echo $row['nw_width']; ?>px</td> <td class="td_num"><?php echo $row['nw_disable_hours']; ?>시간</td>
<td class="td_num"><?php echo $row['nw_height']; ?>px</td> <td class="td_num"><?php echo $row['nw_left']; ?>px</td>
<td class="td_mng td_mng_m"> <td class="td_num"><?php echo $row['nw_top']; ?>px</td>
<a href="./newwinform.php?w=u&amp;nw_id=<?php echo $row['nw_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo $row['nw_subject']; ?> </span>수정</a> <td class="td_num"><?php echo $row['nw_width']; ?>px</td>
<a href="./newwinformupdate.php?w=d&amp;nw_id=<?php echo $row['nw_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo $row['nw_subject']; ?> </span>삭제</a> <td class="td_num"><?php echo $row['nw_height']; ?>px</td>
</td> <td class="td_mng td_mng_m">
</tr> <a href="./newwinform.php?w=u&amp;nw_id=<?php echo $row['nw_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo $row['nw_subject']; ?> </span>수정</a>
<?php <a href="./newwinformupdate.php?w=d&amp;nw_id=<?php echo $row['nw_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo $row['nw_subject']; ?> </span>삭제</a>
} </td>
</tr>
if ($i == 0) { <?php
echo '<tr><td colspan="11" class="empty_table">자료가 한건도 없습니다.</td></tr>'; }
}
?> if ($i == 0) {
</tbody> echo '<tr><td colspan="11" class="empty_table">자료가 한건도 없습니다.</td></tr>';
</table> }
</div> ?>
</tbody>
</table>
<?php </div>
include_once (G5_ADMIN_PATH.'/admin.tail.php');
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';