리빌더 부분 추가
This commit is contained in:
10
adm/rb/_common.php
Normal file
10
adm/rb/_common.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
define('G5_IS_ADMIN', true);
|
||||
require_once '../../common.php';
|
||||
require_once G5_ADMIN_PATH . '/admin.lib.php';
|
||||
|
||||
if (isset($token)) {
|
||||
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
|
||||
}
|
||||
|
||||
run_event('admin_common');
|
||||
210
adm/rb/banner_form.php
Normal file
210
adm/rb/banner_form.php
Normal file
@ -0,0 +1,210 @@
|
||||
<?php
|
||||
$sub_menu = '000300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
$bn_id = isset($bn_id) ? preg_replace('/[^0-9]/', '', $bn_id) : '';
|
||||
|
||||
$html_title = '배너';
|
||||
$g5['title'] = $html_title . ' 관리';
|
||||
|
||||
if (isset($w) && $w == "u") {
|
||||
$html_title .= ' 수정';
|
||||
$sql = "SELECT * FROM rb_banner WHERE bn_id = '$bn_id'";
|
||||
$bn = sql_fetch($sql);
|
||||
} else {
|
||||
$html_title .= ' 입력';
|
||||
$bn = [
|
||||
'bn_url' => "http://",
|
||||
'bn_begin_time' => date("Y-m-d 00:00:00", time()),
|
||||
'bn_end_time' => date("Y-m-d 00:00:00", time() + (60 * 60 * 24 * 31)),
|
||||
'bn_id' => ''
|
||||
];
|
||||
}
|
||||
|
||||
// 접속기기 필드 추가
|
||||
if (!sql_query("SELECT bn_device FROM rb_banner LIMIT 0, 1")) {
|
||||
sql_query("ALTER TABLE `rb_banner` ADD `bn_device` varchar(10) NOT NULL DEFAULT '' AFTER `bn_url`", true);
|
||||
sql_query("UPDATE rb_banner SET bn_device = 'pc'", true);
|
||||
}
|
||||
|
||||
include_once(G5_ADMIN_PATH . '/admin.head.php');
|
||||
?>
|
||||
|
||||
<form name="fbanner" action="./banner_form_update.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="w" value="<?php echo isset($w) ? $w : ''; ?>">
|
||||
<input type="hidden" name="bn_id" value="<?php echo $bn_id; ?>">
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">이미지</th>
|
||||
<td>
|
||||
<input type="file" name="bn_bimg">
|
||||
<?php
|
||||
$bimg_str = "";
|
||||
$bimg = G5_DATA_PATH . "/banners/" . $bn['bn_id'];
|
||||
if (isset($bn['bn_id']) && file_exists($bimg)) {
|
||||
$size = @getimagesize($bimg);
|
||||
$width = (isset($size[0]) && $size[0] > 750) ? 750 : (isset($size[0]) ? $size[0] : 0);
|
||||
|
||||
echo '<input type="checkbox" name="bn_bimg_del" value="1" id="bn_bimg_del"> <label for="bn_bimg_del">삭제</label>';
|
||||
$bimg_str = '<img src="' . G5_DATA_URL . '/banners/' . $bn['bn_id'] . '?ver=' . G5_SERVER_TIME . '" width="' . $width . '">';
|
||||
}
|
||||
if (isset($bn['bn_id']) && $bn['bn_id']) {
|
||||
echo '<div class="banner_or_img">';
|
||||
echo $bimg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_alt">메인타이틀</label></th>
|
||||
<td>
|
||||
<?php echo help("메인 타이틀 워딩 입니다."); ?>
|
||||
<input type="text" name="bn_alt" value="<?php echo isset($bn['bn_alt']) ? get_text($bn['bn_alt']) : ''; ?>" id="bn_alt" class="frm_input" size="80">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_alt">서브워딩</label></th>
|
||||
<td>
|
||||
<?php echo help("메인 타이틀 아래에 출력되는 서브워딩 입니다."); ?>
|
||||
<input type="text" name="bn_alt2" value="<?php echo isset($bn['bn_alt2']) ? get_text($bn['bn_alt2']) : ''; ?>" id="bn_alt2" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_alt">기간</label></th>
|
||||
<td>
|
||||
<?php echo help("기간 및 워딩을 출력할 수 있습니다."); ?>
|
||||
<input type="text" name="bn_alt3" value="<?php echo isset($bn['bn_alt3']) ? get_text($bn['bn_alt3']) : ''; ?>" id="bn_alt3" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_url">링크</label></th>
|
||||
<td>
|
||||
<?php echo help("버튼 클릭시 이동하는 Url입니다."); ?>
|
||||
<input type="text" name="bn_url" size="70" value="<?php echo isset($bn['bn_url']) ? $bn['bn_url'] : 'http://'; ?>" id="bn_url" class="frm_input">
|
||||
<input type="text" name="bn_alt4" value="<?php echo isset($bn['bn_alt4']) ? get_text($bn['bn_alt4']) : ''; ?>" id="bn_alt4" class="frm_input" size="30" placeholder="버튼명">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_position">출력그룹</label></th>
|
||||
<td>
|
||||
<select name="bn_position" id="bn_position">
|
||||
<?php echo rb_banner_group_list($bn['bn_position']) ?>
|
||||
<option value="개별출력" <?php echo get_selected(isset($bn['bn_position']) ? $bn['bn_position'] : '', '개별출력'); ?>>개별출력</option>
|
||||
<option value="" <?php echo get_selected(isset($bn['bn_position']) ? $bn['bn_position'] : '', ''); ?>>미출력</option>
|
||||
</select> <input type="text" name="bn_position_use" id="bn_position_use" class="frm_input" placeholder="그룹생성">
|
||||
<br><br>
|
||||
<?php echo help("개별출력의 경우 그룹화 되지 않습니다. 그룹이 없는 경우 그룹생성 항목에 직접 입력하시면 생성 됩니다.<br>생성되는 배너는 모두 모듈설정 패널에서 사용하실 수 있습니다."); ?>
|
||||
|
||||
<?php echo htmlspecialchars("그룹별 출력 : <?php echo rb_banners('그룹명'); ?>"); ?><br>
|
||||
<?php echo htmlspecialchars("개별출력 : <?php echo rb_banners('개별출력', '배너ID'); ?>"); ?><br>
|
||||
<?php echo htmlspecialchars("미출력 : 배너를 출력하지 않습니다."); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_device">출력기기</label></th>
|
||||
<td>
|
||||
<?php echo help('배너이미지를 출력할 기기를 선택할 수 있습니다.'); ?>
|
||||
<?php $bn_device = isset($bn['bn_device']) ? $bn['bn_device'] : null; ?>
|
||||
<select name="bn_device" id="bn_device">
|
||||
<option value="both"<?php echo get_selected($bn_device, 'both', true); ?>>PC와 모바일</option>
|
||||
<option value="pc"<?php echo get_selected($bn_device, 'pc', true); ?>>PC</option>
|
||||
<option value="mobile"<?php echo get_selected($bn_device, 'mobile', true); ?>>모바일</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_border">테두리</label></th>
|
||||
<td>
|
||||
<?php echo help("배너이미지에 테두리를 넣을지를 설정합니다.", 50); ?>
|
||||
<select name="bn_border" id="bn_border">
|
||||
<option value="0" <?php echo get_selected(isset($bn['bn_border']) ? $bn['bn_border'] : 0, 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected(isset($bn['bn_border']) ? $bn['bn_border'] : 1, 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_radius">모서리</label></th>
|
||||
<td>
|
||||
<?php echo help("배너이미지에 모서리를 둥글게 처리할지를 설정 합니다.", 50); ?>
|
||||
<select name="bn_radius" id="bn_radius">
|
||||
<option value="0" <?php echo get_selected(isset($bn['bn_radius']) ? $bn['bn_radius'] : 0, 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected(isset($bn['bn_radius']) ? $bn['bn_radius'] : 1, 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_ad_ico">AD아이콘</label></th>
|
||||
<td>
|
||||
<?php echo help("배너이미지에 AD 아이콘을 보여줄지 설정 합니다.", 50); ?>
|
||||
<select name="bn_ad_ico" id="bn_ad_ico">
|
||||
<option value="0" <?php echo get_selected(isset($bn['bn_ad_ico']) ? $bn['bn_ad_ico'] : 0, 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected(isset($bn['bn_ad_ico']) ? $bn['bn_ad_ico'] : 1, 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_new_win">새창</label></th>
|
||||
<td>
|
||||
<?php echo help("배너이미지 클릭시 새창연결 여부를 선택할 수 있습니다.", 50); ?>
|
||||
<select name="bn_new_win" id="bn_new_win">
|
||||
<option value="0" <?php echo get_selected(isset($bn['bn_new_win']) ? $bn['bn_new_win'] : 0, 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected(isset($bn['bn_new_win']) ? $bn['bn_new_win'] : 1, 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_begin_time">게시 시작일시</label></th>
|
||||
<td>
|
||||
<?php echo help("배너 게시 시작일시를 설정합니다."); ?>
|
||||
<input type="text" name="bn_begin_time" value="<?php echo isset($bn['bn_begin_time']) ? $bn['bn_begin_time'] : date("Y-m-d 00:00:00", time()); ?>" id="bn_begin_time" class="frm_input" size="21" maxlength="19">
|
||||
<input type="checkbox" name="bn_begin_chk" value="<?php echo date("Y-m-d 00:00:00", time()); ?>" id="bn_begin_chk" onclick="if (this.checked == true) this.form.bn_begin_time.value=this.form.bn_begin_chk.value; else this.form.bn_begin_time.value = this.form.bn_begin_time.defaultValue;">
|
||||
<label for="bn_begin_chk">오늘</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_end_time">게시 종료일시</label></th>
|
||||
<td>
|
||||
<?php echo help("배너 게시 종료일시를 설정합니다."); ?>
|
||||
<input type="text" name="bn_end_time" value="<?php echo isset($bn['bn_end_time']) ? $bn['bn_end_time'] : date("Y-m-d 00:00:00", time() + 60 * 60 * 24 * 31); ?>" id="bn_end_time" class="frm_input" size=21 maxlength=19>
|
||||
<input type="checkbox" name="bn_end_chk" value="<?php echo date("Y-m-d 23:59:59", time() + 60 * 60 * 24 * 31); ?>" id="bn_end_chk" onclick="if (this.checked == true) this.form.bn_end_time.value=this.form.bn_end_chk.value; else this.form.bn_end_time.value = this.form.bn_end_time.defaultValue;">
|
||||
<label for="bn_end_chk">오늘+31일</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_order">출력 순서</label></th>
|
||||
<td>
|
||||
<?php echo help("배너를 출력할 때 순서를 정합니다. 숫자가 작을수록 먼저 출력됩니다."); ?>
|
||||
<?php echo order_select("bn_order", isset($bn['bn_order']) ? $bn['bn_order'] : 0); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<a href="./banner_list.php" class="btn_02 btn">목록</a>
|
||||
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
include_once(G5_ADMIN_PATH . '/admin.tail.php');
|
||||
?>
|
||||
111
adm/rb/banner_form_update.php
Normal file
111
adm/rb/banner_form_update.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
$sub_menu = '000300';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if ($w == 'd')
|
||||
auth_check_menu($auth, $sub_menu, "d");
|
||||
else
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
@mkdir(G5_DATA_PATH."/banners", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/banners", G5_DIR_PERMISSION);
|
||||
|
||||
$bn_bimg = isset($_FILES['bn_bimg']['tmp_name']) ? $_FILES['bn_bimg']['tmp_name'] : null;
|
||||
$bn_bimg_name = isset($_FILES['bn_bimg']['name']) ? $_FILES['bn_bimg']['name'] : null;
|
||||
|
||||
$bn_id = isset($bn_id) ? (int) $bn_id : 0;
|
||||
|
||||
$bn_bimg_del = isset($bn_bimg_del) ? $bn_bimg_del : null;
|
||||
|
||||
if ($bn_bimg_del) {
|
||||
@unlink(G5_DATA_PATH."/banners/$bn_id");
|
||||
}
|
||||
|
||||
// 파일이 이미지인지 체크합니다.
|
||||
if ($bn_bimg || $bn_bimg_name) {
|
||||
if (!preg_match('/\.(gif|jpe?g|bmp|png)$/i', $bn_bimg_name)) {
|
||||
alert("이미지 파일만 업로드 할 수 있습니다.");
|
||||
}
|
||||
|
||||
$timg = @getimagesize($bn_bimg);
|
||||
if ($timg === false || $timg[2] < 1 || $timg[2] > 16) {
|
||||
alert("이미지 파일만 업로드 할 수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
$bn_url = isset($bn_url) ? clean_xss_tags($bn_url) : '';
|
||||
$bn_alt = isset($bn_alt) ? (function_exists('clean_xss_attributes') ? clean_xss_attributes(strip_tags($bn_alt)) : strip_tags($bn_alt)) : '';
|
||||
$bn_alt2 = isset($bn_alt2) ? (function_exists('clean_xss_attributes') ? clean_xss_attributes(strip_tags($bn_alt2)) : strip_tags($bn_alt2)) : '';
|
||||
$bn_alt3 = isset($bn_alt3) ? (function_exists('clean_xss_attributes') ? clean_xss_attributes(strip_tags($bn_alt3)) : strip_tags($bn_alt3)) : '';
|
||||
$bn_alt4 = isset($bn_alt4) ? (function_exists('clean_xss_attributes') ? clean_xss_attributes(strip_tags($bn_alt4)) : strip_tags($bn_alt4)) : '';
|
||||
|
||||
if(isset($_POST['bn_position_use']) && $_POST['bn_position_use']) {
|
||||
$bn_position = $_POST['bn_position_use'];
|
||||
} else {
|
||||
$bn_position = $_POST['bn_position'];
|
||||
}
|
||||
|
||||
if ($w == "") {
|
||||
if (!$bn_bimg_name) alert('배너 이미지를 업로드 하세요.');
|
||||
|
||||
sql_query("ALTER TABLE rb_banner AUTO_INCREMENT=1");
|
||||
|
||||
$sql = "INSERT INTO rb_banner
|
||||
SET bn_alt = '$bn_alt',
|
||||
bn_alt2 = '$bn_alt2',
|
||||
bn_alt3 = '$bn_alt3',
|
||||
bn_alt4 = '$bn_alt4',
|
||||
bn_url = '$bn_url',
|
||||
bn_device = '$bn_device',
|
||||
bn_position = '$bn_position',
|
||||
bn_border = '$bn_border',
|
||||
bn_radius = '$bn_radius',
|
||||
bn_ad_ico = '$bn_ad_ico',
|
||||
bn_new_win = '$bn_new_win',
|
||||
bn_begin_time = '$bn_begin_time',
|
||||
bn_end_time = '$bn_end_time',
|
||||
bn_time = '$now',
|
||||
bn_hit = '0',
|
||||
bn_order = '$bn_order'";
|
||||
sql_query($sql);
|
||||
|
||||
$bn_id = sql_insert_id();
|
||||
} elseif ($w == "u") {
|
||||
$sql = "UPDATE rb_banner
|
||||
SET bn_alt = '$bn_alt',
|
||||
bn_alt2 = '$bn_alt2',
|
||||
bn_alt3 = '$bn_alt3',
|
||||
bn_alt4 = '$bn_alt4',
|
||||
bn_url = '$bn_url',
|
||||
bn_device = '$bn_device',
|
||||
bn_position = '$bn_position',
|
||||
bn_border = '$bn_border',
|
||||
bn_radius = '$bn_radius',
|
||||
bn_ad_ico = '$bn_ad_ico',
|
||||
bn_new_win = '$bn_new_win',
|
||||
bn_begin_time = '$bn_begin_time',
|
||||
bn_end_time = '$bn_end_time',
|
||||
bn_order = '$bn_order'
|
||||
WHERE bn_id = '$bn_id'";
|
||||
sql_query($sql);
|
||||
} elseif ($w == "d") {
|
||||
@unlink(G5_DATA_PATH."/banners/$bn_id");
|
||||
|
||||
$sql = "DELETE FROM rb_banner WHERE bn_id = $bn_id";
|
||||
$result = sql_query($sql);
|
||||
}
|
||||
|
||||
if ($w == "" || $w == "u") {
|
||||
if (isset($_FILES['bn_bimg']['name']) && $_FILES['bn_bimg']['name']) {
|
||||
rb_upload_files($_FILES['bn_bimg']['tmp_name'], $bn_id, G5_DATA_PATH."/banners");
|
||||
}
|
||||
|
||||
goto_url("./banner_form.php?w=u&bn_id=$bn_id");
|
||||
} else {
|
||||
goto_url("./banner_list.php");
|
||||
}
|
||||
?>
|
||||
165
adm/rb/banner_list.php
Normal file
165
adm/rb/banner_list.php
Normal file
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
$sub_menu = '000300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "r");
|
||||
|
||||
//배너 테이블이 있는지 검사한다.
|
||||
if(!sql_query(" DESCRIBE rb_banner ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_banner` (
|
||||
`bn_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`bn_alt` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_url` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_device` varchar(10) NOT NULL DEFAULT '',
|
||||
`bn_position` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_border` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_radius` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_ad_ico` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_new_win` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_hit` int(11) NOT NULL DEFAULT '0',
|
||||
`bn_order` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`bn_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
sql_query(" ALTER TABLE `rb_banner` ADD PRIMARY KEY (`bn_id`) ", false);
|
||||
sql_query(" ALTER TABLE `rb_banner` MODIFY `bn_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;COMMIT ", false);
|
||||
}
|
||||
|
||||
$g5['title'] = '배너관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$sql_common = " from rb_banner ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
?>
|
||||
|
||||
<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 class="btn_fixed_top">
|
||||
<a href="./banner_form.php" class="btn_01 btn">배너추가</a>
|
||||
</div>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" id="th_id">ID</th>
|
||||
<th scope="col" id="th_dvc">배너 Url</th>
|
||||
<th scope="col" id="th_inf">배너설명</th>
|
||||
<th scope="col" id="th_loc">출력그룹</th>
|
||||
<th scope="col" id="th_dev">출력기기</th>
|
||||
<th scope="col" id="th_st">시작일시</th>
|
||||
<th scope="col" id="th_end">종료일시</th>
|
||||
<th scope="col" id="th_odr">출력순서</th>
|
||||
<th scope="col" id="th_hit">클릭</th>
|
||||
<th scope="col" id="th_mng">관리</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = " select * from rb_banner
|
||||
order by bn_position, bn_id desc
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
|
||||
$bn_border = $row['bn_border'];
|
||||
$bn_radius = $row['bn_radius'];
|
||||
$bn_ad_ico = $row['bn_ad_ico'];
|
||||
// 새창 띄우기인지
|
||||
$bn_new_win = ($row['bn_new_win']) ? 'target="_blank"' : '';
|
||||
|
||||
$bimg = G5_DATA_PATH.'/banners/'.$row['bn_id'];
|
||||
if(file_exists($bimg)) {
|
||||
$size = @getimagesize($bimg);
|
||||
if($size[0] && $size[0] > 800)
|
||||
$width = 800;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
$bn_img = "";
|
||||
|
||||
$bn_img .= G5_DATA_URL."/banners/".$row['bn_id'];
|
||||
}
|
||||
|
||||
switch($row['bn_device']) {
|
||||
case 'pc':
|
||||
$bn_device = 'PC';
|
||||
break;
|
||||
case 'mobile':
|
||||
$bn_device = '모바일';
|
||||
break;
|
||||
default:
|
||||
$bn_device = 'PC와 모바일';
|
||||
break;
|
||||
}
|
||||
|
||||
$bn_begin_time = substr($row['bn_begin_time'], 0, 19);
|
||||
$bn_end_time = substr($row['bn_end_time'], 0, 19);
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="th_id" class="td_num"><?php echo $row['bn_id']; ?></td>
|
||||
<td headers="th_dvc"><a href="<?php echo $bn_img; ?>" target="_blank"><?php echo $bn_img; ?></a></td>
|
||||
<td headers="th_loc"><?php echo $row['bn_alt']; ?></td>
|
||||
<td headers="th_loc">
|
||||
<?php if($row['bn_position'] == "") {
|
||||
echo "-";
|
||||
} else {
|
||||
echo $row['bn_position'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td headers="th_loc">
|
||||
<?php echo $bn_device; ?>
|
||||
</td>
|
||||
<td headers="th_st" class="td_datetime"><?php echo $bn_begin_time; ?></td>
|
||||
<td headers="th_end" class="td_datetime"><?php echo $bn_end_time; ?></td>
|
||||
<td headers="th_odr" class="td_num"><?php echo $row['bn_order']; ?></td>
|
||||
<td headers="th_hit" class="td_num"><?php echo number_format($row['bn_hit']); ?></td>
|
||||
<td headers="th_mng" class="td_mng td_mns_m">
|
||||
<a href="./banner_form.php?w=u&bn_id=<?php echo $row['bn_id']; ?>" class="btn btn_03">수정</a>
|
||||
<a href="./banner_form_update.php?w=d&bn_id=<?php echo $row['bn_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02">삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="10" class="empty_table">자료가 없습니다.</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&page="); ?>
|
||||
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
배너를 등록하시면 모듈설정에서 추가하실 수 있습니다.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
252
adm/rb/bbs_form.php
Normal file
252
adm/rb/bbs_form.php
Normal file
@ -0,0 +1,252 @@
|
||||
<?php
|
||||
$sub_menu = '000400';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
|
||||
$bo_table = $_GET['bo_table'];
|
||||
$write_table = $g5['write_prefix'] . $bo_table;
|
||||
|
||||
global $g5, $board;
|
||||
|
||||
if($w == "u") {
|
||||
$wr_id = isset($_REQUEST['wr_id']) ? preg_replace('/[^0-9]/', '', $_REQUEST['wr_id']) : 0;
|
||||
|
||||
$sql = " select * from {$write_table} where wr_id = '$wr_id' and wr_is_comment = '0' ";
|
||||
$wr = sql_fetch($sql);
|
||||
if (! (isset($wr['wr_id']) && $wr['wr_id'])) alert('등록된 게시물이 없습니다.');
|
||||
|
||||
$name = get_text($wr['wr_name']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$g5['title'] = '게시물 관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca;
|
||||
|
||||
// 게시글에 첨부된 파일을 얻는다. (배열로 반환)
|
||||
if($w == "u") {
|
||||
function get_file_qa($bo_table, $wr_id)
|
||||
{
|
||||
global $g5, $qstr, $board;
|
||||
|
||||
$file['count'] = 0;
|
||||
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
$no = (int) $row['bf_no'];
|
||||
$bf_content = $row['bf_content'] ? html_purifier($row['bf_content']) : '';
|
||||
$file[$no]['href'] = G5_BBS_URL."/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
|
||||
$file[$no]['download'] = $row['bf_download'];
|
||||
// 4.00.11 - 파일 path 추가
|
||||
$file[$no]['path'] = G5_DATA_URL.'/file/'.$bo_table;
|
||||
$file[$no]['size'] = get_filesize($row['bf_filesize']);
|
||||
$file[$no]['datetime'] = $row['bf_datetime'];
|
||||
$file[$no]['source'] = addslashes($row['bf_source']);
|
||||
$file[$no]['bf_content'] = $bf_content;
|
||||
$file[$no]['content'] = get_text($bf_content);
|
||||
//$file[$no]['view'] = view_file_link($row['bf_file'], $file[$no]['content']);
|
||||
$file[$no]['view'] = view_file_link($row['bf_file'], $row['bf_width'], $row['bf_height'], $file[$no]['content']);
|
||||
$file[$no]['file'] = $row['bf_file'];
|
||||
$file[$no]['image_width'] = $row['bf_width'] ? $row['bf_width'] : 640;
|
||||
$file[$no]['image_height'] = $row['bf_height'] ? $row['bf_height'] : 480;
|
||||
$file[$no]['image_type'] = $row['bf_type'];
|
||||
$file[$no]['bf_fileurl'] = $row['bf_fileurl'];
|
||||
$file[$no]['bf_thumburl'] = $row['bf_thumburl'];
|
||||
$file[$no]['bf_storage'] = $row['bf_storage'];
|
||||
$file['count']++;
|
||||
}
|
||||
|
||||
return run_replace('get_files', $file, $bo_table, $wr_id);
|
||||
}
|
||||
|
||||
$file = get_file($bo_table, $wr_id);
|
||||
|
||||
if (!isset($file_count)) {
|
||||
$file_count = 0;
|
||||
}
|
||||
|
||||
if (isset($file['count']) && $file_count < $file['count']) {
|
||||
$file_count = $file['count'];
|
||||
}
|
||||
|
||||
for($i=0;$i<$file_count;$i++){
|
||||
if(! isset($file[$i])) {
|
||||
$file[$i] = array('file'=>null, 'source'=>null, 'size'=>null, 'bf_content' => null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//카테고리
|
||||
$is_category = false;
|
||||
$category_option = '';
|
||||
if ($board['bo_use_category']) {
|
||||
$ca_name = "";
|
||||
if (isset($wr['ca_name']))
|
||||
$ca_name = $wr['ca_name'];
|
||||
$category_option = get_category_option($bo_table, $ca_name);
|
||||
$is_category = true;
|
||||
}
|
||||
|
||||
//링크
|
||||
$is_link = false;
|
||||
if ($member['mb_level'] >= $board['bo_link_level']) {
|
||||
$is_link = true;
|
||||
}
|
||||
|
||||
//파일
|
||||
$is_file = false;
|
||||
if ($member['mb_level'] >= $board['bo_upload_level']) {
|
||||
$is_file = true;
|
||||
}
|
||||
|
||||
$is_file_content = false;
|
||||
if ($board['bo_use_file_content']) {
|
||||
$is_file_content = true;
|
||||
}
|
||||
|
||||
$file_count = (int)$board['bo_upload_count'];
|
||||
|
||||
//공지
|
||||
$notice_array = explode(',', trim($board['bo_notice']));
|
||||
$notice_checked = '';
|
||||
if ($w == 'u') {
|
||||
if (in_array((int)$wr_id, $notice_array)) {
|
||||
$notice_checked = 'checked';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="fitemqaform" method="post" action="./bbs_form_update.php" method="post" enctype="multipart/form-data" onsubmit="return fitemqaform_submit(this);">
|
||||
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
|
||||
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
|
||||
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
|
||||
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
|
||||
<input type="hidden" value="html1" name="html">
|
||||
|
||||
<?php if($w == "u") { ?>
|
||||
<input type="hidden" name="wr_id" value="<?php echo $wr_id; ?>">
|
||||
<input type="hidden" name="mb_id" value="<?php echo $wr['mb_id']; ?>">
|
||||
<input type="hidden" name="wr_name" value="<?php echo $wr['wr_name']; ?>">
|
||||
<input type="hidden" name="wr_email" value="<?php echo $wr['wr_email']; ?>">
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="mb_id" value="<?php echo $member['mb_id']; ?>">
|
||||
<input type="hidden" name="wr_name" value="<?php echo $member['mb_nick']; ?>">
|
||||
<input type="hidden" name="wr_email" value="<?php echo $member['mb_email']; ?>">
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<?php if ($is_category) { ?>
|
||||
<tr>
|
||||
<th scope="row">분류</th>
|
||||
<td class="">
|
||||
<select name="ca_name" id="ca_name" required class="select">
|
||||
<option value="">분류를 선택하세요</option>
|
||||
<?php echo $category_option ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<th scope="row">옵션</th>
|
||||
<td class="">
|
||||
<input type="checkbox" id="notice" name="notice" value="1" <?php echo $notice_checked ?>><label for="notice"> 공지</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if($w == "u") { ?>
|
||||
<tr>
|
||||
<th scope="row">작성자</th>
|
||||
<td>
|
||||
<a href="./member_form.php?w=u&mb_id=<?php echo $wr['mb_id'] ?>"><?php echo $name; ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_subject">제목</label></th>
|
||||
<td><input type="text" name="wr_subject" value="<?php echo isset($wr['wr_subject']) ? $wr['wr_subject'] : ''; ?>" id="wr_subject" required class="frm_input required" size="95"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="wr_content">내용</label></th>
|
||||
<td><?php echo editor_html('wr_content', get_text(html_purifier(isset($wr['wr_content']) ? $wr['wr_content'] : ''), 0)); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php for ($i=1; $is_link && $i<=G5_LINK_COUNT; $i++) { ?>
|
||||
<tr>
|
||||
<th scope="row">링크 <?php echo $i ?></th>
|
||||
<td class="">
|
||||
<input type="text" name="wr_link<?php echo $i ?>" value="<?php if($w=="u"){ echo $wr['wr_link'.$i]; } ?>" id="wr_link<?php echo $i ?>" class="frm_input" size="50" placeholder="링크 <?php echo $i ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
if($w == "u") {
|
||||
$file = get_file_qa($bo_table, $wr_id);
|
||||
}
|
||||
for ($i=0; $is_file && $i<$file_count; $i++) {
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_icon">첨부파일 <?php echo $i+1 ?></label></th>
|
||||
<td>
|
||||
<input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?>" class="frm_input">
|
||||
<?php if ($w == "u" && isset($file[$i]['source']) && $file[$i]['source']) { ?>
|
||||
<a href="<?php echo $file[$i]['href']; ?>" style="font-weight:bold"><?php echo $file[$i]['source'] ?></a> (<?php echo $file[$i]['size'] ?>)
|
||||
<?php } ?>
|
||||
<?php if ($w == 'u' && isset($file[$i]['file']) && $file[$i]['file']) { ?>
|
||||
<span class="file_del">
|
||||
<input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"> 파일삭제</label>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<a href="./bbs_list.php?<?php echo $qstr; ?>&bo_table=<?php echo $bo_table; ?>" class="btn btn_02">목록</a>
|
||||
<input type="submit" accesskey='s' value="확인" class="btn_submit btn">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function fitemqaform_submit(f)
|
||||
{
|
||||
<?php echo get_editor_js('wr_content'); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
521
adm/rb/bbs_form_update.php
Normal file
521
adm/rb/bbs_form_update.php
Normal file
@ -0,0 +1,521 @@
|
||||
<?php
|
||||
$sub_menu = '000400';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if ($w == 'd')
|
||||
auth_check_menu($auth, $sub_menu, "d");
|
||||
else
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$bo_table = $_POST['bo_table'];
|
||||
global $g5, $board;
|
||||
|
||||
if ($w == 'u') {
|
||||
$wr_id = $_POST['wr_id'];
|
||||
}
|
||||
|
||||
$mb_id = $_POST['mb_id'];
|
||||
$msg = array();
|
||||
|
||||
|
||||
//분류확인
|
||||
if($board['bo_use_category']) {
|
||||
$ca_name = isset($_POST['ca_name']) ? trim($_POST['ca_name']) : '';
|
||||
if(!$ca_name) {
|
||||
$msg[] = '<strong>분류</strong>를 선택하세요.';
|
||||
}
|
||||
} else {
|
||||
$ca_name = '';
|
||||
}
|
||||
|
||||
//제목확인
|
||||
$wr_subject = '';
|
||||
if (isset($_POST['wr_subject'])) {
|
||||
$wr_subject = substr(trim($_POST['wr_subject']),0,255);
|
||||
$wr_subject = preg_replace("#[\\\]+$#", "", $wr_subject);
|
||||
}
|
||||
if ($wr_subject == '') {
|
||||
$msg[] = '<strong>제목</strong>을 입력하세요.';
|
||||
}
|
||||
|
||||
//내용확인
|
||||
$wr_content = '';
|
||||
if (isset($_POST['wr_content'])) {
|
||||
$wr_content = substr(trim($_POST['wr_content']),0,65536);
|
||||
$wr_content = preg_replace("#[\\\]+$#", "", $wr_content);
|
||||
}
|
||||
if ($wr_content == '') {
|
||||
$msg[] = '<strong>내용</strong>을 입력하세요.';
|
||||
}
|
||||
|
||||
//링크확인
|
||||
$wr_link1 = '';
|
||||
if (isset($_POST['wr_link1'])) {
|
||||
$wr_link1 = substr($_POST['wr_link1'],0,1000);
|
||||
$wr_link1 = trim(strip_tags($wr_link1));
|
||||
$wr_link1 = preg_replace("#[\\\]+$#", "", $wr_link1);
|
||||
}
|
||||
|
||||
$wr_link2 = '';
|
||||
if (isset($_POST['wr_link2'])) {
|
||||
$wr_link2 = substr($_POST['wr_link2'],0,1000);
|
||||
$wr_link2 = trim(strip_tags($wr_link2));
|
||||
$wr_link2 = preg_replace("#[\\\]+$#", "", $wr_link2);
|
||||
}
|
||||
|
||||
//경고출력
|
||||
$msg = implode('<br>', $msg);
|
||||
if ($msg) {
|
||||
alert($msg);
|
||||
}
|
||||
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
|
||||
if (empty($_POST)) {
|
||||
alert("파일 또는 글내용의 크기가 서버에서 설정한 값을 넘어 오류가 발생하였습니다.\\npost_max_size=".ini_get('post_max_size')." , upload_max_filesize=".$upload_max_filesize."\\n서버관리자에게 문의 바랍니다.");
|
||||
}
|
||||
|
||||
$notice_array = explode(",", $board['bo_notice']);
|
||||
$wr_password = isset($_POST['wr_password']) ? $_POST['wr_password'] : '';
|
||||
$bf_content = isset($_POST['bf_content']) ? (array) $_POST['bf_content'] : array();
|
||||
$_POST['html'] = isset($_POST['html']) ? clean_xss_tags($_POST['html'], 1, 1) : '';
|
||||
$_POST['secret'] = isset($_POST['secret']) ? clean_xss_tags($_POST['secret'], 1, 1) : '';
|
||||
$_POST['mail'] = isset($_POST['mail']) ? clean_xss_tags($_POST['mail'], 1, 1) : '';
|
||||
|
||||
if ($w == 'u') {
|
||||
$wr = get_write($write_table, $wr_id);
|
||||
if (!$wr['wr_id']) {
|
||||
alert("해당 게시물이 존재하지 않습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
//비밀글 체크
|
||||
$secret = '';
|
||||
if (isset($_POST['secret']) && $_POST['secret']) {
|
||||
if(preg_match('#secret#', strtolower($_POST['secret']), $matches))
|
||||
$secret = $matches[0];
|
||||
}
|
||||
|
||||
//html 체크
|
||||
$html = '';
|
||||
if (isset($_POST['html']) && $_POST['html']) {
|
||||
if(preg_match('#html(1|2)#', strtolower($_POST['html']), $matches))
|
||||
$html = $matches[0];
|
||||
}
|
||||
|
||||
//메일발송 체크
|
||||
$mail = '';
|
||||
if (isset($_POST['mail']) && $_POST['mail']) {
|
||||
if(preg_match('#mail#', strtolower($_POST['mail']), $matches))
|
||||
$mail = $matches[0];
|
||||
}
|
||||
|
||||
//공지체크
|
||||
$notice = '';
|
||||
if (isset($_POST['notice']) && $_POST['notice']) {
|
||||
$notice = $_POST['notice'];
|
||||
}
|
||||
|
||||
//여분필드 체크
|
||||
for ($i=1; $i<=10; $i++) {
|
||||
$var = "wr_$i";
|
||||
$$var = "";
|
||||
if (isset($_POST['wr_'.$i]) && settype($_POST['wr_'.$i], 'string')) {
|
||||
$$var = trim($_POST['wr_'.$i]);
|
||||
}
|
||||
}
|
||||
|
||||
//옵션
|
||||
$options = array($html,$secret,$mail);
|
||||
$wr_option = implode(',', array_filter(array_map('trim', $options)));
|
||||
|
||||
if ($w == ""){
|
||||
if ($member['mb_id']) {
|
||||
$mb_id = $member['mb_id'];
|
||||
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
|
||||
$wr_password = '';
|
||||
$wr_email = addslashes($member['mb_email']);
|
||||
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
|
||||
} else {
|
||||
$mb_id = '';
|
||||
// 비회원의 경우 이름이 누락되는 경우가 있음
|
||||
$wr_name = clean_xss_tags(trim($_POST['wr_name']));
|
||||
if (!$wr_name)
|
||||
alert('이름은 필히 입력하셔야 합니다.');
|
||||
$wr_password = get_encrypt_string($wr_password);
|
||||
$wr_email = get_email_address(trim($_POST['wr_email']));
|
||||
$wr_homepage = clean_xss_tags($wr_homepage);
|
||||
}
|
||||
}
|
||||
|
||||
$wr_seo_title = exist_seo_title_recursive('bbs', generate_seo_title($wr_subject), $write_table, $wr_id);
|
||||
|
||||
$wr_num = get_next_num($write_table);
|
||||
$wr_reply = '';
|
||||
|
||||
|
||||
if ($w == "") {
|
||||
$sql = " insert into $write_table
|
||||
set wr_num = '$wr_num',
|
||||
wr_reply = '$wr_reply',
|
||||
wr_comment = 0,
|
||||
ca_name = '$ca_name',
|
||||
wr_option = '$wr_option',
|
||||
wr_subject = '$wr_subject',
|
||||
wr_content = '$wr_content',
|
||||
wr_seo_title = '$wr_seo_title',
|
||||
wr_link1 = '$wr_link1',
|
||||
wr_link2 = '$wr_link2',
|
||||
wr_link1_hit = 0,
|
||||
wr_link2_hit = 0,
|
||||
wr_hit = 0,
|
||||
wr_good = 0,
|
||||
wr_nogood = 0,
|
||||
mb_id = '{$member['mb_id']}',
|
||||
wr_password = '$wr_password',
|
||||
wr_name = '$wr_name',
|
||||
wr_email = '$wr_email',
|
||||
wr_homepage = '$wr_homepage',
|
||||
wr_datetime = '".G5_TIME_YMDHIS."',
|
||||
wr_last = '".G5_TIME_YMDHIS."',
|
||||
wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
$wr_id = sql_insert_id();
|
||||
|
||||
// 부모 아이디에 UPDATE
|
||||
sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
|
||||
|
||||
// 새글 INSERT
|
||||
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");
|
||||
|
||||
// 게시글 1 증가
|
||||
sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'");
|
||||
|
||||
// 공지처리
|
||||
if ($w == '') {
|
||||
if ($notice) {
|
||||
$bo_notice = $wr_id.($board['bo_notice'] ? ",".$board['bo_notice'] : '');
|
||||
sql_query(" update {$g5['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' ");
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
} else if($w == "u") {
|
||||
|
||||
if ($member['mb_id']) {
|
||||
// 자신의 글이라면
|
||||
if ($member['mb_id'] === $wr['mb_id']) {
|
||||
$mb_id = $member['mb_id'];
|
||||
$wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']));
|
||||
$wr_email = addslashes($member['mb_email']);
|
||||
$wr_homepage = addslashes(clean_xss_tags($member['mb_homepage']));
|
||||
} else {
|
||||
$mb_id = $wr['mb_id'];
|
||||
if(isset($_POST['wr_name']) && $_POST['wr_name'])
|
||||
$wr_name = clean_xss_tags(trim($_POST['wr_name']));
|
||||
else
|
||||
$wr_name = addslashes(clean_xss_tags($wr['wr_name']));
|
||||
if(isset($_POST['wr_email']) && $_POST['wr_email'])
|
||||
$wr_email = get_email_address(trim($_POST['wr_email']));
|
||||
else
|
||||
$wr_email = addslashes($wr['wr_email']);
|
||||
if(isset($_POST['wr_homepage']) && $_POST['wr_homepage'])
|
||||
$wr_homepage = addslashes(clean_xss_tags($_POST['wr_homepage']));
|
||||
else
|
||||
$wr_homepage = addslashes(clean_xss_tags($wr['wr_homepage']));
|
||||
}
|
||||
} else {
|
||||
$mb_id = "";
|
||||
// 비회원의 경우 이름이 누락되는 경우가 있음
|
||||
if (!trim($wr_name)) alert("이름은 필히 입력하셔야 합니다.");
|
||||
$wr_name = clean_xss_tags(trim($_POST['wr_name']));
|
||||
$wr_email = get_email_address(trim($_POST['wr_email']));
|
||||
}
|
||||
|
||||
$sql_password = $wr_password ? " , wr_password = '".get_encrypt_string($wr_password)."' " : "";
|
||||
|
||||
$sql_ip = '';
|
||||
if (!$is_admin)
|
||||
$sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
|
||||
$sql = " update {$write_table}
|
||||
set ca_name = '{$ca_name}',
|
||||
wr_option = '{$wr_option}',
|
||||
wr_subject = '{$wr_subject}',
|
||||
wr_content = '{$wr_content}',
|
||||
wr_seo_title = '$wr_seo_title',
|
||||
wr_link1 = '{$wr_link1}',
|
||||
wr_link2 = '{$wr_link2}',
|
||||
mb_id = '{$mb_id}',
|
||||
wr_name = '{$wr_name}',
|
||||
wr_email = '{$wr_email}',
|
||||
wr_homepage = '{$wr_homepage}'
|
||||
{$sql_ip}
|
||||
{$sql_password}
|
||||
where wr_id = '{$wr['wr_id']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 분류가 수정되는 경우 해당되는 코멘트의 분류명도 모두 수정함
|
||||
// 코멘트의 분류를 수정하지 않으면 검색이 제대로 되지 않음
|
||||
$sql = " update {$write_table} set ca_name = '{$ca_name}' where wr_parent = '{$wr['wr_id']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
$bo_notice = board_notice($board['bo_notice'], $wr_id, $notice);
|
||||
sql_query(" update {$g5['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' ");
|
||||
|
||||
// 글을 수정한 경우에는 제목이 달라질수도 있으니 static variable 를 새로고침합니다.
|
||||
$write = get_write( $write_table, $wr['wr_id'], false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 파일개수 체크
|
||||
$file_count = 0;
|
||||
$upload_count = (isset($_FILES['bf_file']['name']) && is_array($_FILES['bf_file']['name'])) ? count($_FILES['bf_file']['name']) : 0;
|
||||
|
||||
for ($i=0; $i<$upload_count; $i++) {
|
||||
if($_FILES['bf_file']['name'][$i] && is_uploaded_file($_FILES['bf_file']['tmp_name'][$i]))
|
||||
$file_count++;
|
||||
}
|
||||
|
||||
if($w == 'u') {
|
||||
$file = get_file($bo_table, $wr_id);
|
||||
if($file_count && (int)$file['count'] > $board['bo_upload_count'])
|
||||
alert('기존 파일을 삭제하신 후 첨부파일을 '.number_format($board['bo_upload_count']).'개 이하로 업로드 해주십시오.');
|
||||
} else {
|
||||
if($file_count > $board['bo_upload_count'])
|
||||
alert('첨부파일을 '.number_format($board['bo_upload_count']).'개 이하로 업로드 해주십시오.');
|
||||
}
|
||||
|
||||
// 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.)
|
||||
@mkdir(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION);
|
||||
|
||||
$chars_array = array_merge(range(0,9), range('a','z'), range('A','Z'));
|
||||
|
||||
// 가변 파일 업로드
|
||||
$file_upload_msg = '';
|
||||
$upload = array();
|
||||
|
||||
if(isset($_FILES['bf_file']['name']) && is_array($_FILES['bf_file']['name'])) {
|
||||
for ($i=0; $i<count($_FILES['bf_file']['name']); $i++) {
|
||||
$upload[$i]['file'] = '';
|
||||
$upload[$i]['source'] = '';
|
||||
$upload[$i]['filesize'] = 0;
|
||||
$upload[$i]['image'] = array();
|
||||
$upload[$i]['image'][0] = 0;
|
||||
$upload[$i]['image'][1] = 0;
|
||||
$upload[$i]['image'][2] = 0;
|
||||
$upload[$i]['fileurl'] = '';
|
||||
$upload[$i]['thumburl'] = '';
|
||||
$upload[$i]['storage'] = '';
|
||||
|
||||
// 삭제에 체크가 되어있다면 파일을 삭제합니다.
|
||||
if (isset($_POST['bf_file_del'][$i]) && $_POST['bf_file_del'][$i]) {
|
||||
$upload[$i]['del_check'] = true;
|
||||
|
||||
$row = sql_fetch(" select * from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
|
||||
|
||||
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row['bf_file']), $row);
|
||||
if( file_exists($delete_file) ){
|
||||
@unlink($delete_file);
|
||||
}
|
||||
// 썸네일삭제
|
||||
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row['bf_file'])) {
|
||||
delete_board_thumbnail($bo_table, $row['bf_file']);
|
||||
}
|
||||
}
|
||||
else
|
||||
$upload[$i]['del_check'] = false;
|
||||
|
||||
$tmp_file = $_FILES['bf_file']['tmp_name'][$i];
|
||||
$filesize = $_FILES['bf_file']['size'][$i];
|
||||
$filename = $_FILES['bf_file']['name'][$i];
|
||||
$filename = get_safe_filename($filename);
|
||||
|
||||
// 서버에 설정된 값보다 큰파일을 업로드 한다면
|
||||
if ($filename) {
|
||||
if ($_FILES['bf_file']['error'][$i] == 1) {
|
||||
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량이 서버에 설정('.$upload_max_filesize.')된 값보다 크므로 업로드 할 수 없습니다.\\n';
|
||||
continue;
|
||||
}
|
||||
else if ($_FILES['bf_file']['error'][$i] != 0) {
|
||||
$file_upload_msg .= '\"'.$filename.'\" 파일이 정상적으로 업로드 되지 않았습니다.\\n';
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_uploaded_file($tmp_file)) {
|
||||
// 관리자가 아니면서 설정한 업로드 사이즈보다 크다면 건너뜀
|
||||
if (!$is_admin && $filesize > $board['bo_upload_size']) {
|
||||
$file_upload_msg .= '\"'.$filename.'\" 파일의 용량('.number_format($filesize).' 바이트)이 게시판에 설정('.number_format($board['bo_upload_size']).' 바이트)된 값보다 크므로 업로드 하지 않습니다.\\n';
|
||||
continue;
|
||||
}
|
||||
|
||||
//=================================================================\
|
||||
// 090714
|
||||
// 이미지나 플래시 파일에 악성코드를 심어 업로드 하는 경우를 방지
|
||||
// 에러메세지는 출력하지 않는다.
|
||||
//-----------------------------------------------------------------
|
||||
$timg = @getimagesize($tmp_file);
|
||||
// image type
|
||||
if ( preg_match("/\.({$config['cf_image_extension']})$/i", $filename) ||
|
||||
preg_match("/\.({$config['cf_flash_extension']})$/i", $filename) ) {
|
||||
if ($timg['2'] < 1 || $timg['2'] > 18)
|
||||
continue;
|
||||
}
|
||||
//=================================================================
|
||||
|
||||
$upload[$i]['image'] = $timg;
|
||||
|
||||
// 4.00.11 - 글답변에서 파일 업로드시 원글의 파일이 삭제되는 오류를 수정
|
||||
if ($w == 'u') {
|
||||
// 존재하는 파일이 있다면 삭제합니다.
|
||||
$row = sql_fetch(" select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
|
||||
|
||||
if(isset($row['bf_file']) && $row['bf_file']){
|
||||
$delete_file = run_replace('delete_file_path', G5_DATA_PATH.'/file/'.$bo_table.'/'.str_replace('../', '', $row['bf_file']), $row);
|
||||
if( file_exists($delete_file) ){
|
||||
@unlink(G5_DATA_PATH.'/file/'.$bo_table.'/'.$row['bf_file']);
|
||||
}
|
||||
// 이미지파일이면 썸네일삭제
|
||||
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row['bf_file'])) {
|
||||
delete_board_thumbnail($bo_table, $row['bf_file']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 프로그램 원래 파일명
|
||||
$upload[$i]['source'] = $filename;
|
||||
$upload[$i]['filesize'] = $filesize;
|
||||
|
||||
// 아래의 문자열이 들어간 파일은 -x 를 붙여서 웹경로를 알더라도 실행을 하지 못하도록 함
|
||||
$filename = preg_replace("/\.(php|pht|phtm|htm|cgi|pl|exe|jsp|asp|inc|phar)/i", "$0-x", $filename);
|
||||
|
||||
shuffle($chars_array);
|
||||
$shuffle = implode('', $chars_array);
|
||||
|
||||
// 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925)
|
||||
$upload[$i]['file'] = md5(sha1($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename);
|
||||
|
||||
$dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$upload[$i]['file'];
|
||||
|
||||
// 업로드가 안된다면 에러메세지 출력하고 죽어버립니다.
|
||||
$error_code = move_uploaded_file($tmp_file, $dest_file) or die($_FILES['bf_file']['error'][$i]);
|
||||
|
||||
// 올라간 파일의 퍼미션을 변경합니다.
|
||||
chmod($dest_file, G5_FILE_PERMISSION);
|
||||
|
||||
$dest_file = run_replace('write_update_upload_file', $dest_file, $board, $wr_id, $w);
|
||||
$upload[$i] = run_replace('write_update_upload_array', $upload[$i], $dest_file, $board, $wr_id, $w);
|
||||
}
|
||||
} // end for
|
||||
} // end if
|
||||
|
||||
// 나중에 테이블에 저장하는 이유는 $wr_id 값을 저장해야 하기 때문입니다.
|
||||
for ($i=0; $i<count($upload); $i++)
|
||||
{
|
||||
$upload[$i]['source'] = sql_real_escape_string($upload[$i]['source']);
|
||||
$bf_content[$i] = isset($bf_content[$i]) ? sql_real_escape_string($bf_content[$i]) : '';
|
||||
$bf_width = isset($upload[$i]['image'][0]) ? (int) $upload[$i]['image'][0] : 0;
|
||||
$bf_height = isset($upload[$i]['image'][1]) ? (int) $upload[$i]['image'][1] : 0;
|
||||
$bf_type = isset($upload[$i]['image'][2]) ? (int) $upload[$i]['image'][2] : 0;
|
||||
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
|
||||
if ($row['cnt'])
|
||||
{
|
||||
// 삭제에 체크가 있거나 파일이 있다면 업데이트를 합니다.
|
||||
// 그렇지 않다면 내용만 업데이트 합니다.
|
||||
if ($upload[$i]['del_check'] || $upload[$i]['file'])
|
||||
{
|
||||
$sql = " update {$g5['board_file_table']}
|
||||
set bf_source = '{$upload[$i]['source']}',
|
||||
bf_file = '{$upload[$i]['file']}',
|
||||
bf_content = '{$bf_content[$i]}',
|
||||
bf_fileurl = '{$upload[$i]['fileurl']}',
|
||||
bf_thumburl = '{$upload[$i]['thumburl']}',
|
||||
bf_storage = '{$upload[$i]['storage']}',
|
||||
bf_filesize = '".(int)$upload[$i]['filesize']."',
|
||||
bf_width = '".$bf_width."',
|
||||
bf_height = '".$bf_height."',
|
||||
bf_type = '".$bf_type."',
|
||||
bf_datetime = '".G5_TIME_YMDHIS."'
|
||||
where bo_table = '{$bo_table}'
|
||||
and wr_id = '{$wr_id}'
|
||||
and bf_no = '{$i}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = " update {$g5['board_file_table']}
|
||||
set bf_content = '{$bf_content[$i]}'
|
||||
where bo_table = '{$bo_table}'
|
||||
and wr_id = '{$wr_id}'
|
||||
and bf_no = '{$i}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = " insert into {$g5['board_file_table']}
|
||||
set bo_table = '{$bo_table}',
|
||||
wr_id = '{$wr_id}',
|
||||
bf_no = '{$i}',
|
||||
bf_source = '{$upload[$i]['source']}',
|
||||
bf_file = '{$upload[$i]['file']}',
|
||||
bf_content = '{$bf_content[$i]}',
|
||||
bf_fileurl = '{$upload[$i]['fileurl']}',
|
||||
bf_thumburl = '{$upload[$i]['thumburl']}',
|
||||
bf_storage = '{$upload[$i]['storage']}',
|
||||
bf_download = 0,
|
||||
bf_filesize = '".(int)$upload[$i]['filesize']."',
|
||||
bf_width = '".$bf_width."',
|
||||
bf_height = '".$bf_height."',
|
||||
bf_type = '".$bf_type."',
|
||||
bf_datetime = '".G5_TIME_YMDHIS."' ";
|
||||
sql_query($sql);
|
||||
|
||||
run_event('write_update_file_insert', $bo_table, $wr_id, $upload[$i], $w);
|
||||
}
|
||||
}
|
||||
|
||||
// 업로드된 파일 내용에서 가장 큰 번호를 얻어 거꾸로 확인해 가면서
|
||||
// 파일 정보가 없다면 테이블의 내용을 삭제합니다.
|
||||
$row = sql_fetch(" select max(bf_no) as max_bf_no from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ");
|
||||
for ($i=(int)$row['max_bf_no']; $i>=0; $i--)
|
||||
{
|
||||
$row2 = sql_fetch(" select bf_file from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
|
||||
|
||||
// 정보가 있다면 빠집니다.
|
||||
if (isset($row2['bf_file']) && $row2['bf_file']) break;
|
||||
|
||||
// 그렇지 않다면 정보를 삭제합니다.
|
||||
sql_query(" delete from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
|
||||
}
|
||||
|
||||
// 파일의 개수를 게시물에 업데이트 한다.
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ");
|
||||
sql_query(" update {$write_table} set wr_file = '{$row['cnt']}' where wr_id = '{$wr_id}' ");
|
||||
|
||||
// 자동저장된 레코드를 삭제한다.
|
||||
sql_query(" delete from {$g5['autosave_table']} where as_uid = '{$uid}' ");
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
delete_cache_latest($bo_table);
|
||||
|
||||
if ($file_upload_msg) {
|
||||
alert($file_upload_msg);
|
||||
}
|
||||
|
||||
if($w == "u") {
|
||||
goto_url("./bbs_form.php?w=u&wr_id=$wr_id&sca=$sca&$qstr&bo_table=$bo_table");
|
||||
} else if ($w == "") {
|
||||
goto_url("./bbs_list.php?$qstr&bo_table=$bo_table");
|
||||
}
|
||||
231
adm/rb/bbs_list.php
Normal file
231
adm/rb/bbs_list.php
Normal file
@ -0,0 +1,231 @@
|
||||
<?php
|
||||
$sub_menu = '000400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "r");
|
||||
|
||||
$g5['title'] = '게시물 관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_ADMIN_URL.'/rb/css/style.css">', 1);
|
||||
|
||||
$bo_table = isset($_GET['bo_table']) ? $_GET['bo_table'] : '';
|
||||
$write_table = isset($g5['write_prefix']) ? $g5['write_prefix'] . $bo_table : '';
|
||||
|
||||
global $board;
|
||||
|
||||
$where = " where wr_is_comment = 0 and ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if ($sca != "") {
|
||||
$sql_search .= " and ca_id like '$sca%' ";
|
||||
}
|
||||
|
||||
//if ($sfl == "") $sfl = "it_name";
|
||||
if (!$sst) {
|
||||
$sst = "wr_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
|
||||
if ($stx) {
|
||||
$sql_common = " from {$write_table} ";
|
||||
} else {
|
||||
$sql_common = " from {$write_table} where wr_is_comment = 0 ";
|
||||
}
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = isset($row['cnt']) ? $row['cnt'] : 0;
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
order by $sst $sod, wr_id desc
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = 'page='.$page.'&sst='.$sst.'&sod='.$sod.'&stx='.$stx;
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca.'&save_stx='.$stx;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table.'" class="ov_listall">전체목록</a>';
|
||||
|
||||
|
||||
//제외할 게시판이 있다면 아래 예제와 같이 추가
|
||||
//$sql_wheres = " where (1) ";
|
||||
//$sql_wheres .= " and bo_table != 'aaa' ";
|
||||
//$sql_wheres .= " and bo_table != 'bbb' ";
|
||||
//$sql_wheres .= " and bo_table != 'ccc' ";
|
||||
|
||||
$sql_wheres = isset($sql_wheres) ? $sql_wheres : '';
|
||||
$sql_b = "SELECT bo_table, bo_subject FROM " . (isset($g5['board_table']) ? $g5['board_table'] : '') . " " . $sql_wheres . " ORDER BY bo_mobile_subject";
|
||||
$res_b = sql_query($sql_b);
|
||||
|
||||
|
||||
//
|
||||
|
||||
?>
|
||||
<form name="fcategory" method="get" class="local_sch01 local_sch">
|
||||
<div class="local_ov01 local_ov">
|
||||
<select name="bo_table" onchange="this.form.submit();" class="select">
|
||||
<option value=''>게시판 선택</option>
|
||||
|
||||
<?php
|
||||
for ($i = 0; $row_b = sql_fetch_array($res_b); $i++) {
|
||||
$bo_table_id = isset($row_b['bo_table']) ? $row_b['bo_table'] : '';
|
||||
$bo_table_tit = isset($row_b['bo_subject']) ? $row_b['bo_subject'] : '';
|
||||
$bo_table_partner_txt = isset($bo_table_partner_txt) ? $bo_table_partner_txt : '';
|
||||
?>
|
||||
<option value="<?php echo $bo_table_id ?>" <?php if (isset($bo_table) && $bo_table == $bo_table_id) { ?>selected<?php } ?>><?php echo $bo_table_partner_txt; ?><?php echo $bo_table_tit; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
<!--
|
||||
<?php echo $listall; ?>
|
||||
-->
|
||||
<?php if($bo_table) { ?>
|
||||
<span class="btn_ov01"><span class="ov_txt"> <?php echo $board['bo_mobile_subject']; ?> </span><span class="ov_num"> <?php echo $total_count; ?>건</span></span>
|
||||
<?php } else { ?>
|
||||
<span class="btn_ov01"><span class="ov_txt"> 미선택</span><span class="ov_num">게시판을 선택해주세요.</span></span>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
|
||||
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="wr_name" <?php echo get_selected($sfl, 'wr_name'); ?>>작성자</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
-->
|
||||
|
||||
<form name="fitemqalist" method="post" action="./bbs_list_update.php" onsubmit="return fitemqalist_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
|
||||
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
|
||||
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
|
||||
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap" id="itemqalist">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col"><?php echo subject_sort_link('wr_subject'); ?>제목</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('wr_datetime'); ?>작성일</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('wr_name'); ?>작성자</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('wr_hit'); ?>조회</a></th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$row['wr_subject'] = $row['wr_subject'];
|
||||
|
||||
$mb_info = get_member($row['mb_id']);
|
||||
$name = get_sideview($row['mb_id'], get_text($mb_info['mb_nick']), $mb_info['mb_email'], $mb_info['mb_homepage']);
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
|
||||
<td class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['wr_subject']) ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
<input type="hidden" name="wr_id[<?php echo $i; ?>]" value="<?php echo $row['wr_id']; ?>">
|
||||
</td>
|
||||
|
||||
|
||||
<td class="td_left">
|
||||
<?php if($row['ca_name']) { ?>[<?php echo $row['ca_name']; ?>]<?php } ?> <a href="./bbs_form.php?w=u&wr_id=<?php echo $row['wr_id']; ?>&<?php echo $qstr; ?>&bo_table=<?php echo $bo_table; ?>"><?php echo get_text($row['wr_subject']); ?></a>
|
||||
</td>
|
||||
<td class="td_datetime"><?php echo $row['wr_datetime']; ?></td>
|
||||
<td class="td_name sv_use" nowrap><div><?php echo $name ?></div></td>
|
||||
<td class="td_mng td_mng_s"><?php echo $row['wr_hit']; ?></td>
|
||||
<td class="td_mng td_mng_s">
|
||||
<a href="./bbs_form.php?w=u&wr_id=<?php echo $row['wr_id']; ?>&<?php echo $qstr; ?>&bo_table=<?php echo $bo_table; ?>" class="btn btn_03"><span class="sound_only"><?php echo get_text($row['wr_subject']); ?> </span>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) {
|
||||
if($bo_table) {
|
||||
echo '<tr><td colspan="6" class="empty_table"><span>게시물이 없습니다.</span></td></tr>';
|
||||
} else {
|
||||
echo '<tr><td colspan="6" class="empty_table"><span>게시판을 선택해주세요.</span></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">
|
||||
<?php if(!$bo_table) { ?>
|
||||
<a href="javascript:alert('게시판을 선택해주세요.');" id="bo_add" class="btn_01 btn">게시글 등록</a>
|
||||
<?php } else { ?>
|
||||
<a href="./bbs_form.php?bo_table=<?php echo $bo_table; ?>" id="bo_add" class="btn_01 btn">게시글 등록</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&bo_table=$bo_table&page="); ?>
|
||||
|
||||
<script>
|
||||
function fitemqalist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
38
adm/rb/bbs_list_update.php
Normal file
38
adm/rb/bbs_list_update.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
$sub_menu = '000400';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$count_post_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
|
||||
$bo_table = $_POST['bo_table'];
|
||||
$write_table = $g5['write_prefix'] . $bo_table;
|
||||
|
||||
if (! $count_post_chk) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'd');
|
||||
|
||||
for ($i=0; $i<$count_post_chk; $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
|
||||
$iwr_id = isset($_POST['wr_id'][$i]) ? (int) $_POST['wr_id'][$k] : 0;
|
||||
|
||||
// 게시글과 댓글 삭제
|
||||
sql_query(" delete from {$write_table} where wr_parent = '{$iwr_id}' ");
|
||||
|
||||
// 최근게시물 삭제
|
||||
sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_parent = '{$iwr_id}' ");
|
||||
|
||||
// 스크랩 삭제
|
||||
sql_query(" delete from {$g5['scrap_table']} where bo_table = '{$bo_table}' and wr_id = '{$iwr_id}' ");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
goto_url("./bbs_list.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page&bo_table=$bo_table");
|
||||
17
adm/rb/config_form.php
Normal file
17
adm/rb/config_form.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$sub_menu = '000100';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
$g5['title'] = '환경설정';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
메인페이지 > 우측 하단의 환경설정 버튼을 이용해주세요.<br>
|
||||
(추후 업데이트 예정)
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
7
adm/rb/css/style.css
Normal file
7
adm/rb/css/style.css
Normal file
@ -0,0 +1,7 @@
|
||||
@charset "utf-8";
|
||||
|
||||
.border_box_adm {border:1px solid #ddd; padding: 15px 20px 15px 20px; margin-bottom: 20px; box-sizing: border-box;}
|
||||
.td_name.sv_use a img {height: 12px; margin-left: 2px;}
|
||||
.td_name.sv_use a .profile_img img {height:22px;}
|
||||
.td_name.sv_use div .sv_wrap .sv {width: 100px !important;}
|
||||
.sv_wrap .sv a {display: block !important;}
|
||||
BIN
adm/rb/img/bg_favicon_example.png
Normal file
BIN
adm/rb/img/bg_favicon_example.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
287
adm/rb/memo_form.php
Normal file
287
adm/rb/memo_form.php
Normal file
@ -0,0 +1,287 @@
|
||||
<?php
|
||||
$sub_menu = '000630';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
add_stylesheet('<link rel="stylesheet" href="./css/style.css">', 0);
|
||||
|
||||
$g5['title'] = '쪽지 관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
// 메세지 목록처리
|
||||
$where = " where me_recv_mb_id != '' and ";
|
||||
$sql_search = "";
|
||||
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if (!$sst) {
|
||||
$sst = "me_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
|
||||
|
||||
$sql_common = " from {$g5['memo_table']} ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql_list = " select count(*) as cnt " . $sql_common;
|
||||
$list = sql_fetch($sql_list);
|
||||
$total_count = isset($list['cnt']) ? $list['cnt'] : 0;
|
||||
|
||||
$rows = 10;
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql_is = " select *
|
||||
$sql_common
|
||||
order by $sst $sod
|
||||
limit $from_record, $rows ";
|
||||
$result_is = sql_query($sql_is);
|
||||
|
||||
$qstr .= ($qstr ? '&' : '').'save_stx='.$stx;
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.chat_list_image img {height: 40px; width: auto; border-radius: 8px;}
|
||||
.view_image img {height: 40px; width: auto; border-radius: 8px;}
|
||||
.chat_list_video {border-radius: 8px;}
|
||||
.chat_list_audio {height:40px;}
|
||||
.chat_file_icos {margin-right: 5px;}
|
||||
</style>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="me_send_mb_id" <?php echo get_selected($sfl, 'me_send_mb_id'); ?>>발송인(ID)</option>
|
||||
<option value="me_recv_mb_id" <?php echo get_selected($sfl, 'me_recv_mb_id'); ?>>수신인(ID)</option>
|
||||
<option value="me_send_ip" <?php echo get_selected($sfl, 'me_send_ip'); ?>>발송 IP</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit"> <?php echo $listall ?> <span class="btn_ov01"><span class="ov_txt">총 </span><span class="ov_num"> <?php echo number_format($total_count) ?>건 </span></span>
|
||||
</form>
|
||||
|
||||
<form name="fitemqalist" method="post" action="./memo_list_update.php" onsubmit="return fitemqalist_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
|
||||
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
|
||||
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
|
||||
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap" id="itemqalist">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_send_mb_id'); ?>보냄</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_recv_mb_id'); ?>받음</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_memo'); ?>내용</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_send_datetime'); ?>발송시간</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_read_datetime'); ?>수신시간</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('me_send_ip'); ?>발송IP</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $rowss=sql_fetch_array($result_is); $i++) {
|
||||
|
||||
$mbx1 = isset($rowss['me_send_mb_id']) ? get_member($rowss['me_send_mb_id']) : '';
|
||||
$mbx2 = isset($rowss['me_recv_mb_id']) ? get_member($rowss['me_recv_mb_id']) : '';
|
||||
$name1 = isset($mbx1['mb_nick']) ? get_text($mbx1['mb_nick']) : '';
|
||||
$name2 = isset($mbx2['mb_nick']) ? get_text($mbx2['mb_nick']) : '';
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr style="background-color:#fff;">
|
||||
|
||||
<td class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>"></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
<input type="hidden" name="me_id[<?php echo $i; ?>]" value="<?php echo $rowss['me_id']; ?>">
|
||||
<input type="hidden" name="mb_id[<?php echo $i; ?>]" value="<?php echo $mbx2['mb_id']; ?>">
|
||||
</td>
|
||||
<td class="td_datetime" nowrap>
|
||||
<?php if(isset($name1) && $name1) { ?>
|
||||
<a href="../member_form.php?w=u&mb_id=<?php echo $rowss['me_send_mb_id'] ?>"><?php echo $name1; ?></a>
|
||||
<?php } else { ?>
|
||||
<span style="color:#ff4081">시스템</span>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="td_datetime" nowrap><a href="../member_form.php?w=u&mb_id=<?php echo $rowss['me_recv_mb_id'] ?>"><?php echo $name2; ?></a></td>
|
||||
<td class="td_left">
|
||||
<?php echo $rowss['me_memo']; ?>
|
||||
</td>
|
||||
|
||||
<td class="td_datetime" nowrap><?php echo $rowss['me_send_datetime']; ?></td>
|
||||
<td class="td_datetime" nowrap><?php echo $rowss['me_read_datetime']; ?></td>
|
||||
<td class="td_datetime" nowrap>
|
||||
<?php if(isset($rowss['me_send_ip']) && $rowss['me_send_ip']) { ?>
|
||||
<?php echo $rowss['me_send_ip']; ?>
|
||||
<?php } else { ?>
|
||||
-
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="7" class="empty_table"><span>메세지가 없습니다.</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_fixed_top" style="right:60px;">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_02">
|
||||
<input type="submit" name="act_button" value="전체삭제" onclick="document.pressed=this.value" class="btn btn_02">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<script>
|
||||
function fitemqalist_submit(f)
|
||||
{
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(document.pressed == "전체삭제") {
|
||||
if(!confirm("전체 데이터를 삭제하시겠습니까?\n삭제된 데이터는 복구되지 않습니다.")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<form name="fmemoform" id="fmemoform" action="./memo_update.php" onsubmit="return fmemoform_submit(this);" method="post">
|
||||
|
||||
<section>
|
||||
<h2 class="h2_frm">시스템메세지 전체 발송</h2>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
쪽지미수신(정보비공개) 회원을 포함하여 발송 됩니다.<br>
|
||||
10레벨 발송의 경우 최고 관리자는 제외합니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_admin_company_name">수신그룹</label></th>
|
||||
<td>
|
||||
<input type="checkbox" id="all_check" onclick="check_alls(this.form)">
|
||||
<label for="all_check">전체회원</label>
|
||||
|
||||
<?php for ($i=2; $i<=10; $i++) { ?>
|
||||
<input type="checkbox" name="mb_level[]" id="mb_level_<?php echo $i ?>" value="<?php echo $i ?>">
|
||||
<label for="mb_level_<?php echo $i ?>"><?php echo $i ?> 레벨</label>
|
||||
<?php } ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="de_admin_company_name">시스템메세지</label></th>
|
||||
<td>
|
||||
<textarea name="me_memo" id="me_memo" required></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<input type="submit" name="act_button" value="발송" onclick="document.pressed=this.value" class="btn btn_01">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function check_alls(f)
|
||||
{
|
||||
var chk = document.getElementsByName("mb_level[]");
|
||||
|
||||
for (i=0; i<chk.length; i++)
|
||||
chk[i].checked = f.all_check.checked;
|
||||
}
|
||||
|
||||
function fmemoform_submit(f)
|
||||
{
|
||||
var chk = document.getElementsByName("mb_level[]");
|
||||
var isChecked = false;
|
||||
|
||||
for (i=0; i<chk.length; i++) {
|
||||
if (chk[i].checked) {
|
||||
isChecked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isChecked) {
|
||||
alert("수신그룹을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
46
adm/rb/memo_list_update.php
Normal file
46
adm/rb/memo_list_update.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$sub_menu = '000630';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
check_admin_token();
|
||||
|
||||
if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
$count_post_chk = (isset($_POST['chk']) && is_array($_POST['chk'])) ? count($_POST['chk']) : 0;
|
||||
|
||||
if (! $count_post_chk) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
auth_check_menu($auth, $sub_menu, 'd');
|
||||
|
||||
for ($i = 0; $i < $count_post_chk; $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = isset($_POST['chk'][$i]) ? (int) $_POST['chk'][$i] : 0;
|
||||
$ime_id = isset($_POST['me_id'][$k]) ? (int) $_POST['me_id'][$k] : 0;
|
||||
$imb_id = isset($_POST['mb_id'][$k]) ? $_POST['mb_id'][$k] : '';
|
||||
|
||||
// 삭제를 위해 메모 내용을 가져옴
|
||||
$sqls = "SELECT * FROM {$g5['memo_table']} WHERE me_id = '{$ime_id}'";
|
||||
$rows = sql_fetch($sqls);
|
||||
|
||||
// 삭제
|
||||
sql_query("DELETE FROM {$g5['memo_table']} WHERE me_id = '{$ime_id}'");
|
||||
|
||||
$sql = " update {$g5['member_table']} set mb_memo_cnt = '".get_memo_not_read($imb_id)."' where mb_id = '{$imb_id}' ";
|
||||
sql_query($sql);
|
||||
|
||||
}
|
||||
} else if ($_POST['act_button'] == "전체삭제") {
|
||||
|
||||
// 삭제
|
||||
sql_query(" DELETE FROM {$g5['memo_table']} ");
|
||||
sql_query(" update {$g5['member_table']} set mb_memo_cnt = '0' ");
|
||||
alert('전체 데이터가 삭제 되었습니다.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
goto_url("./memo_form.php?sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
46
adm/rb/memo_update.php
Normal file
46
adm/rb/memo_update.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$sub_menu = '000630';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
check_admin_token();
|
||||
|
||||
$sql_common = " FROM {$g5['member_table']}";
|
||||
$sql_where = " WHERE (1) AND mb_id NOT IN ('{$config['cf_admin']}') ";
|
||||
|
||||
for ($i = 0; $i < count($_POST['mb_level']); $i++) {
|
||||
|
||||
$sql = "SELECT * {$sql_common} {$sql_where} AND mb_level = '".sql_escape_string($_POST['mb_level'][$i])."'";
|
||||
$sql_cnt = sql_fetch ("SELECT COUNT(*) as cnt {$sql_common} {$sql_where} AND mb_level = '".sql_escape_string($_POST['mb_level'][$i])."'");
|
||||
$result = sql_query($sql);
|
||||
|
||||
if (isset($sql_cnt['cnt']) && $sql_cnt['cnt'] > 0) {
|
||||
|
||||
while ($row = sql_fetch_array($result)) {
|
||||
if (!$row['mb_leave_date']) {
|
||||
|
||||
$rows_me = sql_fetch("SELECT MAX(me_id) AS new_me_id FROM {$g5['memo_table']}");
|
||||
$me_id = $rows_me['new_me_id'] + 1;
|
||||
|
||||
$send_id = 'system-msg'; // 발송할 아이디
|
||||
$memo_content = sql_escape_string($_POST['me_memo']);
|
||||
$from_id = $row['mb_id'];
|
||||
|
||||
$sql_m1 = "INSERT INTO {$g5['memo_table']} SET me_id='$me_id', me_recv_mb_id='$from_id', me_send_mb_id='$send_id', me_type='recv', me_send_datetime='".G5_TIME_YMDHIS."', me_memo='$memo_content'";
|
||||
sql_query($sql_m1);
|
||||
|
||||
$sql_m2 = "UPDATE {$g5['member_table']} SET mb_memo_call='$send_id', mb_memo_cnt='".get_memo_not_read($from_id)."' WHERE mb_id='$from_id'";
|
||||
sql_query($sql_m2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
alert('시스템메세지를 발송했습니다.');
|
||||
|
||||
} else {
|
||||
alert('시스템메세지를 발송할 회원이 없습니다.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
212
adm/rb/module_list.php
Normal file
212
adm/rb/module_list.php
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
$sub_menu = '000200';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "r");
|
||||
|
||||
$g5['title'] = '모듈관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
#ff4081
|
||||
|
||||
if(isset($_GET['tables']) && $_GET['tables'] == "rb_module_shop") {
|
||||
$table_name = $_GET['tables'];
|
||||
$cr2 = 'style="background-color:#ff4081"';
|
||||
$cr1 = "";
|
||||
} else {
|
||||
$table_name = "rb_module";
|
||||
$cr1 = 'style="background-color:#ff4081"';
|
||||
$cr2 = "";
|
||||
}
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall" '.$cr1.'>일반모듈</a>';
|
||||
$listall2 = '<a href="'.$_SERVER['SCRIPT_NAME'].'?tables=rb_module_shop" class="ov_listall" '.$cr2.'>마켓모듈</a>';
|
||||
|
||||
|
||||
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
|
||||
$sfl = in_array($sfl, array('md_title', 'md_theme', 'md_layout_name')) ? $sfl : '';
|
||||
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if (isset($save_stx) && $save_stx && ($save_stx != $stx))
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$sql_common = " from {$table_name} ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
if (!$sst)
|
||||
{
|
||||
$sst = "md_id";
|
||||
$sod = "asc";
|
||||
}
|
||||
$sql_order = "order by $sst $sod";
|
||||
|
||||
// 출력할 레코드를 얻음
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
$sql_order
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?> <?php echo $listall2; ?>
|
||||
<span class="btn_ov01"><span class="ov_txt">생성된 모듈 수</span><span class="ov_num"> <?php echo number_format($total_count); ?>개</span></span>
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="tables" value="<?php echo $table_name; ?>">
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="md_title"<?php echo get_selected($sfl, "md_title", true); ?>>모듈명</option>
|
||||
<option value="md_theme"<?php echo get_selected($sfl, "md_theme", true); ?>>적용테마</option>
|
||||
<option value="md_layout_name"<?php echo get_selected($sfl, "md_layout_name", true); ?>>적용레이아웃</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="required frm_input">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="fmodulelist" method="post" action="./modulelistupdate.php" autocomplete="off">
|
||||
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
|
||||
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
|
||||
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
|
||||
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="tables" value="<?php echo $table_name; ?>">
|
||||
|
||||
<div id="sct" class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php echo subject_sort_link("md_id"); ?>ID</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_title"); ?>모듈명</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_theme"); ?>테마</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_layout_name"); ?>레이아웃</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_layout"); ?>섹션</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_type"); ?>타입</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_order_id"); ?>진열순서</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("md_datetime"); ?>생성일시</a></th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$s_add = $s_vie = $s_upd = $s_del = '';
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
|
||||
if ($is_admin == 'super')
|
||||
$s_del = '<a href="./moduleformupdate.php?tables='.$table_name.'&w=d&md_id='.$row['md_id'].'&'.$qstr.'" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only">'.get_text($row['md_title']).' </span>삭제</a> ';
|
||||
|
||||
if($row['md_type'] == "latest") {
|
||||
$md_type = "최신글";
|
||||
} else if($row['md_type'] == "widget") {
|
||||
$md_type = "위젯";
|
||||
} else if($row['md_type'] == "poll") {
|
||||
$md_type = "투표";
|
||||
} else if($row['md_type'] == "banner") {
|
||||
$md_type = "배너";
|
||||
} else if($row['md_type'] == "item") {
|
||||
$md_type = "상품";
|
||||
} else {
|
||||
$md_type = "-";
|
||||
}
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
|
||||
|
||||
<td class="td_code">
|
||||
<input type="hidden" name="md_id[<?php echo $i; ?>]" value="<?php echo $row['md_id']; ?>">
|
||||
<?php echo $row['md_id']; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_title<?php echo $i; ?>" class="sound_only">모듈명</label>
|
||||
<input type="text" name="md_title[<?php echo $i; ?>]" value="<?php echo get_text($row['md_title']); ?>" id="md_title<?php echo $i; ?>" class="tbl_input">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_theme<?php echo $i; ?>" class="sound_only">테마</label>
|
||||
<input type="text" name="md_theme[<?php echo $i; ?>]" value="<?php echo get_text($row['md_theme']); ?>" id="md_theme<?php echo $i; ?>" class="tbl_input">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_layout_name<?php echo $i; ?>" class="sound_only">레이아웃</label>
|
||||
<input type="text" name="md_layout_name[<?php echo $i; ?>]" value="<?php echo get_text($row['md_layout_name']); ?>" id="md_layout_name<?php echo $i; ?>" class="tbl_input">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_layout<?php echo $i; ?>" class="sound_only">섹션</label>
|
||||
<input type="text" name="md_layout[<?php echo $i; ?>]" value="<?php echo get_text($row['md_layout']); ?>" id="md_layout<?php echo $i; ?>" class="tbl_input">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_type<?php echo $i; ?>" class="sound_only">타입</label>
|
||||
<?php echo $md_type ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_order_id<?php echo $i; ?>" class="sound_only">진열순서</label>
|
||||
<?php echo $row['md_order_id'] ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<label for="md_datetime<?php echo $i; ?>" class="sound_only">생성일시</label>
|
||||
<?php echo $row['md_datetime'] ?>
|
||||
</td>
|
||||
|
||||
<td class="td_mng td_mng_s">
|
||||
<?php echo $s_del; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php }
|
||||
if ($i == 0) echo "<tr><td colspan=\"9\" class=\"empty_table\">데이터가 없습니다.</td></tr>\n";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<input type="submit" value="일괄수정" class="btn_submit btn">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?tables=$table_name&$qstr&page="); ?>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
27
adm/rb/moduleformupdate.php
Normal file
27
adm/rb/moduleformupdate.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
$sub_menu = '000200';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "d");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$md_id = isset($_REQUEST['md_id']) ? preg_replace('/[^0-9a-z]/i', '', $_REQUEST['md_id']) : '';
|
||||
$table_name = (isset($_REQUEST['tables']) && $_REQUEST['tables']) ? $_REQUEST['tables'] : 'rb_module';
|
||||
|
||||
if( ! $md_id ){
|
||||
alert('모듈 ID가 없습니다.');
|
||||
}
|
||||
|
||||
if ($w == 'd' && $is_admin != 'super')
|
||||
alert("최고관리자만 삭제할 수 있습니다.");
|
||||
|
||||
if ($w == "d")
|
||||
{
|
||||
// 삭제
|
||||
$sql = " delete from {$table_name} where md_id = '$md_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
}
|
||||
|
||||
goto_url("./module_list.php?tables=$table_name&$qstr");
|
||||
40
adm/rb/modulelistupdate.php
Normal file
40
adm/rb/modulelistupdate.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$sub_menu = '000200';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
$post_md_id_count = (isset($_POST['md_id']) && is_array($_POST['md_id'])) ? count($_POST['md_id']) : 0;
|
||||
$table_name = (isset($_POST['tables']) && $_POST['tables']) ? $_POST['tables'] : 'rb_module';
|
||||
|
||||
for ($i=0; $i<$post_md_id_count; $i++)
|
||||
{
|
||||
|
||||
|
||||
$p_md_title = is_array($_POST['md_title']) ? strip_tags(clean_xss_attributes($_POST['md_title'][$i])) : '';
|
||||
|
||||
|
||||
$posts = array();
|
||||
|
||||
$check_keys = array('md_id', 'md_theme', 'md_layout_name', 'md_layout',);
|
||||
|
||||
foreach($check_keys as $key){
|
||||
$posts[$key] = (isset($_POST[$key]) && isset($_POST[$key][$i])) ? $_POST[$key][$i] : '';
|
||||
}
|
||||
|
||||
$sql = " update {$table_name}
|
||||
set md_title = '".$p_md_title."',
|
||||
md_theme = '".sql_real_escape_string(strip_tags($posts['md_theme']))."',
|
||||
md_layout_name = '".sql_real_escape_string(strip_tags($posts['md_layout_name']))."',
|
||||
md_layout = '".sql_real_escape_string(strip_tags($posts['md_layout']))."'
|
||||
where md_id = '".sql_real_escape_string($posts['md_id'])."' ";
|
||||
|
||||
sql_query($sql);
|
||||
|
||||
}
|
||||
|
||||
goto_url("./module_list.php?tables=$table_name&$qstr");
|
||||
6
adm/rb/rb_db_update.php
Normal file
6
adm/rb/rb_db_update.php
Normal file
File diff suppressed because one or more lines are too long
579
adm/rb/rb_form.php
Normal file
579
adm/rb/rb_form.php
Normal file
@ -0,0 +1,579 @@
|
||||
<?php
|
||||
$sub_menu = '000000';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
add_stylesheet('<link rel="stylesheet" href="./css/style.css">', 0);
|
||||
|
||||
|
||||
$g5['title'] = '빌더설정';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
// 설치여부 (테이블조회)
|
||||
$rbx = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_builder' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$is_rb = $rbx['cnt'];
|
||||
?>
|
||||
|
||||
<?php if($rbx['cnt'] > 0) { ?>
|
||||
|
||||
<?php
|
||||
$sql = " select * from rb_builder limit 1";
|
||||
$bu = sql_fetch($sql);
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_rb0">빌더정보</a></li>
|
||||
<li><a href="#anc_rb1">로고설정</a></li>
|
||||
<li><a href="#anc_rb2">회사정보</a></li>
|
||||
<li><a href="#anc_rb3">로딩인디케이터</a></li>
|
||||
<li><a href="#anc_rb6">시스템메세지</a></li>
|
||||
<li><a href="#anc_rb5">모바일설정</a></li>
|
||||
<li><a href="#anc_rb4">운영채널</a></li>
|
||||
</ul>';
|
||||
?>
|
||||
|
||||
|
||||
<section id="anc_rb0">
|
||||
<h2 class="h2_frm">빌더정보</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">빌더버전</th>
|
||||
<td colspan="3">
|
||||
<?php echo RB_VER ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">라이선스키</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('최초설치 > DB 업데이트시에 자동 생성 됩니다.<br>라이선스키를 공식홈페이지 > 마이페이지 에서 등록해주세요.<br>키 등록이 되지않았거나, 키를 임의로 변경하시는 경우 빌더 업데이트가 불가능 합니다.') ?>
|
||||
<?php
|
||||
$key_info = sql_fetch (" select key_no from rb_key limit 1 ");
|
||||
?>
|
||||
<?php echo !empty($key_info['key_no']) ? $key_info['key_no'] : '라이선스키가 없습니다. DB업데이트를 진행해주세요.'; ?>
|
||||
<?php if(!empty($key_info['key_no'])) { ?>
|
||||
<a href="javascript:void(0);" class="btn_frmline" style="height:25px; line-height:25px;" id="data-copy">복사하기</a>
|
||||
<a href="https://rebuilder.co.kr" target="_blank" class="btn_frmline" style="height:25px; line-height:25px;">라이선스키 등록</a>
|
||||
|
||||
<input type="hidden" id="data-area" class="data-area" value="<?php echo !empty($key_info['key_no']) ? $key_info['key_no'] : ''; ?>">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#data-copy').click(function() {
|
||||
$('#data-area').attr('type', 'text'); // 화면에서 hidden 처리한 input box type을 text로 일시 변환
|
||||
$('#data-area').select(); // input에 담긴 데이터를 선택
|
||||
var copy = document.execCommand('copy'); // clipboard에 데이터 복사
|
||||
$('#data-area').attr('type', 'hidden'); // input box를 다시 hidden 처리
|
||||
if (copy) {
|
||||
alert("라이선스키가 클립보드에 복사 되었습니다."); // 사용자 알림
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">DB업데이트</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('업데이트된 DB가 있는지 확인합니다.') ?>
|
||||
<a href="./rb_db_update.php" class="btn_frmline">DB 업데이트 실행</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form name="bu_form" id="bu_form" action="./rb_form_update.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="token" value="" id="token">
|
||||
<input type="hidden" name="install" value="1" id="install">
|
||||
|
||||
<section id="anc_rb1">
|
||||
<h2 class="h2_frm">로고설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">로고 PC</th>
|
||||
<td>
|
||||
<?php echo help('PC 버전 로고이미지를 등록하세요.') ?>
|
||||
<input type="file" name="bu_logo_pc">
|
||||
<?php
|
||||
$lp_str = "";
|
||||
$lpimg = G5_DATA_PATH."/logos/pc";
|
||||
if (file_exists($lpimg)) {
|
||||
$size = @getimagesize($lpimg);
|
||||
if($size[0] && $size[0] > 400)
|
||||
$width = 400;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="bu_logo_pc_del" value="1" id="bu_logo_pc_del"> <label for="bu_logo_pc_del">삭제</label>';
|
||||
$lpimg_str = '<img src="'.G5_DATA_URL.'/logos/pc?ver='.G5_SERVER_TIME.'" width="'.$width.'">';
|
||||
}
|
||||
if (isset($lpimg_str) && $lpimg_str) {
|
||||
echo '<br><span style="margin-top:20px; background-color:#f1f1f1; padding:10px 20px 10px 20px; display:inline-block; box-sizing:border-box;">';
|
||||
echo $lpimg_str;
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">로고 PC (화이트)</th>
|
||||
<td>
|
||||
<?php echo help('PC 버전 로고이미지(화이트)를 등록하세요.<br>어두운 백그라운드가 사용될 때 변경 됩니다.') ?>
|
||||
<input type="file" name="bu_logo_pc_w">
|
||||
<?php
|
||||
$lpw_str = "";
|
||||
$lpwimg = G5_DATA_PATH."/logos/pc_w";
|
||||
if (file_exists($lpwimg)) {
|
||||
$size = @getimagesize($lpwimg);
|
||||
if($size[0] && $size[0] > 400)
|
||||
$width = 400;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="bu_logo_pc_w_del" value="1" id="bu_logo_pc_w_del"> <label for="bu_logo_pc_w_del">삭제</label>';
|
||||
$lpwimg_str = '<img src="'.G5_DATA_URL.'/logos/pc_w?ver='.G5_SERVER_TIME.'" width="'.$width.'">';
|
||||
}
|
||||
if (isset($lpwimg_str) && $lpwimg_str) {
|
||||
echo '<br><span style="margin-top:20px; background-color:#f1f1f1; padding:10px 20px 10px 20px; display:inline-block; box-sizing:border-box;">';
|
||||
echo $lpwimg_str;
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">로고 Mobile</th>
|
||||
<td>
|
||||
<?php echo help('Mobile 버전 로고이미지를 등록하세요.') ?>
|
||||
<input type="file" name="bu_logo_mo">
|
||||
<?php
|
||||
$lm_str = "";
|
||||
$lmimg = G5_DATA_PATH."/logos/mo";
|
||||
if (file_exists($lmimg)) {
|
||||
$size = @getimagesize($lmimg);
|
||||
if($size[0] && $size[0] > 400)
|
||||
$width = 400;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="bu_logo_mo_del" value="1" id="bu_logo_mo_del"> <label for="bu_logo_mo_del">삭제</label>';
|
||||
$lmimg_str = '<img src="'.G5_DATA_URL.'/logos/mo?ver='.G5_SERVER_TIME.'" width="'.$width.'">';
|
||||
}
|
||||
if (isset($lmimg_str) && $lmimg_str) {
|
||||
echo '<br><span style="margin-top:20px; background-color:#f1f1f1; padding:10px 20px 10px 20px; display:inline-block; box-sizing:border-box;">';
|
||||
echo $lmimg_str;
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th scope="row">로고 Mobile (화이트)</th>
|
||||
<td>
|
||||
<?php echo help('Mobile 버전 로고이미지(화이트)를 등록하세요.<br>어두운 백그라운드가 사용될 때 변경 됩니다.') ?>
|
||||
<input type="file" name="bu_logo_mo_w">
|
||||
<?php
|
||||
$lmw_str = "";
|
||||
$lmwimg = G5_DATA_PATH."/logos/mo_w";
|
||||
if (file_exists($lmwimg)) {
|
||||
$size = @getimagesize($lmwimg);
|
||||
if($size[0] && $size[0] > 400)
|
||||
$width = 400;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="bu_logo_mo_w_del" value="1" id="bu_logo_mo_w_del"> <label for="bu_logo_mo_w_del">삭제</label>';
|
||||
$lmwimg_str = '<img src="'.G5_DATA_URL.'/logos/mo_w?ver='.G5_SERVER_TIME.'" width="'.$width.'">';
|
||||
}
|
||||
if (isset($lmwimg_str) && $lmwimg_str) {
|
||||
echo '<br><span style="margin-top:20px; background-color:#f1f1f1; padding:10px 20px 10px 20px; display:inline-block; box-sizing:border-box;">';
|
||||
echo $lmwimg_str;
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id="anc_rb2">
|
||||
<h2 class="h2_frm">하단 회사정보</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">회사명(사이트명)</th>
|
||||
<td>
|
||||
<input type="text" name="bu_1" value="<?php echo isset($bu['bu_1']) ? get_sanitize_input($bu['bu_1']) : ''; ?>" id="bu_1" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">대표자명</th>
|
||||
<td>
|
||||
<input type="text" name="bu_2" value="<?php echo isset($bu['bu_2']) ? get_sanitize_input($bu['bu_2']) : ''; ?>" id="bu_2" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">전화번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_3" value="<?php echo isset($bu['bu_3']) ? get_sanitize_input($bu['bu_3']) : ''; ?>" id="bu_3" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">팩스번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_4" value="<?php echo isset($bu['bu_4']) ? get_sanitize_input($bu['bu_4']) : ''; ?>" id="bu_4" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">사업자등록번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_5" value="<?php echo isset($bu['bu_5']) ? get_sanitize_input($bu['bu_5']) : ''; ?>" id="bu_5" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">통신판매업신고번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_6" value="<?php echo isset($bu['bu_6']) ? get_sanitize_input($bu['bu_6']) : ''; ?>" id="bu_6" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">부가통신사업자번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_7" value="<?php echo isset($bu['bu_7']) ? get_sanitize_input($bu['bu_7']) : ''; ?>" id="bu_7" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">기타등록번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_8" value="<?php echo isset($bu['bu_8']) ? get_sanitize_input($bu['bu_8']) : ''; ?>" id="bu_8" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">우편번호</th>
|
||||
<td>
|
||||
<input type="text" name="bu_9" value="<?php echo isset($bu['bu_9']) ? get_sanitize_input($bu['bu_9']) : ''; ?>" id="bu_9" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">사업장주소</th>
|
||||
<td>
|
||||
<input type="text" name="bu_10" value="<?php echo isset($bu['bu_10']) ? get_sanitize_input($bu['bu_10']) : ''; ?>" id="bu_10" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">개인정보책임자(이메일)</th>
|
||||
<td>
|
||||
<input type="text" name="bu_11" value="<?php echo isset($bu['bu_11']) ? get_sanitize_input($bu['bu_11']) : ''; ?>" id="bu_11" class="frm_input" size="40">
|
||||
</td>
|
||||
<th scope="row">카피라이트</th>
|
||||
<td>
|
||||
<input type="text" name="bu_12" value="<?php echo isset($bu['bu_12']) ? get_sanitize_input($bu['bu_12']) : ''; ?>" id="bu_12" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_rb3">
|
||||
<h2 class="h2_frm">로딩인디케이터</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">사용여부</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('사용시 로딩 스피너를 표기하며<br>DOM을 포함한 모든 페이지가 준비 되면 사라집니다.') ?>
|
||||
<input type="checkbox" name="bu_load" value="1" id="bu_load" <?php echo isset($bu['bu_load']) && $bu['bu_load'] ? 'checked' : ''; ?>> <label for="bu_load">사용</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_rb6">
|
||||
<h2 class="h2_frm">시스템메세지</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">수신여부</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('시스템메세지 관리자 수신 여부를 설정할 수 있습니다.<br>신규 게시물등록, 주문접수, 회원가입 등 웹사이트에서 일어나는 주요 활동에 대한 알림 입니다.') ?>
|
||||
<input type="checkbox" name="bu_systemmsg_use" value="1" id="bu_systemmsg_use" <?php echo isset($bu['bu_systemmsg_use']) && $bu['bu_systemmsg_use'] ? 'checked' : ''; ?>> <label for="bu_systemmsg_use">수신함</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_rb5">
|
||||
<h2 class="h2_frm">모바일설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">Viewport</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('빌더의 기본 뷰포트 값은 0.9 입니다. 값이 없으면 0.9 로 적용되며,<br>/theme/테마폴더/head.sub.php 파일의 meta name="viewport" 값이 변경 됩니다.<br>숫자가 작을수록 오브젝트의 크기가 축소되며, 1이 정비율 입니다.<br>커스텀 테마를 사용하시는 경우 적용이 되지않을 수 있습니다.') ?>
|
||||
<input type="text" name="bu_viewport" value="<?php echo isset($bu['bu_viewport']) ? get_sanitize_input($bu['bu_viewport']) : ''; ?>" id="bu_viewport" class="frm_input" size="10">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id="anc_rb4">
|
||||
<h2 class="h2_frm">운영채널</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">카카오채널 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns1" value="<?php echo isset($bu['bu_sns1']) ? get_sanitize_input($bu['bu_sns1']) : ''; ?>" id="bu_sns1" class="frm_input" size="70">
|
||||
</td>
|
||||
<th scope="row">카카오채널 상담 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns2" value="<?php echo isset($bu['bu_sns2']) ? get_sanitize_input($bu['bu_sns2']) : ''; ?>" id="bu_sns2" class="frm_input" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">유튜브 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns3" value="<?php echo isset($bu['bu_sns3']) ? get_sanitize_input($bu['bu_sns3']) : ''; ?>" id="bu_sns3" class="frm_input" size="70">
|
||||
</td>
|
||||
<th scope="row">인스타그램 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns4" value="<?php echo isset($bu['bu_sns4']) ? get_sanitize_input($bu['bu_sns4']) : ''; ?>" id="bu_sns4" class="frm_input" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">페이스북 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns5" value="<?php echo isset($bu['bu_sns5']) ? get_sanitize_input($bu['bu_sns5']) : ''; ?>" id="bu_sns5" class="frm_input" size="70">
|
||||
</td>
|
||||
<th scope="row">트위터 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns6" value="<?php echo isset($bu['bu_sns6']) ? get_sanitize_input($bu['bu_sns6']) : ''; ?>" id="bu_sns6" class="frm_input" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">네이버블로그 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns7" value="<?php echo isset($bu['bu_sns7']) ? get_sanitize_input($bu['bu_sns7']) : ''; ?>" id="bu_sns7" class="frm_input" size="70">
|
||||
</td>
|
||||
<th scope="row">텔레그램 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns8" value="<?php echo isset($bu['bu_sns8']) ? get_sanitize_input($bu['bu_sns8']) : ''; ?>" id="bu_sns8" class="frm_input" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">SIR URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns9" value="<?php echo isset($bu['bu_sns9']) ? get_sanitize_input($bu['bu_sns9']) : ''; ?>" id="bu_sns9" class="frm_input" size="70">
|
||||
</td>
|
||||
<th scope="row">기타 URL</th>
|
||||
<td>
|
||||
<input type="text" name="bu_sns10" value="<?php echo isset($bu['bu_sns10']) ? get_sanitize_input($bu['bu_sns10']) : ''; ?>" id="bu_sns10" class="frm_input" size="70">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php } else { ?>
|
||||
<section>
|
||||
<h2 class="h2_frm">그누보드 리빌더</h2>
|
||||
<div class="local_desc01 local_desc">
|
||||
|
||||
그누보드 리빌더를 사용해주셔서 고맙습니다.<br><br>
|
||||
리빌더는 그누보드의 기능을 모두 그대로 사용하면서 폴더의 추가만으로<br>
|
||||
손쉽게 웹사이트를 완성하고 다양한 편의기능을 사용할 수 있습니다.<br><br>
|
||||
|
||||
<b>본 페이지는 테이블이 설치되면 더이상 볼 수 없습니다.</b>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h2 class="h2_frm">빌더 설치안내 및 주의사항</h2>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
|
||||
빌더 구동에 필요한 테이블이 설치 됩니다.<br><br>
|
||||
rb_ 로 시작하는 동일한 테이블명 있는경우 테이블 생성이 되지 않을 수 있으며<br>
|
||||
성능 보장을 위해 가급적 PHP7.X ~ PHP8.X 버전을 사용해주세요.<br>
|
||||
<strong>DB 테이블 설치 후 빌더설정 > [DB 업데이트] 를 반드시 실행해주세요.</strong><br><br>
|
||||
|
||||
--------------<br>
|
||||
<b>생성되는 테이블 목록</b><br>
|
||||
rb_builder (빌더설정), rb_config (환경설정), rb_module (모듈설정)<br>
|
||||
rb_banner (배너관리), rb_seo (SEO설정)<br>
|
||||
--------------<br><br>
|
||||
|
||||
테이블 설치 후 <b>환경설정 > 테마설정</b> 메뉴에서<br>
|
||||
<b>Rebuilder Basic 테마를 적용</b> 해주시고<br>
|
||||
테마적용 직후 뜨는 팝업창에서 <b>[확인]</b> 을 클릭합니다.<br><br>
|
||||
|
||||
[확인] 을 클릭하지 못하였다면 <b>환경설정 > 기본환경설정</b> 메뉴에서<br>
|
||||
<b>[테마 스킨설정 가져오기], [테마 회원스킨설정 가져오기]</b> 를 클릭하신 후<br>
|
||||
반드시 <b>[확인]</b> 을 클릭 해주세요.<br><br>
|
||||
|
||||
설치가 완료 되었다면, <b>관리자모드 > 게시판관리</b> 에서<br>
|
||||
게시판의 스킨을 <b>rb.XXX 로 변경</b> 합니다.<br><br>
|
||||
|
||||
메인페이지로 이동 후 <b>[모듈추가]</b> 버튼을 통해 메인페이지에 출력될 모듈을 구성 합니다.
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<form name="rb_form" id="rb_form" action="./rb_form_update.php" method="post">
|
||||
<h2 class="h2_frm">라이선스 정책</h2>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
본 빌더는 납품물 제작의 용도나 자사운영 목적의 용도로 사용할 수 있습니다.<br>
|
||||
빌더 및 빌더를 구성하는 디자인, 스킨, 프로그램 등을 웹사이트에 게재(전시) 하여 판매 하는 행위 또는<br>
|
||||
배포 (타인이 다운로드 할 수 있도록 게재하는 행위) 는 불가능 합니다.<br><br>
|
||||
|
||||
기타 문의사항 및 기술지원은<br>
|
||||
공식홈페이지 <a href="https://rebuilder.co.kr" target="_blank"><strong>https://rebuilder.co.kr</strong></a> 를 이용해주세요.<br><br>
|
||||
|
||||
<input type="checkbox" value="1" id="agrees">
|
||||
<label for="agrees">상기 내용을 모두 확인하였으며, 라이선스 정책에 동의 합니다.</label>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="DB 테이블 설치하기" class="btn_submit btn">
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#rb_form").on("submit", function(event) {
|
||||
if (confirm("상기 주의사항 및 라이선스 정책을 확인해주세요.\nDB 테이블을 설치 하시겠습니까?")) {
|
||||
if (!$("#agrees").is(":checked")) {
|
||||
alert("라이선스 정책에 동의 하셔야 빌더를 사용할 수 있습니다.");
|
||||
event.preventDefault();
|
||||
}
|
||||
} else {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
389
adm/rb/rb_form_update.php
Normal file
389
adm/rb/rb_form_update.php
Normal file
@ -0,0 +1,389 @@
|
||||
<?php
|
||||
$sub_menu = '000000';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
if (isset($_POST['install']) && $_POST['install'] == 1) {
|
||||
|
||||
@mkdir(G5_DATA_PATH."/logos", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/logos", G5_DIR_PERMISSION);
|
||||
|
||||
$lpimg = isset($_FILES['bu_logo_pc']['tmp_name']) ? $_FILES['bu_logo_pc']['tmp_name'] : null;
|
||||
$lpimg_name = isset($_FILES['bu_logo_pc']['name']) ? $_FILES['bu_logo_pc']['name'] : null;
|
||||
|
||||
$lpwimg = isset($_FILES['bu_logo_pc_w']['tmp_name']) ? $_FILES['bu_logo_pc_w']['tmp_name'] : null;
|
||||
$lpwimg_name = isset($_FILES['bu_logo_pc_w']['name']) ? $_FILES['bu_logo_pc_w']['name'] : null;
|
||||
|
||||
$lmimg = isset($_FILES['bu_logo_mo']['tmp_name']) ? $_FILES['bu_logo_mo']['tmp_name'] : null;
|
||||
$lmimg_name = isset($_FILES['bu_logo_mo']['name']) ? $_FILES['bu_logo_mo']['name'] : null;
|
||||
|
||||
$lmwimg = isset($_FILES['bu_logo_mo_w']['tmp_name']) ? $_FILES['bu_logo_mo_w']['tmp_name'] : null;
|
||||
$lmwimg_name = isset($_FILES['bu_logo_mo_w']['name']) ? $_FILES['bu_logo_mo_w']['name'] : null;
|
||||
|
||||
if (isset($bu_logo_pc_del) && $bu_logo_pc_del) @unlink(G5_DATA_PATH."/logos/pc");
|
||||
if (isset($bu_logo_pc_w_del) && $bu_logo_pc_w_del) @unlink(G5_DATA_PATH."/logos/pc_w");
|
||||
if (isset($bu_logo_mo_del) && $bu_logo_mo_del) @unlink(G5_DATA_PATH."/logos/mo");
|
||||
if (isset($bu_logo_mo_w_del) && $bu_logo_mo_w_del) @unlink(G5_DATA_PATH."/logos/mo_w");
|
||||
|
||||
//이미지인지 체크
|
||||
if( $lpimg || $lpimg_name){
|
||||
if( !preg_match('/\.(gif|jpe?g|bmp|png)$/i', $lpimg_name) ){
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
//이미지인지 체크
|
||||
if( $lpwimg || $lpwimg_name ){
|
||||
if( !preg_match('/\.(gif|jpe?g|bmp|png)$/i', $lpwimg_name) ){
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
//이미지인지 체크
|
||||
if( $lmimg || $lmimg_name ){
|
||||
if( !preg_match('/\.(gif|jpe?g|bmp|png)$/i', $lmimg_name) ){
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
//이미지인지 체크
|
||||
if( $lmwimg || $lmwimg_name ){
|
||||
if( !preg_match('/\.(gif|jpe?g|bmp|png)$/i', $lmwimg_name) ){
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
//컬럼이 있는지 검사한다.
|
||||
$cnt = sql_fetch (" select COUNT(*) as cnt from rb_builder ");
|
||||
|
||||
if($cnt['cnt'] > 0) {
|
||||
$sql = " update rb_builder
|
||||
set bu_load = '{$_POST['bu_load']}',
|
||||
bu_1 = '{$_POST['bu_1']}',
|
||||
bu_2 = '{$_POST['bu_2']}',
|
||||
bu_3 = '{$_POST['bu_3']}',
|
||||
bu_4 = '{$_POST['bu_4']}',
|
||||
bu_5 = '{$_POST['bu_5']}',
|
||||
bu_6 = '{$_POST['bu_6']}',
|
||||
bu_7 = '{$_POST['bu_7']}',
|
||||
bu_8 = '{$_POST['bu_8']}',
|
||||
bu_9 = '{$_POST['bu_9']}',
|
||||
bu_10 = '{$_POST['bu_10']}',
|
||||
bu_11 = '{$_POST['bu_11']}',
|
||||
bu_12 = '{$_POST['bu_12']}',
|
||||
bu_13 = '{$_POST['bu_13']}',
|
||||
bu_14 = '{$_POST['bu_14']}',
|
||||
bu_15 = '{$_POST['bu_15']}',
|
||||
bu_16 = '{$_POST['bu_16']}',
|
||||
bu_17 = '{$_POST['bu_17']}',
|
||||
bu_18 = '{$_POST['bu_18']}',
|
||||
bu_19 = '{$_POST['bu_19']}',
|
||||
bu_20 = '{$_POST['bu_20']}',
|
||||
bu_sns1 = '{$_POST['bu_sns1']}',
|
||||
bu_sns2 = '{$_POST['bu_sns2']}',
|
||||
bu_sns3 = '{$_POST['bu_sns3']}',
|
||||
bu_sns4 = '{$_POST['bu_sns4']}',
|
||||
bu_sns5 = '{$_POST['bu_sns5']}',
|
||||
bu_sns6 = '{$_POST['bu_sns6']}',
|
||||
bu_sns7 = '{$_POST['bu_sns7']}',
|
||||
bu_sns8 = '{$_POST['bu_sns8']}',
|
||||
bu_sns9 = '{$_POST['bu_sns9']}',
|
||||
bu_sns10 = '{$_POST['bu_sns10']}',
|
||||
bu_viewport = '{$_POST['bu_viewport']}',
|
||||
bu_systemmsg_use = '{$_POST['bu_systemmsg_use']}',
|
||||
bu_datetime = '".G5_TIME_YMDHIS."' ";
|
||||
sql_query($sql);
|
||||
} else {
|
||||
|
||||
$sql = " insert rb_builder
|
||||
set bu_load = '{$_POST['bu_load']}',
|
||||
bu_1 = '{$_POST['bu_1']}',
|
||||
bu_2 = '{$_POST['bu_2']}',
|
||||
bu_3 = '{$_POST['bu_3']}',
|
||||
bu_4 = '{$_POST['bu_4']}',
|
||||
bu_5 = '{$_POST['bu_5']}',
|
||||
bu_6 = '{$_POST['bu_6']}',
|
||||
bu_7 = '{$_POST['bu_7']}',
|
||||
bu_8 = '{$_POST['bu_8']}',
|
||||
bu_9 = '{$_POST['bu_9']}',
|
||||
bu_10 = '{$_POST['bu_10']}',
|
||||
bu_11 = '{$_POST['bu_11']}',
|
||||
bu_12 = '{$_POST['bu_12']}',
|
||||
bu_13 = '{$_POST['bu_13']}',
|
||||
bu_14 = '{$_POST['bu_14']}',
|
||||
bu_15 = '{$_POST['bu_15']}',
|
||||
bu_16 = '{$_POST['bu_16']}',
|
||||
bu_17 = '{$_POST['bu_17']}',
|
||||
bu_18 = '{$_POST['bu_18']}',
|
||||
bu_19 = '{$_POST['bu_19']}',
|
||||
bu_20 = '{$_POST['bu_20']}',
|
||||
bu_sns1 = '{$_POST['bu_sns1']}',
|
||||
bu_sns2 = '{$_POST['bu_sns2']}',
|
||||
bu_sns3 = '{$_POST['bu_sns3']}',
|
||||
bu_sns4 = '{$_POST['bu_sns4']}',
|
||||
bu_sns5 = '{$_POST['bu_sns5']}',
|
||||
bu_sns6 = '{$_POST['bu_sns6']}',
|
||||
bu_sns7 = '{$_POST['bu_sns7']}',
|
||||
bu_sns8 = '{$_POST['bu_sns8']}',
|
||||
bu_sns9 = '{$_POST['bu_sns9']}',
|
||||
bu_sns10 = '{$_POST['bu_sns10']}',
|
||||
bu_viewport = '{$_POST['bu_viewport']}',
|
||||
bu_systemmsg_use = '{$_POST['bu_systemmsg_use']}',
|
||||
bu_datetime = '".G5_TIME_YMDHIS."' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if ($lpimg_name) rb_upload_files($lpimg, 'pc', G5_DATA_PATH."/logos");
|
||||
if ($lpwimg_name) rb_upload_files($lpwimg, 'pc_w', G5_DATA_PATH."/logos");
|
||||
if ($lmimg_name) rb_upload_files($lmimg, 'mo', G5_DATA_PATH."/logos");
|
||||
if ($lmwimg_name) rb_upload_files($lmwimg, 'mo_w', G5_DATA_PATH."/logos");
|
||||
|
||||
$lpimg_in = G5_DATA_PATH."/logos/pc";
|
||||
if (file_exists($lpimg_in)) {
|
||||
$sql = " update rb_builder set bu_logo_pc = 'pc' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$lpwimg_in = G5_DATA_PATH."/logos/pc_w";
|
||||
if (file_exists($lpwimg_in)) {
|
||||
$sql = " update rb_builder set bu_logo_pc_w = 'pc_w' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$lmimg_in = G5_DATA_PATH."/logos/mo";
|
||||
if (file_exists($lmimg_in)) {
|
||||
$sql = " update rb_builder set bu_logo_mo = 'mo' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$lmwimg_in = G5_DATA_PATH."/logos/mo_w";
|
||||
if (file_exists($lmwimg_in)) {
|
||||
$sql = " update rb_builder set bu_logo_mo_w = 'mo_w' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
//폴더생성
|
||||
@mkdir(G5_DATA_PATH."/seo", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/seo", G5_DIR_PERMISSION);
|
||||
|
||||
//폴더생성
|
||||
@mkdir(G5_DATA_PATH."/banners", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/banners", G5_DIR_PERMISSION);
|
||||
|
||||
//폴더생성
|
||||
@mkdir(G5_DATA_PATH."/logos", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/logos", G5_DIR_PERMISSION);
|
||||
|
||||
|
||||
//빌더설정 테이블
|
||||
if(!sql_query(" DESCRIBE rb_builder ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_builder` (
|
||||
`bu_logo_pc` varchar(255) NOT NULL DEFAULT '' COMMENT '로고 PC',
|
||||
`bu_logo_pc_w` varchar(255) NOT NULL DEFAULT '' COMMENT '로고 PC W',
|
||||
`bu_logo_mo` varchar(255) NOT NULL DEFAULT '' COMMENT '로고 MO',
|
||||
`bu_logo_mo_w` varchar(255) NOT NULL DEFAULT '' COMMENT '로고 MO W',
|
||||
`bu_load` int(4) NOT NULL DEFAULT 1 COMMENT '로딩인디케이터',
|
||||
`bu_systemmsg_use` int(4) NOT NULL DEFAULT 1 COMMENT '시스템메세지 관리자수신여부',
|
||||
`bu_1` varchar(255) NOT NULL DEFAULT '' COMMENT '회사명',
|
||||
`bu_2` varchar(255) NOT NULL DEFAULT '' COMMENT '대표자명',
|
||||
`bu_3` varchar(255) NOT NULL DEFAULT '' COMMENT '전화번호',
|
||||
`bu_4` varchar(255) NOT NULL DEFAULT '' COMMENT '팩스번호',
|
||||
`bu_5` varchar(255) NOT NULL DEFAULT '' COMMENT '사업자등록번호',
|
||||
`bu_6` varchar(255) NOT NULL DEFAULT '' COMMENT '통신판매업신고번호',
|
||||
`bu_7` varchar(255) NOT NULL DEFAULT '' COMMENT '부가통신사업자번호',
|
||||
`bu_8` varchar(255) NOT NULL DEFAULT '' COMMENT '기타등록번호1',
|
||||
`bu_9` varchar(255) NOT NULL DEFAULT '' COMMENT '우편번호',
|
||||
`bu_10` varchar(255) NOT NULL DEFAULT '' COMMENT '사업장주소',
|
||||
`bu_11` varchar(255) NOT NULL DEFAULT '' COMMENT '개인정보책임자',
|
||||
`bu_12` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_13` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_14` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_15` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_16` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_17` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_18` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_19` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_20` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns1` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns2` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns3` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns4` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns5` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns6` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns7` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns8` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns9` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_sns10` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||
`bu_viewport` varchar(10) NOT NULL,
|
||||
`bu_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
//환경설정 테이블
|
||||
if(!sql_query(" DESCRIBE rb_config ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_config` (
|
||||
`co_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`co_color` varchar(20) NOT NULL DEFAULT '#aa20ff' COMMENT '강조 컬러',
|
||||
`co_dark` varchar(20) NOT NULL DEFAULT '' COMMENT '다크모드',
|
||||
`co_layout` varchar(20) NOT NULL DEFAULT '' COMMENT '레이아웃',
|
||||
`co_layout_hd` varchar(20) NOT NULL DEFAULT '' COMMENT '레이아웃(헤더)',
|
||||
`co_layout_ft` varchar(20) NOT NULL DEFAULT '' COMMENT '레이아웃(푸더)',
|
||||
`co_sub_width` varchar(20) NOT NULL COMMENT '서브가로폭',
|
||||
`co_main_width` varchar(20) NOT NULL COMMENT '메인가로폭',
|
||||
`co_tb_width` varchar(20) NOT NULL COMMENT '상/하단가로폭',
|
||||
`co_header` varchar(20) NOT NULL DEFAULT '#ffffff' COMMENT '헤더',
|
||||
`co_footer` varchar(20) NOT NULL COMMENT '풋터',
|
||||
`co_font` varchar(20) NOT NULL DEFAULT '' COMMENT '폰트',
|
||||
`co_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)',
|
||||
`co_ip` varchar(100) NOT NULL DEFAULT '' COMMENT '등록자IP',
|
||||
PRIMARY KEY (`co_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
$sql = " insert rb_config
|
||||
set co_color = '#aa20ff',
|
||||
co_dark = '',
|
||||
co_layout = 'basic',
|
||||
co_layout_hd = 'basic',
|
||||
co_layout_ft = 'basic',
|
||||
co_sub_width = '960',
|
||||
co_main_width = '1400',
|
||||
co_tb_width = '1400',
|
||||
co_header = '#ffffff',
|
||||
co_footer = '0',
|
||||
co_font = 'Pretendard',
|
||||
co_datetime = '".G5_TIME_YMDHIS."',
|
||||
co_ip = '' ";
|
||||
sql_query($sql);
|
||||
|
||||
|
||||
//모듈설정 테이블
|
||||
if(!sql_query(" DESCRIBE rb_module ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_module` (
|
||||
`md_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`md_layout` varchar(20) NOT NULL DEFAULT '' COMMENT '레이아웃 아이디',
|
||||
`md_layout_name` varchar(255) NOT NULL DEFAULT '' COMMENT '레이아웃이름',
|
||||
`md_theme` varchar(255) NOT NULL DEFAULT '' COMMENT '테마명',
|
||||
`md_title` varchar(255) NOT NULL DEFAULT '' COMMENT '모듈타이틀',
|
||||
`md_type` varchar(255) NOT NULL DEFAULT '' COMMENT '모듈타입',
|
||||
`md_bo_table` varchar(255) NOT NULL DEFAULT '' COMMENT '연결 게시판',
|
||||
`md_sca` varchar(255) NOT NULL DEFAULT '' COMMENT '연결 카테고리',
|
||||
`md_widget` varchar(255) NOT NULL DEFAULT '' COMMENT '프로그램',
|
||||
`md_poll` varchar(255) NOT NULL DEFAULT '' COMMENT '투표',
|
||||
`md_poll_id` varchar(20) NOT NULL DEFAULT '' COMMENT '투표ID',
|
||||
`md_banner` varchar(255) NOT NULL DEFAULT '' COMMENT '배너',
|
||||
`md_banner_id` varchar(20) NOT NULL DEFAULT '' COMMENT '배너ID',
|
||||
`md_banner_skin` varchar(255) NOT NULL DEFAULT '' COMMENT '배너스킨',
|
||||
`md_module` varchar(255) NOT NULL DEFAULT '' COMMENT '출력모듈',
|
||||
`md_skin` varchar(255) NOT NULL DEFAULT '' COMMENT '출력스킨',
|
||||
`md_cnt` int(10) NOT NULL DEFAULT 1 COMMENT '출력갯수',
|
||||
`md_auto_time` int(10) NOT NULL DEFAULT 3000 COMMENT '오토플레이타임',
|
||||
`md_gap` int(10) NOT NULL DEFAULT 40 COMMENT '여백(간격)',
|
||||
`md_gap_mo` int(10) NOT NULL DEFAULT 20 COMMENT '모바일 여백(간격)',
|
||||
`md_col` int(10) NOT NULL DEFAULT 1 COMMENT '출력갯수(열/가로)',
|
||||
`md_row` int(10) NOT NULL DEFAULT 1 COMMENT '출력갯수(행/세로)',
|
||||
`md_col_mo` int(10) NOT NULL DEFAULT 1 COMMENT '모바일 출력갯수(열/가로)',
|
||||
`md_row_mo` int(10) NOT NULL DEFAULT 1 COMMENT '모바일 출력갯수(행/세로)',
|
||||
`md_width` varchar(20) NOT NULL DEFAULT '100%' COMMENT '가로사이즈',
|
||||
`md_height` varchar(20) NOT NULL DEFAULT 'auto' COMMENT '세로사이즈',
|
||||
`md_subject_is` int(4) NOT NULL COMMENT '출력항목(제목)',
|
||||
`md_thumb_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(썸네일)',
|
||||
`md_nick_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(닉네임)',
|
||||
`md_date_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(작성일시)',
|
||||
`md_content_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(본문)',
|
||||
`md_icon_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(아이콘)',
|
||||
`md_comment_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(코멘트)',
|
||||
`md_ca_is` int(4) NOT NULL DEFAULT 1 COMMENT '출력항목(카테고리)',
|
||||
`md_swiper_is` int(4) NOT NULL DEFAULT 0 COMMENT '스와이프여부',
|
||||
`md_auto_is` int(4) NOT NULL DEFAULT 0 COMMENT '오토플레이 여부',
|
||||
`md_order` varchar(255) NOT NULL DEFAULT 'wr_num' COMMENT '출력순서',
|
||||
`md_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)',
|
||||
`md_ip` varchar(100) NOT NULL DEFAULT '' COMMENT '등록자IP',
|
||||
`md_order_id` int(4) NOT NULL DEFAULT 0 COMMENT '모듈순서',
|
||||
PRIMARY KEY (`md_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//배너관리 테이블
|
||||
if(!sql_query(" DESCRIBE rb_banner ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_banner` (
|
||||
`bn_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`bn_alt` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_url` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_device` varchar(10) NOT NULL DEFAULT '',
|
||||
`bn_position` varchar(255) NOT NULL DEFAULT '',
|
||||
`bn_border` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_radius` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_ad_ico` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_new_win` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`bn_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`bn_hit` int(11) NOT NULL DEFAULT '0',
|
||||
`bn_order` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`bn_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
sql_query(" ALTER TABLE `rb_banner` ADD PRIMARY KEY (`bn_id`) ", false);
|
||||
sql_query(" ALTER TABLE `rb_banner` MODIFY `bn_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;COMMIT ", false);
|
||||
}
|
||||
|
||||
|
||||
//SEO설정 테이블
|
||||
if(!sql_query(" DESCRIBE rb_seo ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_seo` (
|
||||
`se_title` varchar(255) NOT NULL COMMENT '사이트명',
|
||||
`se_description` mediumtext NOT NULL COMMENT '사이트설명',
|
||||
`se_keywords` mediumtext NOT NULL COMMENT '키워드',
|
||||
`se_favicon` varchar(255) NOT NULL COMMENT '파비콘',
|
||||
`se_google_meta` varchar(255) NOT NULL COMMENT '구글 소유권 메타',
|
||||
`se_naver_meta` varchar(255) NOT NULL COMMENT '네이버 소유권 메타',
|
||||
`se_robots` mediumtext NOT NULL COMMENT '로봇접근제어',
|
||||
`se_og_image` varchar(255) NOT NULL COMMENT '오픈그래프 이미지',
|
||||
`se_og_site_name` varchar(255) NOT NULL COMMENT '오픈그래프 사이트명',
|
||||
`se_og_title` varchar(255) NOT NULL COMMENT '오픈그래프 사이트명',
|
||||
`se_og_description` varchar(255) NOT NULL COMMENT '오픈그래프 사이트 설명',
|
||||
`se_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
|
||||
// 빌더설정 테이블 설치여부
|
||||
$chk0 = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_builder' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$chk0_is = $chk0['cnt'];
|
||||
|
||||
// 환경설정 테이블 설치여부
|
||||
$chk1 = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_config' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$chk1_is = $chk1['cnt'];
|
||||
|
||||
// 모듈설정 테이블 설치여부
|
||||
$chk2 = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_module' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$chk2_is = $chk2['cnt'];
|
||||
|
||||
// 배너관리 테이블 설치여부
|
||||
$chk3 = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_banner' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$chk3_is = $chk3['cnt'];
|
||||
|
||||
// SEO설정 테이블 설치여부
|
||||
$chk4 = sql_fetch(" select COUNT(*) AS cnt FROM information_schema.TABLES WHERE `TABLE_NAME` = 'rb_seo' AND TABLE_SCHEMA = '".G5_MYSQL_DB."' ");
|
||||
$chk4_is = $chk4['cnt'];
|
||||
|
||||
if($chk0_is > 0 && $chk1_is > 0 && $chk2_is > 0 && $chk3_is > 0 && $chk4_is > 0) {
|
||||
alert('DB 테이블 설치가 완료 되었습니다.\n[DB 업데이트] 를 반드시 실행해주세요.\n테이블 설치 후 환경설정 > 테마설정 메뉴에서\nRebuilder Basic 테마를 적용해주세요.');
|
||||
} else {
|
||||
alert('설치가 누락된 테이블이 있습니다.\nDB 테이블을 확인해주세요.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
update_rewrite_rules();
|
||||
goto_url('./rb_form.php', false);
|
||||
|
||||
?>
|
||||
64
adm/rb/reservation_list.json.php
Normal file
64
adm/rb/reservation_list.json.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
include_once('./_common.php');
|
||||
|
||||
$list = array();
|
||||
$rst = sql_query("SELECT * FROM {$g5['g5_shop_cart_table']} WHERE ct_types != '0' and io_type = '0' and ct_date_s != '0000-00-00' and ct_status NOT IN ('쇼핑') order by ct_id desc ");
|
||||
|
||||
while ($row = sql_fetch_array($rst)) {
|
||||
$start_date = $row['ct_date_s'];
|
||||
$db_end_date = $row['ct_date_e']; // DB에서 가져온 종료일
|
||||
|
||||
//od_id로 정보얻기
|
||||
$od = sql_fetch (" SELECT * FROM {$g5['g5_shop_order_table']} WHERE od_id = '{$row['od_id']}' and mb_id = '{$row['mb_id']}' ");
|
||||
|
||||
if($od['od_status'] == "주문") {
|
||||
$bgColor = "#aaa";
|
||||
} else if($od['od_status'] == "취소") {
|
||||
$bgColor = "#ffcc00";
|
||||
} else {
|
||||
$bgColor = "#000";
|
||||
}
|
||||
|
||||
// 1) 종료일이 비어 있거나 '0000-00-00'이면 => 단일날짜로 취급
|
||||
if ($db_end_date == '0000-00-00' || empty($db_end_date)) {
|
||||
$end_date = $start_date;
|
||||
}
|
||||
// 2) 시작일과 종료일이 같은 경우 => 단일날짜 (종료일 포함 표시하려면 그대로)
|
||||
else if ($start_date == $db_end_date) {
|
||||
$end_date = $start_date;
|
||||
}
|
||||
// 3) 기간(시작일 != 종료일) => 종료일 + 1일
|
||||
else {
|
||||
$end_date = date('Y-m-d', strtotime($db_end_date . ' +1 day'));
|
||||
}
|
||||
|
||||
$list[] = [
|
||||
'id' => $row['ct_id'],
|
||||
'title' => $od['od_name']."님 (".$od['od_status'].")", //예약자명
|
||||
'od_name' => $od['od_name'],
|
||||
'od_id' => $od['od_id'],
|
||||
'od_status' => $od['od_status'],
|
||||
'start' => $start_date, //시작일
|
||||
'end' => $end_date, //종료일
|
||||
'ct_item' => $row['it_name'], //상품명
|
||||
'od_hp' => $od['od_hp'], //예약자연락처
|
||||
'allDay' => true,
|
||||
|
||||
'db_start' => $row['ct_date_s'], // DB에 기록된 'ct_date_s' 그대로
|
||||
'db_end' => ($row['ct_date_e'] == '0000-00-00' || empty($row['ct_date_e']))
|
||||
? $row['ct_date_s']
|
||||
: $row['ct_date_e'], // DB 원본 종료일 (없으면 시작일)
|
||||
|
||||
'price' => $row['ct_price'], //금액
|
||||
'textColor' => '#fff',
|
||||
'backgroundColor' => $bgColor,
|
||||
'borderColor' => $bgColor,
|
||||
'bgColor' => $bgColor,
|
||||
'editable' => false
|
||||
];
|
||||
}
|
||||
|
||||
// JSON 반환
|
||||
echo json_encode($list, JSON_UNESCAPED_UNICODE);
|
||||
?>
|
||||
284
adm/rb/reservation_list_cal.php
Normal file
284
adm/rb/reservation_list_cal.php
Normal file
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
$sub_menu = '000812';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "r");
|
||||
|
||||
$g5['title'] = '예약내역(캘린더)';
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/core@4.3.1/main.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/core@4.3.1/locales-all.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/daygrid@4.3.0/main.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/timegrid@4.3.0/main.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/list@4.3.0/main.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/bootstrap@4.3.0/main.min.js"></script>');
|
||||
add_javascript('<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/interaction@4.3.0/main.min.js"></script>');
|
||||
add_stylesheet('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/core@4.3.1/main.min.css">');
|
||||
add_stylesheet('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/daygrid@4.3.0/main.min.css">');
|
||||
add_stylesheet('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/bootstrap@4.3.0/main.min.css">');
|
||||
?>
|
||||
|
||||
<style>
|
||||
.fc-head {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.fc-day-header {
|
||||
padding: 0.5rem !important;
|
||||
}
|
||||
|
||||
.fc-sun span,
|
||||
.fc-sun a.fc-day-number {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.fc-sat span,
|
||||
.fc-sat a.fc-day-number {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.fc td,
|
||||
.fc th {
|
||||
border-color: #eee;
|
||||
}
|
||||
|
||||
.fc th {
|
||||
background-color: #f9f9f9;
|
||||
padding: 20px !important;
|
||||
}
|
||||
|
||||
.fc-day-number {
|
||||
font-size: 11px !important;
|
||||
padding-top: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
padding-bottom: 10px !important;
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
.fc-content {
|
||||
font-size: 12px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.fc-day-grid-event {
|
||||
margin: 2px 3px 2px 3px;
|
||||
}
|
||||
|
||||
.fc-today {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.fc-today span {
|
||||
color: #002268 !important;
|
||||
}
|
||||
|
||||
.fc-right button {
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
background-color: #fff;
|
||||
border: 1px solid #eee;
|
||||
box-sizing: border-box;
|
||||
margin-left: 5px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.fc-right .btn-group {
|
||||
display: inline-block;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.fc-toolbar h2 {
|
||||
font-family: 'font-B', sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* 팝업 스타일 */
|
||||
#eventDetailPopup {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background: rgba(0, 0, 0, 0.85);
|
||||
color: white;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||
z-index: 1000;
|
||||
min-width: 250px;
|
||||
max-width: 350px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* 제목 스타일 */
|
||||
#popupTitle {
|
||||
font-size: 14px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* 금액 강조 */
|
||||
#popupAmount {
|
||||
font-size: 20px;
|
||||
color: #ffcc00;
|
||||
}
|
||||
|
||||
/* 상세 내용 스타일 */
|
||||
#popupContent {
|
||||
font-size: 12px;
|
||||
margin-top: 10px;
|
||||
line-height: 1.4;
|
||||
color:#999;
|
||||
}
|
||||
|
||||
/* 닫기 버튼 */
|
||||
.close-btn {
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
padding: 10px 10px;
|
||||
background: rgba(255,255,255,0.1);;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 오버레이 */
|
||||
#overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.fc-event {
|
||||
cursor: pointer;
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>
|
||||
<div id="calendar"></div>
|
||||
</div>
|
||||
|
||||
<!-- 팝업 레이어 -->
|
||||
<div id="overlay"></div>
|
||||
<div id="eventDetailPopup">
|
||||
<ul id="popupTitle"></ul>
|
||||
<ul id="popupAmount" class="font-B"></ul>
|
||||
<ul id="popupContent"></ul>
|
||||
<button id="DetailBtn" class="close-btn">예약상세정보</button>
|
||||
<button id="closePopupBtn" class="close-btn">닫기</button>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function openPopup(title, amount, content) {
|
||||
$("#popupTitle").text(title);
|
||||
$("#popupAmount").html(amount);
|
||||
$("#popupContent").html(content);
|
||||
$("#overlay, #eventDetailPopup").fadeIn(200);
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
$("#overlay, #eventDetailPopup").fadeOut(200);
|
||||
}
|
||||
|
||||
// 닫기 버튼에 클릭 이벤트 연결
|
||||
$(document).on("click", "#closePopupBtn", closePopup);
|
||||
$(document).on("click", "#overlay", closePopup);
|
||||
|
||||
var calendarEl = $("#calendar").get(0);
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
plugins: ['dayGrid', 'interaction', 'bootstrap'],
|
||||
editable: false,
|
||||
droppable: false,
|
||||
defaultDate: '<?php echo G5_TIME_YMD?>', // 초기 날짜
|
||||
locale: 'ko',
|
||||
height: 'auto',
|
||||
themeSystem: 'bootstrap',
|
||||
weekNumbers: false,
|
||||
eventLimit: false,
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,dayGridWeek,dayGridDay'
|
||||
},
|
||||
events: function(fetchInfo, successCallback, failureCallback) {
|
||||
$.ajax({
|
||||
url: './reservation_list.json.php',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if (!data || !Array.isArray(data)) {
|
||||
console.error("Invalid JSON response:", data);
|
||||
alert("이벤트 데이터를 불러올 수 없습니다.");
|
||||
failureCallback("Invalid data format");
|
||||
return;
|
||||
}
|
||||
successCallback(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.error("AJAX 요청 실패:", textStatus, errorThrown);
|
||||
console.error("응답 데이터:", jqXHR.responseText);
|
||||
alert("이벤트 데이터를 불러오는 중 오류가 발생했습니다.");
|
||||
failureCallback(errorThrown);
|
||||
}
|
||||
});
|
||||
},
|
||||
eventClick: function(info) {
|
||||
// FullCalendar 이벤트 객체
|
||||
var event = info.event.extendedProps || {};
|
||||
|
||||
// DB 원본 날짜 (팝업용)
|
||||
var db_start = event.db_start || "";
|
||||
var db_end = event.db_end || "";
|
||||
|
||||
// 그 외 예약 정보
|
||||
var od_name = event.od_name || "예약자 없음";
|
||||
var od_status = event.od_status || "상태 미정";
|
||||
var od_hp = event.od_hp || "연락처 없음";
|
||||
var od_id = event.od_id || "주문번호 없음";
|
||||
var ct_item = event.ct_item || "상품 없음";
|
||||
var points = Number(event.price) || 0;
|
||||
|
||||
// 팝업 내용 (DB 원본 날짜 그대로 표시)
|
||||
var details = `
|
||||
<li><strong>예약현황 :</strong> ${od_status}</li>
|
||||
<li><strong>연락처 :</strong> ${od_hp}</li>
|
||||
<li><strong>상품명 :</strong> ${ct_item}</li>
|
||||
`;
|
||||
|
||||
// 팝업 열기
|
||||
openPopup(
|
||||
db_start + (db_end && db_end !== db_start ? " ~ " + db_end : ""), // 제목 영역에 날짜 범위 표시 가능
|
||||
od_name,
|
||||
`<ul>${details}</ul>`
|
||||
);
|
||||
|
||||
// 예약 상세정보 버튼
|
||||
$("#DetailBtn").off("click").on("click", function() {
|
||||
if (od_id) {
|
||||
window.location.href = "../shop_admin/orderform.php?od_id=" + od_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
138
adm/rb/reservation_set.php
Normal file
138
adm/rb/reservation_set.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
$sub_menu = '000810';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
add_stylesheet('<link rel="stylesheet" href="./css/style.css">', 0);
|
||||
|
||||
$g5['rb_prefix'] = G5_TABLE_PREFIX.'rb_'; // 리빌더 테이블명 접두사
|
||||
$rb_table_name = $g5['rb_prefix'].'reservation'; // g5_rb_reservation
|
||||
|
||||
//테이블이 있는지 검사한다.
|
||||
|
||||
if(!sql_query(" DESCRIBE {$rb_table_name} ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$rb_table_name}` (
|
||||
`res_is` int(4) NOT NULL COMMENT '사용여부',
|
||||
`res_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
|
||||
$columns_to_add = [
|
||||
'it_types' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_date_s' => 'DATE NOT NULL',
|
||||
'it_date_e' => 'DATE NOT NULL',
|
||||
'it_date_n' => 'LONGTEXT NOT NULL DEFAULT \'\'',
|
||||
'it_date_t' => 'LONGTEXT NOT NULL DEFAULT \'\'',
|
||||
'it_date_j' => 'INT(4) NOT NULL DEFAULT 0',
|
||||
'it_date_g' => 'INT(4) NOT NULL DEFAULT 0',
|
||||
'it_not_c' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_not_d' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_not_s' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_min' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_max' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_date_min' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_date_max' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_min1' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_max1' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_min2' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_max2' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_min3' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_max3' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_pri1' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_pri2' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_pri3' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'it_user_use1' => 'INT(4) NOT NULL DEFAULT 0',
|
||||
'it_user_use2' => 'INT(4) NOT NULL DEFAULT 0',
|
||||
'it_user_use3' => 'INT(4) NOT NULL DEFAULT 0',
|
||||
'it_user_txt1' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
|
||||
'it_user_txt2' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
|
||||
'it_user_txt3' => 'VARCHAR(100) NOT NULL DEFAULT \'\'',
|
||||
];
|
||||
|
||||
foreach ($columns_to_add as $column => $attributes) {
|
||||
// 컬럼이 있는지 확인
|
||||
$column_check = sql_query("SHOW COLUMNS FROM {$g5['g5_shop_item_table']} LIKE '{$column}'", false);
|
||||
if (!sql_num_rows($column_check)) {
|
||||
// 컬럼 추가
|
||||
sql_query("ALTER TABLE {$g5['g5_shop_item_table']} ADD {$column} {$attributes}", true);
|
||||
}
|
||||
}
|
||||
|
||||
$columns_to_add2 = [
|
||||
'ct_types' => 'INT(10) NOT NULL DEFAULT 0',
|
||||
'ct_date_s' => 'DATE NOT NULL', //시작일
|
||||
'ct_date_e' => 'DATE NOT NULL', //종료일
|
||||
'ct_date_d' => 'INT(10) NOT NULL DEFAULT 0', //일수
|
||||
'ct_date_t' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //선택옵션
|
||||
'ct_user_txt1' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션1 항목
|
||||
'ct_user_txt2' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션2 항목
|
||||
'ct_user_txt3' => 'VARCHAR(255) NOT NULL DEFAULT \'\'', //추가옵션3 항목
|
||||
'ct_user_qty1' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션1 수량
|
||||
'ct_user_qty2' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션2 수량
|
||||
'ct_user_qty3' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션3 수량
|
||||
'ct_user_pri1' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액1
|
||||
'ct_user_pri2' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액2
|
||||
'ct_user_pri3' => 'INT(10) NOT NULL DEFAULT 0', //추가옵션금액3
|
||||
];
|
||||
|
||||
foreach ($columns_to_add2 as $column => $attributes) {
|
||||
// 컬럼이 있는지 확인
|
||||
$column_check = sql_query("SHOW COLUMNS FROM {$g5['g5_shop_cart_table']} LIKE '{$column}'", false);
|
||||
if (!sql_num_rows($column_check)) {
|
||||
// 컬럼 추가
|
||||
sql_query("ALTER TABLE {$g5['g5_shop_cart_table']} ADD {$column} {$attributes}", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$sql = " select * from {$rb_table_name} limit 1";
|
||||
$res = sql_fetch($sql);
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_rb1">기본설정</a></li>
|
||||
</ul>';
|
||||
|
||||
$g5['title'] = '예약 설정';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
|
||||
<form name="rb_form" id="rb_form" action="./reservation_set_update.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="token" value="" id="token">
|
||||
|
||||
<section id="anc_rb1">
|
||||
<h2 class="h2_frm">기본 설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">예약기능 사용여부</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('체크를 해제 하시면 예약기능을 사용하지 않습니다.') ?>
|
||||
<input type="checkbox" name="res_is" value="1" id="res_is" <?php echo isset($res['res_is']) && $res['res_is'] == 1 ? 'checked' : ''; ?>> <label for="res_is">예약기능을 사용 합니다.</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
31
adm/rb/reservation_set_update.php
Normal file
31
adm/rb/reservation_set_update.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
$sub_menu = '000810';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
check_admin_token();
|
||||
|
||||
$g5['rb_prefix'] = G5_TABLE_PREFIX.'rb_'; // 리빌더 테이블명 접두사
|
||||
$rb_table_name = $g5['rb_prefix'].'reservation'; // g5_rb_reservation
|
||||
|
||||
// 컬럼이 있는지 검사한다.
|
||||
$cnt = sql_fetch("SELECT COUNT(*) as cnt FROM {$rb_table_name}");
|
||||
|
||||
|
||||
if ($cnt['cnt'] > 0) {
|
||||
$sql = "UPDATE {$rb_table_name}
|
||||
SET res_is = '{$_POST['res_is']}',
|
||||
res_datetime = '" . G5_TIME_YMDHIS . "'";
|
||||
sql_query($sql);
|
||||
} else {
|
||||
$sql = "INSERT INTO {$rb_table_name}
|
||||
SET res_is = '{$_POST['res_is']}',
|
||||
res_datetime = '" . G5_TIME_YMDHIS . "'";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
update_rewrite_rules();
|
||||
|
||||
goto_url('./reservation_set.php', false);
|
||||
?>
|
||||
265
adm/rb/seo_form.php
Normal file
265
adm/rb/seo_form.php
Normal file
@ -0,0 +1,265 @@
|
||||
<?php
|
||||
$sub_menu = '000500';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
add_stylesheet('<link rel="stylesheet" href="./css/style.css">', 0);
|
||||
|
||||
//테이블이 있는지 검사한다.
|
||||
if(!sql_query(" DESCRIBE rb_seo ", false)) {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `rb_seo` (
|
||||
`se_title` varchar(255) NOT NULL COMMENT '사이트명',
|
||||
`se_description` mediumtext NOT NULL COMMENT '사이트설명',
|
||||
`se_keywords` mediumtext NOT NULL COMMENT '키워드',
|
||||
`se_favicon` varchar(255) NOT NULL COMMENT '파비콘',
|
||||
`se_google_meta` varchar(255) NOT NULL COMMENT '구글 소유권 메타',
|
||||
`se_naver_meta` varchar(255) NOT NULL COMMENT '네이버 소유권 메타',
|
||||
`se_robots` mediumtext NOT NULL COMMENT '로봇접근제어',
|
||||
`se_og_image` varchar(255) NOT NULL COMMENT '오픈그래프 이미지',
|
||||
`se_og_site_name` varchar(255) NOT NULL COMMENT '오픈그래프 사이트명',
|
||||
`se_og_title` varchar(255) NOT NULL COMMENT '오픈그래프 사이트명',
|
||||
`se_og_description` varchar(255) NOT NULL COMMENT '오픈그래프 사이트 설명',
|
||||
`se_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '등록일시(변경일시)'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
$sql = " select * from rb_seo limit 1";
|
||||
$seo = sql_fetch($sql);
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_seo1">기본설정</a></li>
|
||||
<li><a href="#anc_seo2">검색엔진</a></li>
|
||||
<li><a href="#anc_seo3">오픈그래프</a></li>
|
||||
<li><a href="#anc_seo4">기타설정</a></li>
|
||||
</ul>';
|
||||
|
||||
$g5['title'] = 'SEO 관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
|
||||
|
||||
<form name="seo_form" id="seo_form" action="./seo_form_update.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="token" value="" id="token">
|
||||
|
||||
<section id="anc_seo1">
|
||||
<h2 class="h2_frm">기본설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">웹사이트 제목<strong class="sound_only">필수</strong></th>
|
||||
<td colspan="3">
|
||||
<?php echo help('검색결과와 브라우저 제목에 반영되는 대표 정보로,<br>웹사이트 이름과 함께 고유한 브랜드메시지를 짧게 입력하는 것도 좋습니다.') ?>
|
||||
<input type="text" name="se_title" value="<?php echo isset($seo['se_title']) ? get_sanitize_input($seo['se_title']) : ''; ?>" id="se_title" required class="required frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">웹사이트 설명</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('웹사이트 유형, 판매 상품 정보, 사용자의 클릭을 유도하는 설명 등을 요약하여 입력하세요.') ?>
|
||||
<input type="text" name="se_description" value="<?php echo isset($seo['se_description']) ? get_sanitize_input($seo['se_description']) : ''; ?>" id="se_description" class="frm_input" size="100">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">키워드</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('검색형 키워드를 콤마로 구분하여 입력하세요.') ?>
|
||||
<input type="text" name="se_keywords" value="<?php echo isset($seo['se_keywords']) ? get_sanitize_input($seo['se_keywords']) : ''; ?>" id="se_keywords" class="frm_input" size="100">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">파비콘</th>
|
||||
<td>
|
||||
<div class="border_box_adm">
|
||||
<img src="./img/bg_favicon_example.png"><br><br>
|
||||
<?php echo help('파비콘은 주소창에 표시되는 웹사이트를 대표하는 아이콘입니다.<br>브라우저의 상단 탭과 북마크 영역에서 나타납니다.') ?>
|
||||
</div>
|
||||
<?php echo help('ico 파일만 업로드 가능합니다.') ?>
|
||||
<input type="file" name="se_favicon">
|
||||
|
||||
<?php
|
||||
$favimg = G5_DATA_PATH . "/seo/favicon";
|
||||
if (file_exists($favimg)) {
|
||||
echo '<input type="checkbox" name="se_favicon_del" value="1" id="se_favicon_del"> <label for="se_favicon_del">삭제</label>';
|
||||
|
||||
if (isset($seo['se_favicon'])) {
|
||||
echo '<div>' . G5_URL . '/data/seo/' . $seo['se_favicon'] . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_seo2">
|
||||
<h2 class="h2_frm">검색엔진</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">구글 서치 콘솔</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('구글에 웹사이트를 등록하고 발급받은 HTML 태그를 입력하여 사이트 소유권을 확인합니다.') ?>
|
||||
<input type="text" name="se_google_meta" value="<?php echo isset($seo['se_google_meta']) ? get_text($seo['se_google_meta']) : ''; ?>" id="se_google_meta" class="frm_input" size="50" placeholder="<meta name=....">
|
||||
<a href="https://search.google.com/search-console/about" target="_blank" class="btn_frmline">바로가기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">네이버 서치 어드바이저</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('네이버에 웹사이트를 등록하고 발급받은 HTML 태그를 입력하여 사이트 소유권을 확인합니다.') ?>
|
||||
<input type="text" name="se_naver_meta" value="<?php echo isset($seo['se_naver_meta']) ? get_text($seo['se_naver_meta']) : ''; ?>" id="se_naver_meta" class="frm_input" size="50" placeholder="<meta name=....">
|
||||
<a href="https://searchadvisor.naver.com/" target="_blank" class="btn_frmline">바로가기</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_seo3">
|
||||
<h2 class="h2_frm">오픈그래프</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">og:image</th>
|
||||
<td>
|
||||
<?php echo help('SNS에서 공유할 때 노출되는 이미지를 설정합니다.<br>게시판, 상품 등의 페이지는 자동적용 됩니다.') ?>
|
||||
<input type="file" name="se_og_image">
|
||||
<?php
|
||||
$ogimg_str = "";
|
||||
$ogimg = G5_DATA_PATH . "/seo/og_image";
|
||||
if (file_exists($ogimg)) {
|
||||
$size = @getimagesize($ogimg);
|
||||
if ($size !== false) {
|
||||
if ($size[0] && $size[0] > 400) {
|
||||
$width = 400;
|
||||
} else {
|
||||
$width = $size[0];
|
||||
}
|
||||
|
||||
echo '<input type="checkbox" name="se_og_image_del" value="1" id="se_og_image_del"> <label for="se_og_image_del">삭제</label>';
|
||||
$ogimg_str = '<img src="' . G5_DATA_URL . '/seo/og_image?ver=' . G5_SERVER_TIME . '" width="' . $width . '">';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($seo['se_og_image'])) {
|
||||
echo '<div>' . G5_URL . '/data/seo/' . $seo['se_og_image'] . '</div>';
|
||||
}
|
||||
|
||||
if (!empty($ogimg_str)) {
|
||||
echo '<div style="margin-top:20px;">';
|
||||
echo $ogimg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">og:site_name</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('SNS에서 공유할 때 노출되는 사이트이름을 설정합니다.<br>게시판, 상품 등의 페이지는 자동적용 됩니다.') ?>
|
||||
<input type="text" name="se_og_site_name" value="<?php echo isset($seo['se_og_site_name']) ? get_sanitize_input($seo['se_og_site_name']) : ''; ?>" id="se_og_site_name" class="frm_input" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">og:title</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('SNS에서 공유할 때 노출되는 페이지제목(사이트이름)을 설정합니다.<br>게시판, 상품 등의 페이지는 자동적용 됩니다.') ?>
|
||||
<input type="text" name="se_og_title" value="<?php echo isset($seo['se_og_title']) ? get_sanitize_input($seo['se_og_title']) : ''; ?>" id="se_og_title" class="frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row">og:description</th>
|
||||
<td colspan="3">
|
||||
<?php echo help('SNS에서 공유할 때 노출되는 페이지설명(사이트설명)을 설정합니다.<br>게시판, 상품 등의 페이지는 자동적용 됩니다.') ?>
|
||||
<input type="text" name="se_og_description" value="<?php echo isset($seo['se_og_description']) ? get_sanitize_input($seo['se_og_description']) : ''; ?>" id="se_og_description" class="frm_input" size="100">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section id="anc_seo4">
|
||||
<h2 class="h2_frm">기타설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row">robots.txt</th>
|
||||
<td>
|
||||
<?php echo help('robots.txt 파일은 검색로봇에게 페이지를 수집할 수 있도록 허용하거나 제한하는 표준 규약입니다.') ?>
|
||||
<textarea name="se_robots" id="se_robots"><?php echo isset($seo['se_robots']) ? get_text($seo['se_robots']) : ''; ?></textarea>
|
||||
<?php
|
||||
$r_files = G5_PATH."/robots.txt";
|
||||
if (file_exists($r_files)) {
|
||||
echo '<div>'.G5_URL.'/robots.txt</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="btn_fixed_top">
|
||||
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
122
adm/rb/seo_form_update.php
Normal file
122
adm/rb/seo_form_update.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
$sub_menu = '000500';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
|
||||
check_admin_token();
|
||||
@mkdir(G5_DATA_PATH . "/seo", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH . "/seo", G5_DIR_PERMISSION);
|
||||
|
||||
$favimg = isset($_FILES['se_favicon']['tmp_name']) ? $_FILES['se_favicon']['tmp_name'] : null;
|
||||
$favimg_name = isset($_FILES['se_favicon']['name']) ? $_FILES['se_favicon']['name'] : null;
|
||||
|
||||
$ogimg = isset($_FILES['se_og_image']['tmp_name']) ? $_FILES['se_og_image']['tmp_name'] : null;
|
||||
$ogimg_name = isset($_FILES['se_og_image']['name']) ? $_FILES['se_og_image']['name'] : null;
|
||||
|
||||
$se_favicon_del = isset($_POST['se_favicon_del']) ? $_POST['se_favicon_del'] : null;
|
||||
$se_og_image_del = isset($_POST['se_og_image_del']) ? $_POST['se_og_image_del'] : null;
|
||||
|
||||
if ($se_favicon_del) {
|
||||
@unlink(G5_DATA_PATH . "/seo/favicon");
|
||||
}
|
||||
if ($se_og_image_del) {
|
||||
@unlink(G5_DATA_PATH . "/seo/og_image");
|
||||
}
|
||||
|
||||
// ico 파일인지 체크
|
||||
if ($favimg || $favimg_name) {
|
||||
if (!preg_match('/\.(ico)$/i', $favimg_name)) {
|
||||
alert("ico 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
// 파일이 이미지인지 체크
|
||||
if ($ogimg || $ogimg_name) {
|
||||
if (!preg_match('/\.(gif|jpe?g|bmp|png)$/i', $ogimg_name)) {
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
|
||||
$oimg = @getimagesize($ogimg);
|
||||
if ($oimg === false || $oimg[2] < 1 || $oimg[2] > 16) {
|
||||
alert("이미지 파일만 업로드 할수 있습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
// 컬럼이 있는지 검사한다.
|
||||
$cnt = sql_fetch("SELECT COUNT(*) as cnt FROM rb_seo");
|
||||
|
||||
if ($cnt['cnt'] > 0) {
|
||||
$sql = "UPDATE rb_seo
|
||||
SET se_title = '{$_POST['se_title']}',
|
||||
se_description = '{$_POST['se_description']}',
|
||||
se_keywords = '{$_POST['se_keywords']}',
|
||||
se_google_meta = '{$_POST['se_google_meta']}',
|
||||
se_naver_meta = '{$_POST['se_naver_meta']}',
|
||||
se_robots = '{$_POST['se_robots']}',
|
||||
se_og_site_name = '{$_POST['se_og_site_name']}',
|
||||
se_og_title = '{$_POST['se_og_title']}',
|
||||
se_og_description = '{$_POST['se_og_description']}',
|
||||
se_datetime = '" . G5_TIME_YMDHIS . "'";
|
||||
sql_query($sql);
|
||||
} else {
|
||||
$sql = "INSERT INTO rb_seo
|
||||
SET se_title = '{$_POST['se_title']}',
|
||||
se_description = '{$_POST['se_description']}',
|
||||
se_keywords = '{$_POST['se_keywords']}',
|
||||
se_google_meta = '{$_POST['se_google_meta']}',
|
||||
se_naver_meta = '{$_POST['se_naver_meta']}',
|
||||
se_robots = '{$_POST['se_robots']}',
|
||||
se_og_site_name = '{$_POST['se_og_site_name']}',
|
||||
se_og_title = '{$_POST['se_og_title']}',
|
||||
se_og_description = '{$_POST['se_og_description']}',
|
||||
se_datetime = '" . G5_TIME_YMDHIS . "'";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if ($favimg_name) {
|
||||
rb_upload_files($favimg, 'favicon', G5_DATA_PATH . "/seo");
|
||||
}
|
||||
if ($ogimg_name) {
|
||||
rb_upload_files($ogimg, 'og_image', G5_DATA_PATH . "/seo");
|
||||
}
|
||||
|
||||
// 파일이 있는지 체크
|
||||
$ogimg_in = G5_DATA_PATH . "/seo/og_image";
|
||||
if (file_exists($ogimg_in)) {
|
||||
$sql = "UPDATE rb_seo SET se_og_image = 'og_image'";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$favimg_in = G5_DATA_PATH . "/seo/favicon";
|
||||
if (file_exists($favimg_in)) {
|
||||
$sql = "UPDATE rb_seo SET se_favicon = 'favicon'";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// robots.txt 파일 생성
|
||||
if (isset($_POST['se_robots'])) {
|
||||
// textarea에서 입력된 내용을 가져옴
|
||||
$robotsContent = $_POST['se_robots'];
|
||||
|
||||
// robots.txt 파일의 경로를 정의함
|
||||
$filePath = G5_PATH . '/robots.txt';
|
||||
|
||||
// 쓰기 모드로 파일을 오픈
|
||||
if ($fileHandle = fopen($filePath, 'w')) {
|
||||
// 파일에 내용을 저장함
|
||||
if (fwrite($fileHandle, $robotsContent) === false) {
|
||||
echo "robots.txt 파일 쓰기에 실패 했습니다.";
|
||||
}
|
||||
// 파일 핸들을 닫음
|
||||
fclose($fileHandle);
|
||||
} else {
|
||||
echo "robots.txt 파일을 쓰기 위해 여는 데 실패했습니다.";
|
||||
}
|
||||
}
|
||||
|
||||
update_rewrite_rules();
|
||||
|
||||
goto_url('./seo_form.php', false);
|
||||
?>
|
||||
10
adm/rb/shop/_common.php
Normal file
10
adm/rb/shop/_common.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
define('G5_IS_ADMIN', true);
|
||||
require_once '../../../common.php';
|
||||
require_once G5_ADMIN_PATH . '/admin.lib.php';
|
||||
|
||||
if (isset($token)) {
|
||||
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
|
||||
}
|
||||
|
||||
run_event('admin_common');
|
||||
1916
adm/rb/shop/itemform.php
Normal file
1916
adm/rb/shop/itemform.php
Normal file
File diff suppressed because it is too large
Load Diff
709
adm/rb/shop/itemformupdate.php
Normal file
709
adm/rb/shop/itemformupdate.php
Normal file
@ -0,0 +1,709 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($w == "u" || $w == "d")
|
||||
check_demo();
|
||||
|
||||
if ($w == '' || $w == 'u')
|
||||
auth_check_menu($auth, $sub_menu, "w");
|
||||
else if ($w == 'd')
|
||||
auth_check_menu($auth, $sub_menu, "d");
|
||||
|
||||
check_admin_token();
|
||||
|
||||
@mkdir(G5_DATA_PATH."/item", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/item", G5_DIR_PERMISSION);
|
||||
|
||||
// input vars 체크
|
||||
check_input_vars();
|
||||
|
||||
$ca_id = isset($_POST['ca_id']) ? preg_replace('/[^0-9a-z]/i', '', $_POST['ca_id']) : '';
|
||||
$ca_id2 = isset($_POST['ca_id2']) ? preg_replace('/[^0-9a-z]/i', '', $_POST['ca_id2']) : '';
|
||||
$ca_id3 = isset($_POST['ca_id3']) ? preg_replace('/[^0-9a-z]/i', '', $_POST['ca_id3']) : '';
|
||||
|
||||
if ($is_admin != 'super') { // 최고관리자가 아니면 체크
|
||||
if( $w === '' ){
|
||||
$sql = "select ca_mb_id from {$g5['g5_shop_category_table']} where ca_id = '$ca_id'";
|
||||
} else {
|
||||
$sql = "select b.ca_mb_id from {$g5['g5_shop_item_table']} a , {$g5['g5_shop_category_table']} b where (a.ca_id = b.ca_id) and a.it_id = '$it_id'";
|
||||
}
|
||||
$checks = sql_fetch($sql);
|
||||
|
||||
if( ! (isset($checks['ca_mb_id']) && $checks['ca_mb_id']) || $checks['ca_mb_id'] !== $member['mb_id'] ){
|
||||
alert("해당 분류의 관리회원이 아닙니다.");
|
||||
}
|
||||
}
|
||||
|
||||
$it_img1 = $it_img2 = $it_img3 = $it_img4 = $it_img5 = $it_img6 = $it_img7 = $it_img8 = $it_img9 = $it_img10 = '';
|
||||
// 파일정보
|
||||
if($w == "u") {
|
||||
$sql = " select it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$file = sql_fetch($sql);
|
||||
|
||||
$it_img1 = $file['it_img1'];
|
||||
$it_img2 = $file['it_img2'];
|
||||
$it_img3 = $file['it_img3'];
|
||||
$it_img4 = $file['it_img4'];
|
||||
$it_img5 = $file['it_img5'];
|
||||
$it_img6 = $file['it_img6'];
|
||||
$it_img7 = $file['it_img7'];
|
||||
$it_img8 = $file['it_img8'];
|
||||
$it_img9 = $file['it_img9'];
|
||||
$it_img10 = $file['it_img10'];
|
||||
}
|
||||
|
||||
$it_img_dir = G5_DATA_PATH.'/item';
|
||||
|
||||
for($i=0;$i<=10;$i++){
|
||||
${'it_img'.$i.'_del'} = ! empty($_POST['it_img'.$i.'_del']) ? 1 : 0;
|
||||
}
|
||||
|
||||
// 파일삭제
|
||||
if ($it_img1_del) {
|
||||
$file_img1 = $it_img_dir.'/'.clean_relative_paths($it_img1);
|
||||
@unlink($file_img1);
|
||||
delete_item_thumbnail(dirname($file_img1), basename($file_img1));
|
||||
$it_img1 = '';
|
||||
}
|
||||
if ($it_img2_del) {
|
||||
$file_img2 = $it_img_dir.'/'.clean_relative_paths($it_img2);
|
||||
@unlink($file_img2);
|
||||
delete_item_thumbnail(dirname($file_img2), basename($file_img2));
|
||||
$it_img2 = '';
|
||||
}
|
||||
if ($it_img3_del) {
|
||||
$file_img3 = $it_img_dir.'/'.clean_relative_paths($it_img3);
|
||||
@unlink($file_img3);
|
||||
delete_item_thumbnail(dirname($file_img3), basename($file_img3));
|
||||
$it_img3 = '';
|
||||
}
|
||||
if ($it_img4_del) {
|
||||
$file_img4 = $it_img_dir.'/'.clean_relative_paths($it_img4);
|
||||
@unlink($file_img4);
|
||||
delete_item_thumbnail(dirname($file_img4), basename($file_img4));
|
||||
$it_img4 = '';
|
||||
}
|
||||
if ($it_img5_del) {
|
||||
$file_img5 = $it_img_dir.'/'.clean_relative_paths($it_img5);
|
||||
@unlink($file_img5);
|
||||
delete_item_thumbnail(dirname($file_img5), basename($file_img5));
|
||||
$it_img5 = '';
|
||||
}
|
||||
if ($it_img6_del) {
|
||||
$file_img6 = $it_img_dir.'/'.clean_relative_paths($it_img6);
|
||||
@unlink($file_img6);
|
||||
delete_item_thumbnail(dirname($file_img6), basename($file_img6));
|
||||
$it_img6 = '';
|
||||
}
|
||||
if ($it_img7_del) {
|
||||
$file_img7 = $it_img_dir.'/'.clean_relative_paths($it_img7);
|
||||
@unlink($file_img7);
|
||||
delete_item_thumbnail(dirname($file_img7), basename($file_img7));
|
||||
$it_img7 = '';
|
||||
}
|
||||
if ($it_img8_del) {
|
||||
$file_img8 = $it_img_dir.'/'.clean_relative_paths($it_img8);
|
||||
@unlink($file_img8);
|
||||
delete_item_thumbnail(dirname($file_img8), basename($file_img8));
|
||||
$it_img8 = '';
|
||||
}
|
||||
if ($it_img9_del) {
|
||||
$file_img9 = $it_img_dir.'/'.clean_relative_paths($it_img9);
|
||||
@unlink($file_img9);
|
||||
delete_item_thumbnail(dirname($file_img9), basename($file_img9));
|
||||
$it_img9 = '';
|
||||
}
|
||||
if ($it_img10_del) {
|
||||
$file_img10 = $it_img_dir.'/'.clean_relative_paths($it_img10);
|
||||
@unlink($file_img10);
|
||||
delete_item_thumbnail(dirname($file_img10), basename($file_img10));
|
||||
$it_img10 = '';
|
||||
}
|
||||
|
||||
// 이미지업로드
|
||||
if ($_FILES['it_img1']['name']) {
|
||||
if($w == 'u' && $it_img1) {
|
||||
$file_img1 = $it_img_dir.'/'.clean_relative_paths($it_img1);
|
||||
@unlink($file_img1);
|
||||
delete_item_thumbnail(dirname($file_img1), basename($file_img1));
|
||||
}
|
||||
$it_img1 = it_img_upload($_FILES['it_img1']['tmp_name'], $_FILES['it_img1']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img2']['name']) {
|
||||
if($w == 'u' && $it_img2) {
|
||||
$file_img2 = $it_img_dir.'/'.clean_relative_paths($it_img2);
|
||||
@unlink($file_img2);
|
||||
delete_item_thumbnail(dirname($file_img2), basename($file_img2));
|
||||
}
|
||||
$it_img2 = it_img_upload($_FILES['it_img2']['tmp_name'], $_FILES['it_img2']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img3']['name']) {
|
||||
if($w == 'u' && $it_img3) {
|
||||
$file_img3 = $it_img_dir.'/'.clean_relative_paths($it_img3);
|
||||
@unlink($file_img3);
|
||||
delete_item_thumbnail(dirname($file_img3), basename($file_img3));
|
||||
}
|
||||
$it_img3 = it_img_upload($_FILES['it_img3']['tmp_name'], $_FILES['it_img3']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img4']['name']) {
|
||||
if($w == 'u' && $it_img4) {
|
||||
$file_img4 = $it_img_dir.'/'.clean_relative_paths($it_img4);
|
||||
@unlink($file_img4);
|
||||
delete_item_thumbnail(dirname($file_img4), basename($file_img4));
|
||||
}
|
||||
$it_img4 = it_img_upload($_FILES['it_img4']['tmp_name'], $_FILES['it_img4']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img5']['name']) {
|
||||
if($w == 'u' && $it_img5) {
|
||||
$file_img5 = $it_img_dir.'/'.clean_relative_paths($it_img5);
|
||||
@unlink($file_img5);
|
||||
delete_item_thumbnail(dirname($file_img5), basename($file_img5));
|
||||
}
|
||||
$it_img5 = it_img_upload($_FILES['it_img5']['tmp_name'], $_FILES['it_img5']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img6']['name']) {
|
||||
if($w == 'u' && $it_img6) {
|
||||
$file_img6 = $it_img_dir.'/'.clean_relative_paths($it_img6);
|
||||
@unlink($file_img6);
|
||||
delete_item_thumbnail(dirname($file_img6), basename($file_img6));
|
||||
}
|
||||
$it_img6 = it_img_upload($_FILES['it_img6']['tmp_name'], $_FILES['it_img6']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img7']['name']) {
|
||||
if($w == 'u' && $it_img7) {
|
||||
$file_img7 = $it_img_dir.'/'.clean_relative_paths($it_img7);
|
||||
@unlink($file_img7);
|
||||
delete_item_thumbnail(dirname($file_img7), basename($file_img7));
|
||||
}
|
||||
$it_img7 = it_img_upload($_FILES['it_img7']['tmp_name'], $_FILES['it_img7']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img8']['name']) {
|
||||
if($w == 'u' && $it_img8) {
|
||||
$file_img8 = $it_img_dir.'/'.clean_relative_paths($it_img8);
|
||||
@unlink($file_img8);
|
||||
delete_item_thumbnail(dirname($file_img8), basename($file_img8));
|
||||
}
|
||||
$it_img8 = it_img_upload($_FILES['it_img8']['tmp_name'], $_FILES['it_img8']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img9']['name']) {
|
||||
if($w == 'u' && $it_img9) {
|
||||
$file_img9 = $it_img_dir.'/'.clean_relative_paths($it_img9);
|
||||
@unlink($file_img9);
|
||||
delete_item_thumbnail(dirname($file_img9), basename($file_img9));
|
||||
}
|
||||
$it_img9 = it_img_upload($_FILES['it_img9']['tmp_name'], $_FILES['it_img9']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img10']['name']) {
|
||||
if($w == 'u' && $it_img10) {
|
||||
$file_img10 = $it_img_dir.'/'.clean_relative_paths($it_img10);
|
||||
@unlink($file_img10);
|
||||
delete_item_thumbnail(dirname($file_img10), basename($file_img10));
|
||||
}
|
||||
$it_img10 = it_img_upload($_FILES['it_img10']['tmp_name'], $_FILES['it_img10']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
// 다음 입력을 위해서 옵션값을 쿠키로 한달동안 저장함
|
||||
//@setcookie("ck_ca_id", $ca_id, time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
//@setcookie("ck_maker", stripslashes($it_maker), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
//@setcookie("ck_origin", stripslashes($it_origin), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
@set_cookie("ck_ca_id", $ca_id, time() + 86400*31);
|
||||
@set_cookie("ck_ca_id2", $ca_id2, time() + 86400*31);
|
||||
@set_cookie("ck_ca_id3", $ca_id3, time() + 86400*31);
|
||||
@set_cookie("ck_maker", stripslashes($it_maker), time() + 86400*31);
|
||||
@set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31);
|
||||
}
|
||||
|
||||
// 관련상품을 삭제한 뒤에 경고가 노출되어 등록, 수정 없이 관련상품만 삭제될 수 있는 오류 수정 (squared2님,210617)
|
||||
// 포인트 비율 값 체크
|
||||
if(($it_point_type == 1 || $it_point_type == 2) && ($it_point < 0 || $it_point > 99))
|
||||
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
|
||||
|
||||
// 관련상품을 우선 삭제함
|
||||
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' ");
|
||||
|
||||
// 관련상품의 반대도 삭제
|
||||
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id2 = '$it_id' ");
|
||||
|
||||
// 이벤트상품을 우선 삭제함
|
||||
sql_query(" delete from {$g5['g5_shop_event_item_table']} where it_id = '$it_id' ");
|
||||
|
||||
// 선택옵션
|
||||
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '$it_id' "); // 기존선택옵션삭제
|
||||
|
||||
$option_count = (isset($_POST['opt_id']) && is_array($_POST['opt_id'])) ? count($_POST['opt_id']) : array();
|
||||
$it_option_subject = '';
|
||||
$it_supply_subject = '';
|
||||
|
||||
if($option_count) {
|
||||
// 옵션명
|
||||
$opt1_cnt = $opt2_cnt = $opt3_cnt = 0;
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
$post_opt_id = isset($_POST['opt_id'][$i]) ? preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($_POST['opt_id'][$i])) : '';
|
||||
|
||||
$opt_val = explode(chr(30), $post_opt_id);
|
||||
if(isset($opt_val[0]) && $opt_val[0])
|
||||
$opt1_cnt++;
|
||||
if(isset($opt_val[1]) && $opt_val[1])
|
||||
$opt2_cnt++;
|
||||
if(isset($opt_val[2]) && $opt_val[2])
|
||||
$opt3_cnt++;
|
||||
}
|
||||
|
||||
if($opt1_subject && $opt1_cnt) {
|
||||
$it_option_subject = $opt1_subject;
|
||||
if($opt2_subject && $opt2_cnt)
|
||||
$it_option_subject .= ','.$opt2_subject;
|
||||
if($opt3_subject && $opt3_cnt)
|
||||
$it_option_subject .= ','.$opt3_subject;
|
||||
}
|
||||
}
|
||||
|
||||
// 추가옵션
|
||||
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '1' and it_id = '$it_id' "); // 기존추가옵션삭제
|
||||
|
||||
$supply_count = (isset($_POST['spl_id']) && is_array($_POST['spl_id'])) ? count($_POST['spl_id']) : array();
|
||||
if($supply_count) {
|
||||
// 추가옵션명
|
||||
$arr_spl = array();
|
||||
for($i=0; $i<$supply_count; $i++) {
|
||||
$post_spl_id = isset($_POST['spl_id'][$i]) ? preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($_POST['spl_id'][$i])) : '';
|
||||
|
||||
$spl_val = explode(chr(30), $post_spl_id);
|
||||
if(!in_array($spl_val[0], $arr_spl))
|
||||
$arr_spl[] = $spl_val[0];
|
||||
}
|
||||
|
||||
$it_supply_subject = implode(',', $arr_spl);
|
||||
}
|
||||
|
||||
// 상품요약정보
|
||||
$value_array = array();
|
||||
$count_ii_article = (isset($_POST['ii_article']) && is_array($_POST['ii_article'])) ? count($_POST['ii_article']) : 0;
|
||||
for($i=0; $i<$count_ii_article; $i++) {
|
||||
$key = isset($_POST['ii_article'][$i]) ? html_purifier($_POST['ii_article'][$i]) : '';
|
||||
$val = isset($_POST['ii_value'][$i]) ? html_purifier($_POST['ii_value'][$i]) : '';
|
||||
$value_array[$key] = $val;
|
||||
}
|
||||
$it_info_value = addslashes(serialize($value_array));
|
||||
|
||||
$it_name = isset($_POST['it_name']) ? strip_tags(clean_xss_attributes(trim($_POST['it_name']))) : '';
|
||||
|
||||
// KVE-2019-0708
|
||||
$check_sanitize_keys = array(
|
||||
'it_order', // 출력순서
|
||||
'it_maker', // 제조사
|
||||
'it_origin', // 원산지
|
||||
'it_brand', // 브랜드
|
||||
'it_model', // 모델
|
||||
'it_tel_inq', // 전화문의
|
||||
'it_use', // 판매가능
|
||||
'it_nocoupon', // 쿠폰적용안함
|
||||
'ec_mall_pid', // 네이버쇼핑 상품ID
|
||||
'it_sell_email', // 판매자 e-mail
|
||||
'it_price', // 판매가격
|
||||
'it_cust_price', // 시중가격
|
||||
'it_point_type', // 포인트 유형
|
||||
'it_point', // 포인트
|
||||
'it_supply_point', // 추가옵션상품 포인트
|
||||
'it_soldout', // 상품품절
|
||||
'it_stock_sms', // 재입고SMS 알림
|
||||
'it_stock_qty', // 재고수량
|
||||
'it_noti_qty', // 재고 통보수량
|
||||
'it_buy_min_qty', // 최소구매수량
|
||||
'it_notax', // 상품과세 유형
|
||||
'it_sc_type', // 배송비 유형
|
||||
'it_sc_method', // 배송비 결제
|
||||
'it_sc_price', // 기본배송비
|
||||
'it_sc_minimum', // 배송비 상세조건
|
||||
'it_type1', // 상품유형(히트)
|
||||
'it_type2', // 상품유형(추천)
|
||||
'it_type3', // 상품유형(신상품)
|
||||
'it_type4', // 상품유형(인기)
|
||||
'it_type5', // 상품유형(할인)
|
||||
'it_types', // 상품타입
|
||||
'it_date_s', // 기간
|
||||
'it_date_e', // 기간
|
||||
'it_date_n', // 불가날짜
|
||||
'it_date_t', // 시간목록
|
||||
'it_date_j', // 중복예약가능여부
|
||||
'it_date_g', // 구간선택 여부
|
||||
'it_user_min', // 최소인원
|
||||
'it_user_max', // 최대인원
|
||||
'it_date_min', // 최소일
|
||||
'it_date_max', // 최대일
|
||||
'it_user_pri1', // 성인
|
||||
'it_user_pri2', // 아동
|
||||
'it_user_pri3', // 유아
|
||||
'it_user_txt1', // 성인
|
||||
'it_user_txt2', // 아동
|
||||
'it_user_txt3', // 유아
|
||||
'it_user_use1', // 성인
|
||||
'it_user_use2', // 아동
|
||||
'it_user_use3', // 유아
|
||||
'it_not_c', // 마감조건
|
||||
'it_not_d', // 마감조건
|
||||
'it_not_s', // 마감조건
|
||||
);
|
||||
|
||||
foreach( $check_sanitize_keys as $key ){
|
||||
$$key = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
|
||||
}
|
||||
|
||||
$it_basic = preg_replace('#<script(.*?)>(.*?)<\/script>#is', '', $it_basic);
|
||||
$it_explan = isset($_POST['it_explan']) ? $_POST['it_explan'] : '';
|
||||
|
||||
if ($it_name == "")
|
||||
alert("상품명을 입력해 주십시오.");
|
||||
|
||||
$sql_common = " ca_id = '$ca_id',
|
||||
ca_id2 = '$ca_id2',
|
||||
ca_id3 = '$ca_id3',
|
||||
it_skin = '$it_skin',
|
||||
it_mobile_skin = '$it_mobile_skin',
|
||||
it_name = '$it_name',
|
||||
it_maker = '$it_maker',
|
||||
it_origin = '$it_origin',
|
||||
it_brand = '$it_brand',
|
||||
it_model = '$it_model',
|
||||
it_option_subject = '$it_option_subject',
|
||||
it_supply_subject = '$it_supply_subject',
|
||||
it_types = '$it_types',
|
||||
it_type1 = '$it_type1',
|
||||
it_type2 = '$it_type2',
|
||||
it_type3 = '$it_type3',
|
||||
it_type4 = '$it_type4',
|
||||
it_type5 = '$it_type5',
|
||||
it_date_s = '$it_date_s',
|
||||
it_date_e = '$it_date_e',
|
||||
it_date_n = '$it_date_n',
|
||||
it_date_t = '$it_date_t',
|
||||
it_date_j = '$it_date_j',
|
||||
it_date_g = '$it_date_g',
|
||||
it_user_min = '$it_user_min',
|
||||
it_user_max = '$it_user_max',
|
||||
it_user_min1 = '$it_user_min1',
|
||||
it_user_max1 = '$it_user_max1',
|
||||
it_user_min2 = '$it_user_min2',
|
||||
it_user_max2 = '$it_user_max2',
|
||||
it_user_min3 = '$it_user_min3',
|
||||
it_user_max3 = '$it_user_max3',
|
||||
it_date_min = '$it_date_min',
|
||||
it_date_max = '$it_date_max',
|
||||
it_user_pri1 = '$it_user_pri1',
|
||||
it_user_pri2 = '$it_user_pri2',
|
||||
it_user_pri3 = '$it_user_pri3',
|
||||
it_user_txt1 = '$it_user_txt1',
|
||||
it_user_txt2 = '$it_user_txt2',
|
||||
it_user_txt3 = '$it_user_txt3',
|
||||
it_user_use1 = '$it_user_use1',
|
||||
it_user_use2 = '$it_user_use2',
|
||||
it_user_use3 = '$it_user_use3',
|
||||
it_not_c = '$it_not_c',
|
||||
it_not_d = '$it_not_d',
|
||||
it_not_s = '$it_not_s',
|
||||
it_basic = '$it_basic',
|
||||
it_explan = '$it_explan',
|
||||
it_explan2 = '".strip_tags(trim(clean_xss_attributes($it_explan)))."',
|
||||
it_mobile_explan = '$it_mobile_explan',
|
||||
it_cust_price = '$it_cust_price',
|
||||
it_price = '$it_price',
|
||||
it_point = '$it_point',
|
||||
it_point_type = '$it_point_type',
|
||||
it_supply_point = '$it_supply_point',
|
||||
it_notax = '$it_notax',
|
||||
it_sell_email = '$it_sell_email',
|
||||
it_use = '$it_use',
|
||||
it_nocoupon = '$it_nocoupon',
|
||||
it_soldout = '$it_soldout',
|
||||
it_stock_qty = '$it_stock_qty',
|
||||
it_stock_sms = '$it_stock_sms',
|
||||
it_noti_qty = '$it_noti_qty',
|
||||
it_sc_type = '$it_sc_type',
|
||||
it_sc_method = '$it_sc_method',
|
||||
it_sc_price = '$it_sc_price',
|
||||
it_sc_minimum = '$it_sc_minimum',
|
||||
it_sc_qty = '$it_sc_qty',
|
||||
it_buy_min_qty = '$it_buy_min_qty',
|
||||
it_buy_max_qty = '$it_buy_max_qty',
|
||||
it_head_html = '$it_head_html',
|
||||
it_tail_html = '$it_tail_html',
|
||||
it_mobile_head_html = '$it_mobile_head_html',
|
||||
it_mobile_tail_html = '$it_mobile_tail_html',
|
||||
it_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
it_order = '$it_order',
|
||||
it_tel_inq = '$it_tel_inq',
|
||||
it_info_gubun = '$it_info_gubun',
|
||||
it_info_value = '$it_info_value',
|
||||
it_shop_memo = '$it_shop_memo',
|
||||
ec_mall_pid = '$ec_mall_pid',
|
||||
it_img1 = '$it_img1',
|
||||
it_img2 = '$it_img2',
|
||||
it_img3 = '$it_img3',
|
||||
it_img4 = '$it_img4',
|
||||
it_img5 = '$it_img5',
|
||||
it_img6 = '$it_img6',
|
||||
it_img7 = '$it_img7',
|
||||
it_img8 = '$it_img8',
|
||||
it_img9 = '$it_img9',
|
||||
it_img10 = '$it_img10',
|
||||
it_1_subj = '$it_1_subj',
|
||||
it_2_subj = '$it_2_subj',
|
||||
it_3_subj = '$it_3_subj',
|
||||
it_4_subj = '$it_4_subj',
|
||||
it_5_subj = '$it_5_subj',
|
||||
it_6_subj = '$it_6_subj',
|
||||
it_7_subj = '$it_7_subj',
|
||||
it_8_subj = '$it_8_subj',
|
||||
it_9_subj = '$it_9_subj',
|
||||
it_10_subj = '$it_10_subj',
|
||||
it_1 = '$it_1',
|
||||
it_2 = '$it_2',
|
||||
it_3 = '$it_3',
|
||||
it_4 = '$it_4',
|
||||
it_5 = '$it_5',
|
||||
it_6 = '$it_6',
|
||||
it_7 = '$it_7',
|
||||
it_8 = '$it_8',
|
||||
it_9 = '$it_9',
|
||||
it_10 = '$it_10'
|
||||
";
|
||||
|
||||
|
||||
if ($w == "")
|
||||
{
|
||||
$it_id = isset($_POST['it_id']) ? $_POST['it_id'] : '';
|
||||
|
||||
if (!trim($it_id)) {
|
||||
alert('상품 코드가 없으므로 상품을 추가하실 수 없습니다.');
|
||||
}
|
||||
|
||||
$t_it_id = preg_replace("/[A-Za-z0-9\-_]/", "", $it_id);
|
||||
if($t_it_id)
|
||||
alert('상품 코드는 영문자, 숫자, -, _ 만 사용할 수 있습니다.');
|
||||
|
||||
$sql_common .= " , it_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql_common .= " , it_update_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql = " insert {$g5['g5_shop_item_table']}
|
||||
set it_id = '$it_id',
|
||||
$sql_common ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w == "u")
|
||||
{
|
||||
$sql_common .= " , it_update_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set $sql_common
|
||||
where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
/*
|
||||
else if ($w == "d")
|
||||
{
|
||||
if ($is_admin != 'super')
|
||||
{
|
||||
$sql = " select it_id from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b
|
||||
where a.it_id = '$it_id'
|
||||
and a.ca_id = b.ca_id
|
||||
and b.ca_mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['it_id'])
|
||||
alert("\'{$member['mb_id']}\' 님께서 삭제 할 권한이 없는 상품입니다.");
|
||||
}
|
||||
|
||||
itemdelete($it_id);
|
||||
}
|
||||
*/
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
// 관련상품 등록
|
||||
$it_id2 = explode(",", $it_list);
|
||||
for ($i=0; $i<count($it_id2); $i++)
|
||||
{
|
||||
if (trim($it_id2[$i]))
|
||||
{
|
||||
$sql = " insert into {$g5['g5_shop_item_relation_table']}
|
||||
set it_id = '$it_id',
|
||||
it_id2 = '".sql_real_escape_string($it_id2[$i])."',
|
||||
ir_no = '$i' ";
|
||||
sql_query($sql, false);
|
||||
|
||||
// 관련상품의 반대로도 등록
|
||||
$sql = " insert into {$g5['g5_shop_item_relation_table']}
|
||||
set it_id = '".sql_real_escape_string($it_id2[$i])."',
|
||||
it_id2 = '$it_id',
|
||||
ir_no = '$i' ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트상품 등록
|
||||
$ev_id = explode(",", $ev_list);
|
||||
for ($i=0; $i<count($ev_id); $i++)
|
||||
{
|
||||
if (trim($ev_id[$i]))
|
||||
{
|
||||
$sql = " insert into {$g5['g5_shop_event_item_table']}
|
||||
set ev_id = '".sql_real_escape_string($ev_id[$i])."',
|
||||
it_id = '$it_id' ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 선택옵션등록
|
||||
if($option_count) {
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g5['g5_shop_item_option_table']}
|
||||
( `io_id`, `io_type`, `it_id`, `io_price`, `io_stock_qty`, `io_noti_qty`, `io_use` )
|
||||
VALUES ";
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
$sql .= $comma . " ( '".sql_real_escape_string($_POST['opt_id'][$i])."', '0', '$it_id', '".sql_real_escape_string($_POST['opt_price'][$i])."', '".sql_real_escape_string($_POST['opt_stock_qty'][$i])."', '".sql_real_escape_string($_POST['opt_noti_qty'][$i])."', '".sql_real_escape_string($_POST['opt_use'][$i])."' )";
|
||||
$comma = ' , ';
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 추가옵션등록
|
||||
if($supply_count) {
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g5['g5_shop_item_option_table']}
|
||||
( `io_id`, `io_type`, `it_id`, `io_price`, `io_stock_qty`, `io_noti_qty`, `io_use` )
|
||||
VALUES ";
|
||||
for($i=0; $i<$supply_count; $i++) {
|
||||
$sql .= $comma . " ( '".sql_real_escape_string($_POST['spl_id'][$i])."', '1', '$it_id', '".sql_real_escape_string($_POST['spl_price'][$i])."', '".sql_real_escape_string($_POST['spl_stock_qty'][$i])."', '".sql_real_escape_string($_POST['spl_noti_qty'][$i])."', '".sql_real_escape_string($_POST['spl_use'][$i])."' )";
|
||||
$comma = ' , ';
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 동일 분류내 상품 동일 옵션 적용
|
||||
$ca_fields = '';
|
||||
if(is_checked('chk_ca_it_skin')) $ca_fields .= " , it_skin = '$it_skin' ";
|
||||
if(is_checked('chk_ca_it_mobile_skin')) $ca_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
|
||||
if(is_checked('chk_ca_it_basic')) $ca_fields .= " , it_basic = '$it_basic' ";
|
||||
if(is_checked('chk_ca_it_order')) $ca_fields .= " , it_order = '$it_order' ";
|
||||
if(is_checked('chk_ca_it_type')) $ca_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";
|
||||
if(is_checked('chk_ca_it_maker')) $ca_fields .= " , it_maker = '$it_maker' ";
|
||||
if(is_checked('chk_ca_it_origin')) $ca_fields .= " , it_origin = '$it_origin' ";
|
||||
if(is_checked('chk_ca_it_brand')) $ca_fields .= " , it_brand = '$it_brand' ";
|
||||
if(is_checked('chk_ca_it_model')) $ca_fields .= " , it_model = '$it_model' ";
|
||||
if(is_checked('chk_ca_it_notax')) $ca_fields .= " , it_notax = '$it_notax' ";
|
||||
if(is_checked('chk_ca_it_sell_email')) $ca_fields .= " , it_sell_email = '$it_sell_email' ";
|
||||
if(is_checked('chk_ca_it_shop_memo')) $ca_fields .= " , it_shop_memo = '$it_shop_memo' ";
|
||||
if(is_checked('chk_ca_it_tel_inq')) $ca_fields .= " , it_tel_inq = '$it_tel_inq' ";
|
||||
if(is_checked('chk_ca_it_use')) $ca_fields .= " , it_use = '$it_use' ";
|
||||
if(is_checked('chk_ca_it_nocoupon')) $ca_fields .= " , it_nocoupon = '$it_nocoupon' ";
|
||||
if(is_checked('chk_ca_it_soldout')) $ca_fields .= " , it_soldout = '$it_soldout' ";
|
||||
if(is_checked('chk_ca_it_info')) $ca_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' ";
|
||||
if(is_checked('chk_ca_it_price')) $ca_fields .= " , it_price = '$it_price' ";
|
||||
if(is_checked('chk_ca_it_cust_price')) $ca_fields .= " , it_cust_price = '$it_cust_price' ";
|
||||
if(is_checked('chk_ca_it_point')) $ca_fields .= " , it_point = '$it_point' ";
|
||||
if(is_checked('chk_ca_it_point_type')) $ca_fields .= " , it_point_type = '$it_point_type' ";
|
||||
if(is_checked('chk_ca_it_supply_point')) $ca_fields .= " , it_supply_point = '$it_supply_point' ";
|
||||
if(is_checked('chk_ca_it_stock_qty')) $ca_fields .= " , it_stock_qty = '$it_stock_qty' ";
|
||||
if(is_checked('chk_ca_it_noti_qty')) $ca_fields .= " , it_noti_qty = '$it_noti_qty' ";
|
||||
if(is_checked('chk_ca_it_sendcost')) $ca_fields .= " , it_sc_type = '$it_sc_type', it_sc_method = '$it_sc_method', it_sc_price = '$it_sc_price', it_sc_minimum = '$it_sc_minimum', it_sc_qty = '$it_sc_qty' ";
|
||||
if(is_checked('chk_ca_it_buy_min_qty')) $ca_fields .= " , it_buy_min_qty = '$it_buy_min_qty' ";
|
||||
if(is_checked('chk_ca_it_buy_max_qty')) $ca_fields .= " , it_buy_max_qty = '$it_buy_max_qty' ";
|
||||
if(is_checked('chk_ca_it_head_html')) $ca_fields .= " , it_head_html = '$it_head_html' ";
|
||||
if(is_checked('chk_ca_it_tail_html')) $ca_fields .= " , it_tail_html = '$it_tail_html' ";
|
||||
if(is_checked('chk_ca_it_mobile_head_html')) $ca_fields .= " , it_mobile_head_html = '$it_mobile_head_html' ";
|
||||
if(is_checked('chk_ca_it_mobile_tail_html')) $ca_fields .= " , it_mobile_tail_html = '$it_mobile_tail_html' ";
|
||||
if(is_checked('chk_ca_1')) $ca_fields .= " , it_1_subj = '$it_1_subj', it_1 = '$it_1' ";
|
||||
if(is_checked('chk_ca_2')) $ca_fields .= " , it_2_subj = '$it_2_subj', it_2 = '$it_2' ";
|
||||
if(is_checked('chk_ca_3')) $ca_fields .= " , it_3_subj = '$it_3_subj', it_3 = '$it_3' ";
|
||||
if(is_checked('chk_ca_4')) $ca_fields .= " , it_4_subj = '$it_4_subj', it_4 = '$it_4' ";
|
||||
if(is_checked('chk_ca_5')) $ca_fields .= " , it_5_subj = '$it_5_subj', it_5 = '$it_5' ";
|
||||
if(is_checked('chk_ca_6')) $ca_fields .= " , it_6_subj = '$it_6_subj', it_6 = '$it_6' ";
|
||||
if(is_checked('chk_ca_7')) $ca_fields .= " , it_7_subj = '$it_7_subj', it_7 = '$it_7' ";
|
||||
if(is_checked('chk_ca_8')) $ca_fields .= " , it_8_subj = '$it_8_subj', it_8 = '$it_8' ";
|
||||
if(is_checked('chk_ca_9')) $ca_fields .= " , it_9_subj = '$it_9_subj', it_9 = '$it_9' ";
|
||||
if(is_checked('chk_ca_10')) $ca_fields .= " , it_10_subj = '$it_10_subj', it_10 = '$it_10' ";
|
||||
|
||||
if($ca_fields) {
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id = '$ca_id' ");
|
||||
if($ca_id2)
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id2 = '$ca_id2' ");
|
||||
if($ca_id3)
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id3 = '$ca_id3' ");
|
||||
}
|
||||
|
||||
// 모든 상품 동일 옵션 적용
|
||||
$all_fields = '';
|
||||
if(is_checked('chk_all_it_skin')) $all_fields .= " , it_skin = '$it_skin' ";
|
||||
if(is_checked('chk_all_it_mobile_skin')) $all_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
|
||||
if(is_checked('chk_all_it_basic')) $all_fields .= " , it_basic = '$it_basic' ";
|
||||
if(is_checked('chk_all_it_order')) $all_fields .= " , it_order = '$it_order' ";
|
||||
if(is_checked('chk_all_it_type')) $all_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";
|
||||
if(is_checked('chk_all_it_maker')) $all_fields .= " , it_maker = '$it_maker' ";
|
||||
if(is_checked('chk_all_it_origin')) $all_fields .= " , it_origin = '$it_origin' ";
|
||||
if(is_checked('chk_all_it_brand')) $all_fields .= " , it_brand = '$it_brand' ";
|
||||
if(is_checked('chk_all_it_model')) $all_fields .= " , it_model = '$it_model' ";
|
||||
if(is_checked('chk_all_it_notax')) $all_fields .= " , it_notax = '$it_notax' ";
|
||||
if(is_checked('chk_all_it_sell_email')) $all_fields .= " , it_sell_email = '$it_sell_email' ";
|
||||
if(is_checked('chk_all_it_shop_memo')) $all_fields .= " , it_shop_memo = '$it_shop_memo' ";
|
||||
if(is_checked('chk_all_it_tel_inq')) $all_fields .= " , it_tel_inq = '$it_tel_inq' ";
|
||||
if(is_checked('chk_all_it_use')) $all_fields .= " , it_use = '$it_use' ";
|
||||
if(is_checked('chk_all_it_nocoupon')) $all_fields .= " , it_nocoupon = '$it_nocoupon' ";
|
||||
if(is_checked('chk_all_it_soldout')) $all_fields .= " , it_soldout = '$it_soldout' ";
|
||||
if(is_checked('chk_all_it_info')) $all_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' ";
|
||||
if(is_checked('chk_all_it_price')) $all_fields .= " , it_price = '$it_price' ";
|
||||
if(is_checked('chk_all_it_cust_price')) $all_fields .= " , it_cust_price = '$it_cust_price' ";
|
||||
if(is_checked('chk_all_it_point')) $all_fields .= " , it_point = '$it_point' ";
|
||||
if(is_checked('chk_all_it_point_type')) $all_fields .= " , it_point_type = '$it_point_type' ";
|
||||
if(is_checked('chk_all_it_supply_point')) $all_fields .= " , it_supply_point = '$it_supply_point' ";
|
||||
if(is_checked('chk_all_it_stock_qty')) $all_fields .= " , it_stock_qty = '$it_stock_qty' ";
|
||||
if(is_checked('chk_all_it_noti_qty')) $all_fields .= " , it_noti_qty = '$it_noti_qty' ";
|
||||
if(is_checked('chk_all_it_sendcost')) $all_fields .= " , it_sc_type = '$it_sc_type', it_sc_method = '$it_sc_method', it_sc_price = '$it_sc_price', it_sc_minimum = '$it_sc_minimum', it_sc_qty = '$it_sc_qty' ";
|
||||
if(is_checked('chk_all_it_buy_min_qty')) $all_fields .= " , it_buy_min_qty = '$it_buy_min_qty' ";
|
||||
if(is_checked('chk_all_it_buy_max_qty')) $all_fields .= " , it_buy_max_qty = '$it_buy_max_qty' ";
|
||||
if(is_checked('chk_all_it_head_html')) $all_fields .= " , it_head_html = '$it_head_html' ";
|
||||
if(is_checked('chk_all_it_tail_html')) $all_fields .= " , it_tail_html = '$it_tail_html' ";
|
||||
if(is_checked('chk_all_it_mobile_head_html')) $all_fields .= " , it_mobile_head_html = '$it_mobile_head_html' ";
|
||||
if(is_checked('chk_all_it_mobile_tail_html')) $all_fields .= " , it_mobile_tail_html = '$it_mobile_tail_html' ";
|
||||
if(is_checked('chk_all_1')) $all_fields .= " , it_1_subj = '$it_1_subj', it_1 = '$it_1' ";
|
||||
if(is_checked('chk_all_2')) $all_fields .= " , it_2_subj = '$it_2_subj', it_2 = '$it_2' ";
|
||||
if(is_checked('chk_all_3')) $all_fields .= " , it_3_subj = '$it_3_subj', it_3 = '$it_3' ";
|
||||
if(is_checked('chk_all_4')) $all_fields .= " , it_4_subj = '$it_4_subj', it_4 = '$it_4' ";
|
||||
if(is_checked('chk_all_5')) $all_fields .= " , it_5_subj = '$it_5_subj', it_5 = '$it_5' ";
|
||||
if(is_checked('chk_all_6')) $all_fields .= " , it_6_subj = '$it_6_subj', it_6 = '$it_6' ";
|
||||
if(is_checked('chk_all_7')) $all_fields .= " , it_7_subj = '$it_7_subj', it_7 = '$it_7' ";
|
||||
if(is_checked('chk_all_8')) $all_fields .= " , it_8_subj = '$it_8_subj', it_8 = '$it_8' ";
|
||||
if(is_checked('chk_all_9')) $all_fields .= " , it_9_subj = '$it_9_subj', it_9 = '$it_9' ";
|
||||
if(is_checked('chk_all_10')) $all_fields .= " , it_10_subj = '$it_10_subj', it_10 = '$it_10' ";
|
||||
|
||||
if($all_fields) {
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$all_fields} ");
|
||||
}
|
||||
|
||||
$is_seo_title_edit = $w ? true : false;
|
||||
if( function_exists('shop_seo_title_update') ) shop_seo_title_update($it_id, $is_seo_title_edit);
|
||||
|
||||
run_event('shop_admin_itemformupdate', $it_id, $w);
|
||||
|
||||
$qstr = "$qstr&sca=$sca&page=$page";
|
||||
|
||||
|
||||
if ($w == "u") {
|
||||
goto_url("./itemform.php?w=u&it_id=$it_id&$qstr");
|
||||
} else if ($w == "d") {
|
||||
$qstr = "ca_id=$ca_id&sfl=$sfl&sca=$sca&page=$page&stx=".urlencode($stx)."&save_stx=".urlencode($save_stx);
|
||||
goto_url("../../shop_admin/itemlist.php?$qstr");
|
||||
}
|
||||
|
||||
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
|
||||
?>
|
||||
<script>
|
||||
if (confirm("계속 입력하시겠습니까?"))
|
||||
location.href = "<?php echo "./itemform.php?".str_replace('&', '&', $qstr); ?>";
|
||||
else
|
||||
location.href = "<?php echo "../../shop_admin/itemlist.php?".str_replace('&', '&', $qstr); ?>";
|
||||
</script>
|
||||
1329
adm/rb/shop/orderform.php
Normal file
1329
adm/rb/shop/orderform.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user