1 Commits

Author SHA1 Message Date
70c6a95a45 우대요금 표시방식 변경 테스트 2025-07-09 09:55:27 +09:00
230 changed files with 10594 additions and 13042 deletions

View File

@ -1,115 +1,11 @@
/** 공통 UI 모듈 */
window.CommonUI = {
bindTabs(tabSelector, contentSelector, options = {}) {
const tabs = document.querySelectorAll(tabSelector);
const contents = document.querySelectorAll(contentSelector);
function check_all(f)
{
var chk = document.getElementsByName("chk[]");
tabs.forEach(tab => {
tab.addEventListener('click', () => {
const tabName = tab.dataset.tab;
const target = document.getElementById(`tab-${tabName}`);
tabs.forEach(t => t.classList.remove('active'));
tab.classList.add('active');
contents.forEach(c => c.classList.add('is-hidden'));
if (target) target.classList.remove('is-hidden');
options.onChange?.(tabName, target);
});
});
}
};
function setHtml(el, markup) {
if (!el) return;
if (markup == null || markup === '') {
el.textContent = '';
return;
}
const range = document.createRange();
range.selectNodeContents(el);
el.replaceChildren(range.createContextualFragment(markup));
for (i=0; i<chk.length; i++)
chk[i].checked = f.chkall.checked;
}
/** 팝업 관리 모듈 */
window.PopupManager = {
open(id, options = {}) {
const el = document.getElementById(id);
if (el) {
el.classList.remove('is-hidden');
this.bindOutsideClickClose(id);
if (!options.disableOutsideClose) {
this.bindOutsideClickClose(id);
} else {
this.unbindOutsideClickClose(id);
}
}
},
close(id) {
const el = document.getElementById(id);
if (el) el.classList.add('is-hidden');
},
toggle(id) {
const el = document.getElementById(id);
if (el) el.classList.toggle('is-hidden');
},
bindOutsideClickClose(id) {
const el = document.getElementById(id);
if (!el) return;
el.onclick = () => this.close(id);
},
unbindOutsideClickClose(id) {
const el = document.getElementById(id);
if (!el) return;
el.onclick = null;
},
/**
* 팝업 콘텐츠 렌더링 (타이틀, 바디, 푸터 구성)
* @param {string} title - 팝업 제목
* @param {string} body - 팝업 본문 HTML
* @param {string} [footer] - 푸터 HTML
* @param {object} [options] - 팝업 열기 옵션
*/
render(title, body, footer = '', options = {}) {
const titleEl = document.getElementById('popupTitle');
const bodyEl = document.getElementById('popupBody');
const footerEl = document.getElementById('popupFooter');
if (titleEl) titleEl.textContent = title;
if (bodyEl) setHtml(bodyEl, body);
if (footerEl) setHtml(footerEl, footer);
this.open('popupOverlay', options);
}
};
/** 형식 체크 */
function check_all(target) {
const chkboxes = document.getElementsByName("chk[]");
let chkall;
if (target && target.tagName === "FORM") {
chkall = target.querySelector('input[name="chkall"]');
} else if (target && target.type === "checkbox") {
chkall = target;
}
if (!chkall) return;
for (const checkbox of chkboxes) {
checkbox.checked = chkall.checked;
}
}
function btn_check(f, act)
{
if (act == "update") // 선택수정

View File

@ -11,7 +11,6 @@ $menu['menu100'] = array(
array('100900', '캐시파일 일괄삭제', G5_ADMIN_URL . '/cache_file_delete.php', 'cf_cache', 1),
array('100910', '캡챠파일 일괄삭제', G5_ADMIN_URL . '/captcha_file_delete.php', 'cf_captcha', 1),
array('100920', '썸네일파일 일괄삭제', G5_ADMIN_URL . '/thumbnail_file_delete.php', 'cf_thumbnail', 1),
array('100930', '회원관리파일 일괄삭제', G5_ADMIN_URL . '/member_list_file_delete.php', 'cf_memberlist', 1),
array('100500', 'phpinfo()', G5_ADMIN_URL . '/phpinfo.php', 'cf_phpinfo')
);

View File

@ -2,7 +2,6 @@
$menu['menu200'] = array(
array('200000', '회원관리', G5_ADMIN_URL . '/member_list.php', 'member'),
array('200100', '회원관리', G5_ADMIN_URL . '/member_list.php', 'mb_list'),
array('200400', '회원관리파일', G5_ADMIN_URL . '/member_list_exel.php', 'mb_list'),
array('200300', '회원메일발송', G5_ADMIN_URL . '/mail_list.php', 'mb_mail'),
array('200800', '접속자집계', G5_ADMIN_URL . '/visit_list.php', 'mb_visit', 1),
array('200810', '접속자검색', G5_ADMIN_URL . '/visit_search.php', 'mb_search', 1),

View File

@ -19,5 +19,5 @@ $menu['menu400'] = array(
array('400800', '쿠폰관리', G5_ADMIN_URL . '/shop_admin/couponlist.php', 'scf_coupon'),
array('400810', '쿠폰존관리', G5_ADMIN_URL . '/shop_admin/couponzonelist.php', 'scf_coupon_zone'),
array('400750', '추가배송비관리', G5_ADMIN_URL . '/shop_admin/sendcostlist.php', 'scf_sendcost', 1),
array('400410', '미완료주문', G5_ADMIN_URL . '/shop_admin/inorderlist.php', 'scf_inorder', 1)
array('400410', '미완료주문', G5_ADMIN_URL . '/shop_admin/inorderlist.php', 'scf_inorder', 1),
);

View File

@ -14,6 +14,7 @@ $print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
<strong>자바스크립트를 사용하지 않음</strong>으로 설정하신 경우는 수정이나 삭제시 별도의 경고창이 나오지 않으므로 이점 주의하시기 바랍니다.
</p>
</noscript>
</div>
<footer id="ft">
<p>
@ -21,25 +22,8 @@ $print_version = ($is_admin == 'super') ? 'Version ' . G5_GNUBOARD_VER : '';
<button type="button" class="scroll_top"><span class="top_img"></span><span class="top_txt">TOP</span></button>
</p>
</footer>
</div>
<!-- 공통 레이어 팝업 컨테이너 -->
<div id="adminPopupContainer">
<div id="popupOverlay" class="popup-overlay is-hidden" onclick="PopupManager.close('popupOverlay')">
<div class="popup-content" onclick="event.stopPropagation()">
<div class="popup-header">
<strong id="popupTitle" class="popup-title"></strong>
<button type="button" class="popup-close-btn" onclick="PopupManager.close('popupOverlay')">
<i class="fa fa-close"></i><span class="sound_only">팝업 닫기</span>
</button>
</div>
<div class="popup-body" id="popupBody">
<!-- 동적으로 내용 주입 -->
</div>
<div class="popup-footer" id="popupFooter">
<!-- 버튼 등 동적으로 -->
</div>
</div>
</div>
</div>
<script>

View File

@ -13,7 +13,7 @@ if ($is_admin != 'super') {
}
$mb = get_member($mb_id);
if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
if (!$mb['mb_id']) {
alert('존재하는 회원아이디가 아닙니다.');
}

View File

@ -1439,7 +1439,7 @@ function frm_check_file(){
return false;
} else {
// jQuery("#admin_captcha_box").hide();
jQuery("#admin_captcha_box").hide();
}
return true;
@ -1447,12 +1447,12 @@ function frm_check_file(){
jQuery(function($){
if( window.self !== window.top ){ // frame 또는 iframe을 사용할 경우 체크
$("#bo_include_head, #bo_include_tail").on("change paste keyup", function(e) {
frm_check_file();
});
use_captcha_check();
}
$("#bo_include_head, #bo_include_tail").on("change paste keyup", function(e) {
frm_check_file();
});
});
function fboardform_submit(f)
@ -1487,14 +1487,10 @@ function fboardform_submit(f)
return false;
}
if (frm_check_file() == false) {
jQuery(window).scrollTop($('#bo_include_tail').offset().top - 30);
}
if( captcha_chk ) {
<?php echo isset($captcha_js) ? $captcha_js : ''; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
}
return true;
}
</script>

View File

@ -36,27 +36,10 @@ if ($w == '' && in_array($bo_table, get_bo_table_banned_word())) {
$bo_include_head = isset($_POST['bo_include_head']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_head'], 0, 255)) : '';
$bo_include_tail = isset($_POST['bo_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_tail'], 0, 255)) : '';
$check_captcha = false;
// 관리자가 자동등록방지 CAPTCHA를 사용해야 할 경우
// 최고 관리자인 경우에만 수정가능
if ($is_admin === 'super') {
if ($w === 'u') {
if (isset($board['bo_include_head'], $board['bo_include_tail']) &&
($board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail)) {
$check_captcha = true;
}
} elseif ($w === '') {
if ($bo_include_head !== '_head.php' || $bo_include_tail !== '_tail.php') {
$check_captcha = true;
}
}
}
// 실제 CAPTCHA 검증
if ($check_captcha) {
// 관리자가 자동등록방지를 사용해야 할 경우
if ($board && (isset($board['bo_include_head']) && $board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
if (!chk_captcha()) {
alert('자동등록방지 숫자가 틀렸습니다.');
}

View File

@ -422,30 +422,6 @@ if (!isset($config['cf_cert_kcp_enckey'])) {
$config['cf_cert_kcp_enckey'] = '';
}
// 광고성 정보 수신 동의 사용 필드 추가
if (!isset($config['cf_use_promotion'])) {
sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_use_promotion` tinyint(1) NOT NULL DEFAULT '0' AFTER `cf_privacy` ",
true
);
}
// 광고성 정보 수신 동의 여부 필드 추가 + 메일 / SMS 수신 일자 추가
if (!isset($member['mb_marketing_agree'])) {
sql_query(
" ALTER TABLE `{$g5['member_table']}`
ADD `mb_marketing_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_scrap_cnt`,
ADD `mb_marketing_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_marketing_agree`,
ADD `mb_thirdparty_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_marketing_date`,
ADD `mb_thirdparty_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_thirdparty_agree`,
ADD `mb_agree_log` TEXT NOT NULL AFTER `mb_thirdparty_date`,
ADD `mb_mailling_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_mailling`,
ADD `mb_sms_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_sms` ",
true
);
}
if (!$config['cf_faq_skin']) {
$config['cf_faq_skin'] = "basic";
}
@ -987,17 +963,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<th scope="row"><label for="cf_privacy">개인정보처리방침</label></th>
<td colspan="3"><textarea id="cf_privacy" name="cf_privacy" rows="10"><?php echo html_purifier($config['cf_privacy']); ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="cf_use_promotion">회원가입 약관 동의에<br>광고성 정보 수신 동의 표시 여부</label></th>
<td colspan="3">
<?php echo help('<b>광고성 정보 수신 · 마케팅 목적의 개인정보 수집 및 이용 · 개인정보 제 3자 제공</b> 여부를 설정합니다. <b>SMS 또는 카카오톡</b> 사용 시 <b>개인정보 제3자 제공</b>이 활성화됩니다.'); ?>
<?php echo help('동의한 회원에게 <b>카카오톡(친구톡)·문자</b>로 광고성 메시지를 발송할 수 있습니다.'); ?>
<?php echo help('<b>휴대전화번호</b> 사용을 위해서는 <b>기본환경설정 > 회원가입 > 휴대전화번호 입력</b>을 <b>[보이기]</b> 또는 <b>[필수입력]</b>으로 설정해야 하며, 미설정 시 수집이 불가합니다.'); ?>
<?php echo help('* 「정보통신망이용촉진및정보보호등에관한법률」에 따라 <b>광고성 정보 수신 동의</b>를 매 2년마다 반드시 확인해야 합니다.'); ?>
<input type="checkbox" name="cf_use_promotion" value="1" id="cf_use_promotion" <?php echo $config['cf_use_promotion'] ? 'checked' : ''; ?>>
<label for="cf_use_promotion">사용</label>
</td>
</tr>
</tbody>
</table>
</div>
@ -1173,7 +1138,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
<input type="checkbox" name="cf_formmail_is_member" value="1" id="cf_formmail_is_member" <?php echo $config['cf_formmail_is_member'] ? 'checked' : ''; ?>> 회원만 사용
</td>
</tr>
</tbody>
</table>
</div>
</section>
@ -1562,6 +1526,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
</div>
</section>
<section id="anc_cf_extra">
<h2 class="h2_frm">여분필드 기본 설정</h2>
<?php echo $pg_anchor ?>

View File

@ -141,7 +141,6 @@ $check_keys = array(
'cf_visit' => 'char',
'cf_stipulation' => 'text',
'cf_privacy' => 'text',
'cf_use_promotion' => 'int',
'cf_open_modify' => 'int',
'cf_memo_send_point' => 'int',
'cf_mobile_new_skin' => 'char',
@ -301,7 +300,6 @@ $sql = " update {$g5['config_table']}
cf_mobile_page_rows = '{$_POST['cf_mobile_page_rows']}',
cf_stipulation = '{$_POST['cf_stipulation']}',
cf_privacy = '{$_POST['cf_privacy']}',
cf_use_promotion = '{$_POST['cf_use_promotion']}',
cf_open_modify = '{$_POST['cf_open_modify']}',
cf_memo_send_point = '{$_POST['cf_memo_send_point']}',
cf_mobile_new_skin = '{$_POST['cf_mobile_new_skin']}',

View File

@ -28,39 +28,6 @@ box-sizing: border-box;
h2{font-size: 1.083em;font-weight: bold;margin:10px 0}
#wrapper {min-height:480px}
/* admin 공통 */
/* 공통 - display none/block */
.is-hidden { display: none !important; }
.is-visible { display: block !important; }
/* 공통 - 뷰포트 (pc / mobile) 별 display none/block */
.pc-only { display: none; }
@media (min-width: 769px) { .pc-only { display: block !important; }}
.mobile-only { display: block; }
@media (min-width: 769px) { .mobile-only { display: none !important; }}
/* 공통 - 레이어 팝업 */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.popup-content { background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); width: 800px; overflow: hidden; }
.popup-header, .popup-footer { padding: 18px 20px; display: flex; align-items: center; }
.popup-header { justify-content: space-between; border-bottom: 1px solid #e0e0e0; }
.popup-footer { gap: 20px; border-top: 1px solid #e0e0e0;}
.popup-close-btn { background: none; border: none; color: #888; font-size: 20px; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease; }
.popup-close-btn:hover { color: #333; }
.popup-title { font-size: 18px; font-weight: 600; }
.popup-body { padding: 20px; max-height: 400px; overflow-y: auto; color: #333; }
.popup-footer button { background: #3d70ff; color: white; border: 1px solid #3d70ff; padding: 8px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.popup-footer button:hover { background: #2b3d9f; border-color: #2b3d9f; }
/* 공통 - tab */
.tab-container { display: flex; flex-direction: column; width: 100%; }
.tab-header { position: relative; bottom: -1px; display: flex; }
.tab-btn { padding: 10px 14px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; color: inherit; font: inherit; }
.tab-btn.active { border-bottom-color: #000; font-weight: bold; }
.tab-body { width: 100%; border-top: 1px solid #ccc; }
.tab-content { padding: 16px 0; }
/* 레이아웃 */
#hd h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#hd_top{position:fixed;top:0;left:0;width:100%;height:50px;background:#3f51b5;z-index:1000}
@ -128,11 +95,9 @@ box-shadow: 2px 0 2px rgba(150,150,150,0.1);}
#container.container-small #container_title{padding-left:70px}
.container_wr{padding:20px}
/* 화면낭독기 사용자용 (스크린 리더 대응) */
/* 일반적인 .blind/.sr-only 사용시에 .sound_only 사용 권장 */
/* 화면낭독기 사용자용 */
#hd_login_msg {position:absolute;top:0;left:0;width:1px;height:1px;overflow:hidden}
.sound_only, .msg_sound_only {overflow:hidden;position:absolute;width:1px;height:1px;margin:-1px;padding:0;clip:rect(0,0,0,0)}
.msg_sound_only, .sound_only {display:inline-block !important;position:absolute;top:0;left:0;margin:0 !important;padding:0 !important;width:1px !important;height:1px !important;font-size:0;line-height:0;border:0 !important;overflow:hidden !important}
/* 본문 바로가기 */
#to_content a {z-index:100000;position:absolute;top:0;left:0;font-size:0;line-height:0;overflow:hidden}
#to_content a:focus, #to_content a:active {width:100%;height:70px;background:#fff;font-size:2em;font-weight:bold;text-align:center;text-decoration:none;line-height:3.1em}
@ -231,7 +196,6 @@ a.btn_submit{background:#ff4081;color:#fff}
.btn_02,a.btn_02{background:#9eacc6;color:#fff;}
.btn_03,a.btn_03{background:#3f51b5;color:#fff;}
.btn_03,a.btn_04{background:#819FF7;color:#fff;}
.btn_frmline{display:inline-block;background:#9eacc6;color:#fff;height:35px;border:0;border-radius:5px;padding:0 10px}
a.btn_frmline{display:inline-block;background:#9eacc6;color:#fff;height:35px;line-height:33px;border-radius:5px;padding:0 10px;text-decoration:none !important}
@ -283,14 +247,18 @@ legend {position:absolute;width:0;height:0;font-size:0;line-height:0;text-indent
.anchor a {display:inline-block;padding:5px 10px;border:1px solid #c8ced1;background:#d6dde1;text-decoration:none}
.anchor .selected{background:#3f51b5}
#sort_mb {width:800px}
#sort_sodr {width:600px}
/* 하단 레이아웃 */
#ft{background:#f3f3f3;padding:0 25px;color:#777;text-align:center}
#ft p{line-height:50px;}
.scroll_top{position:fixed;bottom:10px;right:10px;width:50px;height:50px;border:0;text-align:center;background:#ddd;background:rgba(0,0,0,0.1);z-index:50;}
.scroll_top{position:fixed;bottom:10px;right:10px;width:50px;height:50px;border:0;text-align:center;background:#ddd;background:rgba(0,0,0,0.1)}
.scroll_top span.top_img{display:inline-block;width: 0; height: 0; border-left: 5px solid transparent;border-right: 5px solid transparent;
border-bottom: 5px solid black;}
.scroll_top span.top_txt{display:block}
@ -313,59 +281,9 @@ border-bottom: 5px solid black;}
.local_sch03 button{height:30px;padding:0 5px;border:0;background:#9eacc6;color:#fff;}
.local_sch03 .btn_submit{height:30px;padding:0 5px;border:0;color:#fff;}
.local_sch03 .frm_input{height:30px;border:1px solid #dcdcdc;padding:0 5px;}
/* 회원 관리 데이터 필터링 */
.member_list_data { display: flex; flex-direction: column; padding: 20px; margin: 20px 0 40px; background: #f9f9f9; border: 1px solid #f2f2f2; color: #333; }
.sch_table { display: flex; flex-direction: column; gap: 10px; font-size: 11.5px; color: #333; }
.member_list_data .sch_row { display: flex; align-items: center; gap: 12px; min-height: 30px; }
.label { min-width: 120px; font-weight: 500; white-space: nowrap; display: flex; align-items: center; }
.label label {display: flex; gap: 10px;}
.field { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select { height: 30px; min-width: 100px; padding: 0 10px; font-size: 11.5px; border: 1px solid #ddd; border-radius: 8px; background: #fff; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.field input[type="text"]:focus, .field input[type="number"]:focus, .field input[type="date"]:focus, .field select:focus { border-color: #6f809a; box-shadow: 0 0 0 2px rgba(63,81,181,0.1); outline: none; }
.field input::placeholder { color: #aaa; }
.field input[type="checkbox"], .field input[type="radio"] { width: 14px; height: 14px; accent-color: #536177; }
.radio_group { display: flex; gap: 15px; align-items: center; padding: 0 10px;}
.radio_group label {display: flex; align-items: center; gap: 5px;}
.ad_range_wrap {flex: 1; padding-left: 20px;}
.ad_range_box {display: flex;}
.ad_range_box .label {width: 109px;}
.sch_notice { font-size: 11px; color: #999; }
.sch_btn { display: flex; gap: 20px; justify-content: center; margin-top: 40px; }
.sch_btn { display: flex; gap: 10px; }
.btn_reset { display: flex; align-items: center; gap: 6px; padding: 0 20px; height: 40px; background: #9eacc6; color: #fff; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; }
.btn_reset:hover { background: #5f6e89; }
.sch_btn button:not(.btn_reset) { padding: 0 20px; height: 40px; border: 1px solid #ccd1d8; background-color: #fff; color: #444; font-weight: 600; border-radius: 8px; cursor: pointer; user-select: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.sch_btn button:not(.btn_reset):hover { border-color: #6f809a; box-shadow: 0 2px 4px rgba(111, 128, 154, 0.15); }
.sch_btn button:not(.btn_reset):active { box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
/* 회원 관리 다운로드 진행 팝업 */
.excel-download-progress p { color: #374151; }
.excel-download-progress .progress-desc { padding: 40px 0 32px; text-align: center; }
.excel-download-progress .progress-summary { margin-bottom: 6px; font-size: 16px; font-weight: 500; color: #111827; }
.excel-download-progress .progress-message { font-size: 20px; font-weight: 600; color: #3b82f6; }
.excel-download-progress .progress-error { color:red; }
.progress-spinner { display: flex; flex-direction: column; align-items: center; gap: 45px; padding: 24px 0; transition: all 0.2s ease; }
.spinner { width: 48px; height: 48px; border: 5px solid #3b82f6; border-top: 5px solid #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-message { text-align: center; font-size: 14px; color: #374151; }
.excel-download-progress .progress-download-box { margin-top: 24px; background: #f9fafb; padding: 20px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.excel-download-progress .progress-download-box a { display: block; width: 100%; height: auto; text-align: center; margin-top: 8px; font-weight: 600; font-size: 14px; padding: 10px 20px; background: #fff; border: 1px solid #ccd1d8; border-radius: 8px; color: #444; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.excel-download-progress .progress-download-box a:hover { border-color: #6f809a; box-shadow: 0 2px 4px rgba(111, 128, 154, 0.15); }
.excel-download-progress .progress-download-box a:active { box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.field-select-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 15px; gap: 0px 10px; padding: 10px; background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; color: #374151; }
.field-select-form label { display: flex; align-items: center; cursor: pointer; padding: 6px 10px; border-radius: 4px; }
.field-select-form label:hover { background-color: #f3f4f6; }
.field-select-form input[type="checkbox"] { margin-right: 8px; transform: scale(1.2); }
.field-separator { grid-column: 1 / -1; border-top: 1px solid #d1d5db; margin: 8px 0; }
.selected-fields-preview { padding: 8px; background-color: #eef2f7; border: 1px solid #d1d5db; border-radius: 6px; margin: 10px 0px; color: #1f2937; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.selected-fields-preview strong { padding: 4px 8px; }
.selected-fields-preview .field-tag { background-color: #dbeafe; color: #1e40af; padding: 4px 8px; border-radius: 4px; }
/* 페이지 내 실행 */
.local_cmd {min-width:960px}
.local_cmd01 {margin:0 0 10px;padding:0 }
.local_cmd01 .cmd_tit {font-weight:bold}
.local_cmd01 .btn_submit {padding:3px 5px;border:1px solid #ff3061;color:#fff;font-size:0.95em;vertical-align:middle}
@ -380,7 +298,7 @@ border-bottom: 5px solid black;}
.local_desc01 {margin:10px 0 10px ;padding:10px 20px;border:1px solid #f2f2f2;background:#f9f9f9}
.local_desc01 strong {color:#ff3061}
.local_desc01 a {text-decoration:underline;text-underline-offset:2px;}
.local_desc01 a {text-decoration:underline}
.local_desc02 {margin:10px 0 ;min-width:960px} /* 주로 온라인 서식 관련 안내 내용에 사용 */
.local_desc02 p {padding:0;line-height:1.8em}
@ -483,7 +401,6 @@ tfoot th {}
.mb_leave_msg {color:#b6b6b6}
.mb_intercept_msg {color:#ff0000}
#point_mng {margin-top:50px}
.ad_agree_log {max-height: 150px !important;}
/* 게시판추가/수정 */
#anc_bo_extra .td_grpset label {width:auto}
@ -587,7 +504,6 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
.td_time{text-align:center;width:130px}
.td_center{text-align:center;}
.td_type{width:120px}
.td_consent{min-width:70px;max-width:200px}
.td_mng_s{width:60px}
.td_mng_m{width:100px}
@ -740,15 +656,14 @@ a.nicepay_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#0
ul.de_pg_tab{margin:0;padding:0;zoom:1}
ul.de_pg_tab:after{display:block;visibility:hidden;clear:both;content:"";}
ul.de_pg_tab li{position:relative;display:inline-block;float:left;text-align:center;margin:0;padding:0;min-width:130px}
ul.de_pg_tab li a{margin:0 2px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:2.5;background-color:#f7f7f7;color:#74777b;font-weight:bold;font-size:1.2em;text-decoration:none; padding:0px 10px;}
ul.de_pg_tab li{position:relative;display:inline-block;float:left;text-align:center;margin:0;padding:0;width:120px}
ul.de_pg_tab li a{margin:0 2px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:2.5;background-color:#f7f7f7;color:#74777b;font-weight:bold;font-size:1.2em;text-decoration:none}
ul.de_pg_tab li a:hover{text-decoration:none}
ul.de_pg_tab li.tab-current a{background:#2CC185;color:#fff}
.pg_info_fld{position:relative}
.kcp_info_fld th{background-color:#F6FCFF}
.lg_info_fld th{background-color:#FFF4FA}
.lg_info_fld_v2 th{background-color:#ffe8f5}
.inicis_info_fld th{background-color:#F6F1FF}
.kakao_info_fld th{background-color:#FFFCED}
.naver_info_fld th{background-color:#F3FFF3}
@ -964,20 +879,6 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
.sbn_img {text-align:center}
.sbn_image {display:none;margin:0 0 10px;text-align:left}
/* SMS문자전송 */
#sms_send {padding-bottom:100px;zoom:1}
#sms_send:after {display:block;visibility:hidden;clear:both;content:""}
#sms_frm {float:left;width:650px}
#sms_frm table {margin:0 0 30px}
#sms_frm textarea {height:70px}
#sms_sm {position:relative;float:left;width:229px;height:418px;background:url('../shop_admin/img/mobilebg.jpg') no-repeat}
#sms_sm_text {position:absolute;top:75px;left:27px;width:180px;color:#fff;font-size:2em;word-break:break-all}
#sms_sm p {position:absolute;bottom:-70px;left:0;font-size:0.95em;letter-spacing:-0.1em}
#sms_send .local_desc01 {min-width:320px}
/* 가격비교사이트 */
#anc_pricecompare_info li {margin:5px 0 5px -1px}
@ -1232,4 +1133,4 @@ input[type="text"]{max-width:200px}
@media only screen and (max-device-width : 480px) and (orientation : portrait){
/* Styles */
input[type="text"]{max-width:200px}
}
}

View File

@ -269,54 +269,6 @@ while ($row = sql_fetch_array($result)){
}
}
// SMS5 테이블 G5_TABLE_PREFIX 적용
if($g5['sms5_prefix'] != 'sms5_' && sql_num_rows(sql_query("show tables like 'sms5_config'")))
{
$tables = array('config','write','history','book','book_group','form','form_group');
foreach($tables as $name){
$old_table = 'sms5_' . $name;
$new_table = $g5['sms5_prefix'] . $name;
// 기존 테이블이 있고, G5_TABLE_PREFIX 적용 테이블이 없을 경우 → 테이블명 변경
if(sql_num_rows(sql_query("SHOW TABLES LIKE '{$old_table}' "))){
if(!sql_num_rows(sql_query("SHOW TABLES LIKE '{$new_table}' "))){
sql_query("RENAME TABLE {$old_table} TO {$new_table}", false);
}
}
}
$is_check = true;
}
// 광고성 정보 수신 동의 사용 필드 추가
if (!isset($config['cf_use_promotion'])) {
sql_query(
" ALTER TABLE `{$g5['config_table']}`
ADD `cf_use_promotion` tinyint(1) NOT NULL DEFAULT '0' AFTER `cf_privacy` ",
true
);
$is_check = true;
}
// 광고성 정보 수신 동의 여부 필드 추가 + 메일 / SMS 수신 일자 추가
if (!isset($member['mb_marketing_agree'])) {
sql_query(
" ALTER TABLE `{$g5['member_table']}`
ADD `mb_marketing_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_scrap_cnt`,
ADD `mb_marketing_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_marketing_agree`,
ADD `mb_thirdparty_agree` tinyint(1) NOT NULL DEFAULT '0' AFTER `mb_marketing_date`,
ADD `mb_thirdparty_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_thirdparty_agree`,
ADD `mb_agree_log` TEXT NOT NULL AFTER `mb_thirdparty_date`,
ADD `mb_mailling_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_mailling`,
ADD `mb_sms_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `mb_sms` ",
true
);
$is_check = true;
}
$is_check = run_replace('admin_dbupgrade', $is_check);
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';

View File

@ -13,7 +13,7 @@ $where = array();
// 퍼스트가든용
// $od_status = '입금'; //입금처리 된것만 출력한다.
// 특정 카테고리만 노출
$ca_id = "20"; // 특정 카테고리 선택
$ca_id = "10"; // 특정 카테고리 선택
$sel_ca_id = " NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$tot_ct_qty = 0;
@ -23,7 +23,7 @@ $fr_date = "2024-04-01";
$to_date = "2024-04-30";
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once ('orderlist.head.php');
$sql_search = "";
if ($search != "") {

View File

@ -1,9 +1,9 @@
<?php
$sub_menu = '998413';
include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
//auth_check($auth[$sub_menu], "r");
$g5['title'] = '월간 주문내역 합계';
include_once (G5_ADMIN_PATH.'/admin.head.php');
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
@ -13,33 +13,14 @@ $where = array();
// 퍼스트가든용
// $od_status = '입금'; //입금처리 된것만 출력한다.
// 특정 카테고리만 노출
#$ca_id = "30"; // 특정 카테고리 선택
#$sel_ca_id = " NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
$ca_id = "10"; // 특정 카테고리 선택
$sel_ca_id = " NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다.
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$tot_ct_qty = 0;
// 기존: $where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
// 변경: sel_ca_id가 비어있지 않을 때만 WHERE조건에 추가
if (!empty($sel_ca_id)) {
$where[] = $sel_ca_id;
}
//$od_status = '입금'; //입금처리 된것만 출력한다.
//$where[] = " a.od_status = '{$od_status}' ";
// 시작일이 설정되지 않았다면: 지난달 1일
if (!isset($fr_date)) {
$fr_date = date("Y-m-01", strtotime("first day of last month", G5_SERVER_TIME));
}
// 종료일이 설정되지 않았다면: 지난달 마지막 날
if (!isset($to_date)) {
$to_date = date("Y-m-t", strtotime("last month", G5_SERVER_TIME));
}
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.head.php');
$sql_search = "";
if ($search != "") {
@ -54,8 +35,8 @@ if ($search != "") {
// od_status가 입금, 완료인 것만 출력함
$where[] = " a.od_status IN('입금','완료') ";
/*
$where[] = " a.od_status IN('완료') ";
if ($od_settle_case) {
$where[] = " a.od_settle_case = '$od_settle_case' ";
}
@ -83,7 +64,7 @@ if ($od_coupon) {
if ($od_escrow) {
$where[] = " a.od_escrow = 1 ";
}
*/
if ($fr_date && $to_date) {
$where[] = " a.od_time between '$fr_date 00:00:00' AND '$to_date 23:59:59' ";
}
@ -98,57 +79,52 @@ if ( empty($sort2) ) $sort2 = "desc";
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
";
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
";
$sql_common .= $sql_search;
// 기존: 페이징용 count 쿼리 및 LIMIT 처리로 인해 일부 결과만 집계되는 문제가 있어 전체 결과 조회로 변경
// $sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
// $row = sql_fetch($sql);
// $total_count = $row['cnt'];
$sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// $rows = 100; // 페이지 당 출력 개수
// if( !isset($rows) ) $rows = $config['cf_page_rows'];
$rows = 100;
if( !isset($rows) ) $rows = $config['cf_page_rows'];
// $total_page = ceil($total_count / $rows); // 전체 페이지 계산
// if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
// $from_record = ($page - 1) * $rows; // 시작 열을 구함
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
// 상품명, 수량, 단가, 카테고리를 가져옴
$sql = " SELECT a.od_id,
b.it_name,
b.ct_qty,
b.ct_price,
b.ct_option,
b.io_id,
c.ca_id,
c.it_1,
c.it_2,
d.io_price
b.it_name,
b.ct_qty,
b.ct_price,
b.ct_option,
b.io_id,
c.ca_id,
c.it_1,
c.it_2,
d.io_price
$sql_common
ORDER BY $sort1 $sort2 ";
ORDER BY $sort1 $sort2
LIMIT $from_record, $rows ";
$result = sql_query($sql);
// qstr 생성부가 불완전하게 작성되어 있어 안전하게 재작성
$qarr = array(
'od_status' => $od_status,
'od_settle_case' => $od_settle_case,
'od_misu' => $od_misu,
'od_cancel_price' => $od_cancel_price,
'od_refund_price' => $od_refund_price,
'od_receipt_point' => $od_receipt_point,
'od_coupon' => $od_coupon,
'fr_date' => $fr_date,
'to_date' => $to_date,
'sel_field' => $sel_field,
'search' => $search,
'save_search' => $search
);
// http_build_query로 생성 후 HTML용으로 & -> &amp; 변환
$qstr1 = str_replace('&', '&amp;', http_build_query($qarr));
$qstr1 = "od_status=".urlencode($od_status)."&amp;
od_settle_case=".urlencode($od_settle_case)."&amp;
od_misu=$od_misu&amp
;od_cancel_price=$od_cancel_price&amp;
od_refund_price=$od_refund_price&amp;
od_receipt_point=$od_receipt_point&amp;
od_coupon=$od_coupon&amp;
fr_date=$fr_date&amp;
to_date=$to_date&amp;
sel_field=$sel_field&amp;
search=$search&amp;
save_search=$search";
if($default['de_escrow_use'])
$qstr1 .= "&amp;od_escrow=$od_escrow";
@ -159,7 +135,6 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
?>
<!--
<form name="frmorderlist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
@ -178,9 +153,8 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
<input type="submit" value="검색" class="btn_submit">
</form>
-->
<form class="local_sch03 local_sch">
<div class="sch_last">
<div class="sch_last"">
<strong>주문일자</strong>
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
@ -235,7 +209,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<tr>
<td><?php echo $item_name; ?></td>
<td><?php echo $option; ?></td>
<td class="td_num"><?php echo number_format( $totals['quantity'] ? ($totals['total_price'] / $totals['quantity']) : 0 ); ?></td>
<td class="td_num"><?php echo number_format($totals['total_price'] / $totals['quantity']); ?></td>
<td class="th_odrcnt"><?php echo number_format($totals['quantity']); ?></td>
<td class="td_num td_numsum"><?php echo number_format($totals['total_price']); ?></td>
</tr>
@ -248,6 +222,6 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
<?php
include_once ('orderlist_tail.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.tail.php');
include_once (G5_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -19,7 +19,7 @@ $where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$tot_ct_qty = 0;
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.head.php');
$sql_search = "";
if ($search != "") {

View File

@ -20,7 +20,7 @@ $od_status = '완료'; //입금처리 된것만 출력한다.
$where[] = " a.od_status = '{$od_status}' ";
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.head.php');
$sql_search = "";
if ($search != "") {

View File

@ -19,7 +19,7 @@ $where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$tot_ct_qty = 0;
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.head.php');
$sql_search = "";
if ($search != "") {

View File

@ -1,158 +0,0 @@
<script>
$(function(){
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
// 주문상품보기
$(".orderitem").on("click", function() {
var $this = $(this);
var od_id = $this.text().replace(/[^0-9]/g, "");
if($this.next("#orderitemlist").size())
return false;
$("#orderitemlist").remove();
$.post(
"./ajax.orderitem.php",
{ od_id: od_id },
function(data) {
$this.after("<div id=\"orderitemlist\"><div class=\"itemlist\"></div></div>");
$("#orderitemlist .itemlist")
.html(data)
.append("<div id=\"orderitemlist_close\"><button type=\"button\" id=\"orderitemlist-x\" class=\"btn_frmline\">닫기</button></div>");
}
);
return false;
});
// 상품리스트 닫기
$(".orderitemlist-x").on("click", function() {
$("#orderitemlist").remove();
});
$("body").on("click", function() {
$("#orderitemlist").remove();
});
// 엑셀배송처리창
$("#order_delivery").on("click", function() {
var opt = "width=600,height=450,left=10,top=10";
window.open(this.href, "win_excel", opt);
return false;
});
});
function set_date(today)
{
<?php
$date_term = date('w', G5_SERVER_TIME);
$week_term = $date_term + 7;
$last_term = strtotime(date('Y-m-01', G5_SERVER_TIME));
?>
if (today == "오늘") {
document.getElementById("fr_date").value = "<?php echo G5_TIME_YMD; ?>";
document.getElementById("to_date").value = "<?php echo G5_TIME_YMD; ?>";
} else if (today == "어제") {
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
} else if (today == "이번주") {
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$date_term.' days', G5_SERVER_TIME)); ?>";
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
} else if (today == "이번달") {
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', G5_SERVER_TIME); ?>";
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
} else if (today == "지난주") {
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$week_term.' days', G5_SERVER_TIME)); ?>";
document.getElementById("to_date").value = "<?php echo date('Y-m-d', strtotime('-'.($week_term - 6).' days', G5_SERVER_TIME)); ?>";
} else if (today == "지난달") {
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', strtotime('-1 Month', $last_term)); ?>";
document.getElementById("to_date").value = "<?php echo date('Y-m-t', strtotime('-1 Month', $last_term)); ?>";
} else if (today == "전체") {
document.getElementById("fr_date").value = "";
document.getElementById("to_date").value = "";
}
}
</script>
<script>
function forderlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
var change_status = f.od_status.value;
if (f.od_status.checked == false) {
alert("주문상태 변경에 체크하세요.");
return false;
}
var chk = document.getElementsByName("chk[]");
for (var i=0; i<chk.length; i++)
{
if (chk[i].checked)
{
var k = chk[i].value;
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
var current_status = f.elements['current_status['+k+']'].value;
switch (change_status)
{
case "입금" :
if (!(current_status == "주문" && current_settle_case == "무통장")) {
alert("'주문' 상태의 '무통장'(결제수단)인 경우에만 '입금' 처리 가능합니다.");
return false;
}
break;
case "준비" :
if (current_status != "입금") {
alert("'입금' 상태의 주문만 '준비'로 변경이 가능합니다.");
return false;
}
break;
case "배송" :
if (current_status != "준비") {
alert("'준비' 상태의 주문만 '배송'으로 변경이 가능합니다.");
return false;
}
var invoice = f.elements['od_invoice['+k+']'];
var invoice_time = f.elements['od_invoice_time['+k+']'];
var delivery_company = f.elements['od_delivery_company['+k+']'];
if ($.trim(invoice_time.value) == '') {
alert("배송일시를 입력하시기 바랍니다.");
invoice_time.focus();
return false;
}
if ($.trim(delivery_company.value) == '') {
alert("배송업체를 입력하시기 바랍니다.");
delivery_company.focus();
return false;
}
if ($.trim(invoice.value) == '') {
alert("운송장번호를 입력하시기 바랍니다.");
invoice.focus();
return false;
}
break;
}
}
}
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
return false;
f.action = "./orderlistupdate_ticket.php";
return true;
}
</script>

View File

@ -5,6 +5,7 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
$g5['title'] = '매표소 주문확인';
include_once (G5_ADMIN_PATH.'/admin.head.php');
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
@ -12,15 +13,15 @@ $where = array();
// 퍼스트가든용
// 특정 카테고리만 노출 제외를 위한 부분
$ca_id = "30"; // 분류 선택
$sel_ca_id = "ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
$ca_id = "20"; // 특정 카테고리 선택
$sel_ca_id = "NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
$tot_ct_qty = 0;
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$od_status = '입금'; //입금처리 된것만 출력한다.
$where[] = " a.od_status = '{$od_status}' ";
// 퍼스트가든용 끝
include_once ('orderlist_head.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.head.php');
$sql_search = "";
if ($search != "") {
@ -43,10 +44,10 @@ if ($sort2 == "") $sort2 = "desc";
// 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다
$sql_common = " FROM {$g5['g5_shop_order_table']} AS a
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
";
LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id
LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id
LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id
";
$sql_common .= $sql_search;
@ -54,24 +55,23 @@ $sql = " SELECT count(a.od_id) AS cnt " . $sql_common ;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 100; // 페이지 당 출력 개수
if( !isset($rows) ) $rows = $config['cf_page_rows'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
// 상품명, 수량, 단가, 카테고리를 가져옴
$sql = " SELECT a.*,
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
b.it_name,
b.ct_qty,
b.ct_price,
b.ct_option,
b.io_id,
c.ca_id,
c.it_1,
c.it_2,
d.io_price
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
b.it_name,
b.ct_qty,
b.ct_price,
b.ct_option,
b.io_id,
c.ca_id,
c.it_1,
c.it_2,
d.io_price
$sql_common
ORDER BY $sort1 $sort2
LIMIT $from_record, $rows ";
@ -79,17 +79,17 @@ $sql = " SELECT a.*,
$result = sql_query($sql);
$qstr1 = "od_status=".urlencode($od_status)."&amp;
od_settle_case=".urlencode($od_settle_case)."&amp;
od_misu=$od_misu&amp
;od_cancel_price=$od_cancel_price&amp;
od_refund_price=$od_refund_price&amp;
od_receipt_point=$od_receipt_point&amp;
od_coupon=$od_coupon&amp;
fr_date=$fr_date&amp;
to_date=$to_date&amp;
sel_field=$sel_field&amp;
search=$search&amp;
save_search=$search";
od_settle_case=".urlencode($od_settle_case)."&amp;
od_misu=$od_misu&amp
;od_cancel_price=$od_cancel_price&amp;
od_refund_price=$od_refund_price&amp;
od_receipt_point=$od_receipt_point&amp;
od_coupon=$od_coupon&amp;
fr_date=$fr_date&amp;
to_date=$to_date&amp;
sel_field=$sel_field&amp;
search=$search&amp;
save_search=$search";
if($default['de_escrow_use'])
$qstr1 .= "&amp;od_escrow=$od_escrow";
$qstr = "$qstr1&amp;sort1=$sort1&amp;sort2=$sort2&amp;page=$page";
@ -106,55 +106,26 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
?>
<style>
#container { height: unset;}
.search_and_export_wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 20px;
margin-bottom: 20px;
}
.search_and_export_wrap form {
flex: 1;
}
.export_btn_wrap {
display: flex;
gap: 10px;
align-items: flex-start;
}
.export_btn_wrap button {
white-space: nowrap;
}
</style>
<div class="search_and_export_wrap">
<form name="frmorderlist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
<form name="frmorderlist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="od_hp" <?php echo get_selected($sel_field, 'od_hp'); ?> selected>연락처</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
</select>
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?> selected>연락처</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
</select>
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="search" value="<?php echo $search; ?>" id="search" class="frm_input" autocomplete="off">
<input type="submit" value="검색" class="btn_submit">
</form>
<div class="export_btn_wrap">
<form method="post" action="orderlist_ticket_ex.php" target="_blank">
<input type="hidden" name="sql_common" value="<?php echo htmlspecialchars($sql_common); ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<button type="submit" class="btn btn_submit" style="background-color: #4CAF50;">엑셀 다운로드</button>
</form>
</div>
</div>
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="search" value="<?php echo $search; ?>" id="search" class="frm_input" autocomplete="off">
<input type="submit" value="검색" class="btn_submit">
</form>
<!--
<form class="local_sch03 local_sch">
<div class="sch_last"">
@ -206,97 +177,73 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
return 0;
}
}
// 크리스마스 수량 취합하기
$eve_id = "1764036560";
$xmas_id = "1764036885";
$xmas_eve_r = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$eve_id}' AND b.io_id = 'R일반'");
$xmas_eve_s = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$eve_id}' AND b.io_id = 'S일반'");
$xmas_eve_a = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$eve_id}' AND b.io_id = 'A일반'");
$xmas_eve_36 = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$eve_id}' AND (b.io_id = 'R36개월미만 OR b.io_id = S석36개월미만' OR b.io_id = 'A석36개월미만')");
$xmas_eve_total = $xmas_eve_r + $xmas_eve_s + $xmas_eve_a + $xmas_eve_36;
$xmas_n = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$xmas_id}' AND b.io_id = '대인'");
$xmas_s = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$xmas_id}' AND b.io_id = '소인'");
$xmas_36 = cntQuery($count_sql," WHERE a.od_status = '입금' AND b.it_id = '{$xmas_id}' AND b.io_id = '36개월미만'");
$xmas_total = $xmas_n + $xmas_s + $xmas_36;
?>
<div class="tbl_head01 tbl_wrap">
<h2>크리스마스주문내역 Total</h2>
<p><b>전체 주문수량 : <?=$xmas_total+$xmas_eve_total?></b>
<div class="table_wrap" style="display: flex;flex-direction: row;justify-content: space-around;">
<div style="width: 49.5%">
<h3>크리스마스 이브</h3>
<table>
<thead>
<tr>
<th>R석</th>
<th>S석</th>
<th>A석</th>
<th>유아</th>
<th><b>계</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><?=$xmas_eve_r?></td>
<td><?=$xmas_eve_s?></td>
<td><?=$xmas_eve_a?></td>
<td><?=$xmas_eve_36?></td>
<td><b><?=$xmas_eve_total?></b></td>
</tr>
</tbody>
</table>
</div>
<div style="width: 49.5%">
<h3>크리스마스</h3>
<table>
<thead>
<tr>
<th>대인</th>
<th>소인</th>
<th>유아</th>
<th><b>계</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><?=$xmas_n?></td>
<td><?=$xmas_s?></td>
<td><?=$xmas_36?></td>
<td><b><?=$xmas_total?></b></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>미사용 주문 수량에 대해서만 합산합니다. </p>
<table>
<thead>
<tr>
<th>R석</th>
<th>S석</th>
<th>A석</th>
<th>유아</th>
<th><b>계</b></th>
<th>대인</th>
<th>소인</th>
<th>유아</th>
<th><b>계</b></th>
<th><b>합계</b></th>
</tr>
</thead>
<tbody>
<tr>
<?php
$xmas_eve_r = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "R석일반"');
$xmas_eve_s = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "S석일반"');
$xmas_eve_a = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND b.io_id = "A석일반"');
$xmas_eve_36 = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 이브 - 캔들라이트 콘서트" AND (b.io_id = "R석36개월미만 OR b.io_id = S석36개월미만" OR b.io_id = "A석36개월미만")');
$xmas_eve_total = $xmas_eve_r + $xmas_eve_s + $xmas_eve_a + $xmas_eve_36;
$xmas_n = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "대인"');
$xmas_s = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "소인"');
$xmas_36 = cntQuery($count_sql,' WHERE a.od_status = "입금" AND b.it_name = "2024 크리스마스 - 스타일리쉬 매직쇼" AND b.io_id = "36개월 미만"');
$xmas_total = $xmas_n + $xmas_s + $xmas_36;
?>
<td><?=$xmas_eve_r?></td>
<td><?=$xmas_eve_s?></td>
<td><?=$xmas_eve_a?></td>
<td><?=$xmas_eve_36?></td>
<td><b><?=$xmas_eve_total?></b></td>
<td><?=$xmas_n?></td>
<td><?=$xmas_s?></td>
<td><?=$xmas_36?></td>
<td><b><?=$xmas_total?></b></td>
<td><b><?=$xmas_total+$xmas_eve_total?></b></td>
</tr>
</tbody>
</table>
</div>
<!-- 크리스마스용 판매확인 끝 -->
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
<!-- 목록 시작 -->
<div class="tbl_head01 tbl_wrap">
<table id="sodr_list">
<caption>주문 내역 목록</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" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&amp;$qstr1"; ?>">주문번호</a></th>-->
<th scope="col" id="th_odrer">주문일</th>
<th scope="col" id="th_odrer">주문자</th>
<th scope="col" id="th_odrertel">주문자전화</th>
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
<th scope="col" id="th_odrer">옵션</th>
<th scope="col" id="th_odrer">주문자</th>
<th scope="col" id="th_odrertel">주문자전화</th>
<th scope="col" style="width:85px;">단가</th>
<th scope="col" style="width:62px;">주문수량</th>
<th scope="col" style="width:85px;">합계</th>
@ -307,21 +254,19 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
</thead>
<tbody>
<?php
$chk_od_id == "false";
for ($i=0; $row=sql_fetch_array($result); $i++) {
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
?>
<!-- 목록 내용 시작 -->
<tr class="orderlist<?php echo ' '.$bg; ?>">
<!-- 체크박스 제거
<td class="td_chk">
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
-->
<!-- 주문번호 표시안함
<!--
<td headers="th_ordnum" class="td_odrnum2">
<?php if ($is_admin == 'super'){ ?>
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&amp;uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
@ -330,11 +275,11 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
<?php echo $od_paytype; ?>
</td>
-->
<td headers="th_ordnum" class="td_odrnum2"><?php if ($row['od_id'] != $chk_od_id ) { echo substr($row['od_receipt_time'],0,10); }?></td>
<td headers="th_odrer" class="td_name"><?php if ($row['od_id'] != $chk_od_id ) { echo $mb_nick; }?></td>
<td headers="th_odrertel" class="td_hp" style="text-align:center;"><?php if ($row['od_id'] != $chk_od_id ) { echo add_hyphen(get_text($row['od_hp'])); }?></td>
<td headers="th_ordnum" class="td_odrnum2"><?php if ($row['od_id'] != $chk_od_id ) { echo $row['it_name']; } ?></td>
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
<td class="td_num td_numsum">
@ -352,20 +297,16 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
echo "사용불가<br>(";
if( $row['od_status'] == '취소' ) echo "취소)"; // 취소라면
else echo "유효일자:".$row['it_1'].")"; // 유효일자가 지났다면
} else if ($row['od_id'] === $chk_od_id) { // 동일 주문번호에는 출력하지 않음
} else { // 위 조건에 해당하지 않으면 사용처리 버튼 출력
?>
<a href="orderliveupdate.php?bo=u&od_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
<?php } //사용처리 버튼 끝 ?>
</td>
<td class="td_mng td_mng_s">
<?php if ($row['od_id'] != $chk_od_id ) { ?>
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
<?php } ?>
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
</td>
</tr>
<?php
// 합계 처리
$tot_itemcount += $row['od_cart_count'];
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
@ -373,9 +314,6 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
$tot_receiptprice += $row['od_receipt_price'];
$tot_couponprice += $row['couponprice'];
$tot_ct_qty += $row['ct_qty'];
// 주문번호 체크용
$chk_od_id = $row['od_id'];
}
sql_free_result($result);
if ($i == 0)
@ -384,7 +322,7 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
</tbody>
<tfoot>
<tr class="orderlist">
<th scope="row" colspan="6">합 계</th>
<th scope="row" colspan="7">합 계</th>
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?>건</td>
<td><?php echo number_format($tot_orderprice); ?></td>
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
@ -395,7 +333,7 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
</div>
<div class="local_desc02 local_desc">
<p style="font-weight:bold;">
<p>
&lt;사용&gt;버튼을 클릭하면 티켓 사용처리가 완료됩니다. 부분사용, 부분취소가 불가능하므로 이용수량이 다른 경우 고객님께 꼭 확인해주시기 바랍니다.
</p>
</div>
@ -405,5 +343,5 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<?php
include_once ('orderlist_tail.php');
include_once (G5_ADMIN_PATH.'/fg_admin/orderlist.tail.php');
include_once (G5_ADMIN_PATH.'/admin.tail.php');

View File

@ -1,13 +1,6 @@
<?php
include_once('./_common.php');
auth_check($auth['998411'], "r");
// POST로 전달된 데이터 받기
$sql_common = isset($_POST['sql_common']) ? $_POST['sql_common'] : '';
$sort1 = isset($_POST['sort1']) ? $_POST['sort1'] : 'a.od_id';
$sort2 = isset($_POST['sort2']) ? $_POST['sort2'] : 'desc';
$file_name = "orderlist_".date("ymd")."_".date("His").".xls"; // 파일명지정
header("Content-Type: application/vnd.ms-excel");
@ -21,11 +14,7 @@ $sql = " SELECT a.*,
b.ct_qty,
b.ct_price,
b.ct_option,
b.io_id,
c.ca_id,
c.it_1,
c.it_2,
d.io_price
c.ca_id
$sql_common
ORDER BY $sort1 $sort2
";
@ -36,85 +25,188 @@ $result = sql_query($sql);
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
table { border-collapse: collapse;}
th, td { border: 1px solid #000; padding: 0px; text-align: center; }
th { background-color: #D3D3D3; font-weight: bold; text-align: center; }
tr.bg0 { background-color: #FFFFFF; }
tr.bg1 { background-color: #F0F0F0; }
.empty_table { text-align: center; }
tfoot tr { background-color: #E8E8E8; font-weight: bold; }
.number { mso-number-format:\#\,\#\#0; , text-align: right; }
.tit {background-color:#C0C0C0; height:30px; }
.no-text {mso-number-format:'\@'; text-align:center;}
</style>
<table cellspacing="0" cellpadding="0">
<table cellspacing="0" cellpadding="0" border="1">
<caption>주문 내역 목록</caption>
<thead>
<tr>
<th style="width: 120px;">주문일</th>
<th style="width: 100px;">주문자</th>
<th style="width: 200px;">주문자전화</th>
<th style="width: 400px;">상품명</th>
<th style="width: 150px;">옵션</th>
<th style="width: 100px;">단가</th>
<th style="width: 100px;">주문수량</th>
<th style="width: 200px;">총금액</th>
<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" id="th_ordnum" style="width:200px;"><a href="<?php echo title_sort("od_id", 1)."&amp;$qstr1"; ?>">주문번호</a></th>-->
<th scope="col" id="th_odrer">주문일</th>
<th scope="col" id="th_odrer" style="width:240px;">상품명</th>
<th scope="col" id="th_odrer">옵션</th>
<th scope="col" id="th_odrer">주문자</th>
<th scope="col" id="th_odrertel">주문자전화</th>
<th scope="col" style="width:85px;">단가<br>(옵션가)</th>
<th scope="col" style="width:62px;">주문수량</th>
<th scope="col" style="width:85px;">합계</th>
<!-- <th scope="col">입금합계</th>-->
<th scope="col" style="width:62px;">사용처리</th>
<th scope="col" style="width:61px;">상세</th>
</tr>
</thead>
<tbody>
<?php
$tot_ct_qty = 0;
$tot_orderprice = 0;
$prev_od_id = '';
$bg_class = 'bg0';
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 같은 주문번호 중 첫 번째 행만 출력
if ($row['od_id'] != $prev_od_id) {
$order_date = substr($row['od_receipt_time'], 0, 10);
$order_name = get_text($row['od_name']);
$order_tel = add_hyphen(get_text($row['od_hp']));
// 주문번호가 바뀔 때마다 배경색 토글
$bg_class = ($bg_class === 'bg0') ? 'bg1' : 'bg0';
} else {
$order_date = '';
$order_name = '';
$order_tel = '';
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// '입금'인 것만 출력
if ($row['od_status'] != '입금') continue;
// 결제 수단
$s_receipt_way = $s_br = "";
if ($row['od_settle_case'])
{
$s_receipt_way = $row['od_settle_case'];
$s_br = '<br />';
// 간편결제
if($row['od_settle_case'] == '간편결제') {
switch($row['od_pg']) {
case 'lg':
$s_receipt_way = 'PAYNOW';
break;
case 'inicis':
$s_receipt_way = 'KPAY';
break;
case 'kcp':
$s_receipt_way = 'PAYCO';
break;
default:
$s_receipt_way = $row['od_settle_case'];
break;
}
}
}
$it_name = $row['it_name'];
$io_id = isset($row['io_id']) ? $row['io_id'] : '';
$unit_price = $row['io_price'] ? ($row['ct_price'] + $row['io_price']) : $row['ct_price'];
$qty = $row['ct_qty'];
$total_price = $unit_price * $qty;
$tot_ct_qty += $qty;
$tot_orderprice += $total_price;
$prev_od_id = $row['od_id'];
else
{
$s_receipt_way = '결제수단없음';
$s_br = '<br />';
}
if ($row['od_receipt_point'] > 0)
$s_receipt_way .= $s_br."포인트";
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
$od_cnt = 0;
if ($row['mb_id'])
{
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$od_cnt = $row2['cnt'];
}
// 주문 번호에 device 표시
$od_mobile = '';
if($row['od_mobile'])
$od_mobile = '(M)';
// 주문번호에 - 추가
switch(strlen($row['od_id'])) {
case 16:
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
break;
default:
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
break;
}
// 주문 번호에 에스크로 표시
$od_paytype = '';
if($row['od_test'])
$od_paytype .= '<span class="list_test">테스트</span>';
if($default['de_escrow_use'] && $row['od_escrow'])
$od_paytype .= '<span class="list_escrow">에스크로</span>';
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
$bg = 'bg'.($i%2);
$td_color = 0;
if($row['od_cancel_price'] > 0) {
$bg .= 'cancel';
$td_color = 1;
}
?>
<tr class="<?php echo $bg_class; ?>">
<td><?php echo $order_date; ?></td>
<td><?php echo $order_name; ?></td>
<td><?php echo $order_tel; ?></td>
<td><?php echo $it_name; ?></td>
<td><?php echo $io_id; ?></td>
<td class="number"> <?php echo number_format($unit_price); ?></td>
<td style="text-align: center;"> <?php echo $qty; ?></td>
<td class="number"> <?php echo number_format($total_price); ?></td>
<!-- 목록 내용 시작 -->
<tr class="orderlist<?php echo ' '.$bg; ?>">
<td class="td_chk">
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<!--
<td headers="th_ordnum" class="td_odrnum2">
<?php if ($is_admin == 'super'){ ?>
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&amp;uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
<?php } else { echo $disp_od_id; }?>
<?php echo $od_mobile; ?>
<?php echo $od_paytype; ?>
</td>
-->
<td headers="th_ordnum" class="td_odrnum2"><?php echo substr($row['od_receipt_time'],0,10) ?></td>
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></td>
<td heardrs="th_ordnum" class="td_odrnum2"><?php echo ($row['io_id']) ? $row['io_id'] : '' ?> </td>
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
<td headers="th_odrertel" class="td_tel" style="text-align:center;"><?php echo add_hyphen(get_text($row['od_tel'])); ?></td>
<td headers="th_odrcnt"><?php echo ($row['io_price']) ? number_format($row['ct_price']+$row['io_price']) : number_format($row['ct_price']) ?></td>
<td headers="th_odrcnt"><?php echo $row['ct_qty']; ?></td>
<td class="td_num td_numsum">
<?php echo number_format(($row['ct_price'] + $row['io_price']) * $row['ct_qty']); ?>
<?php // echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); // 같은 승인번호의 결제건 여러개가 있는 경우 금액이 알아보기 불편함 ?></td>
<!-- <td class="td_num_right"><?php echo number_format($row['od_receipt_price']); ?></td>-->
<td class="td_mng td_mng_s">
<?php
// 사용처리
// 사용처리 버튼 출력을 위한 부분
if ($row['it_2'] && (substr($row['od_receipt_time'],0,10) == date('Y-m-d'))) { // 당일주문 사용불가 대상 & 당일주문 체크
echo '사용불가<br>당일주문';
// 상태가 '입금' 이 아니면서 유효기간이 지났거나 주문 상태가 취소인 경우
} else if ($row['od_status'] != '입금' || $row['it_1'] < date("ymd") && !isset($row['it_1']) || $row['od_status'] == '취소') {
echo "사용불가<br>(";
if( $row['od_status'] == '취소' ) echo "취소)"; // 취소라면
else echo "유효일자:".$row['it_1'].")"; // 유효일자가 지났다면
} else { // 위 조건에 해당하지 않으면 사용처리 버튼 출력
?>
<a href="orderliveupdate.php?bo=u&od_id=<?php echo $row['od_id']; ?>&st=<?php echo $row['od_status'];?>" class="mng_mod btn btn_04"><span class="sound_only"><?php echo $row['od_id']; ?></span>사용</a>
<?php } //사용처리 버튼 끝 ?>
</td>
<td class="td_mng td_mng_s">
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>" class="mng_mod btn btn_02"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
</td>
</tr>
<?php
$tot_itemcount += $row['od_cart_count'];
$tot_orderprice += (($row['ct_price'] + $row['io_price']) * $row['ct_qty']);
// $tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
$tot_ordercancel += $row['od_cancel_price'];
$tot_receiptprice += $row['od_receipt_price'];
$tot_couponprice += $row['couponprice'];
$tot_ct_qty += $row['ct_qty'];
}
sql_free_result($result);
if ($i == 0)
echo '<tr class="bg0"><td colspan="8" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
<tfoot>
<tr>
<th colspan="6" style="text-align: center;">합 계</th>
<th style="text-align: center;"><?php echo $tot_ct_qty; ?></th>
<th class="number"><?php echo number_format($tot_orderprice); ?></th>
<tr class="orderlist">
<th scope="row" colspan="7">합 계</th>
<td><?php echo $tot_ct_qty //number_format($tot_itemcount); ?></td>
<td><?php echo number_format($tot_orderprice); ?></td>
<!-- <td><?php echo number_format($tot_receiptprice); ?></td>-->
<td colspan="2"></td>
</tr>
</tfoot>
</table>

View File

@ -52,11 +52,8 @@ if ($w == '') {
$sound_only = '<strong class="sound_only">필수</strong>';
$mb['mb_mailling'] = 1;
$mb['mb_sms'] = 1;
$mb['mb_open'] = 1;
$mb['mb_level'] = $config['cf_register_level'];
$mb['mb_marketing_agree'] = 0;
$mb['mb_thirdparty_agree'] = 0;
$html_title = '추가';
} elseif ($w == 'u') {
$mb = get_member($mb_id);
@ -142,14 +139,6 @@ $mb_sms_no = !$mb['mb_sms'] ? 'checked="checked"' : '';
$mb_open_yes = $mb['mb_open'] ? 'checked="checked"' : '';
$mb_open_no = !$mb['mb_open'] ? 'checked="checked"' : '';
// 마케팅 목적의 개인정보 수집 및 이용
$mb_marketing_agree_yes = $mb['mb_marketing_agree'] ? 'checked="checked"' : '';
$mb_marketing_agree_no = !$mb['mb_marketing_agree'] ? 'checked="checked"' : '';
// 개인정보 제3자 제공 동의
$mb_thirdparty_agree_yes = $mb['mb_thirdparty_agree'] ? 'checked="checked"' : '';
$mb_thirdparty_agree_no = !$mb['mb_thirdparty_agree'] ? 'checked="checked"' : '';
if (isset($mb['mb_certify'])) {
// 날짜시간형이라면 drop 시킴
if (preg_match("/-/", $mb['mb_certify'])) {
@ -365,64 +354,21 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</td>
</tr>
<tr>
<th scope="row">광고성 이메일 수신</th>
<th scope="row">메일 수신</th>
<td>
<input type="radio" name="mb_mailling" value="1" id="mb_mailling_yes" <?php echo $mb_mailling_yes; ?>>
<label for="mb_mailling_yes">예</label>
<input type="radio" name="mb_mailling" value="0" id="mb_mailling_no" <?php echo $mb_mailling_no; ?>>
<label for="mb_mailling_no">아니오</label>
<?php if($w == "u" && $mb['mb_mailling_date'] != "0000-00-00 00:00:00"){
echo $mb['mb_mailling'] == 1 ? "<br>(동의 일자: ".$mb['mb_mailling_date'].")" : '';
} ?>
</td>
<th scope="row"><label for="mb_sms_yes">광고성 SMS/카카오톡 수신</label></th>
<th scope="row"><label for="mb_sms_yes">SMS 수신</label></th>
<td>
<input type="radio" name="mb_sms" value="1" id="mb_sms_yes" <?php echo $mb_sms_yes; ?>>
<label for="mb_sms_yes">예</label>
<input type="radio" name="mb_sms" value="0" id="mb_sms_no" <?php echo $mb_sms_no; ?>>
<label for="mb_sms_no">아니오</label>
<?php if($w == "u" && $mb['mb_sms_date'] != "0000-00-00 00:00:00"){
echo $mb['mb_sms'] == 1 ? "<br>(동의 일자: ".$mb['mb_sms_date'].")" : '';
} ?>
</td>
</tr>
<tr>
<th scope="row">마케팅 목적의<br>개인정보 수집 및 이용</th>
<td>
<input type="radio" name="mb_marketing_agree" value="1" id="mb_marketing_agree_yes" <?php echo $mb_marketing_agree_yes; ?>>
<label for="mb_marketing_agree_yes">예</label>
<input type="radio" name="mb_marketing_agree" value="0" id="mb_marketing_agree_no" <?php echo $mb_marketing_agree_no; ?>>
<label for="mb_marketing_agree_no">아니오</label>
<?php if($w == "u" && $mb['mb_marketing_date'] != "0000-00-00 00:00:00"){
echo $mb['mb_marketing_agree'] == 1 ? "<br>(동의 일자: ".$mb['mb_marketing_date'].")" : '';
} ?>
</td>
<th scope="row"><label for="mb_sms_yes">개인정보 제3자 제공</label></th>
<td>
<input type="radio" name="mb_thirdparty_agree" value="1" id="mb_thirdparty_agree_yes" <?php echo $mb_thirdparty_agree_yes; ?>>
<label for="mb_thirdparty_agree_yes">예</label>
<input type="radio" name="mb_thirdparty_agree" value="0" id="mb_thirdparty_agree_no" <?php echo $mb_thirdparty_agree_no; ?>>
<label for="mb_thirdparty_agree_no">아니오</label>
<?php if($w == "u" && $mb['mb_thirdparty_date'] != "0000-00-00 00:00:00"){
echo $mb['mb_thirdparty_agree'] == 1 ? "<br>(동의 일자: ".$mb['mb_thirdparty_date'].")" : '';
} ?>
</td>
</tr>
<?php if($w == "u"){?>
<tr>
<th scope="row">약관동의 변경내역</th>
<td colspan="3">
<section id="sodr_request_log_wrap" class="ad_agree_log">
<div>
<?php echo conv_content($mb['mb_agree_log'], 0); ?>
</div>
</section>
</td>
</tr>
<?php } ?>
<tr>
<th scope="row">정보 공개</th>
<td colspan="3">
@ -430,9 +376,6 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<label for="mb_open_yes">예</label>
<input type="radio" name="mb_open" value="0" id="mb_open_no" <?php echo $mb_open_no; ?>>
<label for="mb_open_no">아니오</label>
<?php if($w == "u" && $mb['mb_open_date'] != "0000-00-00 00:00:00"){
echo $mb['mb_open'] == 1 ? "<br>(동의 일자: ".$mb['mb_open_date'].")" : '';
} ?>
</td>
</tr>
<tr>

View File

@ -18,10 +18,6 @@ $mb_certify_case = isset($_POST['mb_certify_case']) ? preg_replace('/[^0-9a-z_]/
$mb_certify = isset($_POST['mb_certify']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_certify']) : '';
$mb_zip = isset($_POST['mb_zip']) ? preg_replace('/[^0-9a-z_]/i', '', $_POST['mb_zip']) : '';
// 광고성 정보 수신
$mb_marketing_agree = isset($_POST['mb_marketing_agree']) ? clean_xss_tags($_POST['mb_marketing_agree'], 1, 1) : '0';
$mb_thirdparty_agree = isset($_POST['mb_thirdparty_agree']) ? clean_xss_tags($_POST['mb_thirdparty_agree'], 1, 1) : '0';
// 관리자가 자동등록방지를 사용해야 할 경우 ( 회원의 비밀번호 변경시 캡챠를 체크한다 )
if ($mb_password) {
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
@ -90,6 +86,8 @@ foreach ($check_keys as $key) {
}
}
$mb_memo = isset($_POST['mb_memo']) ? $_POST['mb_memo'] : '';
$sql_common = " mb_name = '{$posts['mb_name']}',
mb_nick = '{$mb_nick}',
mb_email = '{$mb_email}',
@ -111,11 +109,8 @@ $sql_common = " mb_name = '{$posts['mb_name']}',
mb_mailling = '{$posts['mb_mailling']}',
mb_sms = '{$posts['mb_sms']}',
mb_open = '{$posts['mb_open']}',
mb_open_date = '".G5_TIME_YMDHIS."',
mb_profile = '{$posts['mb_profile']}',
mb_level = '{$posts['mb_level']}',
mb_marketing_agree = '{$mb_marketing_agree}',
mb_thirdparty_agree = '{$mb_thirdparty_agree}',
mb_1 = '{$posts['mb_1']}',
mb_2 = '{$posts['mb_2']}',
mb_3 = '{$posts['mb_3']}',
@ -147,36 +142,6 @@ if ($w == '') {
alert('이미 존재하는 이메일입니다.\\n : ' . $row['mb_id'] . '\\n이름 : ' . $row['mb_name'] . '\\n닉네임 : ' . $row['mb_nick'] . '\\n메일 : ' . $row['mb_email']);
}
$agree_items = [];
// 마케팅 목적의 개인정보 수집 및 이용
if ($mb_marketing_agree == 1) {
$sql_common .= " , mb_marketing_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "마케팅 목적의 개인정보 수집 및 이용(동의)";
}
// 광고성 이메일 수신
if ($mb_mailling == 1) {
$sql_common .= " , mb_mailling_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 이메일 수신(동의)";
}
// 광고성 SMS/카카오톡 수신
if ($mb_sms == 1) {
$sql_common .= " , mb_sms_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 SMS/카카오톡 수신(동의)";
}
// 개인정보 제3자 제공
if ($mb_thirdparty_agree == 1) {
$sql_common .= " , mb_thirdparty_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "개인정보 제3자 제공(동의)";
}
// 동의 로그 추가
if (!empty($agree_items)) {
$agree_log = "[".G5_TIME_YMDHIS.", 관리자 회원추가] " . implode(' | ', $agree_items) . "\n";
$sql_common .= " , mb_agree_log = CONCAT('{$agree_log}', IFNULL(mb_agree_log, ''))";
}
sql_query(" insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '" . get_encrypt_string($mb_password) . "', mb_datetime = '" . G5_TIME_YMDHIS . "', mb_ip = '{$_SERVER['REMOTE_ADDR']}', mb_email_certify = '" . G5_TIME_YMDHIS . "', {$sql_common} ");
} elseif ($w == 'u') {
$mb = get_member($mb_id);
@ -228,54 +193,10 @@ if ($w == '') {
$sql_certify = "";
}
// 현재 데이터 조회
$row = sql_fetch("select * from {$g5['member_table']} where mb_id = '{$mb_id}' ");
$agree_items = [];
// 마케팅 목적의 개인정보 수집 및 이용
$sql_marketing_date = "";
if ($row['mb_marketing_agree'] !== $mb_marketing_agree) {
$sql_marketing_date .= " , mb_marketing_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "마케팅 목적의 개인정보 수집 및 이용(" . ($mb_marketing_agree == 1 ? "동의" : "철회") . ")";
}
// 광고성 이메일 수신
$sql_mailling_date = "";
if ($row['mb_mailling'] !== $mb_mailling) {
$sql_mailling_date .= " , mb_mailling_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 이메일 수신(" . ($mb_mailling == 1 ? "동의" : "철회") . ")";
}
// 광고성 SMS/카카오톡 수신
$sql_sms_date = "";
if ($row['mb_sms'] !== $mb_sms) {
$sql_sms_date .= " , mb_sms_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 SMS/카카오톡 수신(" . ($mb_sms == 1 ? "동의" : "철회") . ")";
}
// 개인정보 제3자 제공
$sql_thirdparty_date = "";
if ($row['mb_thirdparty_agree'] !== $mb_thirdparty_agree) {
$sql_thirdparty_date .= " , mb_thirdparty_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "개인정보 제3자 제공(" . ($mb_thirdparty_agree == 1 ? "동의" : "철회") . ")";
}
// 동의 로그 추가
$sql_agree_log = "";
if (!empty($agree_items)) {
$agree_log = "[".G5_TIME_YMDHIS.", 관리자 회원수정] " . implode(' | ', $agree_items) . "\n";
$sql_agree_log .= " , mb_agree_log = CONCAT('{$agree_log}', IFNULL(mb_agree_log, ''))";
}
$sql = " update {$g5['member_table']}
set {$sql_common}
{$sql_password}
{$sql_certify}
{$sql_mailling_date}
{$sql_sms_date}
{$sql_marketing_date}
{$sql_thirdparty_date}
{$sql_agree_log}
where mb_id = '{$mb_id}' ";
sql_query($sql);
} else {

View File

@ -127,7 +127,7 @@ $colspan = 16;
<th scope="col" rowspan="2" id="mb_list_cert"><?php echo subject_sort_link('mb_certify', '', 'desc') ?>본인확인</a></th>
<th scope="col" id="mb_list_mailc"><?php echo subject_sort_link('mb_email_certify', '', 'desc') ?>메일인증</a></th>
<th scope="col" id="mb_list_open"><?php echo subject_sort_link('mb_open', '', 'desc') ?>정보공개</a></th>
<th scope="col" id="mb_list_mailr"><?php echo subject_sort_link('mb_mailling', '', 'desc') ?>광고성이메일</a></th>
<th scope="col" id="mb_list_mailr"><?php echo subject_sort_link('mb_mailling', '', 'desc') ?>메일수신</a></th>
<th scope="col" id="mb_list_auth">상태</th>
<th scope="col" id="mb_list_mobile">휴대폰</th>
<th scope="col" id="mb_list_lastcall"><?php echo subject_sort_link('mb_today_login', '', 'desc') ?>최종접속</a></th>
@ -137,9 +137,9 @@ $colspan = 16;
<tr>
<th scope="col" id="mb_list_name"><?php echo subject_sort_link('mb_name') ?>이름</a></th>
<th scope="col" id="mb_list_nick"><?php echo subject_sort_link('mb_nick') ?>닉네임</a></th>
<th scope="col" id="mb_list_sms"><?php echo subject_sort_link('mb_sms', '', 'desc') ?>SMS수신</a></th>
<th scope="col" id="mb_list_adultc"><?php echo subject_sort_link('mb_adult', '', 'desc') ?>성인인증</a></th>
<th scope="col" id="mb_list_auth"><?php echo subject_sort_link('mb_intercept_date', '', 'desc') ?>접근차단</a></th>
<th scope="col" id="mb_list_sms"><?php echo subject_sort_link('mb_sms', '', 'desc') ?>광고성SMS</a></th>
<th scope="col" id="mb_list_deny"><?php echo subject_sort_link('mb_level', '', 'desc') ?>권한</a></th>
<th scope="col" id="mb_list_tel">전화번호</th>
<th scope="col" id="mb_list_join"><?php echo subject_sort_link('mb_datetime', '', 'desc') ?>가입일</a></th>
@ -252,15 +252,14 @@ $colspan = 16;
<input type="radio" name="mb_certify[<?php echo $i; ?>]" value="ipin" id="mb_certify_ipin_<?php echo $i; ?>" <?php echo $row['mb_certify'] == 'ipin' ? 'checked' : ''; ?>>
<label for="mb_certify_ipin_<?php echo $i; ?>">아이핀</label>
</td>
<td headers="mb_list_mailc" class="td_consent"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '<span class="txt_true">Yes</span>' : '<span class="txt_false">No</span>'; ?></td>
<td headers="mb_list_open" class="td_consent">
<td headers="mb_list_mailc"><?php echo preg_match('/[1-9]/', $row['mb_email_certify']) ? '<span class="txt_true">Yes</span>' : '<span class="txt_false">No</span>'; ?></td>
<td headers="mb_list_open">
<label for="mb_open_<?php echo $i; ?>" class="sound_only">정보공개</label>
<input type="checkbox" name="mb_open[<?php echo $i; ?>]" <?php echo $row['mb_open'] ? 'checked' : ''; ?> value="1" id="mb_open_<?php echo $i; ?>">
</td>
<td headers="mb_list_mailr" class="td_consent">
<label for="mb_mailling_<?php echo $i; ?>" class="sound_only">광고성이메일수신</label>
<td headers="mb_list_mailr">
<label for="mb_mailling_<?php echo $i; ?>" class="sound_only">메일수신</label>
<input type="checkbox" name="mb_mailling[<?php echo $i; ?>]" <?php echo $row['mb_mailling'] ? 'checked' : ''; ?> value="1" id="mb_mailling_<?php echo $i; ?>">
<input type="hidden" name="mb_mailling_default[<?php echo $i; ?>]" value="<?php echo isset($row['mb_mailling']) ? $row['mb_mailling'] : '0'; ?> " id="mb_mailling_default_<?php echo $i; ?>">
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php
@ -281,6 +280,11 @@ $colspan = 16;
<td headers="mb_list_nick" class="td_name sv_use">
<div><?php echo $mb_nick ?></div>
</td>
<td headers="mb_list_sms">
<label for="mb_sms_<?php echo $i; ?>" class="sound_only">SMS수신</label>
<input type="checkbox" name="mb_sms[<?php echo $i; ?>]" <?php echo $row['mb_sms'] ? 'checked' : ''; ?> value="1" id="mb_sms_<?php echo $i; ?>">
</td>
<td headers="mb_list_adultc">
<label for="mb_adult_<?php echo $i; ?>" class="sound_only">성인인증</label>
<input type="checkbox" name="mb_adult[<?php echo $i; ?>]" <?php echo $row['mb_adult'] ? 'checked' : ''; ?> value="1" id="mb_adult_<?php echo $i; ?>">
@ -291,11 +295,6 @@ $colspan = 16;
<label for="mb_intercept_date_<?php echo $i; ?>" class="sound_only">접근차단</label>
<?php } ?>
</td>
<td headers="mb_list_sms">
<label for="mb_sms_<?php echo $i; ?>" class="sound_only">광고성SMS/카카오톡수신</label>
<input type="checkbox" name="mb_sms[<?php echo $i; ?>]" <?php echo $row['mb_sms'] ? 'checked' : ''; ?> value="1" id="mb_sms_<?php echo $i; ?>">
<input type="hidden" name="mb_sms_default[<?php echo $i; ?>]" value="<?php echo isset($row['mb_sms']) ? $row['mb_sms'] : '0'; ?> " id="mb_sms_default_<?php echo $i; ?>">
</td>
<td headers="mb_list_auth" class="td_mbstat">
<?php echo get_member_level_select("mb_level[$i]", 1, $member['mb_level'], $row['mb_level']) ?>
</td>

View File

@ -1,288 +0,0 @@
<?php
/*************************************************************************
**
** 내보내기 관련 상수 정의
**
*************************************************************************/
define('MEMBER_EXPORT_PAGE_SIZE', 10000); // 파일당 처리할 회원 수
define('MEMBER_EXPORT_MAX_SIZE', 300000); // 최대 처리할 회원 수
define('MEMBER_BASE_DIR', "member_list"); // 엑셀 베이스 폴더
define('MEMBER_BASE_DATE', date('YmdHis')); // 폴더/파일명용 날짜
define('MEMBER_EXPORT_DIR', G5_DATA_PATH . "/" . MEMBER_BASE_DIR . "/" . MEMBER_BASE_DATE); // 엑셀 파일 저장 경로
define('MEMBER_LOG_DIR', G5_DATA_PATH . "/" . MEMBER_BASE_DIR . "/" . "log"); // 로그 파일 저장 경로
/*************************************************************************
**
** 공통 함수 정의
**
*************************************************************************/
/**
* 검색 옵션 설정
*/
function get_export_config($type = null)
{
$config = [
'sfl_list' => [
'mb_id'=>'아이디',
'mb_name'=>'이름',
'mb_nick'=>'닉네임',
'mb_email'=>'이메일',
'mb_tel'=>'전화번호',
'mb_hp'=>'휴대폰번호',
'mb_addr1'=>'주소'
],
'point_cond_map' => [
'gte'=>'≥',
'lte'=>'≤',
'eq'=>'='
],
'intercept_list' => [
'exclude'=>'차단회원 제외',
'only'=>'차단회원만'
],
'ad_range_list' => [
'all' => '수신동의 회원 전체',
'mailling_only' => '이메일 수신동의 회원만',
'sms_only' => 'SMS/카카오톡 수신동의 회원만',
'month_confirm' => date('m월').' 수신동의 확인 대상만',
'custom_period' => '수신동의 기간 직접 입력'
],
];
return $type ? (isset($config[$type]) ? $config[$type] : []) : $config;
}
/**
* 파라미터 수집 및 유효성 검사
*/
function get_member_export_params()
{
// 친구톡 양식 - 엑셀 양식에 포함할 항목
$fieldArray = array_map('trim', explode(',', isset($_GET['fields']) ? $_GET['fields'] : ''));
$vars = [];
foreach ($fieldArray as $index => $field) {
if(!empty($field)){
$vars['var' . ($index + 1)] = $field;
}
}
$params = [
'page' => 1,
'formatType' => (int)(isset($_GET['formatType']) ? $_GET['formatType'] : 1),
'use_stx' => isset($_GET['use_stx']) ? $_GET['use_stx'] : 0,
'stx_cond' => clean_xss_tags(isset($_GET['stx_cond']) ? $_GET['stx_cond'] : 'like'),
'sfl' => clean_xss_tags(isset($_GET['sfl']) ? $_GET['sfl'] : ''),
'stx' => clean_xss_tags(isset($_GET['stx']) ? $_GET['stx'] : ''),
'use_level' => isset($_GET['use_level']) ? $_GET['use_level'] : 0,
'level_start' => (int)(isset($_GET['level_start']) ? $_GET['level_start'] : 1),
'level_end' => (int)(isset($_GET['level_end']) ? $_GET['level_end'] : 10),
'use_date' => isset($_GET['use_date']) ? $_GET['use_date'] : 0,
'date_start' => clean_xss_tags(isset($_GET['date_start']) ? $_GET['date_start'] : ''),
'date_end' => clean_xss_tags(isset($_GET['date_end']) ? $_GET['date_end'] : ''),
'use_point' => isset($_GET['use_point']) ? $_GET['use_point'] : 0,
'point' => isset($_GET['point']) ? $_GET['point'] : '',
'point_cond' => isset($_GET['point_cond']) ? $_GET['point_cond'] : 'gte',
'use_hp_exist' => isset($_GET['use_hp_exist']) ? $_GET['use_hp_exist'] : 0,
'ad_range_only' => isset($_GET['ad_range_only']) ? $_GET['ad_range_only'] : 0,
'ad_range_type' => clean_xss_tags(isset($_GET['ad_range_type']) ? $_GET['ad_range_type'] : 'all'),
'ad_mailling' => isset($_GET['ad_mailling']) ? $_GET['ad_mailling'] : 0,
'ad_sms' => isset($_GET['ad_sms']) ? $_GET['ad_sms'] : 0,
'agree_date_start' => clean_xss_tags(isset($_GET['agree_date_start']) ? $_GET['agree_date_start'] : ''),
'agree_date_end' => clean_xss_tags(isset($_GET['agree_date_end']) ? $_GET['agree_date_end'] : ''),
'use_intercept' => isset($_GET['use_intercept']) ? $_GET['use_intercept'] : 0,
'intercept' => clean_xss_tags(isset($_GET['intercept']) ? $_GET['intercept'] : 'exclude'),
'vars' => $vars,
];
// 레벨 범위 검증
if ($params['level_start'] > $params['level_end']) {
[$params['level_start'] , $params['level_end']] = [$params['level_end'], $params['level_start']];
}
// 가입기간 - 날짜 범위 검증
if ($params['use_date'] && $params['date_start'] && $params['date_end']) {
if ($params['date_start'] > $params['date_end']) {
[$params['date_start'] , $params['date_end']] = [$params['date_end'], $params['date_start']];
}
}
// 수신동의기간 - 날짜 범위 검증
if ($params['ad_range_type'] == 'custom_period' && $params['agree_date_start'] && $params['agree_date_end']) {
if ($params['agree_date_start'] > $params['agree_date_end']) {
[$params['agree_date_start'] , $params['agree_date_end']] = [$params['agree_date_end'], $params['agree_date_start']];
}
}
return $params;
}
/**
* 전체 데이터 개수 조회
*/
function member_export_get_total_count($params)
{
global $g5;
$where = member_export_build_where($params);
$sql = "SELECT COUNT(*) as cnt FROM {$g5['member_table']} {$where}";
$result = sql_query($sql);
if (!$result) {
throw new Exception("데이터 조회에 실패하였습니다. 다시 시도해주세요.");
}
$row = sql_fetch_array($result);
return (int)$row['cnt'];
}
/**
* WHERE 조건절 생성
*/
function member_export_build_where($params)
{
global $config;
$conditions = [];
// 기본 조건 - 탈퇴하지 않은 사용자
$conditions[] = "mb_leave_date = ''";
// 검색어 조건 (sql_escape_string 사용으로 보안 강화)
if (!empty($params['use_stx']) && $params['use_stx'] === '1') {
$sfl_list = get_export_config('sfl_list');
$sfl = in_array($params['sfl'], array_keys($sfl_list)) ? $params['sfl'] : '';
$stx = sql_escape_string($params['stx']);
if(!empty($sfl) && !empty($stx)){
if ($params['stx_cond'] === 'like') {
$conditions[] = "{$sfl} LIKE '%{$stx}%'";
} else {
$conditions[] = "{$sfl} = '{$stx}'";
}
}
}
// 권한 조건
if (!empty($params['use_level']) && $params['use_level'] === '1') {
$level_start = max(1, (int)$params['level_start']);
$level_end = min(10, (int)$params['level_end']);
$conditions[] = "(mb_level BETWEEN {$level_start} AND {$level_end})";
}
// 가입기간 조건
if (!empty($params['use_date']) && $params['use_date'] === '1') {
$date_start = isset($params['date_start']) ? sql_escape_string(trim($params['date_start'])) : '';
$date_end = isset($params['date_end']) ? sql_escape_string(trim($params['date_end'])) : '';
if ($date_start && $date_end) {
$conditions[] = "mb_datetime BETWEEN '{$date_start} 00:00:00' AND '{$date_end} 23:59:59'";
} elseif ($date_start) {
$conditions[] = "mb_datetime >= '{$date_start} 00:00:00'";
} elseif ($date_end) {
$conditions[] = "mb_datetime <= '{$date_end} 23:59:59'";
}
}
// 포인트 조건
if (!empty($params['use_point']) && $params['use_point'] === '1') {
$point = $params['point'];
$point_cond = $params['point_cond'];
if ($point != '') {
$point = (int)$point; // 정수로 캐스팅
switch ($point_cond) {
case 'lte':
$conditions[] = "mb_point <= {$point}";
break;
case 'eq':
$conditions[] = "mb_point = {$point}";
break;
default:
$conditions[] = "mb_point >= {$point}";
break;
}
}
}
// 휴대폰 번호 존재 조건
if (!empty($params['use_hp_exist']) && $params['use_hp_exist'] === '1') {
$conditions[] = "(mb_hp is not null and mb_hp != '')";
}
// 정보수신동의 조건
if (!empty($params['ad_range_only']) && $params['ad_range_only'] === '1') {
$range = isset($params['ad_range_type']) ? $params['ad_range_type'] : '';
// 공통: 마케팅 목적 수집·이용 동의 + (필요 시) 제3자 동의
$thirdparty_clause = $config['cf_sms_use'] !== '' ? " AND mb_thirdparty_agree = 1" : "";
$base_marketing = "mb_marketing_agree = 1{$thirdparty_clause}";
if ($range === 'all') {
// 마케팅 동의 + (이메일 OR SMS 동의)
$conditions[] = "({$base_marketing} AND (mb_mailling = 1 OR mb_sms = 1))";
} elseif ($range === 'mailling_only') {
// 마케팅 동의 + 이메일 동의
$conditions[] = "({$base_marketing} AND mb_mailling = 1)";
} elseif ($range === 'sms_only') {
// 마케팅 동의 + SMS/카카오톡 동의
$conditions[] = "({$base_marketing} AND mb_sms = 1)";
} elseif ($range === 'month_confirm' || $range === 'custom_period') {
// 채널 필터 체크
$useEmail = !empty($params['ad_mailling']);
$useSms = !empty($params['ad_sms']);
if ($range === 'month_confirm') {
// 23개월 전 그 달
$start = date('Y-m-01 00:00:00', strtotime('-23 months'));
$end = date('Y-m-t 23:59:59', strtotime('-23 months'));
$emailDateCond = "mb_mailling_date BETWEEN '{$start}' AND '{$end}'";
$smsDateCond = "mb_sms_date BETWEEN '{$start}' AND '{$end}'";
} else {
// 수신동의기간 직접 입력 - custom_period
$date_start = isset($params['agree_date_start']) ? $params['agree_date_start'] : '';
$date_end = isset($params['agree_date_end']) ? $params['agree_date_end'] : '';
if ($date_start && $date_end) {
$emailDateCond = "mb_mailling_date BETWEEN '{$date_start} 00:00:00' AND '{$date_end} 23:59:59'";
$smsDateCond = "mb_sms_date BETWEEN '{$date_start} 00:00:00' AND '{$date_end} 23:59:59'";
} elseif ($date_start) {
$emailDateCond = "mb_mailling_date >= '{$date_start} 00:00:00'";
$smsDateCond = "mb_sms_date >= '{$date_start} 00:00:00'";
} elseif ($date_end) {
$emailDateCond = "mb_mailling_date <= '{$date_end} 23:59:59'";
$smsDateCond = "mb_sms_date <= '{$date_end} 23:59:59'";
} else {
$emailDateCond = "mb_mailling_date <> '0000-00-00 00:00:00'";
$smsDateCond = "mb_sms_date <> '0000-00-00 00:00:00'";
}
}
if (!$useEmail && !$useSms) {
$conditions[] = "0=1"; // 둘 다 해제 ⇒ 결과 0건
} else {
// 조건 조립
$parts = [];
if ($useEmail) $parts[] = "(mb_mailling = 1 AND {$emailDateCond})";
if ($useSms) $parts[] = "(mb_sms = 1 AND {$smsDateCond})";
$conditions[] = !empty($parts) ? '(' . implode(' OR ', $parts) . ')' : '';
}
}
}
// 차단 회원 조건
if (!empty($params['use_intercept']) && $params['use_intercept'] === '1') {
switch ($params['intercept']) {
case 'exclude':
$conditions[] = "mb_intercept_date = ''";
break;
case 'only':
$conditions[] = "mb_intercept_date != ''";
break;
}
}
return empty($conditions) ? '' : 'WHERE ' . implode(' AND ', $conditions);
}

View File

@ -1,483 +0,0 @@
<?php
$sub_menu = "200400";
require_once './_common.php';
require_once './member_list_exel.lib.php'; // 회원관리파일 공통 라이브러리
auth_check_menu($auth, $sub_menu, 'r');
// 파라미터 수집 및 유효성 검사
$params = get_member_export_params();
// 총건수
$total_count = 0;
$total_error = "";
try {
$total_count = member_export_get_total_count($params);
} catch (Exception $e) {
$total_error = $e->getMessage(); // 메서드 호출 괄호 필수
}
$g5['title'] = '회원관리파일';
require_once './admin.head.php';
$colspan = 14;
?>
<h2>회원 엑셀 생성</h2>
<div class="local_desc01 local_desc">
<p><b>회원수 <?php echo number_format(MEMBER_EXPORT_PAGE_SIZE);?>건 초과 시</b> <?php echo number_format(MEMBER_EXPORT_PAGE_SIZE);?>건 단위로 분리 저장되며, <b>엑셀 생성 최대 건수는 <?php echo number_format(MEMBER_EXPORT_MAX_SIZE);?>건</b>입니다. 초과 시 조건 추가 설정 후 재시도하시기 바랍니다.</p>
<p><b>수신동의 확인 대상은 만료일까지 1달 미만인 회원</b>을 기준으로 필터링됩니다.</p>
<br>
<p>파일 생성 시 서버에 임시 생성된 파일 중 <b>오늘 날짜를 제외 한 파일은 자동 삭제</b>되며, 수동 삭제 필요 시 <a href="<?php echo G5_ADMIN_URL;?>/member_list_file_delete.php"><b>회원관리파일 일괄삭제</b></a>에서 진행하시기 바랍니다.</p>
<p>회원 정보 수정은 <a href="<?php echo G5_ADMIN_URL;?>/member_list.php" class="link"><b>회원 관리</b></a>에서 진행하실 수 있습니다.</p>
</div>
<div class="local_ov01 local_ov">
<span class="btn_ov01">
<span class="ov_txt">총건수 </span>
<?php if($total_error != "") { ?>
<span class="ov_num"> <?php echo $total_error ?></span>
<?php } else {?>
<span class="ov_num"> <?php echo number_format($total_count) ?>건</span>
<?php } ?>
</span>
</div>
<!-- 회원 검색 필터링 폼 -->
<form id="fsearch" name="fsearch" class="member_list_data" method="get">
<input type="hidden" name="token" value="<?php echo get_token(); ?>">
<fieldset>
<legend class="sound_only">회원 검색 필터링</legend>
<div class="sch_table">
<!-- 검색어 적용 -->
<div class="sch_row">
<div class="label">
<label>
<input type="checkbox" name="use_stx" value="1" <?php echo isset($_GET['use_stx']) ? 'checked' : ''; ?>>
검색어 적용
</label>
</div>
<div class="field">
<select name="sfl">
<?php
// 검색어 옵션 : [정의] get_export_config() - adm/member_list_exel.lib.php;
foreach (get_export_config('sfl_list') as $val => $label) {
$selected = (isset($_GET['sfl']) && $_GET['sfl'] === $val) ? 'selected' : '';
echo "<option value=\"$val\" $selected>$label</option>";
}
?>
</select>
<input type="text" name="stx" value="<?php echo htmlspecialchars(isset($_GET['stx']) ? $_GET['stx'] : ''); ?>" placeholder="검색어 입력">
<span class="radio_group">
<label><input type="radio" name="stx_cond" value="like" <?php echo (isset($_GET['stx_cond']) ? $_GET['stx_cond'] : 'like') === 'like' ? 'checked' : ''; ?>> 포함</label>
<label><input type="radio" name="stx_cond" value="equal" <?php echo (isset($_GET['stx_cond']) ? $_GET['stx_cond'] : '') === 'equal' ? 'checked' : ''; ?>> 일치</label>
</span>
</div>
</div>
<!-- 레벨 적용 -->
<div class="sch_row">
<div class="label">
<label><input type="checkbox" name="use_level" value="1" <?php echo isset($_GET['use_level']) ? 'checked' : ''; ?>> 레벨 적용</label>
</div>
<div class="field">
<select name="level_start">
<?php for ($i = 1; $i <= 10; $i++): ?>
<option value="<?php echo $i; ?>" <?php echo (isset($_GET['level_start']) && $_GET['level_start'] == $i) ? 'selected' : ''; ?>><?php echo $i; ?></option>
<?php endfor; ?>
</select> ~
<select name="level_end">
<?php for ($i = 1; $i <= 10; $i++): ?>
<option value="<?php echo $i; ?>" <?php echo (isset($_GET['level_end']) && $_GET['level_end'] == $i) ? 'selected' : ''; ?>><?php echo $i; ?></option>
<?php endfor; ?>
</select>
</div>
</div>
<!-- 가입기간 적용 -->
<div class="sch_row">
<div class="label">
<label><input type="checkbox" name="use_date" value="1" <?php echo isset($_GET['use_date']) ? 'checked' : ''; ?>> 가입기간 적용</label>
</div>
<div class="field">
<input type="date" name="date_start" max="9999-12-31" value="<?php echo htmlspecialchars(isset($_GET['date_start']) ? $_GET['date_start'] : ''); ?>"> ~
<input type="date" name="date_end" max="9999-12-31" value="<?php echo htmlspecialchars(isset($_GET['date_end']) ? $_GET['date_end'] : ''); ?>">
</div>
</div>
<!-- 포인트 적용 -->
<div class="sch_row">
<div class="label">
<label><input type="checkbox" name="use_point" value="1" <?php echo isset($_GET['use_point']) ? 'checked' : ''; ?>> 포인트 적용</label>
</div>
<div class="field">
<input type="number" name="point" value="<?php echo htmlspecialchars(isset($_GET['point']) ? $_GET['point'] : ''); ?>" placeholder="포인트 입력">
<span class="radio_group">
<label><input type="radio" name="point_cond" value="gte" <?php echo (isset($_GET['point_cond']) ? $_GET['point_cond'] : 'gte') === 'gte' ? 'checked' : ''; ?>> 이상</label>
<label><input type="radio" name="point_cond" value="lte" <?php echo (isset($_GET['point_cond']) ? $_GET['point_cond'] : '') === 'lte' ? 'checked' : ''; ?>> 이하</label>
<label><input type="radio" name="point_cond" value="eq" <?php echo (isset($_GET['point_cond']) ? $_GET['point_cond'] : '') === 'eq' ? 'checked' : ''; ?>> 일치</label>
</span>
</div>
</div>
<!-- 차단회원 조건 -->
<div class="sch_row">
<div class="label">
<label><input type="checkbox" name="use_intercept" value="1" <?php echo isset($_GET['use_intercept']) ? 'checked' : ''; ?>> 차단회원</label>
</div>
<div class="field">
<select name="intercept" id="intercept">
<?php
// 차단회원 옵션 : [정의] get_export_config() - adm/member_list_exel.lib.php
foreach (get_export_config('intercept_list') as $val => $label) {
$selected = ((isset($_GET['intercept']) ? $_GET['intercept'] : '') === $val) ? 'selected' : '';
echo "<option value=\"$val\" $selected>$label</option>";
}
?>
</select>
</div>
</div>
<!-- 휴대폰 번호 조건 - 초기세팅(설정에 휴대폰번호가 보이기/필수입력이면 기본값 checked로 설정) -->
<div class="sch_row">
<div class="label">
<label>
<?php $use_hp_checked = isset($_GET['token']) ? (isset($_GET['use_hp_exist']) ? 'checked' : '') : (($config['cf_use_hp'] || $config['cf_req_hp']) ? 'checked' : '');?>
<input type="checkbox" name="use_hp_exist" value="1" <?php echo $use_hp_checked; ?>> 휴대폰 번호 있는 경우만
</label>
</div>
</div>
<!-- 정보수신동의 조건 -->
<div class="sch_row">
<div class="label">
<label><input type="checkbox" name="ad_range_only" value="1" <?php echo isset($_GET['ad_range_only']) ? 'checked' : ''; ?>> 정보수신동의에 동의한 경우만</label>
</div>
<!-- 안내 문구 -->
<div class="field">
<p class="sch_notice">「정보통신망이용촉진및정보보호등에관한법률」에 따라 <b>광고성 정보 수신동의 여부</b>를 <b>매2년</b>마다 확인해야 합니다.</p>
</div>
</div>
<div class="sch_row <?php echo isset($_GET['ad_range_only']) ? '' : 'is-hidden'; ?>">
<div class="ad_range_wrap">
<div class="ad_range_box">
<div class="label">
<label for="ad_range_type">회원범위</label>
</div>
<div class="field">
<select name="ad_range_type" id="ad_range_type">
<?php
foreach (get_export_config('ad_range_list') as $val => $label) {
$selected = ((isset($_GET['ad_range_type']) ? $_GET['ad_range_type'] : '') === $val) ? 'selected' : '';
echo "<option value=\"$val\" $selected>$label</option>";
}
?>
</select>
<div class="ad_range_wrap">
<!-- 기간 직접 입력 -->
<div class="ad_range_box <?php echo isset($_GET['ad_range_only']) && (isset($_GET['ad_range_type']) ? $_GET['ad_range_type'] : '') == 'custom_period' ? '' : 'is-hidden'; ?>">
<div class="field">
<input type="date" name="agree_date_start" max="9999-12-31" value="<?php echo htmlspecialchars(isset($_GET['agree_date_start']) ? $_GET['agree_date_start'] : date('Y-m-d', strtotime('-1 month'))); ?>"> ~
<input type="date" name="agree_date_end" max="9999-12-31" value="<?php echo htmlspecialchars(isset($_GET['agree_date_end']) ? $_GET['agree_date_end'] : date('Y-m-d')); ?>">
<p>* 광고성 정보 수신(<b>이메일 또는 SMS/카카오톡</b>) 동의일자 기준</p>
</div>
</div>
<!-- 설명 문구 -->
<?php
$thirdpartyLbl = (!empty($config['cf_sms_use'])) ? ' / <b>개인정보 제3자 제공</b>' : '';
$ad_range_text = [
'all' => "* <b>광고성 정보 수신(이메일 또는 SMS/카카오톡)</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
'mailling_only' => "* <b>광고성 이메일 수신</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
'sms_only' => "* <b>광고성 SMS/카카오톡 수신</b> / <b>마케팅 목적의 개인정보 수집 및 이용</b>{$thirdpartyLbl}에 모두 동의한 회원을 선택합니다.",
'month_confirm' => "* 23개월 전(" . date('Y년 m월', strtotime('-23 month')) . ") <b>광고성 정보 수신 동의(이메일 또는 SMS/카카오톡)</b>한 회원을 선택합니다."
];
if (isset($_GET['ad_range_only'], $_GET['ad_range_type']) && isset($ad_range_text[$_GET['ad_range_type']])) {
echo '<div class="ad_range_box"><p>' . $ad_range_text[$_GET['ad_range_type']] . '</p></div>';
}
?>
</div>
<br>
</div>
</div>
</div>
</div>
<!-- 채널 체크박스 -->
<div class="sch_row <?php echo isset($_GET['ad_range_only']) && in_array($_GET['ad_range_type'], ['month_confirm', 'custom_period']) ? '' : 'is-hidden'; ?>">
<div class="ad_range_wrap">
<div class="ad_range_box">
<div class="label">
</div>
<div class="field">
<?php $ad_mailling_checked = isset($_GET['token']) ? (isset($_GET['ad_mailling']) ? 'checked' : '') : 'checked';?>
<?php $ad_sms_checked = isset($_GET['token']) ? (isset($_GET['ad_sms']) ? 'checked' : '') : 'checked';?>
<label><input type="checkbox" name="ad_mailling" value="1" <?php echo $ad_mailling_checked; ?>> 광고성 이메일 수신</label>
<label><input type="checkbox" name="ad_sms" value="1" <?php echo $ad_sms_checked; ?>> 광고성 SMS/카카오톡 수신</label>
</div>
</div>
</div>
</div>
<div class="sch_btn">
<button type="button" id="btnExcelDownload">엑셀파일 다운로드</button>
<button type="button" class="btn_reset" onclick="location.href='?'">초기화</button>
</div>
</div>
</fieldset>
</form>
<script>
document.querySelector('input[name="ad_range_only"]').addEventListener('change', function () {
document.querySelectorAll('.ad_range_wrap').forEach(el => {
el.classList.toggle('is-hidden', !this.checked);
});
});
document.querySelectorAll('#fsearch input, #fsearch select').forEach(el => {
const submit = () => document.getElementById('fsearch').submit();
el.addEventListener(el.type === 'date' ? 'blur' : 'change', submit);
el.addEventListener('keydown', e => {
if (e.key === 'Enter') {
e.preventDefault();
submit();
}
});
});
</script>
<script>
let eventSource = null;
// 일반 엑셀 다운로드 버튼 클릭
document.getElementById('btnExcelDownload').addEventListener('click', () => {
startExcelDownload();
});
// 엑셀 다운로드 실행
// 1. 기존 SSE 종료
function closePreviousEventSource() {
if (eventSource) {
eventSource.close();
eventSource = null;
}
}
// 2. FormData QueryString 변환
function buildDownloadParams(selectedFields = []) {
const formData = new FormData(document.getElementById('fsearch'));
const params = new URLSearchParams(formData);
params.append('mode', 'start');
return params.toString();
}
// 3. 메인 함수
function startExcelDownload(selectedFields = []) {
closePreviousEventSource();
const query = buildDownloadParams(selectedFields);
showDownloadPopup();
eventSource = new EventSource(`member_list_exel_export.php?${query}`);
eventSource.onmessage = handleProgressUpdate();
eventSource.onerror = handleDownloadError();
}
// 다운로드 팝업 표시
function showDownloadPopup() {
const bodyHTML = `
<div class="excel-download-progress">
<div class="progress-desc">
<p class="progress-summary">총 <strong>0</strong>개 파일로 분할됩니다</p>
<p class="progress-message"><strong>(0 / 0)</strong> 파일 다운로드 중</p>
<p class="progress-error"></p>
</div>
<div class="progress-spinner">
<div class="spinner"></div>
<p class="loading-message">
엑셀 파일을 생성 중입니다. 잠시만 기다려주세요.<br>
현재 데이터 기준으로 <strong id="estimatedTimeText"></strong> 정도 소요될 수 있습니다.<br>
<strong>페이지를 벗어나거나 닫으면 다운로드가 중단</strong>되니, 작업 완료까지 기다려 주세요.
</p>
</div>
<div class="progress-box">
<div class="progress-download-box"></div>
</div>
</div>
`;
PopupManager.render('엑셀 다운로드 진행 중', bodyHTML, '', { disableOutsideClose: true });
// 닫기 버튼 이벤트 핸들링
const closeBtn = document.querySelector('.popup-close-btn');
if (closeBtn) {
closeBtn.removeAttribute('onclick');
closeBtn.addEventListener('click', handlePopupCloseWithConfirm);
}
}
// 닫기 버튼 클릭 시 다운로드 중단 여부 확인
function handlePopupCloseWithConfirm(e) {
if (eventSource) {
const confirmClose = confirm("엑셀 다운로드가 진행 중입니다.\n정말 중지하시겠습니까?");
if (!confirmClose) {
e.preventDefault();
return;
}
eventSource.close();
eventSource = null;
alert("엑셀 다운로드가 중단되었습니다.");
}
PopupManager.close('popupOverlay');
}
// 체크박스 선택 시 최대 3개 제한 및 선택된 항목 미리보기 표시
function bindFieldSelectEvents() {
const fieldSelectForm = document.getElementById('fieldSelectForm');
if (!fieldSelectForm) return;
fieldSelectForm.addEventListener('change', function (e) {
if (e.target.name === 'fields') {
const selected = fieldSelectForm.querySelectorAll('input[name="fields"]:checked');
if (selected.length > 3) {
alert("최대 3개까지 선택 가능합니다.");
e.target.checked = false;
return;
}
// 선택된 항목 표시
const previewContainer = document.getElementById('selectedFieldsPreview');
let spans = '<strong>선택된 항목:</strong>';
selected.forEach(field => {
const label = field.parentElement.textContent.trim();
spans += `<span class="field-tag">${label}</span>`;
});
previewContainer.innerHTML = spans;
}
});
}
// 엑셀 생성 및 다운로드 실행
function handleProgressUpdate() {
return function(e) {
const data = JSON.parse(e.data);
const { status, downloadType, message, total, current, totalChunks, currentChunk, zipFile, files, filePath } = data;
// DOM 요소 캐싱
const titleEl = document.getElementById('popupTitle');
const summaryEl = document.querySelector('.progress-summary');
const messageEl = document.querySelector('.progress-message');
const spinnerEl = document.querySelector('.progress-spinner');
const resultEl = document.querySelector('.loading-message');
const downloadBoxEl = document.querySelector('.progress-download-box');
const errorEl = document.querySelector('.progress-error');
if (status === "progress")
{
summaryEl.innerHTML = `총 <strong>${totalChunks}</strong>개 파일로 ` + (downloadType === 2 ? `분할 생성됩니다` : `다운로드됩니다`) + ` (총 ${total.toLocaleString('ko-KR')}건)`;
messageEl.innerHTML = downloadType === 2 ? `<strong>(${currentChunk} / ${totalChunks})</strong> 파일 생성 중` : `엑셀 파일 생성 중`;
/* 작업 소요 시간 : 예상 시간 (1만건당 10초) */
const sec = Math.max(5, Math.ceil(total * 0.0012 * 1.2)); // 최소 5초 보장
const text = `예상 처리 시간은 약 ${sec >= 60 ? `${Math.floor(sec / 60)}분 ${sec % 60}초` : `${sec}초`}`;
document.getElementById('estimatedTimeText').innerText = text;
}
else if (status === "zipping")
{
summaryEl.innerHTML = `총 <strong>${totalChunks}</strong>개 파일이 압축파일로 생성됩니다`;
messageEl.innerHTML = `<strong>${totalChunks}</strong> 파일 압축하는 중`;
}
else if (status === "zippingError")
{
errorEl.innerHTML = message;
}
else if (status === "error")
{
summaryEl.innerHTML = `엑셀 파일 다운로드 실패`;
resultEl.innerHTML = '';
spinnerEl?.classList.add('is-hidden');
const parts = message.split(/<br\s*\/?>/i);
messageEl.innerHTML = parts[0] || '';
errorEl.innerHTML = parts.slice(1).join('<br>') || '';
// SSE 작업 닫기
eventSource?.close();
eventSource = null;
}
else if (status === "done")
{
// SSE 작업 닫기
eventSource?.close();
eventSource = null;
titleEl.textContent = '엑셀 파일 다운로드 완료';
messageEl.innerHTML = `<strong>총 ${total.toLocaleString('ko-KR')}건의 데이터 다운로드가 완료되었습니다!</strong>`;
spinnerEl?.classList.add('is-hidden');
let html = '<p>* 자동으로 다운로드가 되지 않았다면 아래 버튼을 클릭해주세요.</p>';
const baseUrl = `<?php echo G5_DATA_URL; ?>/member_list/<?php echo date('Ymdhis'); ?>/`; // 공통 URL 분리
if (zipFile) {
const url = `${filePath}/${zipFile}`;
html += `<a href="${url}" class="btn btn_03" download>압축파일 다운로드</a>`;
downloadBoxEl.innerHTML = html;
triggerAutoDownload(url, zipFile);
} else if (files?.length) {
files.forEach((file, index) => {
const url = `${filePath}/${file}`;
html += `<a class="btn btn_03" href="${url}" download>엑셀파일 다운로드 ${index + 1}</a>`;
});
downloadBoxEl.innerHTML = html;
if (files.length === 1) {
const url = `${filePath}/${files[0]}`;
triggerAutoDownload(url, files[0]);
} else {
summaryEl.innerHTML = `총 <strong>${totalChunks}</strong>개 파일이 생성되었습니다. 아래 버튼을 눌러 다운로드 받아주세요.`;
}
}
}
}
}
// SSE 오류 처리
function handleDownloadError() {
return function(e){
const errorMessage = e?.message || e?.data || '알 수 없는 오류가 발생했습니다.';
document.querySelector('.progress-summary').innerHTML = `엑셀 파일 다운로드 실패`;
document.querySelector('.progress-message').innerHTML = `엑셀 파일 다운로드에 실패하였습니다`;
document.querySelector('.progress-error').innerHTML = errorMessage;
document.querySelector('.loading-message').innerHTML = '';
document.querySelector('.progress-spinner').classList.add('is-hidden');
if (eventSource) {
eventSource.close();
eventSource = null;
}
}
}
// 자동 다운로드 실행
function triggerAutoDownload(url, filename) {
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
</script>
<?php
require_once './admin.tail.php';

View File

@ -1,551 +0,0 @@
<?php
$sub_menu = "200400";
require_once './_common.php';
require_once './member_list_exel.lib.php'; // 회원관리파일 공통 라이브러리 (상수, 검색 옵션 설정, SQL WHERE 등)
include_once(G5_LIB_PATH.'/PHPExcel.php');
check_demo();
auth_check_menu($auth, $sub_menu, 'w');
ini_set('memory_limit', '-1');
session_write_close(); // 세션 종료 및 잠금 해제 (백그라운드 작업을 위해 필요)
// 파라미터 수집 및 유효성 검사
$params = get_member_export_params();
if (!$params || !is_array($params)) {
member_export_send_progress("error", "데이터가 올바르게 전달되지 않아 작업에 실패하였습니다.");
member_export_write_log([], ['success' => false, 'error' => '데이터가 올바르게 전달되지 않아 작업에 실패하였습니다.']);
exit;
}
// 기존 생성된 엑셀 파일 삭제 - LOG 및 오늘 날짜 폴더 제외
$resultExcelDelete = member_export_delete();
// 서버 전송 이벤트(SSE)를 위한 헤더 설정
member_export_set_sse_headers();
// 모드 확인
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
if ($mode !== 'start') {
member_export_send_progress("error", "잘못된 요청 입니다.");
member_export_write_log($params, ['success' => false, 'error' => '잘못된 요청 입니다.']);
exit;
}
/**
* 회원 내보내기 처리 실행 (예외 처리 포함)
*/
try {
main_member_export($params);
}
catch (Exception $e)
{
// 에러 로그 저장 및 SSE 에러 전송
error_log("[Member Export Error] " . $e->getMessage());
member_export_send_progress("error", $e->getMessage());
member_export_write_log($params, ['success' => false, 'error' => $e->getMessage()]);
}
/**
* 메인 내보내기 프로세스
*/
function main_member_export($params)
{
$total = member_export_get_total_count($params);
if($total > MEMBER_EXPORT_MAX_SIZE){
throw new Exception("엑셀 다운로드 가능 범위(최대 " . number_format(MEMBER_EXPORT_MAX_SIZE) . "건)를 초과했습니다.<br>조건을 추가로 설정하신 후 다시 시도해 주세요.");
}
if($total <= 0){
throw new Exception("조회된 데이터가 없어 엑셀 파일을 생성할 수 없습니다.<br>조건을 추가로 설정하신 후 다시 시도해 주세요.");
}
$fileName = 'member_'.MEMBER_BASE_DATE;
$fileList = [];
$zipFileName = '';
if ($total > MEMBER_EXPORT_PAGE_SIZE) {
// 대용량 데이터 - 분할 처리
$pages = (int)ceil($total / MEMBER_EXPORT_PAGE_SIZE);
member_export_send_progress("progress", "", 2, $total, 0, $pages, 0);
for ($i = 1; $i <= $pages; $i++) {
$params['page'] = $i;
member_export_send_progress("progress", "", 2, $total, ($pages == $i ? $total : $i * MEMBER_EXPORT_PAGE_SIZE), $pages, $i);
try {
$data = member_export_get_data($params);
$fileList[] = member_export_create_excel($data, $fileName, $i);
} catch (Exception $e) {
throw new Exception("{$pages}개 중 {$i}번째 파일을 생성하지 못했습니다<br>" . $e->getMessage());
}
}
// 압축 파일 생성
if (count($fileList) > 1) {
member_export_send_progress("zipping", "", 2, $total, $total, $pages, $i);
$zipResult = member_export_create_zip($fileList, $fileName); // 압축 파일 생성
if($zipResult['error']){
member_export_write_log($params, ['success' => false, 'error' => $zipResult['error']]);
member_export_send_progress("zippingError", $zipResult['error']);
}
if ($zipResult && $zipResult['result']) {
member_export_delete($fileList); // 압축 후 엑셀 파일 제거
$zipFileName = $zipResult['zipFile'];
}
}
} else {
// 소용량 데이터 - 단일 파일
member_export_send_progress("progress", "", 1, $total, 0);
$data = member_export_get_data($params);
member_export_send_progress("progress", "", 1, $total, $total/2);
$fileList[] = member_export_create_excel($data, $fileName, 0);
member_export_send_progress("progress", "", 1, $total, $total);
}
member_export_write_log($params, ['success' => true, 'total' => $total, 'files' => $fileList, 'zip' => isset($zipFileName) ? $zipFileName : null]);
member_export_send_progress("done", "", 2, $total, $total, $pages, $pages, $fileList, $zipFileName);
}
/**
* 진행률 전송
*/
function member_export_send_progress($status, $message = "", $downloadType = 1, $total = 1, $current = 1, $totalChunks = 1, $currentChunk = 1, $files = [], $zipFile = '')
{
// 연결 상태 확인
if (connection_aborted()) return;
$data = [
'status' => $status,
'message' => $message,
'downloadType' => $downloadType,
'total' => $total,
'current' => $current,
'totalChunks' => $totalChunks,
'currentChunk' => $currentChunk,
'files' => $files,
'zipFile' => $zipFile,
'filePath' => G5_DATA_URL . "/" . MEMBER_BASE_DIR . "/" . MEMBER_BASE_DATE,
];
echo "data: " . json_encode($data, JSON_UNESCAPED_UNICODE) . "\n\n";
// 더 안정적인 플러시
if (ob_get_level()) ob_end_flush();
flush();
}
/**
* 엑셀 내보내기 설정
*/
function member_export_get_config()
{
$type = 1;
$configs = [
1 => [
'title' => ["회원관리파일(일반)"],
'headers' => ['아이디', '이름', '닉네임', '휴대폰번호', '전화번호', '이메일', '주소', '회원권한', '포인트', '가입일', '차단',
'광고성 이메일 수신동의', '광고성 이메일 동의일자', '광고성 SMS/카카오톡 수신동의', '광고성 SMS/카카오톡 동의일자',
'마케팅목적의개인정보수집및이용동의', '마케팅목적의개인정보수집및이용동의일자', '개인정보제3자제공동의', '개인정보제3자제공동의일자'],
'fields' => ['mb_id', 'mb_name', 'mb_nick', 'mb_hp', 'mb_tel', 'mb_email', 'mb_addr1', 'mb_level', 'mb_point', 'mb_datetime', 'mb_intercept_date',
'mb_mailling','mb_mailling_date', 'mb_sms','mb_sms_date', 'mb_marketing_agree',
'mb_marketing_date', 'mb_thirdparty_agree', 'mb_thirdparty_date'],
'widths' => [20, 20, 20, 20, 20, 30, 30, 10, 15, 25, 10, 20, 25, 20, 25, 20, 25, 20, 25],
],
];
return isset($configs[$type]) ? $configs[$type] : $configs[1];
}
/**
* SSE 헤더 설정
*/
function member_export_set_sse_headers()
{
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
header('Connection: keep-alive');
header('X-Accel-Buffering: no');
if (ob_get_level()) ob_end_flush();
ob_implicit_flush(true);
}
/**
* 엑셀 컬럼 문자 반환
*/
function member_export_column_char($i)
{
return chr(65 + $i);
}
/**
* 회원 데이터 조회
*/
function member_export_get_data($params)
{
global $g5;
$config = member_export_get_config();
$fields = $config['fields'];
$fields = array_unique($fields);
// SQL 변환 맵 (가공이 필요한 필드만 정의)
$sqlTransformMap = [
'mb_datetime' => "IF(mb_datetime = '0000-00-00 00:00:00', '', mb_datetime) AS mb_datetime",
'mb_intercept_date' => "IF(mb_intercept_date != '', '차단됨', '정상') AS mb_intercept_date",
'mb_sms' => "IF(mb_sms = '1', '동의', '미동의') AS mb_sms",
'mb_sms_date' => "IF(mb_sms != '1' OR mb_sms_date = '0000-00-00 00:00:00', '', mb_sms_date) AS mb_sms_date",
'mb_mailling' => "IF(mb_mailling = '1', '동의', '미동의') AS mb_mailling",
'mb_mailling_date' => "IF(mb_mailling != '1' OR mb_mailling_date = '0000-00-00 00:00:00', '', mb_mailling_date) AS mb_mailling_date",
'mb_marketing_agree' => "IF(mb_marketing_agree = '1', '동의', '미동의') AS mb_marketing_agree",
'mb_marketing_date' => "IF(mb_marketing_agree != '1' OR mb_marketing_date = '0000-00-00 00:00:00', '', mb_marketing_date) AS mb_marketing_date",
'mb_thirdparty_agree' => "IF(mb_thirdparty_agree = '1', '동의', '미동의') AS mb_thirdparty_agree",
'mb_thirdparty_date' => "IF(mb_thirdparty_agree != '1' OR mb_thirdparty_date = '0000-00-00 00:00:00', '', mb_thirdparty_date) AS mb_thirdparty_date",
];
// SQL 필드 생성
$sqlFields = [];
foreach ($fields as $field) {
$sqlFields[] = isset($sqlTransformMap[$field]) ? $sqlTransformMap[$field] : $field;
}
$field_list = implode(', ', $sqlFields);
$where = member_export_build_where($params);
$page = (int)(isset($params['page']) ? $params['page'] : 1);
if ($page < 1) $page = 1;
$offset = ($page - 1) * MEMBER_EXPORT_PAGE_SIZE;
$sql = "SELECT {$field_list} FROM {$g5['member_table']} {$where} ORDER BY mb_no DESC LIMIT {$offset}, " . MEMBER_EXPORT_PAGE_SIZE;
$result = sql_query($sql);
if (!$result) {
throw new Exception("데이터 조회에 실패하였습니다");
}
$excelData = [$config['title'], $config['headers']];
while ($row = sql_fetch_array($result)) {
$rowData = [];
foreach ($fields as $field) {
$rowData[] = isset($row[$field]) ? $row[$field] : '';
}
$excelData[] = $rowData;
}
return $excelData;
}
/**
* 엑셀 파일 생성
*/
function member_export_create_excel($data, $fileName, $index = 0)
{
$config = member_export_get_config();
if (!class_exists('PHPExcel')) {
error_log('[Member Export Error] PHPExcel 라이브러리를 찾을 수 없습니다.');
throw new Exception('파일 생성 중 내부 오류가 발생했습니다: PHPExcel 라이브러리를 찾을 수 없습니다.');
}
// 현재 설정값 백업
$currentCache = PHPExcel_Settings::getCacheStorageMethod();
// 캐싱 모드 설정 (엑셀 생성 전용)
$cacheMethods = [
PHPExcel_CachedObjectStorageFactory::cache_to_discISAM,
PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized
];
foreach ($cacheMethods as $method) {
if (PHPExcel_Settings::setCacheStorageMethod($method)) {
break;
}
}
try {
$excel = new PHPExcel();
$sheet = $excel->setActiveSheetIndex(0);
// 헤더 스타일 적용
$last_char = member_export_column_char(count($config['headers']) - 1);
$sheet->getStyle("A2:{$last_char}2")->applyFromArray([
'fill' => [
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'startcolor' => ['rgb' => 'D9E1F2'], // 연파랑 배경
],
]);
// 셀 정렬 및 줄바꿈 설정
$sheet->getStyle("A:{$last_char}")->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER)->setWrapText(true);
// 컬럼 너비 설정
foreach ($config['widths'] as $i => $width) {
$sheet->getColumnDimension(member_export_column_char($i))->setWidth($width);
}
// 데이터 입력
$sheet->fromArray($data, NULL, 'A1');
// 디렉토리 확인
member_export_ensure_directory(MEMBER_EXPORT_DIR);
// 파일명 생성
$subname = $index == 0 ? 'all' : sprintf("%02d", $index);
$filename = $fileName . "_" . $subname . ".xlsx";
$filePath = MEMBER_EXPORT_DIR . "/" . $filename;
// 파일 저장
$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
$writer->setPreCalculateFormulas(false);
$writer->save($filePath);
unset($excel, $sheet, $writer); // 생성 완료 후 메모리 해제
}
catch (Exception $e)
{
throw new Exception("엑셀 파일 생성에 실패하였습니다: " . $e->getMessage());
}
finally
{
// 캐싱 모드 원래 상태로 복원
if ($currentCache) {
PHPExcel_Settings::setCacheStorageMethod($currentCache);
}
}
return $filename;
}
/**
* 압축 파일 생성
*/
function member_export_create_zip($files, $zipFileName)
{
if (!class_exists('ZipArchive')) {
error_log('[Member Export Error] ZipArchive 클래스를 사용할 수 없습니다.');
return ['error' => '파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다.<br>: ZipArchive 클래스를 사용할 수 없습니다.'];
}
member_export_ensure_directory(MEMBER_EXPORT_DIR);
$destinationZipPath = rtrim(MEMBER_EXPORT_DIR, "/") . "/" . $zipFileName . ".zip";
$zip = new ZipArchive();
if ($zip->open($destinationZipPath, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== TRUE) {
return ['error' => "파일을 압축하는 중 문제가 발생했습니다. 개별 파일로 제공됩니다."];
}
foreach ($files as $file) {
$filePath = MEMBER_EXPORT_DIR . "/" . $file;
if (file_exists($filePath)) {
$zip->addFile($filePath, basename($filePath));
}
}
$result = $zip->close();
return [
'result' => $result,
'zipFile' => $zipFileName . ".zip",
'zipPath' => $destinationZipPath,
];
}
/**
* 디렉토리 생성 및 확인
*/
function member_export_ensure_directory($dir)
{
if (!is_dir($dir)) {
if (!@mkdir($dir, G5_DIR_PERMISSION, true)) {
throw new Exception("디렉토리 생성 실패");
}
@chmod($dir, G5_DIR_PERMISSION);
}
if (!is_writable($dir)) {
throw new Exception("디렉토리 쓰기 권한 없음");
}
}
/**
* 파일 삭제 - 값이 있으면 해당 파일만 삭제, 없으면 디렉토리 내 모든 파일 삭제
* - 알집 생성 완료 시 엑셀 파일 제거
* - 작업 전 오늘 날짜 폴더 및 log 폴더를 제외한 나머지 파일 모두 제거
*/
function member_export_delete($fileList = [])
{
$cnt = 0;
// 파일 리스트가 있는 경우 -> 해당 파일만 삭제
if (!empty($fileList)) {
foreach ($fileList as $file) {
$filePath = rtrim(MEMBER_EXPORT_DIR, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
if (file_exists($filePath) && is_file($filePath) && @unlink($filePath)) {
$cnt++;
}
}
}
// 파일 리스트가 없는 경우 -> 디렉토리 내 모든 파일 삭제
else {
$files = glob(rtrim(G5_DATA_PATH . "/" . MEMBER_BASE_DIR, '/') . '/*');
function deleteFolder($dir) {
foreach (glob($dir . '/{.,}*', GLOB_BRACE) as $item) {
if (in_array(basename($item), ['.', '..'])) continue;
is_dir($item) ? deleteFolder($item) : unlink($item);
}
rmdir($dir);
}
foreach ($files as $file) {
$name = basename($file);
// log 폴더와 오늘 날짜로 시작하는 폴더는 제외
if ($name === 'log' || preg_match('/^' . date('Ymd') . '\d{6}$/', $name)) continue;
if (is_file($file) && pathinfo($file, PATHINFO_EXTENSION) !== 'log' && @unlink($file)) {
$cnt++;
} elseif (is_dir($file)) {
deleteFolder($file); // 재귀 폴더 삭제 함수 사용
$cnt++;
}
}
}
return $cnt;
}
/**
* 로그 작성
*/
function member_export_write_log($params, $result = [])
{
global $member;
$maxSize = 1024 * 1024 * 2; // 2MB
$maxFiles = 10; // 최대 로그 파일 수 (필요시 조정)
$username = isset($member['mb_id']) ? $member['mb_id'] : 'guest';
$datetime = date("Y-m-d H:i:s");
if (!is_dir(MEMBER_LOG_DIR)) {
@mkdir(MEMBER_LOG_DIR, G5_DIR_PERMISSION, true);
@chmod(MEMBER_LOG_DIR, G5_DIR_PERMISSION);
}
$logFiles = glob(MEMBER_LOG_DIR . "/export_log_*.log") ?: [];
// 최신 파일 기준 정렬 (최신 → 오래된)
usort($logFiles, fn($a, $b) => filemtime($b) - filemtime($a));
$latestLogFile = isset($logFiles[0]) ? $logFiles[0] : null;
// 용량 기준으로 새 파일 생성
if (!$latestLogFile || filesize($latestLogFile) >= $maxSize) {
$latestLogFile = MEMBER_LOG_DIR . "/export_log_" . date("YmdHi") . ".log";
file_put_contents($latestLogFile, '');
array_unshift($logFiles, $latestLogFile);
}
// 최대 파일 수 초과 시 오래된 파일 제거
if (count($logFiles) > $maxFiles) {
$filesToDelete = array_slice($logFiles, $maxFiles);
foreach ($filesToDelete as $file) {
@unlink($file);
}
}
$success = isset($result['success']) && $result['success'] === true;
$status = $success ? '성공' : '실패';
// 조건 정리
$condition = [];
// 검색 조건
if ($params['use_stx'] == 1 && !empty($params['stx'])) {
$sfl_list = get_export_config('sfl_list');
$label = isset($sfl_list[$params['sfl']]) ? $sfl_list[$params['sfl']] : '';
$condition[] = "검색({$params['stx_cond']}) : {$label} - {$params['stx']}";
}
// 레벨 조건
if ($params['use_level'] == 1 && ($params['level_start'] || $params['level_end'])) {
$condition[] = "레벨: {$params['level_start']}~{$params['level_end']}";
}
// 가입일 조건
if ($params['use_date'] == 1 && ($params['date_start'] || $params['date_end'])) {
$condition[] = "가입일: {$params['date_start']}~{$params['date_end']}";
}
// 포인트 조건
if ($params['use_point'] == 1 && $params['point'] !== '') {
$point_cond_map = get_export_config('point_cond_map');
$symbol = isset($point_cond_map[$params['point_cond']]) ? $point_cond_map[$params['point_cond']] : '≥';
$condition[] = "포인트 {$symbol} {$params['point']}";
}
// 휴대폰 여부
if ($params['use_hp_exist'] == 1) {
$condition[] = "휴대폰번호 있는 경우만";
}
// 광고 수신 동의
if ($params['ad_range_only'] == 1) {
$ad_range_list = get_export_config('ad_range_list');
$label = isset($ad_range_list[$params['ad_range_type']]) ? $ad_range_list[$params['ad_range_type']] : '';
$condition[] = "수신동의: 예 ({$label})";
if ($params['ad_range_type'] == "custom_period" && ($params['agree_date_start'] || $params['agree_date_end'])) {
$condition[] = "수신동의일: {$params['agree_date_start']}~{$params['agree_date_end']}";
}
if (in_array($params['ad_range_type'], ["month_confirm", "custom_period"])){
$channels = array_filter([
!empty($params['ad_mailling']) && (int)$params['ad_mailling'] === 1 ? '이메일' : null,
!empty($params['ad_sms']) && (int)$params['ad_sms'] === 1 ? 'SMS/카카오톡' : null,
]);
if ($channels) {
$condition[] = '수신채널: ' . implode(', ', $channels);
}
}
}
// 차단회원 처리
if ($params['use_intercept'] == 1) {
$intercept_list = get_export_config('intercept_list');
$label = isset($intercept_list[$params['intercept']]) ? $intercept_list[$params['intercept']] : '';
if ($label) $condition[] = $label;
}
$conditionStr = !empty($condition) ? implode(', ', $condition) : '없음';
$line1 = "[{$datetime}] [{$status}] 관리자: {$username}";
// 성공일 경우 추가 정보
if ($success) {
$total = isset($result['total']) ? $result['total'] : 0;
$fileCount = isset($result['zip']) ? 1 : count(isset($result['files']) ? $result['files'] : []);
$line1 .= " | 총 {$total}건 | 파일: {$fileCount}";
}
$logEntry = $line1 . PHP_EOL;
$logEntry .= "조건: {$conditionStr}" . PHP_EOL;
if (!$success && !empty($result['error'])) {
$logEntry .= "오류 메시지: {$result['error']}" . PHP_EOL;
}
$logEntry .= PHP_EOL;
// 파일에 기록
if (@file_put_contents($latestLogFile, $logEntry, FILE_APPEND | LOCK_EX) === false) {
error_log("[Member Export Error] 로그 파일 기록 실패: {$latestLogFile}");
}
}

View File

@ -1,72 +0,0 @@
<?php
$sub_menu = '100930';
include_once('./_common.php');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.', G5_URL);
$g5['title'] = '회원관리파일 일괄삭제';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<div class="local_desc02 local_desc">
<p>
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
</p>
</div>
<?php
flush();
if (!$dir = @opendir(G5_DATA_PATH . '/member_list')) {
echo '<p>회원관리파일를 열지못했습니다.</p>';
}
$cnt = 0;
echo '<ul class="session_del">' . PHP_EOL;
$files = glob(G5_DATA_PATH . '/member_list/*');
$cnt = 0;
// 폴더 및 하위 파일 재귀 삭제 함수
function deleteFolder($folderPath) {
$items = glob($folderPath . '/*');
foreach ($items as $item) {
if (is_dir($item)) {
deleteFolder($item);
} else {
unlink($item);
}
}
rmdir($folderPath); // 폴더 자체 삭제
}
if (is_array($files)) {
foreach ($files as $member_list_file) {
// log 확장자가 아닌 파일/디렉토리 처리
$ext = strtolower(pathinfo($member_list_file, PATHINFO_EXTENSION));
$basename = basename($member_list_file);
if (is_file($member_list_file) && $ext !== 'log') {
unlink($member_list_file);
echo '<li>파일 삭제: ' . $member_list_file . '</li>' . PHP_EOL;
$cnt++;
} elseif (is_dir($member_list_file) && $basename !== 'log') {
deleteFolder($member_list_file);
echo '<li>폴더 삭제: ' . $member_list_file . '</li>' . PHP_EOL;
$cnt++;
}
flush();
if ($cnt % 10 == 0) {
echo PHP_EOL;
}
}
}
echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>회원관리파일 ' . $cnt . '건 삭제 완료됐습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
?>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');

View File

@ -27,30 +27,6 @@ if ($_POST['act_button'] == "선택수정") {
$post_mb_sms = isset($_POST['mb_sms'][$k]) ? (int) $_POST['mb_sms'][$k] : 0;
$post_mb_open = isset($_POST['mb_open'][$k]) ? (int) $_POST['mb_open'][$k] : 0;
$agree_items = [];
// 광고성 이메일 수신동의 일자 추가
$post_mb_mailling_default = isset($_POST['mb_mailling_default'][$k]) ? (int) $_POST['mb_mailling_default'][$k] : 0;
$sql_mailling_date = "";
if ($post_mb_mailling_default != $post_mb_mailling) {
$sql_mailling_date = " , mb_mailling_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 이메일 수신(" . ($post_mb_mailling == 1 ? "동의" : "철회") . ")";
}
// 광고성 SMS/카카오톡 수신동의 일자 추가
$post_mb_sms_default = isset($_POST['mb_sms_default'][$k]) ? (int) $_POST['mb_sms_default'][$k] : 0;
$sql_sms_date = "";
if ($post_mb_sms_default != $post_mb_sms) {
$sql_sms_date = " , mb_sms_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 SMS/카카오톡 수신(" . ($post_mb_sms == 1 ? "동의" : "철회") . ")";
}
// 동의 로그 추가
$sql_agree_log = "";
if (!empty($agree_items)) {
$agree_log = "[".G5_TIME_YMDHIS.", 회원관리 선택수정] " . implode(' | ', $agree_items) . "\n";
$sql_agree_log .= " , mb_agree_log = CONCAT('{$agree_log}', IFNULL(mb_agree_log, ''))";
}
$mb_datas[] = $mb = get_member($_POST['mb_id'][$k]);
if (!(isset($mb['mb_id']) && $mb['mb_id'])) {
@ -74,9 +50,6 @@ if ($_POST['act_button'] == "선택수정") {
mb_open = '" . $post_mb_open . "',
mb_certify = '" . sql_real_escape_string($post_mb_certify) . "',
mb_adult = '{$mb_adult}'
{$sql_mailling_date}
{$sql_sms_date}
{$sql_agree_log}
where mb_id = '" . sql_real_escape_string($mb['mb_id']) . "' ";
sql_query($sql);
}

View File

@ -29,26 +29,6 @@ if (!sql_query("SELECT bn_device FROM rb_banner LIMIT 0, 1")) {
sql_query("UPDATE rb_banner SET bn_device = 'pc'", true);
}
// 콘텐츠 유형 필드 추가 (image/video/video_url/youtube/vimeo)
if (!sql_query("SELECT bn_content_type FROM rb_banner LIMIT 0, 1")) {
sql_query("ALTER TABLE `rb_banner` ADD `bn_content_type` varchar(20) NOT NULL DEFAULT 'image' AFTER `bn_device`", true);
}
// 비디오 URL 필드 추가
if (!sql_query("SELECT bn_video_url FROM rb_banner LIMIT 0, 1")) {
sql_query("ALTER TABLE `rb_banner` ADD `bn_video_url` varchar(500) NOT NULL DEFAULT '' AFTER `bn_content_type`", true);
}
// 유튜브 URL 필드 추가
if (!sql_query("SELECT bn_youtube_url FROM rb_banner LIMIT 0, 1")) {
sql_query("ALTER TABLE `rb_banner` ADD `bn_youtube_url` varchar(500) NOT NULL DEFAULT '' AFTER `bn_video_url`", true);
}
// 비메오 URL 필드 추가
if (!sql_query("SELECT bn_vimeo_url FROM rb_banner LIMIT 0, 1")) {
sql_query("ALTER TABLE `rb_banner` ADD `bn_vimeo_url` varchar(500) NOT NULL DEFAULT '' AFTER `bn_youtube_url`", true);
}
include_once(G5_ADMIN_PATH . '/admin.head.php');
?>
@ -65,23 +45,9 @@ include_once(G5_ADMIN_PATH . '/admin.head.php');
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="bn_content_type">콘텐츠 유형</label></th>
<td>
<?php echo help("배너의 콘텐츠 유형을 선택하세요."); ?>
<?php $bn_content_type = isset($bn['bn_content_type']) ? $bn['bn_content_type'] : 'image'; ?>
<select name="bn_content_type" id="bn_content_type" onchange="toggleContentInputs()">
<option value="image" <?php echo get_selected($bn_content_type, 'image', true); ?>>이미지</option>
<option value="video" <?php echo get_selected($bn_content_type, 'video', true); ?>>동영상 파일 (로컬 업로드)</option>
<option value="video_url" <?php echo get_selected($bn_content_type, 'video_url', true); ?>>비디오 URL (MP4, M3U8 등)</option>
<option value="youtube" <?php echo get_selected($bn_content_type, 'youtube', true); ?>>유튜브</option>
<option value="vimeo" <?php echo get_selected($bn_content_type, 'vimeo', true); ?>>비메오</option>
</select>
</td>
</tr>
<tr id="image_row">
<th scope="row">이미지</th>
<td>
<input type="file" name="bn_bimg" accept="image/*">
<input type="file" name="bn_bimg">
<?php
$bimg_str = "";
$bimg = G5_DATA_PATH . "/banners/" . $bn['bn_id'];
@ -100,43 +66,6 @@ include_once(G5_ADMIN_PATH . '/admin.head.php');
?>
</td>
</tr>
<tr id="video_row" style="display:none;">
<th scope="row">동영상 파일</th>
<td>
<?php echo help("MP4, MKV, MOV, WebM 등의 동영상 파일을 업로드하세요."); ?>
<input type="file" name="bn_video_file" accept="video/*">
<?php
if (isset($bn['bn_id']) && $bn['bn_id'] && $bn_content_type === 'video') {
$video_file = G5_DATA_PATH . "/banners/" . $bn['bn_id'];
if (file_exists($video_file)) {
echo '<div><p>업로드된 파일: ' . basename($video_file) . '</p>';
echo '<input type="checkbox" name="bn_video_del" value="1" id="bn_video_del"> <label for="bn_video_del">삭제</label></div>';
}
}
?>
</td>
</tr>
<tr id="video_url_row" style="display:none;">
<th scope="row">비디오 URL</th>
<td>
<?php echo help("MP4, M3U8, DASH 등의 비디오 파일 직접 URL을 입력하세요."); ?>
<input type="text" name="bn_video_url" value="<?php echo isset($bn['bn_video_url']) ? htmlspecialchars($bn['bn_video_url']) : ''; ?>" class="frm_input" size="80" placeholder="https://example.com/video.mp4">
</td>
</tr>
<tr id="youtube_row" style="display:none;">
<th scope="row">유튜브</th>
<td>
<?php echo help("유튜브 URL을 입력하세요. (예: https://www.youtube.com/watch?v=xxxxx 또는 https://youtu.be/xxxxx)"); ?>
<input type="text" name="bn_youtube_url" value="<?php echo isset($bn['bn_youtube_url']) ? htmlspecialchars($bn['bn_youtube_url']) : ''; ?>" class="frm_input" size="80" placeholder="https://www.youtube.com/watch?v=...">
</td>
</tr>
<tr id="vimeo_row" style="display:none;">
<th scope="row">비메오</th>
<td>
<?php echo help("비메오 URL을 입력하세요. (예: https://vimeo.com/xxxxx)"); ?>
<input type="text" name="bn_vimeo_url" value="<?php echo isset($bn['bn_vimeo_url']) ? htmlspecialchars($bn['bn_vimeo_url']) : ''; ?>" class="frm_input" size="80" placeholder="https://vimeo.com/...">
</td>
</tr>
<tr>
<th scope="row"><label for="bn_alt">메인타이틀</label></th>
<td>
@ -276,20 +205,6 @@ include_once(G5_ADMIN_PATH . '/admin.head.php');
</form>
<script>
function toggleContentInputs() {
const contentType = document.getElementById('bn_content_type').value;
document.getElementById('image_row').style.display = (contentType === 'image') ? 'table-row' : 'none';
document.getElementById('video_row').style.display = (contentType === 'video') ? 'table-row' : 'none';
document.getElementById('video_url_row').style.display = (contentType === 'video_url') ? 'table-row' : 'none';
document.getElementById('youtube_row').style.display = (contentType === 'youtube') ? 'table-row' : 'none';
document.getElementById('vimeo_row').style.display = (contentType === 'vimeo') ? 'table-row' : 'none';
}
// 페이지 로드 시 초기화
document.addEventListener('DOMContentLoaded', toggleContentInputs);
</script>
<?php
include_once(G5_ADMIN_PATH . '/admin.tail.php');
?>

View File

@ -16,60 +16,24 @@ check_admin_token();
$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_video_file = isset($_FILES['bn_video_file']['tmp_name']) ? $_FILES['bn_video_file']['tmp_name'] : null;
$bn_video_name = isset($_FILES['bn_video_file']['name']) ? $_FILES['bn_video_file']['name'] : null;
$bn_content_type = isset($bn_content_type) ? $bn_content_type : 'image';
$bn_video_url = isset($bn_video_url) ? clean_xss_tags($bn_video_url) : '';
$bn_youtube_url = isset($bn_youtube_url) ? clean_xss_tags($bn_youtube_url) : '';
$bn_vimeo_url = isset($bn_vimeo_url) ? clean_xss_tags($bn_vimeo_url) : '';
$bn_id = isset($bn_id) ? (int) $bn_id : 0;
$bn_bimg_del = isset($bn_bimg_del) ? $bn_bimg_del : null;
$bn_video_del = isset($bn_video_del) ? $bn_video_del : null;
if ($bn_bimg_del) {
@unlink(G5_DATA_PATH."/banners/$bn_id");
}
if ($bn_video_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("이미지 파일만 업로드 할 수 있습니다.");
}
// 콘텐츠 유형에 따른 검증
if ($bn_content_type === 'image') {
// 파일이 이미지인지 체크합니다.
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("이미지 파일만 업로드 할 수 있습니다.");
}
}
} elseif ($bn_content_type === 'video') {
// 동영상 파일 검증
if ($bn_video_file || $bn_video_name) {
if (!preg_match('/\.(mp4|mkv|mov|avi|webm|flv|wmv|m4v)$/i', $bn_video_name)) {
alert("동영상 파일(MP4, MKV, MOV, AVI, WebM, FLV, WMV, M4V)만 업로드 할 수 있습니다.");
}
}
} elseif ($bn_content_type === 'video_url') {
// URL 검증
if (!$bn_video_url) {
alert("비디오 URL을 입력하세요.");
}
} elseif ($bn_content_type === 'youtube') {
// 유튜브 URL 검증
if (!$bn_youtube_url) {
alert("유튜브 URL을 입력하세요.");
}
} elseif ($bn_content_type === 'vimeo') {
// 비메오 URL 검증
if (!$bn_vimeo_url) {
alert("비메오 URL을 입력하세요.");
$timg = @getimagesize($bn_bimg);
if ($timg === false || $timg[2] < 1 || $timg[2] > 16) {
alert("이미지 파일만 업로드 할 수 있습니다.");
}
}
@ -86,22 +50,7 @@ if(isset($_POST['bn_position_use']) && $_POST['bn_position_use']) {
}
if ($w == "") {
// 콘텐츠 유형별 필수 검사
if ($bn_content_type === 'image' && !$bn_bimg_name) {
alert('배너 이미지를 업로드 하세요.');
}
if ($bn_content_type === 'video' && !$bn_video_name) {
alert('동영상 파일을 업로드 하세요.');
}
if ($bn_content_type === 'video_url' && !$bn_video_url) {
alert('비디오 URL을 입력하세요.');
}
if ($bn_content_type === 'youtube' && !$bn_youtube_url) {
alert('유튜브 URL을 입력하세요.');
}
if ($bn_content_type === 'vimeo' && !$bn_vimeo_url) {
alert('비메오 URL을 입력하세요.');
}
if (!$bn_bimg_name) alert('배너 이미지를 업로드 하세요.');
sql_query("ALTER TABLE rb_banner AUTO_INCREMENT=1");
@ -112,10 +61,6 @@ if ($w == "") {
bn_alt4 = '$bn_alt4',
bn_url = '$bn_url',
bn_device = '$bn_device',
bn_content_type = '$bn_content_type',
bn_video_url = '$bn_video_url',
bn_youtube_url = '$bn_youtube_url',
bn_vimeo_url = '$bn_vimeo_url',
bn_position = '$bn_position',
bn_border = '$bn_border',
bn_radius = '$bn_radius',
@ -137,10 +82,6 @@ if ($w == "") {
bn_alt4 = '$bn_alt4',
bn_url = '$bn_url',
bn_device = '$bn_device',
bn_content_type = '$bn_content_type',
bn_video_url = '$bn_video_url',
bn_youtube_url = '$bn_youtube_url',
bn_vimeo_url = '$bn_vimeo_url',
bn_position = '$bn_position',
bn_border = '$bn_border',
bn_radius = '$bn_radius',
@ -159,17 +100,9 @@ if ($w == "") {
}
if ($w == "" || $w == "u") {
// 콘텐츠 유형에 따라 파일 업로드
if ($bn_content_type === 'image') {
if (isset($_FILES['bn_bimg']['name']) && $_FILES['bn_bimg']['name']) {
rb_upload_files($_FILES['bn_bimg']['tmp_name'], $bn_id, G5_DATA_PATH."/banners");
}
} elseif ($bn_content_type === 'video') {
if (isset($_FILES['bn_video_file']['name']) && $_FILES['bn_video_file']['name']) {
rb_upload_files($_FILES['bn_video_file']['tmp_name'], $bn_id, G5_DATA_PATH."/banners");
}
if (isset($_FILES['bn_bimg']['name']) && $_FILES['bn_bimg']['name']) {
rb_upload_files($_FILES['bn_bimg']['tmp_name'], $bn_id, G5_DATA_PATH."/banners");
}
// 나머지 타입(video_url, youtube, vimeo)은 파일 업로드 필요 없음 (URL만 저장)
goto_url("./banner_form.php?w=u&amp;bn_id=$bn_id");
} else {

View File

@ -125,15 +125,12 @@ function pg_setting_check($is_print=false){
$msg = '';
$pg_msg = '';
$pg_test_conf_link = G5_ADMIN_URL.'/shop_admin/configform.php#de_card_test1';
if( $default['de_card_test'] ){
if( $default['de_pg_service'] === 'kcp' && $default['de_kcp_mid'] && $default['de_kcp_site_key'] ){
$pg_msg = 'NHN KCP';
} else if ( $default['de_pg_service'] === 'lg' && $config['cf_lg_mid'] && $config['cf_lg_mert_key'] ){
$pg_msg = 'LG유플러스';
} else if ( $default['de_pg_service'] === 'toss' && $config['cf_lg_mid'] && $config['cf_toss_client_key'] && $config['cf_toss_secret_key'] ){
$msg .= '<div class="admin_pg_notice od_test_caution">(주의!) 토스페이먼츠 결제의 결제 설정이 현재 테스트결제로 되어 있습니다.<br>반드시 <a href="#lg_info_anchor">상점 API키</a>를 <u>[테스트]키</u>로 설정한 후 테스트결제를 진행해야합니다.<br>쇼핑몰 운영 시에는 실결제로 전환하여 <u>[라이브]키</u>로 설정해 주시기 바랍니다.<br>아래 링크를 클릭하여 실결제로 설정하여 운영해 주세요.<br><a href="'.$pg_test_conf_link.'" class="pg_test_conf_link">'.$pg_test_conf_link.'</a></div>';
} else if ( $default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] && $default['de_inicis_sign_key'] ){
$pg_msg = 'KG이니시스';
} else if ( $default['de_pg_service'] === 'nicepay' && $default['de_nicepay_mid'] && $default['de_nicepay_key'] ){
@ -150,6 +147,7 @@ function pg_setting_check($is_print=false){
}
if( $pg_msg ){
$pg_test_conf_link = G5_ADMIN_URL.'/shop_admin/configform.php#de_card_test1';
$msg .= '<div class="admin_pg_notice od_test_caution">(주의!) '.$pg_msg.' 결제의 결제 설정이 현재 테스트결제 로 되어 있습니다.<br>테스트결제시 실제 결제가 되지 않으므로, 쇼핑몰 운영중이면 반드시 실결제로 설정하여 운영하셔야 합니다.<br>아래 링크를 클릭하여 실결제로 설정하여 운영해 주세요.<br><a href="'.$pg_test_conf_link.'" class="pg_test_conf_link">'.$pg_test_conf_link.'</a></div>';
}
@ -172,10 +170,6 @@ function is_cancel_shop_pg_order($od){
$is_od_pg_cancel = true;
}
if($od['od_pg'] === 'toss' && in_array($od['od_settle_case'], array('계좌이체', '휴대폰'))) {
$is_od_pg_cancel = true;
}
return $is_od_pg_cancel;
}

View File

@ -215,14 +215,6 @@ if (! isset($default['de_nicepay_mid'])) {
sql_query($sql, false);
}
// 토스페이먼츠 client, secret key 추가
if( ! isset($config['cf_toss_client_key']) ){
$sql = "ALTER TABLE `{$g5['config_table']}`
ADD COLUMN `cf_toss_client_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_lg_mert_key`,
ADD COLUMN `cf_toss_secret_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_toss_client_key`; ";
sql_query($sql, false);
}
if( function_exists('pg_setting_check') ){
pg_setting_check(true);
}
@ -644,23 +636,17 @@ if(!$default['de_kakaopay_cancelpwd']){
<?php echo G5_SHOP_URL; ?>/settle_kcp_common.php</td>
</tr>
<tr id="inicis_vbank_url" class="pg_vbank_url">
<th scope="row">KG이니시스 가상계좌<br>입금통보 URL</th>
<th scope="row">KG이니시스 가상계좌 입금통보 URL</th>
<td>
<?php echo help("KG이니시스 가상계좌 사용시 다음 주소를 <strong><a href=\"https://iniweb.inicis.com/\" target=\"_blank\">KG이니시스 관리자</a> &gt; 거래내역 &gt; 가상계좌 &gt; 입금통보방식선택 &gt; URL 수신 설정</strong>에 넣으셔야 상점에 자동으로 입금 통보됩니다."); ?>
<?php echo G5_SHOP_URL; ?>/settle_inicis_common.php</td>
</tr>
<tr id="nicepay_vbank_url" class="pg_vbank_url">
<th scope="row">NICEPAY 가상계좌<br>입금통보 URL</th>
<th scope="row">NICEPAY 가상계좌 입금통보 URL</th>
<td>
<?php echo help("NICEPAY 가상계좌 사용시 다음 주소를 <strong><a href=\"https://npg.nicepay.co.kr/\" target=\"_blank\">NICEPAY 관리자</a> &gt; 가맹점관리자페이지 설정 (메인화면 → 가맹점정보 클릭)</strong>에 넣으셔야 상점에 자동으로 입금 통보됩니다."); ?>
<?php echo G5_SHOP_URL; ?>/settle_nicepay_common.php</td>
</tr>
<tr id="toss_vbank_url" class="pg_vbank_url">
<th scope="row">토스페이먼츠 가상계좌<br>입금통보 URL</th>
<td>
<?php echo help("토스페이먼츠 가상계좌 사용시 다음 주소를 <strong><a href=\"https://app.tosspayments.com/\" target=\"_blank\">토스페이먼츠 상점관리자</a> &gt; 개발자센터 &gt; 웹훅 &gt; 웹훅 등록하기에 URL</strong>에 넣으시고, <strong>구독할 이벤트를 [DEPOSIT_CALLBACK]</strong>을 선택하셔야 상점에 자동으로 입금 통보됩니다."); ?>
<?php echo G5_SHOP_URL; ?>/settle_toss_common.php</td>
</tr>
<tr>
<th scope="row"><label for="de_hp_use">휴대폰결제사용</label></th>
<td>
@ -701,7 +687,6 @@ if(!$default['de_kakaopay_cancelpwd']){
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="de_taxsave_use">현금영수증<br>발급사용</label></th>
<td>
@ -790,8 +775,7 @@ if(!$default['de_kakaopay_cancelpwd']){
<?php echo help('쇼핑몰에서 사용할 결제대행사를 선택합니다.'); ?>
<ul class="de_pg_tab">
<li class="<?php if($default['de_pg_service'] == 'kcp') echo 'tab-current'; ?>"><a href="#kcp_info_anchor" data-value="kcp" title="NHN KCP 선택하기" >NHN KCP</a></li>
<li class="<?php if($default['de_pg_service'] == 'lg') echo 'tab-current'; ?>"><a href="#lg_info_anchor" data-value="lg" title="토스페이먼츠(구버전) 선택하기">토스페이먼츠(구버전)</a></li>
<li class="<?php if($default['de_pg_service'] == 'toss') echo 'tab-current'; ?>"><a href="#lg_info_anchor" data-value="toss" title="토스페이먼츠 선택하기">토스페이먼츠</a></li>
<li class="<?php if($default['de_pg_service'] == 'lg') echo 'tab-current'; ?>"><a href="#lg_info_anchor" data-value="lg" title="토스페이먼츠 선택하기">토스페이먼츠</a></li>
<li class="<?php if($default['de_pg_service'] == 'inicis') echo 'tab-current'; ?>"><a href="#inicis_info_anchor" data-value="inicis" title="KG이니시스 선택하기">KG이니시스</a></li>
<li class="<?php if($default['de_pg_service'] == 'nicepay') echo 'tab-current'; ?>"><a href="#nicepay_info_anchor" data-value="nicepay" title="NICEPAY 선택하기">NICEPAY</a></li>
</ul>
@ -849,26 +833,12 @@ if(!$default['de_kakaopay_cancelpwd']){
</td>
</tr>
<tr class="pg_info_fld lg_info_fld">
<th scope="row"><label for="cf_lg_mert_key">토스페이먼츠(구버전) MERT KEY</label></th>
<th scope="row"><label for="cf_lg_mert_key">토스페이먼츠 MERT KEY</label></th>
<td>
<?php echo help("토스페이먼츠(구버전) 상점 MertKey는 상점관리자 -> 개발자센터 -> API키 -> 머트 키에서 확인하실 수 있습니다.\n예) 95160cce09854ef44d2edb2bfb05f9f3"); ?>
<?php echo help("토스페이먼츠 상점MertKey는 상점관리자 -> 계약정보 -> 상점정보관리에서 확인하실 수 있습니다.\n예) 95160cce09854ef44d2edb2bfb05f9f3\n<a href=\"".G5_ADMIN_URL."/config_form.php#anc_cf_cert\">기본환경설정 &gt; 본인확인</a> 설정의 토스페이먼츠 MERT KEY와 동일합니다."); ?>
<input type="text" name="cf_lg_mert_key" value="<?php echo get_sanitize_input($config['cf_lg_mert_key']); ?>" id="cf_lg_mert_key" class="frm_input " size="36" maxlength="50">
</td>
</tr>
<tr class="pg_info_fld lg_info_fld_v2">
<th scope="row"><label for="cf_toss_client_key">토스페이먼츠 API Client Key</label></th>
<td>
<?php echo help("토스페이먼츠 API 클라이언트 키는 상점관리자 -> 개발자센터 -> API키 -> 클라이언트 키에서 확인하실 수 있습니다. 예) live_ck_tosspayment\n실결제용 [라이브] 키와 테스트용 [테스트] 키는 서로 다르므로, <b>테스트로 결제시에는 [테스트] 키</b>로 변경하여 사용해주시기 바랍니다. 예) 테스트 키: test_ck_tosspayment"); ?>
<input type="text" name="cf_toss_client_key" value="<?php echo get_sanitize_input($config['cf_toss_client_key']); ?>" id="cf_toss_client_key" class="frm_input " size="40" maxlength="50">
</td>
</tr>
<tr class="pg_info_fld lg_info_fld_v2">
<th scope="row"><label for="cf_toss_secret_key">토스페이먼츠 API Secret Key</label></th>
<td>
<?php echo help("토스페이먼츠 API 시크릿 키는 상점관리자 -> 개발자센터 -> API키 -> 시크릿 키에서 확인하실 수 있습니다. 예) live_sk_tosspayment\n실결제용 [라이브] 키와 테스트용 [테스트] 키는 서로 다르므로, <b>테스트로 결제시에는 [테스트] 키</b>로 변경하여 사용해주시기 바랍니다. 예) 테스트 키: test_sk_tosspayment"); ?>
<input type="text" name="cf_toss_secret_key" value="<?php echo get_sanitize_input($config['cf_toss_secret_key']); ?>" id="cf_toss_secret_key" class="frm_input " size="40" maxlength="50">
</td>
</tr>
<tr class="pg_info_fld inicis_info_fld" id="inicis_info_anchor">
<th scope="row">
<label for="de_inicis_mid">KG이니시스 상점아이디</label><br>
@ -1100,9 +1070,6 @@ if(!$default['de_kakaopay_cancelpwd']){
<a href="https://app.tosspayments.com/" target="_blank" class="btn_frmline">실결제 관리자</a>
<a href="https://pgweb.tosspayments.com/tmert" target="_blank" class="btn_frmline">테스트 관리자</a>
</div>
<div class="scf_cardtest toss_cardtest">
<a href="https://app.tosspayments.com/" target="_blank" class="btn_frmline">상점 관리자</a>
</div>
<div class="scf_cardtest inicis_cardtest">
<a href="https://iniweb.inicis.com/" target="_blank" class="btn_frmline">상점 관리자</a>
</div>
@ -1128,9 +1095,6 @@ if(!$default['de_kakaopay_cancelpwd']){
<ul id="lg_cardtest_tip" class="scf_cardtest_tip_adm scf_cardtest_tip_adm_hide">
<li>테스트결제의 <a href="https://pgweb.tosspayments.com/tmert" target="_blank">상점관리자</a> 로그인 정보는 토스페이먼츠 상점아이디 첫 글자에 t를 추가해서 로그인하시기 바랍니다. 예) tsi_lguplus</li>
</ul>
<ul id="toss_cardtest_tip" class="scf_cardtest_tip_adm scf_cardtest_tip_adm_hide">
<li>테스트 결제 시 <a href="https://app.tosspayments.com/" target="_blank">상점관리자</a> 로그인 정보는 실결제용 키와는 다르니 반드시 <b>[테스트] API 연동 키</b>로 로그인해야 합니다. 예) test_ck_toss</li>
</ul>
<ul id="inicis_cardtest_tip" class="scf_cardtest_tip_adm scf_cardtest_tip_adm_hide">
<li><b>일반결제</b>의 테스트 사이트 mid는 <b>INIpayTest</b> 이며, <b>에스크로 결제</b>의 테스트 사이트 mid는 <b>iniescrow0</b> 입니다.</li>
</ul>
@ -1805,11 +1769,7 @@ function fconfig_check(f)
}
} else if ( f.de_pg_service.value == "lg" ) {
if( f.cf_lg_mid.value && f.cf_lg_mert_key.value && parseInt(f.de_card_test.value) > 0 ){
pg_msg = "토스페이먼츠(구버전)";
}
} else if ( f.de_pg_service.value == "toss" ) {
if( f.cf_lg_mid.value && f.cf_toss_client_key.value && f.cf_toss_secret_key.value && parseInt(f.de_card_test.value) > 0 ){
msg += "(주의!) 토스페이먼츠 결제의 결제 설정이 현재 테스트결제로 되어 있습니다.\n상점 API키를 [테스트]키로 설정한 후 테스트결제를 진행해주세요.\n쇼핑몰 운영중이면 반드시 실결제 전환 및 [라이브]키로 설정하여 운영하셔야 합니다.\n실결제로 변경하려면 결제설정 탭 -> 결제 테스트에서 실결제를 선택해 주세요.\n정말로 테스트결제로 설정하시겠습니까?";
pg_msg = "토스페이먼츠";
}
} else if ( f.de_pg_service.value == "inicis" ) {
if( f.de_inicis_mid.value && f.de_inicis_sign_key.value && parseInt(f.de_card_test.value) > 0 ){

View File

@ -64,8 +64,6 @@ foreach($check_skin_keys as $key){
if( isset($_POST[$key]) && preg_match('#\.+(\/|\\\)#', $_POST[$key]) ){
alert('스킨설정에 유효하지 문자가 포함되어 있습니다.');
}
$$key = $_POST[$key] = sql_real_escape_string($_POST[$key]);
}
// 현금영수증 발급수단
@ -161,8 +159,6 @@ $check_sanitize_keys = array(
'de_kcp_site_key', //NHN KCP SITE KEY
'cf_lg_mid', //LG유플러스 상점아이디
'cf_lg_mert_key', //LG유플러스 MERT KEY
'cf_toss_client_key', //토스페이먼츠 MERT KEY
'cf_toss_secret_key', //토스페이먼츠 MERT KEY
'de_inicis_mid', //KG이니시스 상점아이디
'de_inicis_iniapi_key', //KG이니시스 INIAPI KEY
'de_inicis_iniapi_iv', //KG이니시스 INIAPI IV
@ -469,9 +465,7 @@ $sql = " update {$g5['config_table']}
cf_icode_server_port = '{$_POST['cf_icode_server_port']}',
cf_icode_token_key = '{$cf_icode_token_key}',
cf_lg_mid = '{$cf_lg_mid}',
cf_lg_mert_key = '{$cf_lg_mert_key}',
cf_toss_client_key = '{$cf_toss_client_key}',
cf_toss_secret_key = '{$cf_toss_secret_key}' ";
cf_lg_mert_key = '{$cf_lg_mert_key}' ";
sql_query($sql);
run_event('shop_admin_configformupdate');

View File

@ -67,9 +67,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
for ($i=0; $i<$len; $i++)
$nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row['ca_id']) : $row['ca_name'];
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$category_path}</option>\n";
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
}
// 모바일 1줄당 이미지수 필드 추가

View File

@ -107,9 +107,7 @@ if($ev_id) {
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -146,11 +146,9 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$nbsp = "";
for ($i=0; $i<$len; $i++)
$nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시 (예: 남성의류 > 상의 > 셔츠)
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row['ca_id']) : $row['ca_name'];
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$category_path}</option>\n";
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
$script .= "ca_use['{$row['ca_id']}'] = {$row['ca_use']};\n";
$script .= "ca_stock_qty['{$row['ca_id']}'] = {$row['ca_stock_qty']};\n";
//$script .= "ca_explan_html['$row[ca_id]'] = $row[ca_explan_html];\n";
@ -1396,9 +1394,7 @@ $(function(){
for ($i=0; $i<$len; $i++)
$nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row['ca_id']) : $row['ca_name'];
echo "<option value=\"{$row['ca_id']}\">$nbsp{$category_path}</option>\n";
echo "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
}
?>
</select>

View File

@ -235,14 +235,6 @@ 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' "); // 기존선택옵션삭제
// 금지할 패턴 목록
$forbidden_patterns = array(
'/<\s*script/i', // <script>
'/<\s*iframe/i', // <iframe>
'/on\w+\s*=/i', // onclick=, onerror= 등 이벤트 핸들러
'/javascript:/i' // javascript: 프로토콜
);
$option_count = (isset($_POST['opt_id']) && is_array($_POST['opt_id'])) ? count($_POST['opt_id']) : array();
$it_option_subject = '';
$it_supply_subject = '';
@ -251,18 +243,8 @@ 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]) ? $_POST['opt_id'][$i] : '';
foreach ($forbidden_patterns as $pattern) {
if (preg_match($pattern, $post_opt_id)) {
$post_opt_id = '';
$_POST['opt_id'][$i] = '';
continue 2;
}
}
$post_opt_id = preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($post_opt_id));
$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++;
@ -289,18 +271,8 @@ if($supply_count) {
// 추가옵션명
$arr_spl = array();
for($i=0; $i<$supply_count; $i++) {
$post_spl_id = isset($_POST['spl_id'][$i]) ? $_POST['spl_id'][$i] : '';
foreach ($forbidden_patterns as $pattern) {
if (preg_match($pattern, $post_spl_id)) {
$post_spl_id = '';
$_POST['spl_id'][$i] = '';
continue 2;
}
}
$post_spl_id = preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($post_spl_id));
$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];

View File

@ -25,8 +25,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
for ($i=0; $i<$len; $i++) {
$nbsp .= '&nbsp;&nbsp;&nbsp;';
}
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row['ca_id']) : $row['ca_name'];
$ca_list .= '<option value="'.$row['ca_id'].'">'.$nbsp.$category_path.'</option>'.PHP_EOL;
$ca_list .= '<option value="'.$row['ca_id'].'">'.$nbsp.$row['ca_name'].'</option>'.PHP_EOL;
}
$where = " and ";
@ -101,9 +100,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = '';
for ($i=0; $i<$len; $i++) $nbsp .= '&nbsp;&nbsp;&nbsp;';
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -84,11 +84,11 @@ if($po_run) {
?>
<tr>
<td class="td_chk">
<input type="hidden" name="opt_id[]" value="<?php echo get_text($opt_id); ?>">
<input type="hidden" name="opt_id[]" value="<?php echo $opt_id; ?>">
<label for="opt_chk_<?php echo $i; ?>" class="sound_only"></label>
<input type="checkbox" name="opt_chk[]" id="opt_chk_<?php echo $i; ?>" value="1">
</td>
<td class="opt-cell"><?php echo get_text($opt_1); if ($opt_2_len) echo ' <small>&gt;</small> '.get_text($opt_2); if ($opt_3_len) echo ' <small>&gt;</small> '.get_text($opt_3); ?></td>
<td class="opt-cell"><?php echo $opt_1; if ($opt_2_len) echo ' <small>&gt;</small> '.$opt_2; if ($opt_3_len) echo ' <small>&gt;</small> '.$opt_3; ?></td>
<td class="td_numsmall">
<label for="opt_price_<?php echo $i; ?>" class="sound_only"></label>
<input type="text" name="opt_price[]" value="<?php echo $opt_price; ?>" id="opt_price_<?php echo $i; ?>" class="frm_input" size="9">

View File

@ -79,9 +79,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
$selected = ($row1['ca_id'] == $sca) ? ' selected="selected"' : '';
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -83,9 +83,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -82,9 +82,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -170,16 +170,13 @@ function fitemstocksms_submit(f)
return false;
}
var action = document.pressed;
switch (action) {
case "선택삭제":
return confirm("선택한 자료를 정말 삭제하시겠습니까?");
case "선택SMS전송":
return confirm("선택한 자료에 대해서 SMS로 재입고 알림을 전송하시겠습니까?");
default:
return true;
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>

View File

@ -55,12 +55,12 @@ if($ps_run) {
?>
<tr>
<td class="td_chk">
<input type="hidden" name="spl_id[]" value="<?php echo get_text($spl_id); ?>">
<label for="spl_chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($spl_subject.' '.$spl); ?></label>
<input type="hidden" name="spl_id[]" value="<?php echo $spl_id; ?>">
<label for="spl_chk_<?php echo $i; ?>" class="sound_only"><?php echo $spl_subject.' '.$spl; ?></label>
<input type="checkbox" name="spl_chk[]" id="spl_chk_<?php echo $i; ?>" value="1">
</td>
<td class="spl-subject-cell"><?php echo get_text($spl_subject); ?></td>
<td class="spl-cell"><?php echo get_text($spl); ?></td>
<td class="spl-subject-cell"><?php echo $spl_subject; ?></td>
<td class="spl-cell"><?php echo $spl; ?></td>
<td class="td_numsmall">
<label for="spl_price_<?php echo $i; ?>" class="sound_only">상품금액</label>
<input type="text" name="spl_price[]" value="<?php echo $spl_price; ?>" id="spl_price_<?php echo $i; ?>" class="frm_input" size="5">

View File

@ -98,9 +98,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$category_path.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].PHP_EOL;
}
?>
</select>

View File

@ -81,9 +81,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
$selected = ($row1['ca_id'] == $sca) ? ' selected="selected"' : '';
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$category_path.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -84,9 +84,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$category_path.'</option>'.PHP_EOL;
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
}
?>
</select>

View File

@ -20,7 +20,7 @@ $od_refund_price = isset($_REQUEST['od_refund_price']) ? clean_xss_tags($_REQUES
$od_receipt_point = isset($_REQUEST['od_receipt_point']) ? clean_xss_tags($_REQUEST['od_receipt_point'], 1, 1) : '';
$od_coupon = isset($_REQUEST['od_coupon']) ? clean_xss_tags($_REQUEST['od_coupon'], 1, 1) : '';
$od_id = isset($_REQUEST['od_id']) ? safe_replace_regex($_REQUEST['od_id'], 'od_id') : '';
$od_escrow = isset($_REQUEST['od_escrow']) ? clean_xss_tags($_REQUEST['od_escrow'], 1, 1) : '';
$od_escrow = isset($_REQUEST['od_escrow']) ? clean_xss_tags($_REQUEST['od_escrow'], 1, 1) : '';
$sort1 = isset($_REQUEST['sort1']) ? clean_xss_tags($_REQUEST['sort1'], 1, 1) : '';
$sort2 = isset($_REQUEST['sort2']) ? clean_xss_tags($_REQUEST['sort2'], 1, 1) : '';
@ -68,7 +68,8 @@ $sql = " select it_id,
cp_price,
ct_notax,
ct_send_cost,
it_sc_type
it_sc_type,
ct_id
from {$g5['g5_shop_cart_table']}
where od_id = '{$od['od_id']}'
group by it_id
@ -107,10 +108,20 @@ if($od['od_pg'] == 'lg') {
}
}
$print_od_deposit_name = $od['od_deposit_name'];
// nicepay 로 주문하고 가상계좌인 경우
if ($od['od_pg'] === 'nicepay' && $od['od_settle_case'] === '가상계좌' && $od['od_deposit_name']){
$print_od_deposit_name .= '_NICE';
}
// add_javascript('js 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
?>
<style>
#sodr_qty_log {padding-left: 0px; padding-right: 0px;}
.od_test_caution {border-radius: 0px;}
strong.sodr_nonpay {border-radius: 0px;}
</style>
<section id="anc_sodr_list">
<h2 class="h2_frm">주문상품 목록</h2>
<?php echo $pg_anchor; ?>
@ -119,8 +130,6 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
현재 주문상태 <strong><?php echo $od['od_status'] ?></strong>
|
주문일시 <strong><?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>)</strong>
|
주문총액 <strong><?php echo number_format($od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원
</p>
<?php if ($default['de_hope_date_use']) { ?><p>희망배송일은 <?php echo $od['od_hope_date']; ?> (<?php echo get_yoil($od['od_hope_date']); ?>) 입니다.</p><?php } ?>
<?php if($od['od_mobile']) { ?>
@ -156,9 +165,20 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="col">소계</th>
<th scope="col">쿠폰</th>
<th scope="col">포인트</th>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<th scope="col">배송비</th>
<?php } ?>
<th scope="col">포인트반영</th>
<th scope="col">재고반영</th>
<!-- 20241018 리빌더 추가 { -->
<?php if(isset($pa['pa_is']) && $pa['pa_is'] == 1) { ?>
<th scope="col">운송장번호</th>
<th scope="col">배송사</th>
<th scope="col">배송일시</th>
<?php } ?>
<!-- } -->
</tr>
</thead>
<tbody>
@ -167,22 +187,47 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
for($i=0; $row=sql_fetch_array($result); $i++) {
// 상품이미지
$image = get_it_image($row['it_id'], 50, 50);
// 상품의 옵션정보
$sql = " select ct_id, it_id, ct_price, ct_point, ct_qty, ct_option, ct_status, cp_price, ct_stock_use, ct_point_use, ct_send_cost, io_type, io_price
if(isset($pa['pa_is']) && $pa['pa_is'] == 1) {
$sql = " select ct_id, it_id, ct_price, ct_point, ct_qty, ct_option, ct_status, cp_price, ct_stock_use, ct_point_use, ct_send_cost, io_type, io_price, ct_delivery_company, ct_invoice, ct_invoice_time
from {$g5['g5_shop_cart_table']}
where od_id = '{$od['od_id']}'
and it_id = '{$row['it_id']}'
order by io_type asc, ct_id asc ";
$res = sql_query($sql);
$res = sql_query($sql);
} else {
$sql = " select ct_id, it_id, ct_price, ct_point, ct_qty, ct_option, ct_status, cp_price, ct_stock_use, ct_point_use, ct_send_cost, io_type, io_price
from {$g5['g5_shop_cart_table']}
where od_id = '{$od['od_id']}'
and it_id = '{$row['it_id']}'
order by io_type asc, ct_id asc ";
$res = sql_query($sql);
}
$rowspan = sql_num_rows($res);
if (isset($rb_item_res['res_is']) && $rb_item_res['res_is'] == 1) {
$resv = sql_fetch("SELECT * FROM {$g5['g5_shop_cart_table']} WHERE ct_id = '{$row['ct_id']}' ");
}
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_qty) as qty
from {$g5['g5_shop_cart_table']}
where it_id = '{$row['it_id']}'
and od_id = '{$od['od_id']}' ";
$price_calc = "((ct_price + io_price) * ct_qty)";
if (isset($rb_item_res['res_is']) && $rb_item_res['res_is'] == 1 && isset($resv['ct_types']) && $resv['ct_types'] == 1) {
$price_calc = "((ct_price + io_price) * ct_qty * ct_date_d +
(COALESCE(ct_user_pri1, 0) * COALESCE(ct_user_qty1, 0)) +
(COALESCE(ct_user_pri2, 0) * COALESCE(ct_user_qty2, 0)) +
(COALESCE(ct_user_pri3, 0) * COALESCE(ct_user_qty3, 0)))";
}
$sql = "SELECT SUM(IF(io_type = 1, (io_price * ct_qty), $price_calc)) AS price,
SUM(ct_point * ct_qty) AS point,
SUM(ct_qty) AS qty
FROM {$g5['g5_shop_cart_table']}
WHERE it_id = '{$row['it_id']}'
AND od_id = '{$od['od_id']}'";
$sum = sql_fetch($sql);
// 배송비
@ -214,8 +259,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
$opt_price = $opt['ct_price'] + $opt['io_price'];
// 소계
$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
//$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
$ct_price['stotal'] = $sum['price'];
$ct_point['stotal'] = $opt['ct_point'] * $opt['ct_qty'];
?>
<tr>
<?php if($k == 0) { ?>
@ -233,6 +280,15 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="checkbox" name="ct_chk[<?php echo $chk_cnt; ?>]" id="ct_chk_<?php echo $chk_cnt; ?>" value="<?php echo $chk_cnt; ?>" class="sct_sel_<?php echo $i; ?>">
<input type="hidden" name="ct_id[<?php echo $chk_cnt; ?>]" value="<?php echo $opt['ct_id']; ?>">
<?php echo get_text($opt['ct_option']); ?>
<?php
//예약정보 로드
if(isset($rb_item_res['res_is']) && $rb_item_res['res_is'] == 1) {
if(isset($resv['ct_types']) && $resv['ct_types'] == 1) {
include (G5_PATH.'/rb/rb.mod/reservation/info.inc.php');
}
}
?>
</td>
<td class="td_mngsmall"><?php echo $opt['ct_status']; ?></td>
<td class="td_num">
@ -243,9 +299,49 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<td class="td_num_right"><?php echo number_format($ct_price['stotal']); ?></td>
<td class="td_num_right"><?php echo number_format($opt['cp_price']); ?></td>
<td class=" td_num_right"><?php echo number_format($ct_point['stotal']); ?></td>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<td class="td_sendcost_by"><?php echo $ct_send_cost; ?></td>
<td class="td_mngsmall"><?php echo get_yn($opt['ct_point_use']); ?></td>
<td class="td_mngsmall"><?php echo get_yn($opt['ct_stock_use']); ?></td>
<?php } ?>
<td class=""><?php echo get_yn($opt['ct_point_use']); ?></td>
<td class=""><?php echo get_yn($opt['ct_stock_use']); ?></td>
<!-- 20241018 리빌더 추가 { -->
<?php if(isset($pa['pa_is']) && $pa['pa_is'] == 1) { ?>
<td class=""><input type="text" name="ct_invoice[<?php echo $chk_cnt; ?>]" value="<?php echo $opt['ct_invoice']; ?>" id="ct_invoice_<?php echo $chk_cnt; ?>" class="frm_input"></td>
<td class="">
<input type="text" name="ct_delivery_company[<?php echo $chk_cnt; ?>]" id="ct_delivery_company_<?php echo $chk_cnt; ?>" value="<?php echo $opt['ct_delivery_company']; ?>" class="frm_input" style="width:60%;">
<input type="checkbox" id="ct_delivery_chk_<?php echo $chk_cnt; ?>" value="<?php echo $default['de_delivery_company']; ?>" onclick="chk_delivery_company_<?php echo $chk_cnt; ?>()">
<label for="ct_delivery_chk_<?php echo $chk_cnt; ?>">기본</label>
<script>
function chk_delivery_company_<?php echo $chk_cnt; ?>()
{
var chk_<?php echo $chk_cnt; ?> = document.getElementById("ct_delivery_chk_<?php echo $chk_cnt; ?>");
var company_<?php echo $chk_cnt; ?> = document.getElementById("ct_delivery_company_<?php echo $chk_cnt; ?>");
company_<?php echo $chk_cnt; ?>.value = chk_<?php echo $chk_cnt; ?>.checked ? chk_<?php echo $chk_cnt; ?>.value : company_<?php echo $chk_cnt; ?>.defaultValue;
}
</script>
</td>
<td class="">
<input type="text" name="ct_invoice_time[<?php echo $chk_cnt; ?>]" id="ct_invoice_time_<?php echo $chk_cnt; ?>" value="<?php echo is_null_time($opt['ct_invoice_time']) ? "" : $opt['ct_invoice_time']; ?>" class="frm_input" maxlength="19" style="width:60%;">
<input type="checkbox" id="ct_invoice_chk_<?php echo $chk_cnt; ?>" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="chk_invoice_time_<?php echo $chk_cnt; ?>()">
<label for="ct_invoice_chk_<?php echo $chk_cnt; ?>">현재</label>
<script>
function chk_invoice_time_<?php echo $chk_cnt; ?>()
{
var chk_<?php echo $chk_cnt; ?> = document.getElementById("ct_invoice_chk_<?php echo $chk_cnt; ?>");
var time_<?php echo $chk_cnt; ?> = document.getElementById("ct_invoice_time_<?php echo $chk_cnt; ?>");
time_<?php echo $chk_cnt; ?>.value = chk_<?php echo $chk_cnt; ?>.checked ? chk_<?php echo $chk_cnt; ?>.value : time_<?php echo $chk_cnt; ?>.defaultValue;
}
</script>
</td>
<?php } ?>
<!-- } -->
</tr>
<?php
$chk_cnt++;
@ -264,20 +360,19 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<strong>주문 및 장바구니 상태 변경</strong>
<input type="submit" name="ct_status" value="주문" onclick="document.pressed=this.value" class="btn_02 color_01">
<input type="submit" name="ct_status" value="입금" onclick="document.pressed=this.value" class="btn_02 color_02">
<!--
<input type="submit" name="ct_status" value="준비" onclick="document.pressed=this.value" class="btn_02 color_03">
<input type="submit" name="ct_status" value="배송" onclick="document.pressed=this.value" class="btn_02 color_04">
-->
<input type="submit" name="ct_status" value="완료" onclick="document.pressed=this.value" class="btn_02 color_05">
<?php if( $od['od_status'] != "완료" || $is_admin) { // 완료라면 취소, 반품을 출력하지 않음
?>
<input type="submit" name="ct_status" value="취소" onclick="document.pressed=this.value" class="btn_02 color_06">
<input type="submit" name="ct_status" value="반품" onclick="document.pressed=this.value" class="btn_02 color_06">
<input type="submit" name="ct_status" value="품절" onclick="document.pressed=this.value" class="btn_02 color_06">
<?php } ?>
</p>
</div>
<div class="local_desc01 local_desc">
<p>주문, 입금, 준비, 배송, 완료는 장바구니와 주문서 상태를 모두 변경하지만, 취소, 반품, 품절은 장바구니의 상태만 변경하며, 주문서 상태는 변경하지 않습니다.</p>
<p>주문, 입금, 완료는 장바구니와 주문서 상태를 모두 변경하지만, 취소, 반품, 품절은 장바구니의 상태만 변경하며, 주문서 상태는 변경하지 않습니다.</p>
<p>개별적인(이곳에서의) 상태 변경은 모든 작업을 수동으로 처리합니다. 예를 들어 주문에서 입금으로 상태 변경시 입금액(결제금액)을 포함한 모든 정보는 수동 입력으로 처리하셔야 합니다.</p>
</div>
@ -303,7 +398,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
if(isset($tmp_row['P_TID']) && $tmp_row['P_TID']){
?>
<div class="od_test_caution">주의) 이 주문은 결제취소된 내역이 있습니다. 이니시스 관리자 상점에서 반드시 재확인을 해 주세요.</div>
<?php
<?php
} //end if
} //end if
?>
@ -345,7 +440,9 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="col">주문번호</th>
<th scope="col">결제방법</th>
<th scope="col">주문총액</th>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<th scope="col">배송비</th>
<?php } ?>
<th scope="col">포인트결제</th>
<th scope="col">총결제액</th>
<th scope="col">쿠폰</th>
@ -357,7 +454,9 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<td><?php echo $od['od_id']; ?></td>
<td class="td_paybybig"><?php echo $s_receipt_way; ?></td>
<td class="td_numbig td_numsum"><?php echo display_price($amount['order']); ?></td>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<td class="td_numbig"><?php echo display_price($od['od_send_cost'] + $od['od_send_cost2']); ?></td>
<?php } ?>
<td class="td_numbig"><?php echo display_point($od['od_receipt_point']); ?></td>
<td class="td_numbig td_numincome"><?php echo number_format($amount['receipt']); ?>원</td>
<td class="td_numbig td_numcoupon"><?php echo display_price($amount['coupon']); ?></td>
@ -411,7 +510,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<tr>
<th scope="row">입금자</th>
<td><?php echo get_text($od['od_deposit_name']); ?></td>
<td><?php echo get_text($print_od_deposit_name); ?></td>
</tr>
<tr>
<th scope="row">입금확인일시</th>
@ -522,6 +621,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
$pg_url = 'https://mms.cnspay.co.kr';
$pg_test = 'KAKAOPAY';
break;
case 'nicepay':
$pg_url = 'https://npg.nicepay.co.kr/';
$pg_test = 'NICEPAY';
break;
default:
$pg_url = 'http://admin8.kcp.co.kr';
$pg_test = 'KCP';
@ -568,20 +671,30 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="row">결제취소/환불액</th>
<td><?php echo display_price($od['od_refund_price']); ?></td>
</tr>
<?php if ($od['od_invoice']) { ?>
<tr>
<th scope="row">배송회사</th>
<td><?php echo $od['od_delivery_company']; ?> <?php echo get_delivery_inquiry($od['od_delivery_company'], $od['od_invoice'], 'dvr_link'); ?></td>
</tr>
<tr>
<th scope="row">운송장번호</th>
<td><?php echo $od['od_invoice']; ?></td>
</tr>
<tr>
<th scope="row">배송일시</th>
<td><?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?></td>
</tr>
<!-- 20241018 리빌더 수정 { -->
<?php if(isset($pa['pa_is']) && $pa['pa_is'] == 1) { ?>
<?php } else { ?>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<?php if ($od['od_invoice']) { ?>
<tr>
<th scope="row">배송회사</th>
<td><?php echo $od['od_delivery_company']; ?> <?php echo get_delivery_inquiry($od['od_delivery_company'], $od['od_invoice'], 'dvr_link'); ?></td>
</tr>
<tr>
<th scope="row">운송장번호</th>
<td><?php echo $od['od_invoice']; ?></td>
</tr>
<tr>
<th scope="row">배송일시</th>
<td><?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?></td>
</tr>
<?php } ?>
<?php } ?>
<?php } ?>
<!-- } -->
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<tr>
<th scope="row"><label for="od_send_cost">배송비</label></th>
<td>
@ -600,6 +713,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="text" name="od_send_cost2" value="<?php echo $od['od_send_cost2']; ?>" id="od_send_cost2" class="frm_input" size="10"> 원
</td>
</tr>
<?php } ?>
<?php
if ($od['od_misu'] == 0 && $od['od_receipt_price'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '가상계좌' || $od['od_settle_case'] == '계좌이체')) {
?>
@ -626,6 +740,18 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
} else if($od['od_pg'] == 'inicis') {
$cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($od['od_pg'] == 'nicepay') {
$od_tid = $od['od_tno'];
$cash_type = 0;
if (! $od_tid) {
$cash = unserialize($od['od_cash_info']);
$od_tid = isset($cash['TID']) ? $cash['TID'] : '';
$cash_type = $od_tid ? 1 : 0;
}
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type='.$cash_type.'&TID='.$od_tid.'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
require G5_SHOP_PATH.'/settle_kcp.inc.php';
@ -695,11 +821,11 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<tr>
<th scope="row"><label for="od_deposit_name">입금자명</label></th>
<td>
<?php if ($config['cf_sms_use'] && $default['de_sms_use4']) { ?>
<input type="checkbox" name="od_sms_ipgum_check" id="od_sms_ipgum_check">
<label for="od_sms_ipgum_check">SMS 입금 문자전송</label>
<label for="od_sms_ipgum_check">SMS 입금 문자 및 알림전송</label>
<br>
<?php } ?>
<input type="text" name="od_deposit_name" value="<?php echo get_text($od['od_deposit_name']); ?>" id="od_deposit_name" class="frm_input">
</td>
</tr>
@ -799,14 +925,21 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="text" name="od_refund_price" value="<?php echo $od['od_refund_price']; ?>" id="od_refund_price" class="frm_input" size="10"> 원
</td>
</tr>
<!-- 20241018 리빌더 수정 { -->
<?php if(isset($pa['pa_is']) && $pa['pa_is'] == 1) { ?>
<?php } else { ?>
<?php if ((!isset($rb_item_res['res_is'])) || $rb_item_res['res_is'] != 1) { ?>
<tr>
<th scope="row"><label for="od_invoice">운송장번호</label></th>
<td>
<?php if ($config['cf_sms_use'] && $default['de_sms_use5']) { ?>
<input type="checkbox" name="od_sms_baesong_check" id="od_sms_baesong_check">
<label for="od_sms_baesong_check">SMS 배송 문자전송</label>
<label for="od_sms_baesong_check">SMS 배송 문자 및 알림전송</label>
<br>
<?php } ?>
<input type="text" name="od_invoice" value="<?php echo $od['od_invoice']; ?>" id="od_invoice" class="frm_input">
</td>
</tr>
@ -826,17 +959,23 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="text" name="od_invoice_time" id="od_invoice_time" value="<?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?>" class="frm_input" maxlength="19">
</td>
</tr>
<?php } ?>
<?php if ($config['cf_email_use']) { ?>
<tr>
<th scope="row"><label for="od_send_mail">메일발송</label></th>
<td>
<?php echo help("주문자님께 입금, 배송내역을 메일로 발송합니다.\n메일발송시 상점메모에 기록됩니다."); ?>
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail"> 메일발송
</td>
</tr>
<tr>
<th scope="row"><label for="od_send_mail">메일발송</label></th>
<td>
<?php echo help("주문자님께 입금, 배송내역을 메일로 발송합니다.\n메일발송시 상점메모에 기록됩니다."); ?>
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail"> 메일발송
</td>
</tr>
<?php } ?>
<?php } ?>
<!-- } -->
</tbody>
</table>
</div>
@ -889,7 +1028,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</section>
<section>
<h2 class="h2_frm">주문자/배송지 정보</h2>
<h2 class="h2_frm">주문자/사용자 정보</h2>
<?php echo $pg_anchor; ?>
<form name="frmorderform3" action="./orderformupdate.php" method="post">
@ -904,11 +1043,11 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<div class="compare_wrap">
<section id="anc_sodr_orderer" class="compare_left">
<h3>주문하신 분</h3>
<h3>주문자 정보</h3>
<div class="tbl_frm01">
<table>
<caption>주문자/배송지 정보</caption>
<caption>주문자 정보</caption>
<colgroup>
<col class="grid_4">
<col>
@ -938,8 +1077,8 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<input type="text" name="od_addr2" value="<?php echo get_text($od['od_addr2']); ?>" id="od_addr2" class="frm_input" size="35">
<label for="od_addr2">상세주소</label>
<br>
<input type="text" name="od_addr3" value="<?php echo get_text($od['od_addr3']); ?>" id="od_addr3" class="frm_input" size="35">
<label for="od_addr3">참고항목</label>
<input type="text" name="od_addr3" value="<?php echo get_text($od['od_addr3']); ?>" id="od_addr3" class="frm_input" size="35"><br>
<input type="hidden" name="od_addr_jibeon" value="<?php echo get_text($od['od_addr_jibeon']); ?>"><br>
</td>
</tr>
@ -954,14 +1093,14 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tbody>
</table>
</div>
</section>
<section id="anc_sodr_taker" class="compare_right">
<h3>받으시는 분</h3>
<br><br>
<h3>사용자(수령자) 정보</h3>
<div class="tbl_frm01">
<table>
<caption>받으시는 분 정보</caption>
<caption>사용자(수령자) 정보</caption>
<colgroup>
<col class="grid_4">
<col>
@ -985,13 +1124,12 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<label for="od_b_zip" class="sound_only">우편번호</label>
<input type="text" name="od_b_zip" value="<?php echo get_text($od['od_b_zip1']).get_text($od['od_b_zip2']); ?>" id="od_b_zip" required class="frm_input required" size="5">
<button type="button" class="btn_frmline" onclick="win_zip('frmorderform3', 'od_b_zip', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon');">주소 검색</button><br>
<input type="text" name="od_b_addr1" value="<?php echo get_text($od['od_b_addr1']); ?>" id="od_b_addr1" required class="frm_input required" size="35">
<label for="od_b_addr1">기본주소</label>
<input type="text" name="od_b_addr2" value="<?php echo get_text($od['od_b_addr2']); ?>" id="od_b_addr2" class="frm_input" size="35">
<label for="od_b_addr2">상세주소</label>
<input type="text" name="od_b_addr3" value="<?php echo get_text($od['od_b_addr3']); ?>" id="od_b_addr3" class="frm_input" size="35">
<label for="od_b_addr3">참고항목</label>
<input type="hidden" name="od_b_addr_jibeon" value="<?php echo get_text($od['od_b_addr_jibeon']); ?>"><br>
<input type="text" name="od_b_addr1" value="<?php echo get_text($od['od_b_addr1']); ?>" id="od_b_addr1" required class="frm_input required" size="35" style="margin-top:5px;">
<label for="od_b_addr1">기본주소</label><br>
<input type="text" name="od_b_addr2" value="<?php echo get_text($od['od_b_addr2']); ?>" id="od_b_addr2" class="frm_input" size="35" style="margin-top:5px;">
<label for="od_b_addr2">상세주소</label><br>
<input type="text" name="od_b_addr3" value="<?php echo get_text($od['od_b_addr3']); ?>" id="od_b_addr3" class="frm_input" size="35" style="margin-top:5px;">
<input type="hidden" name="od_b_addr_jibeon" value="<?php echo get_text($od['od_b_addr_jibeon']); ?>">
</td>
</tr>
@ -1013,6 +1151,41 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</div>
</section>
<section id="anc_sodr_taker" class="compare_right">
<?php
if (isset($rb_item_res['res_is']) && $rb_item_res['res_is'] == 1) {
$resv = sql_fetch("SELECT ct_user_qty1 FROM {$g5['g5_shop_cart_table']} WHERE od_id = '{$od['od_id']}' AND ct_select = '1' LIMIT 1");
$ct_user_qty1 = (int)$resv['ct_user_qty1'];
if(isset($ct_user_qty1) && $ct_user_qty1 > 0) {
$names = explode('|', $od['od_names']);
$hps = explode('|', $od['od_hps']);
if($names[0]) {
?>
<section id="sod_fin_receiver">
<h3>추가사용자 정보</h3>
<div class="tbl_head01 tbl_wrap">
<table>
<tbody>
<?php for($i = 0; $i < $ct_user_qty1; $i++) { ?>
<tr>
<th scope="row">사용자 <?php echo $i+1 ?></th>
<td><?php echo get_text($names[$i] ?? ''); ?> / <?php echo get_text($hps[$i] ?? ''); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</section>
<?php } ?>
<?php } ?>
<?php } ?>
</section>
</div>
<div class="btn_confirm01 btn_confirm">
@ -1078,7 +1251,7 @@ function form_submit(f)
var msg = "";
<?php if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == 'KAKAOPAY' || $od['od_settle_case'] == '간편결제' || ($od['od_pg'] == 'inicis' && is_inicis_order_pay($od['od_settle_case']) )) { ?>
<?php if (is_cancel_shop_pg_order($od)) { ?>
if(status == "취소" || status == "반품" || status == "품절") {
var $ct_chk = $("input[name^=ct_chk]");
var chk_cnt = $ct_chk.length;
@ -1143,4 +1316,4 @@ function chk_receipt_price()
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
include_once(G5_ADMIN_PATH.'/admin.tail.php');

View File

@ -251,10 +251,6 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$pg_res_msg = $xpay->Response_Msg();
}
break;
case 'toss':
$cancel_msg = '쇼핑몰 운영자 승인 취소';
include_once(G5_SHOP_PATH.'/toss/toss_cancel.php');
break;
case 'inicis':
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
$cancel_msg = '쇼핑몰 운영자 승인 취소';

View File

@ -160,11 +160,11 @@ if( function_exists('pg_setting_check') ){
</div>
<form name="frmorderlist" class="local_sch01 local_sch">
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="save_search" value="<?php echo $search; ?>">
<input type="hidden" name="doc" value="<?php echo get_sanitize_input($doc); ?>">
<input type="hidden" name="sort1" value="<?php echo get_sanitize_input($sort1); ?>">
<input type="hidden" name="sort2" value="<?php echo get_sanitize_input($sort2); ?>">
<input type="hidden" name="page" value="<?php echo get_sanitize_input($page); ?>">
<input type="hidden" name="save_search" value="<?php echo get_sanitize_input($search); ?>">
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">

View File

@ -1,27 +0,0 @@
<?
$sub_menu = "800100";
include_once("./_common.php");
$current_status = $od_id = 0; // 변수 초기화
// orderlist_ticket.php 에서 가져온거 넣어줌
$current_status = $_GET['st'];
$od_id = $_GET['od_id'];
// 조건문 시작
if($_GET['bo']=="u" && $current_status === '입금') { //사용처리
change_status($od_id, '입금', '완료'); // 완료처리하고
// cart table에도 완료처리 시키고
$sql2 = " select it_id from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_status = '완료' group by it_id ";
$result2 = sql_query($sql2);
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
$sql3 = " select sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where it_id = '{$row2['it_id']}' and ct_status = '완료' ";
$row3 = sql_fetch($sql3);
$sql4 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row2['it_id']}' ";
sql_query($sql4);
}
} // end if
goto_url("./orderlist_ticket.php"); //이전 url로 보내기
?>

View File

@ -210,8 +210,6 @@ if(!sql_query(" select pp_cash from {$g5['g5_shop_personalpay_table']} limit 1 "
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$pp['pp_id'].'\',\''.$pp['pp_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} else if($pp['pp_pg'] == 'toss') {
$cash_receipt_script = 'window.open(\'https://dashboard.tosspayments.com/receipt/mids/si_'.$config['cf_lg_mid'].'/orders/'.$pp['pp_id'].'/cash-receipt?ref=dashboard\',\'receipt\',\'width=430,height=700\');';
} else if($pp['pp_pg'] == 'inicis') {
$cash = unserialize($pp['pp_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';

View File

@ -71,9 +71,7 @@ $listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목
$len = strlen($row1['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++) $nbsp .= "&nbsp;&nbsp;&nbsp;";
// 전체 카테고리 경로 표시
$category_path = function_exists('get_shop_category_path') ? get_shop_category_path($row1['ca_id']) : $row1['ca_name'];
echo "<option value='{$row1['ca_id']}'".get_selected($row1['ca_id'], $sel_ca_id).">$nbsp{$category_path}\n";
echo "<option value='{$row1['ca_id']}'".get_selected($row1['ca_id'], $sel_ca_id).">$nbsp{$row1['ca_name']}\n";
}
?>
</select>

View File

@ -5,16 +5,6 @@ include_once(G5_ADMIN_PATH.'/admin.lib.php');
include_once(G5_SMS5_PATH.'/sms5.lib.php');
if (!strstr($_SERVER['SCRIPT_NAME'], 'install.php')) {
// SMS5 테이블 G5_TABLE_PREFIX 적용
if($g5['sms5_prefix'] != 'sms5_' && sql_num_rows(sql_query("show tables like 'sms5_config'")))
{
echo '<script>
alert("기존 SMS5 테이블을 sms5 prefix 기준으로 변경합니다.\n(DB 업그레이드에서 자동 적용됩니다.)");
location.href = "'.G5_ADMIN_URL.'/dbupgrade.php";
</script>';
exit;
}
if(!sql_num_rows(sql_query(" show tables like '{$g5['sms5_config_table']}' ")))
goto_url('install.php');

View File

@ -14,9 +14,7 @@ if($config['cf_visit_del'] > 0) {
$tmp_before_date = date("Y-m-d", G5_SERVER_TIME - ($config['cf_visit_del'] * 86400));
$sql = " delete from {$g5['visit_table']} where vi_date < '$tmp_before_date' ";
sql_query($sql);
if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) {
sql_query(" OPTIMIZE TABLE `{$g5['visit_table']}`, `{$g5['visit_sum_table']}` ");
}
sql_query(" OPTIMIZE TABLE `{$g5['visit_table']}`, `{$g5['visit_sum_table']}` ");
}
// 설정일이 지난 인기검색어 삭제
@ -24,9 +22,7 @@ if($config['cf_popular_del'] > 0) {
$tmp_before_date = date("Y-m-d", G5_SERVER_TIME - ($config['cf_popular_del'] * 86400));
$sql = " delete from {$g5['popular_table']} where pp_date < '$tmp_before_date' ";
sql_query($sql);
if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) {
sql_query(" OPTIMIZE TABLE `{$g5['popular_table']}` ");
}
sql_query(" OPTIMIZE TABLE `{$g5['popular_table']}` ");
}
// 설정일이 지난 최근게시물 삭제
@ -40,9 +36,7 @@ if($config['cf_new_del'] > 0) {
if($config['cf_memo_del'] > 0) {
$sql = " delete from {$g5['memo_table']} where (TO_DAYS('".G5_TIME_YMDHIS."') - TO_DAYS(me_send_datetime)) > '{$config['cf_memo_del']}' ";
sql_query($sql);
if (defined('G5_USE_OPTIMIZE_DBTABLE') && G5_USE_OPTIMIZE_DBTABLE) {
sql_query(" OPTIMIZE TABLE `{$g5['memo_table']}` ");
}
sql_query(" OPTIMIZE TABLE `{$g5['memo_table']}` ");
}
// 탈퇴회원 자동 삭제
@ -71,8 +65,4 @@ if($captcha_mp3 && is_array($captcha_mp3)) {
// 실행일 기록
if(isset($config['cf_optimize_date'])) {
sql_query(" update {$g5['config_table']} set cf_optimize_date = '".G5_TIME_YMD."' ");
run_event('cf_optimize_date_update', $config);
}
run_event('db_table_optimize_end', $config);
}

View File

@ -40,12 +40,6 @@ if ($type) {
else
$mail_content = $content;
// 환경설정에서 폼메일 사용 여부가 회원만 사용에 체크되어 있으면
if ($config['cf_formmail_is_member']) {
$fnick = (isset($member['mb_nick']) && $member['mb_nick']) ? $member['mb_nick'] : $member['mb_name'];
$fmail = $member['mb_email'];
}
mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file);
// 임시 첨부파일 삭제

View File

@ -20,7 +20,7 @@ $me_id = isset($_REQUEST['me_id']) ? clean_xss_tags($_REQUEST['me_id']
if ($me_recv_mb_id)
{
$mb = get_member($me_recv_mb_id);
if (!(isset($mb['mb_id']) && $mb['mb_id']))
if (!$mb['mb_id'])
alert_close('회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.');
if (!$mb['mb_open'] && $is_admin != 'super')

View File

@ -86,7 +86,6 @@ $qa_related = 0;
$qa_email_recv = (isset($_POST['qa_email_recv']) && $_POST['qa_email_recv']) ? 1 : 0;
$qa_sms_recv = (isset($_POST['qa_sms_recv']) && $_POST['qa_sms_recv']) ? 1 : 0;
$qa_status = 0;
$qa_html = (isset($_POST['qa_html']) && $_POST['qa_html']) ? (int) $_POST['qa_html'] : 0;
$answer_id = null;
for ($i=1; $i<=5; $i++) {

View File

@ -50,8 +50,8 @@ $mb_addr_jibeon = isset($_POST['mb_addr_jibeon']) ? trim($_POST['mb_addr_jibeo
$mb_signature = isset($_POST['mb_signature']) ? trim($_POST['mb_signature']) : "";
$mb_profile = isset($_POST['mb_profile']) ? trim($_POST['mb_profile']) : "";
$mb_recommend = isset($_POST['mb_recommend']) ? trim($_POST['mb_recommend']) : "";
$mb_mailling = isset($_POST['mb_mailling']) ? trim($_POST['mb_mailling']) : "0";
$mb_sms = isset($_POST['mb_sms']) ? trim($_POST['mb_sms']) : "0";
$mb_mailling = isset($_POST['mb_mailling']) ? trim($_POST['mb_mailling']) : "";
$mb_sms = isset($_POST['mb_sms']) ? trim($_POST['mb_sms']) : "";
$mb_open = isset($_POST['mb_open']) ? trim($_POST['mb_open']) : "0";
$mb_1 = isset($_POST['mb_1']) ? trim($_POST['mb_1']) : "";
$mb_2 = isset($_POST['mb_2']) ? trim($_POST['mb_2']) : "";
@ -63,7 +63,8 @@ $mb_7 = isset($_POST['mb_7']) ? trim($_POST['mb_7'])
$mb_8 = isset($_POST['mb_8']) ? trim($_POST['mb_8']) : "";
$mb_9 = isset($_POST['mb_9']) ? trim($_POST['mb_9']) : "";
$mb_10 = isset($_POST['mb_10']) ? trim($_POST['mb_10']) : "";
$mb_name = clean_xss_tags($mb_name, 1, 1);
$mb_name = clean_xss_tags($mb_name);
$mb_email = get_email_address($mb_email);
$mb_homepage = clean_xss_tags($mb_homepage);
$mb_tel = clean_xss_tags($mb_tel);
@ -74,9 +75,6 @@ $mb_addr2 = clean_xss_tags($mb_addr2);
$mb_addr3 = clean_xss_tags($mb_addr3);
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
$mb_marketing_agree = isset($_POST['mb_marketing_agree']) ? trim($_POST['mb_marketing_agree']) : "0";
$mb_thirdparty_agree = isset($_POST['mb_thirdparty_agree']) ? trim($_POST['mb_thirdparty_agree']) : "0";
run_event('register_form_update_before', $mb_id, $w);
if ($w == '' || $w == 'u') {
@ -252,46 +250,12 @@ if ($w == '') {
mb_7 = '{$mb_7}',
mb_8 = '{$mb_8}',
mb_9 = '{$mb_9}',
mb_10 = '{$mb_10}',
mb_marketing_agree = '{$mb_marketing_agree}',
mb_thirdparty_agree = '{$mb_thirdparty_agree}'
mb_10 = '{$mb_10}'
{$sql_certify} ";
// 이메일 인증을 사용하지 않는다면 이메일 인증시간을 바로 넣는다
if (!$config['cf_use_email_certify'])
$sql .= " , mb_email_certify = '".G5_TIME_YMDHIS."' ";
$agree_items = [];
// 마케팅 목적의 개인정보 수집 및 이용
if ($mb_marketing_agree == 1) {
$sql .= " , mb_marketing_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "마케팅 목적의 개인정보 수집 및 이용(동의)";
}
// 광고성 이메일 수신
if ($mb_mailling == 1) {
$sql .= " , mb_mailling_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 이메일 수신(동의)";
}
// 광고성 SMS/카카오톡 수신
if ($mb_sms == 1) {
$sql .= " , mb_sms_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 SMS/카카오톡 수신(동의)";
}
// 개인정보 제3자 제공
if ($mb_thirdparty_agree == 1) {
$sql .= " , mb_thirdparty_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "개인정보 제3자 제공(동의)";
}
// 동의 로그 추가
if (!empty($agree_items)) {
$agree_log = "[".G5_TIME_YMDHIS.", 회원가입] " . implode(' | ', $agree_items) . "\n";
$sql .= " , mb_agree_log = CONCAT('{$agree_log}', IFNULL(mb_agree_log, ''))";
}
sql_query($sql);
// 회원가입 포인트 부여
@ -382,43 +346,6 @@ if ($w == '') {
if ($old_email != $mb_email && $config['cf_use_email_certify'])
$sql_email_certify = " , mb_email_certify = '' ";
$agree_items = [];
// 마케팅 목적의 개인정보 수집 및 이용
$sql_marketing_date = "";
if ($mb_marketing_agree_default !== $mb_marketing_agree) {
$sql_marketing_date .= " , mb_marketing_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "마케팅 목적의 개인정보 수집 및 이용(" . ($mb_marketing_agree == 1 ? "동의" : "철회") . ")";
}
// 광고성 이메일 수신
$sql_mailling_date = "";
if ($mb_mailling_default !== $mb_mailling) {
$sql_mailling_date .= " , mb_mailling_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 이메일 수신(" . ($mb_mailling == 1 ? "동의" : "철회") . ")";
}
// 광고성 SMS/카카오톡 수신
$sql_sms_date = "";
if ($mb_sms_default !== $mb_sms) {
$sql_sms_date .= " , mb_sms_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "광고성 SMS/카카오톡 수신(" . ($mb_sms == 1 ? "동의" : "철회") . ")";
}
// 개인정보 제3자 제공
$sql_thirdparty_date = "";
if ($mb_thirdparty_agree_default !== $mb_thirdparty_agree) {
$sql_thirdparty_date .= " , mb_thirdparty_date = '".G5_TIME_YMDHIS."' ";
$agree_items[] = "개인정보 제3자 제공(" . ($mb_thirdparty_agree == 1 ? "동의" : "철회") . ")";
}
// 동의 로그 추가
$sql_agree_log = "";
if (!empty($agree_items)) {
$agree_log = "[".G5_TIME_YMDHIS.", 회원 정보 수정] " . implode(' | ', $agree_items) . "\n";
$sql_agree_log .= " , mb_agree_log = CONCAT('{$agree_log}', IFNULL(mb_agree_log, ''))";
}
$sql = " update {$g5['member_table']}
set mb_nick = '{$mb_nick}',
mb_mailling = '{$mb_mailling}',
@ -444,19 +371,12 @@ if ($w == '') {
mb_7 = '{$mb_7}',
mb_8 = '{$mb_8}',
mb_9 = '{$mb_9}',
mb_10 = '{$mb_10}',
mb_marketing_agree = '{$mb_marketing_agree}',
mb_thirdparty_agree = '{$mb_thirdparty_agree}'
mb_10 = '{$mb_10}'
{$sql_password}
{$sql_nick_date}
{$sql_open_date}
{$sql_email_certify}
{$sql_certify}
{$sql_mailling_date}
{$sql_sms_date}
{$sql_marketing_date}
{$sql_thirdparty_date}
{$sql_agree_log}
where mb_id = '$mb_id' ";
sql_query($sql);

View File

@ -7,7 +7,7 @@ if ($is_guest && $board['bo_comment_level'] < 2) {
$captcha_html = captcha_html('_comment');
}
$c_id = isset($_GET['c_id']) ? preg_replace('/[\'",]/', '', clean_xss_tags($_GET['c_id'], 1, 1)) : '';
$c_id = isset($_GET['c_id']) ? clean_xss_tags($_GET['c_id'], 1, 1) : '';
$c_wr_content = '';
@include_once($board_skin_path.'/view_comment.head.skin.php');

View File

@ -346,10 +346,8 @@ if ($w == '') {
}
for($i=0;$i<$file_count;$i++){
if (!isset($file[$i])) {
if(! isset($file[$i])) {
$file[$i] = array('file'=>null, 'source'=>null, 'size'=>null, 'bf_content' => null);
} else {
$file[$i]['bf_content'] = isset($file[$i]['bf_content']) ? htmlspecialchars($file[$i]['bf_content'], ENT_QUOTES, 'UTF-8', false) : null;
}
}

View File

@ -173,7 +173,7 @@ define('G5_DIR_PERMISSION', 0755); // 디렉토리 생성시 퍼미션
define('G5_FILE_PERMISSION', 0644); // 파일 생성시 퍼미션
// 모바일 인지 결정 $_SERVER['HTTP_USER_AGENT']
define('G5_MOBILE_AGENT', 'phone|samsung.*mobile|lgtel|mobile|[^A]skt|nokia|blackberry|BB10|android|sony');
define('G5_MOBILE_AGENT', 'phone|samsung|lgtel|mobile|[^A]skt|nokia|blackberry|BB10|android|sony');
// SMTP
// lib/mailer.lib.php 에서 사용

View File

@ -55,16 +55,6 @@ border:1px solid #558ab7 !important;
#container_wr,
#ft_wr {width:1200px}
/* 공통 - display none/block */
.is-hidden { display: none !important; }
.is-visible { display: block !important; }
/* 공통 - 뷰포트 (pc / mobile) 별 display none/block */
.pc-only { display: none; }
@media (min-width: 769px) { .pc-only { display: block !important; }}
.mobile-only { display: block; }
@media (min-width: 769px) { .mobile-only { display: none !important; }}
/* 팝업레이어 */
#hd_pop {z-index:1000;position:relative;margin:0 auto;height:0}
#hd_pop h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
@ -342,8 +332,6 @@ box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
.tbl_frm01 a {text-decoration:none}
.tbl_frm01 .frm_file {display:block;margin-bottom:5px}
.tbl_frm01 .frm_info {display:block;padding:0 0 5px;line-height:1.4em}
.frm_info.add_info { margin-top: 10px !important; padding: 8px 12px; background: #fff; border: 1px solid #ddd; border-radius: 6px; line-height: 1.6; }
.btn_info_toggle { display: block; margin: 5px 0 0 21px; font-size: 12px; color: #3f51b5; background: none; border: none; cursor: pointer; text-decoration: underline; }
/*기본 리스트*/
.list_01 ul {border-top:1px solid #ececec}

View File

@ -812,7 +812,6 @@ box-shadow: 1px 2px 2px #eee;}
#sod_frm_paysel .inicis_kakaopay em{position:absolute;top:15px;left:45px;width:70px;height:30px;background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;overflow:hidden;text-indent:-999px;border-radius:30px}
#sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon{background:url('../img/ico-default-naverpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon.nhnkcp_icon{text-indent:0;background-position: 50% 30%;padding-top:35px;padding-left:0;text-align:center}
#sod_frm_paysel .samsungpay_icon{background:url('../img/samsungpay.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 50% 50% #fff; background-size: 70px;display:inline-block;overflow:hidden;text-indent:-999px}
@ -1152,8 +1151,6 @@ box-shadow: 1px 2px 2px #eee;}
.sod_frm_mobile #m_sod_frm_paysel .inicis_lpay{background:url(../img/lpay_logo.png) no-repeat;width:35px;height:12px;overflow:hidden;text-indent:-999px;display:inline-block;background-size:100%}
.sod_frm_mobile #m_sod_frm_paysel .inicis_kakaopay{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .kakaopay_icon{background:url(../img/kakao.png) no-repeat 50% 50% #f4dc34;border-radius:30px;height:22px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .naverpay_icon{background:url(../img/ico-default-naverpay.png) no-repeat 50% 50% #fff;border-radius:30px;height:22px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .naverpay_icon.nhnkcp_icon{text-indent:0;padding-left:50px;padding-top:2px;width:83px}
.sod_frm_mobile #m_sod_frm_paysel .applepay_icon{background:url(../img/ico-mobile-applepay.png) no-repeat 50% 50% #fff;border-radius:30px;height:23px;width:50px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:35px auto}
.sod_frm_mobile #m_sod_frm_paysel .samsung_pay{margin-left:-23px;background:url(../img/samsungpay.png) no-repeat 24px 3px;height:25px;width:106px;display:inline-block;overflow:hidden;text-indent:-999px}
.sod_frm_mobile #sod_frm_pay{border-top:1px solid #f3f3f3}

View File

@ -228,7 +228,6 @@ box-shadow: 0 0 6px rgba(0,0,0,0.2);}
#m_sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #ffeb00;border-radius:30px;height:26px;width:74px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:36px auto}
#m_sod_frm_paysel .kakaopay_icon{background:url('../img/ico-mobile-kakaopay.png') no-repeat #fff;height:23px;width:63px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 10% 40%}
#m_sod_frm_paysel .naverpay_icon{background:url('../img/ico-mobile-naverpay.png') no-repeat #fff;height:23px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:45px auto;background-position: 0% 30%}
#m_sod_frm_paysel .naverpay_icon.nhnkcp_icon{text-indent:0;padding-left:50px;padding-top:2px;width:83px}
#m_sod_frm_paysel .applepay_icon{background:url('../img/ico-mobile-applepay.png') no-repeat #fff;height:30px;width:60px;display:inline-block;overflow:hidden;text-indent:-999px;background-size:43px auto}
#m_sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 0px 3px #fff;width:55px;height:20px;background-size:100%;display:inline-block;overflow:hidden;text-indent:-999px}
#m_sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 0px 3px #fff;width:55px;height:20px;background-size:100%;display:inline-block;overflow:hidden;text-indent:-999px}
@ -915,7 +914,6 @@ box-shadow:0 0 8px rgba(65,98,255,0.8)}
#sod_frm_paysel .inicis_kakaopay{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .kakaopay_icon{background:url('../img/kakao.png') no-repeat 50% 50% #f4dc34;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon{background:url('../img/ico-default-naverpay.png') no-repeat 50% 50% #fff;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .naverpay_icon.nhnkcp_icon{text-indent:0;background-position: 50% 30%;padding-top:35px;padding-left:0;text-align:center}
#sod_frm_paysel .samsungpay_icon{background:url('../img/samsungpay.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .ssgpay_icon{background:url('../img/ssgpay_icon.png') no-repeat 50% 50% #fff;display:inline-block;overflow:hidden;text-indent:-999px}
#sod_frm_paysel .skpay_icon{background:url('../img/skpay11_icon.png') no-repeat 50% 50% #fff; background-size: 70px;display:inline-block;overflow:hidden;text-indent:-999px}

View File

@ -16,7 +16,7 @@ define('FG_MANAGER_PATH', G5_PATH.'/'.FG_MANAGER_DIR);
// define('FG_MANAGER_PATH', G5_ADMIN_PATH.'/'.FG_MANAGER_DIR);
// 퍼스트가든 caf24 CDN 경로
// include_once G5_PATH.'/fg_config.php';
include_once G5_PATH.'/fg_config.php';
// define('CDN_URL', G5_URL.'/image');
// define('CDN_URL', 'https://firstgarden.cdn3.cafe24.com');
@ -42,24 +42,19 @@ if(! function_exists('add_admin_menu_update') ) {
add_replace('admin_menu', 'add_admin_menu_update', 1, 1);
function add_admin_menu_update($menu) {
$menu['menu998'] = array();
array_push($menu['menu400'],
array('400411', '매표소주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_ticket.php', 'firstgarden')
);
array_push($menu['menu998'],
array('998000', '퍼스트가든', G5_ADMIN_URL . '/fg_admin/orderlist_ticket.php', 'firstgarden'),
//array('998010', '베이커리 재고관리', G5_ADMIN_URL . '/fg_admin/bakery/bakery_stock_adm.php', 'firstgarden'),
//array('998020', '베이커리 목록관리', G5_ADMIN_URL . '/fg_admin/bakery/bakery_product_list.php', 'firstgarden'),
//array('998210', 'VIP 명단관리', G5_ADMIN_URL . '/fg_admin/vip/vip_list.php', 'firstgarden'),
//array('998220', 'VIP 구분관리', G5_ADMIN_URL . '/fg_admin/vip/vip_list_category.php', 'firstgarden'),
//array('998310', '연간회원 명단관리', G5_ADMIN_URL . '/fg_admin/annual_member/annual_member_list.php', 'firstgarden'),
//array('998320', '연간회원 구분관리', G5_ADMIN_URL . '/fg_admin/annual_member/annual_member_category.php', 'firstgarden'),
array('998000', '퍼스트가든', G5_ADMIN_URL . '/fg_admin/bakery/bakery_stock.php', 'firstgarden'),
array('998010', '베이커리 재고관리', G5_ADMIN_URL . '/fg_admin/bakery/bakery_stock_adm.php', 'firstgarden'),
array('998020', '베이커리 목록관리', G5_ADMIN_URL . '/fg_admin/bakery/bakery_product_list.php', 'firstgarden'),
array('998210', 'VIP 명단관리', G5_ADMIN_URL . '/fg_admin/vip/vip_list.php', 'firstgarden'),
array('998220', 'VIP 구분관리', G5_ADMIN_URL . '/fg_admin/vip/vip_list_category.php', 'firstgarden'),
array('998310', '연간회원 명단관리', G5_ADMIN_URL . '/fg_admin/annual_member/annual_member_list.php', 'firstgarden'),
array('998320', '연간회원 구분관리', G5_ADMIN_URL . '/fg_admin/annual_member/annual_member_category.php', 'firstgarden'),
array('998411', '매표소주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_ticket.php', 'firstgarden'),
//array('998421', '혜윰주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_hy.php', 'firstgarden'),
//array('998431', 'B2B주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_b2b.php', 'firstgarden'),
//array('998412', '관리자주문확인', G5_ADMIN_URL . '/fg_admin/orderlist_admin.php', 'firstgarden'),
array('998413', '관리자월정산용', G5_ADMIN_URL . '/fg_admin/orderlist_admin_sum.php', 'firstgarden'),
array('998421', '혜윰주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_hy.php', 'firstgarden'),
array('998431', 'B2B주문확인', G5_ADMIN_URL.'/fg_admin/orderlist_b2b.php', 'firstgarden'),
array('998412', '관리자주문확인', G5_ADMIN_URL . '/fg_admin/orderlist_admin.php', 'firstgarden'),
array('998413', '관지라월정산용', G5_ADMIN_URL . '/fg_admin/orderlist_admin_sum.php', 'firstgarden'),
);
return $menu;
}
@ -204,17 +199,3 @@ function annu_send_sms($phone, $message) {
return false;
}
// 전화번호에 하이픈 추가
function add_hyphen($tel){
$tel = preg_replace("/[^0-9]*/s","",$tel); //숫자이외 제거
if (substr($tel,0,2) =='02'){
return preg_replace("/([0-9]{2})([0-9]{3,4})([0-9]{4})$/","\\1-\\2-\\3", $tel);
} else if(substr($tel,0,2) =='8' && substr($tel,0,2) =='15' || substr($tel,0,2) =='16'|| substr($tel,0,2) =='18' ) {
return preg_replace("/([0-9]{4})([0-9]{4})$/","\\1-\\2",$tel); // 지능망 번호이면
} else {
return preg_replace("/([0-9]{3})([0-9]{3,4})([0-9]{4})$/","\\1-\\2-\\3" ,$tel); //핸드폰번호만 이용한다면 이것만있어도됨
}
}

View File

@ -20,7 +20,7 @@ define('G5_ICODE_LMS_MAX_LENGTH', 1500); // 구버전 LMS 최대길이
define('G5_ICODE_JSON_MAX_LENGTH', 2000); // JSON 버전 LMS 최대길이
// SMS 테이블명
$g5['sms5_prefix'] = G5_TABLE_PREFIX.'sms5_';
$g5['sms5_prefix'] = 'sms5_';
$g5['sms5_config_table'] = $g5['sms5_prefix'] . 'config';
$g5['sms5_write_table'] = $g5['sms5_prefix'] . 'write';
$g5['sms5_history_table'] = $g5['sms5_prefix'] . 'history';

9195
firstgarden.sql Normal file

File diff suppressed because one or more lines are too long

View File

@ -276,7 +276,6 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_max_po_id` int(11) NOT NULL DEFAULT '0',
`cf_stipulation` text NOT NULL,
`cf_privacy` text NOT NULL,
`cf_use_promotion` tinyint(1) NOT NULL DEFAULT '0',
`cf_open_modify` int(11) NOT NULL DEFAULT '0',
`cf_memo_send_point` int(11) NOT NULL DEFAULT '0',
`cf_mobile_new_skin` varchar(50) NOT NULL DEFAULT '',
@ -299,8 +298,6 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_cert_kcp_enckey` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mid` varchar(100) NOT NULL DEFAULT '',
`cf_lg_mert_key` varchar(100) NOT NULL DEFAULT '',
`cf_toss_client_key` varchar(100) NOT NULL DEFAULT '',
`cf_toss_secret_key` varchar(100) NOT NULL DEFAULT '',
`cf_cert_limit` int(11) NOT NULL DEFAULT '0',
`cf_cert_req` tinyint(4) NOT NULL DEFAULT '0',
`cf_sms_use` varchar(255) NOT NULL DEFAULT '',
@ -523,20 +520,13 @@ CREATE TABLE IF NOT EXISTS `g5_member` (
`mb_memo` text NOT NULL,
`mb_lost_certify` varchar(255) NOT NULL,
`mb_mailling` tinyint(4) NOT NULL default '0',
`mb_mailling_date` datetime NOT NULL default '0000-00-00 00:00:00',
`mb_sms` tinyint(4) NOT NULL default '0',
`mb_sms_date` datetime NOT NULL default '0000-00-00 00:00:00',
`mb_open` tinyint(4) NOT NULL default '0',
`mb_open_date` date NOT NULL default '0000-00-00',
`mb_profile` text NOT NULL,
`mb_memo_call` varchar(255) NOT NULL default '',
`mb_memo_cnt` int(11) NOT NULL DEFAULT '0',
`mb_scrap_cnt` int(11) NOT NULL default '0',
`mb_marketing_agree` tinyint(1) NOT NULL default '0',
`mb_marketing_date` datetime NOT NULL default '0000-00-00 00:00:00',
`mb_thirdparty_agree` tinyint(1) NOT NULL default '0',
`mb_thirdparty_date` datetime NOT NULL default '0000-00-00 00:00:00',
`mb_agree_log` TEXT NOT NULL,
`mb_1` varchar(255) NOT NULL default '',
`mb_2` varchar(255) NOT NULL default '',
`mb_3` varchar(255) NOT NULL default '',
@ -552,6 +542,7 @@ CREATE TABLE IF NOT EXISTS `g5_member` (
KEY `mb_today_login` (`mb_today_login`),
KEY `mb_datetime` (`mb_datetime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
@ -965,4 +956,4 @@ CREATE TABLE IF NOT EXISTS `g5_menu` (
`me_use` tinyint(4) NOT NULL DEFAULT '0',
`me_mobile_use` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@ -158,7 +158,7 @@ if ($g5_install || $is_install === false) {
cf_theme = 'basic',
cf_admin = '$admin_id',
cf_admin_email = '$admin_email',
cf_admin_email_name = '".G5_VERSION.'_'.substr(base_convert(mt_rand(), 10, 36), 0, 6)."',
cf_admin_email_name = '".G5_VERSION."',
cf_use_point = '1',
cf_use_copy_log = '1',
cf_login_point = '100',

View File

@ -257,13 +257,7 @@ function url_auto_link($str)
{
global $g5;
global $config;
if ($replace_str = run_replace('url_auto_link_before', '', $str)) {
return $replace_str;
}
$ori_str = $str;
// 140326 유창화님 제안코드로 수정
// http://sir.kr/pg_lecture/461
// http://sir.kr/pg_lecture/463
@ -296,7 +290,7 @@ function url_auto_link($str)
$str = preg_replace("/\t_gt_\t/", "&gt;", $str);
*/
return run_replace('url_auto_link', $str, $ori_str);
return run_replace('url_auto_link', $str);
}
@ -1137,11 +1131,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
function insert_use_point($mb_id, $point, $po_id='')
{
global $g5, $config;
if ($replace_insert = run_replace('insert_use_point_before', '', $mb_id, $point, $po_id)) {
return $replace_insert;
}
if($config['cf_point_term'])
$sql_order = " order by po_expire_date asc, po_id asc ";
else
@ -3421,9 +3411,6 @@ function clean_xss_tags($str, $check_entities=0, $is_remove_tags=0, $cur_str_len
$result = preg_replace('#([^\p{L}]|^)(?:javascript|jar|applescript|vbscript|vbs|wscript|jscript|behavior|mocha|livescript|view-source)\s*:(?:.*?([/\\\;()\'">]|$))#ius',
'$1$2', $result);
// 따옴표 + 속성으로 강제 진입 차단 (예: "style=..., 'onerror=...)
$result = preg_replace('/["\']\s*(?:on\w+|style)\s*=\s*/i', '', $result);
if((string)$result === (string)$str) break;
$str = $result;
@ -3680,10 +3667,6 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
alert('url 에 올바르지 않은 값이 포함되어 있습니다.');
}
if (preg_match('#//[^/@]+@#', $url)) {
alert('url에 사용자 정보가 포함되어 있어 접근할 수 없습니다.');
}
while ( ( $replace_url = preg_replace(array('/\/{2,}/', '/\\@/'), array('//', ''), urldecode($url)) ) != $url ) {
$url = $replace_url;
}
@ -3951,16 +3934,10 @@ class str_encrypt
function __construct($salt='')
{
global $config;
if (!$salt) {
$config_hash = md5(serialize(array($config['cf_title'], $config['cf_theme'], $config['cf_admin_email_name'], $config['cf_login_point'], $config['cf_memo_send_point'])));
//$this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr($config_hash, -1), $_SERVER['SERVER_SOFTWARE'].$config_hash.$_SERVER['DOCUMENT_ROOT']));
$this->salt = hash('sha256', preg_replace('/[^0-9A-Za-z]/', substr($config_hash, -1), $_SERVER['SERVER_SOFTWARE'].$config_hash.$_SERVER['DOCUMENT_ROOT']));
} else {
if(!$salt)
$this->salt = md5(preg_replace('/[^0-9A-Za-z]/', substr(G5_MYSQL_USER, -1), $_SERVER['SERVER_SOFTWARE'].$_SERVER['DOCUMENT_ROOT']));
else
$this->salt = $salt;
}
$this->length = strlen($this->salt);
}
@ -4247,8 +4224,8 @@ function is_include_path_check($path='', $is_input='')
//echo 'Caught exception: ', $e->getMessage(), "\n";
return false;
}
if (preg_match('/\/data\/(file|editor|qa|cache|member|member_image|session|tmp)\/[A-Za-z0-9_]{1,20}\//i', $replace_path) || preg_match('/pe(?:ar|cl)(?:cmd)?\.php/i', $replace_path)){
if( preg_match('/\/data\/(file|editor|qa|cache|member|member_image|session|tmp)\/[A-Za-z0-9_]{1,20}\//i', $replace_path) ){
return false;
}
if( preg_match('/'.G5_PLUGIN_DIR.'\//i', $replace_path) && (preg_match('/'.G5_OKNAME_DIR.'\//i', $replace_path) || preg_match('/'.G5_KCPCERT_DIR.'\//i', $replace_path) || preg_match('/'.G5_LGXPAY_DIR.'\//i', $replace_path)) || (preg_match('/search\.skin\.php/i', $replace_path) ) ){

View File

@ -5,7 +5,6 @@ include_once(G5_PHPMAILER_PATH.'/PHPMailerAutoload.php');
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
/* 원본 이메일 발송 기능
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
@ -56,7 +55,7 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
if (!($mail_send_result = $mail->send())) {
throw new Exception($mail->ErrorInfo);
}
} catch (Exception $e) {
error_log("Mail sending error: " . $e->getMessage());
}
@ -65,65 +64,6 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
return $mail_send_result;
}
*/
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g5;
// 메일발송 사용을 하지 않는다면
if (!$config['cf_email_use']) return;
if ($type != 1)
$content = nl2br($content);
$mail = new PHPMailer(); // defaults to using php “mail()”
if (defined('G5_SMTP') && G5_SMTP) {
// Modified By taeho. 2015.12.31, 메일을 보낼 때 메일서버에 접속하기 위한 설정입니다.
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.daum.net"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "first_garden@daum.net"; // MAIL username
$mail->Password = "rsdkjqeaxzdtsfrx"; // MAIL password
}
// 아래 두개를 설정하지 않으면 한글 깨짐
$mail->CharSet = 'UTF-8'; // 문자셋 설정
$mail->Encoding = 'base64'; // 인코딩 설정
$mail->isHTML(true); // HTML 메일 명시
$mail->AddAddress($to);
// $mail->AddAddress($to); // 중복 제거
$mail->From = 'firstgarden@firstgarden.co.kr'; // 사용자에게 보여줄 보내는이 메일주소
$mail->FromName = '퍼스트가든'; // 사용자에게 보여줄 보내는 사람의 이름 등
$mail->Subject = $subject;
$mail->AltBody = ''; // optional, comment out and test
$mail->MsgHTML($content);
$mail->AddAddress($to);
$mail->AddAddress($to);
if ($cc)
$mail->AddCC($cc);
if ($bcc)
$mail->AddBCC($bcc);
//print_r2($file); exit;
if ($file != "") {
foreach ($file as $f) {
$mail->AddAttachment($f['path'], $f['name']);
}
}
return $mail->Send();
}
// 파일을 첨부함
function attach_file($filename, $tmp_name)

View File

@ -50,7 +50,6 @@ function create_hash($password, $force_compat = false)
$salt = base64_encode(mcrypt_create_iv(PBKDF2_COMPAT_SALT_BYTES, MCRYPT_DEV_URANDOM));
} elseif (@file_exists('/dev/urandom') && $fp = @fopen('/dev/urandom', 'r')) {
$salt = base64_encode(fread($fp, PBKDF2_COMPAT_SALT_BYTES));
fclose($fp); // 파일 닫기
} else {
$salt = '';
for ($i = 0; $i < PBKDF2_COMPAT_SALT_BYTES; $i += 2) {

View File

@ -1010,7 +1010,7 @@ function get_item_options($it_id, $subject, $is_div='', $is_first_option_title='
for($k=0; $k<$opt_count; $k++) {
$opt_val = $opt[$k];
if(strlen($opt_val)) {
$select .= '<option value="'.get_text($opt_val).'">'.get_text($opt_val).'</option>'.PHP_EOL;
$select .= '<option value="'.$opt_val.'">'.$opt_val.'</option>'.PHP_EOL;
}
}
$select .= '</select>'.PHP_EOL;
@ -1046,7 +1046,7 @@ function get_item_options($it_id, $subject, $is_div='', $is_first_option_title='
else
$soldout = '';
$select .= '<option value="'.get_text($row['io_id']).','.$row['io_price'].','.$row['io_stock_qty'].'">'.get_text($row['io_id']).$price.$soldout.'</option>'.PHP_EOL;
$select .= '<option value="'.$row['io_id'].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$row['io_id'].$price.$soldout.'</option>'.PHP_EOL;
}
$select .= '</select>'.PHP_EOL;
@ -1101,7 +1101,7 @@ function get_item_supply($it_id, $subject, $is_div='', $is_first_option_title=''
else
$soldout = '';
$options[$opt_id[0]][] = '<option value="'.get_text($opt_id[1]).','.$row['io_price'].','.$io_stock_qty.'">'.get_text($opt_id[1]).$price.$soldout.'</option>';
$options[$opt_id[0]][] = '<option value="'.$opt_id[1].','.$row['io_price'].','.$io_stock_qty.'">'.$opt_id[1].$price.$soldout.'</option>';
}
}
@ -1122,7 +1122,7 @@ function get_item_supply($it_id, $subject, $is_div='', $is_first_option_title=''
$first_option_title = $is_first_option_title ? $subj[$i] : '선택';
$select = '<select id="it_supply_'.$seq.'" class="it_supply">'.PHP_EOL;
$select .= '<option value="">'.get_text($first_option_title).'</option>'.PHP_EOL;
$select .= '<option value="">'.$first_option_title.'</option>'.PHP_EOL;
for($k=0; $k<$opt_count; $k++) {
$opt_val = $opt[$k];
if($opt_val) {
@ -2461,7 +2461,7 @@ function get_itemuselist_thumbnail($it_id, $contents, $thumb_width, $thumb_heigh
}
function shop_is_taxsave($od, $is_view_receipt=false){
global $default, $is_member;
global $default, $is_memeber;
$od_pay_type = '';
@ -2770,50 +2770,6 @@ function get_item_images_info($it, $size=array(), $image_width=0, $image_height=
return $images;
}
// 카테고리 전체 경로를 가져오는 함수 (예: 남성의류 > 상의 > 셔츠)
function get_shop_category_path($ca_id, $separator = ' &gt; ')
{
global $g5;
static $category_cache = array(); // 카테고리명 캐시
static $path_cache = array(); // 경로 캐시
if (!$ca_id) return '';
// 동일한 separator로 이미 조회한 경로가 있으면 캐시에서 반환
$cache_key = $ca_id . '|' . $separator;
if (isset($path_cache[$cache_key])) {
return $path_cache[$cache_key];
}
$path_arr = array();
$ca_id_len = strlen($ca_id);
// 카테고리 ID를 2자리씩 분할하여 각 단계의 카테고리명을 조회
for ($i = 2; $i <= $ca_id_len; $i += 2) {
$current_ca_id = substr($ca_id, 0, $i);
// 캐시에 없으면 DB 조회
if (!isset($category_cache[$current_ca_id])) {
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$current_ca_id' ";
$row = sql_fetch($sql);
if ($row) {
$category_cache[$current_ca_id] = $row['ca_name'];
} else {
$category_cache[$current_ca_id] = '';
}
}
if ($category_cache[$current_ca_id]) {
$path_arr[] = $category_cache[$current_ca_id];
}
}
$result = implode($separator, $path_arr);
$path_cache[$cache_key] = $result; // 결과를 캐시에 저장
return $result;
}
function check_payment_method($od_settle_case) {
global $default;
@ -2867,7 +2823,7 @@ function check_pay_name_replace($payname, $od=array(), $is_client=0){
} else if( isset($od['od_pg']) && $od['od_pg'] === 'inicis' ){
return 'KPAY';
} else if( isset($od['od_pg']) && $od['od_pg'] === 'kcp' ){
if( isset($od['od_other_pay_type']) && ($od['od_other_pay_type'] === 'OT16' || $od['od_other_pay_type'] === 'NHNKCP_NAVERMONEY')){
if( isset($od['od_other_pay_type']) && $od['od_other_pay_type'] === 'OT16' ){
return '네이버페이_NHNKCP'.$add_str;
} else if( isset($od['od_other_pay_type']) && ($od['od_other_pay_type'] === 'OT13' || $od['od_other_pay_type'] === 'NHNKCP_KAKAOMONEY') ){
return '카카오페이_NHNKCP'.$add_str;

View File

@ -275,10 +275,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
// $thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$file_ext;
$thumb_time = @filemtime($thumb_file);
$source_time = @filemtime($source_file);
if (file_exists($thumb_file)) {
$thumb_time = @filemtime($thumb_file);
$source_time = @filemtime($source_file);
if ($is_create == false && $source_time < $thumb_time) {
return basename($thumb_file);
}

View File

@ -5,17 +5,17 @@ if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로
include_once FG_MANAGER_PATH."/head.php";
$table = "{$fg['member_table']} AS a LEFT JOIN {$fg['member_group_table']} AS b ON a.tid = b.tid";
if ( $_SESSION['user_lv'] != 4 ) { // 시스템관리자는 모든 계정 열람 가능함
if ( $_SESSION['user_lv'] == 4 ) { // 시스템관리자는 모든 계정 열람 가능함
$where = "";
} else { // 아닌경우 로그인 계정과 동일 부서이면서 낮은 등급의 계정만 처리가능
$where = "WHERE user_lv < '{$_SESSION['user_lv']}' AND tname = '{$_SESSION['user_team']}' OR user_id = '{$_SESSION['user_id']}'";
}
$record_count = get_num_rows($table);
$ord_by = " ORDER BY a.used DESC, b.tname ASC, a.idx ASC ";
$ord_by = " ORDER BY idx ASC ";
$R = get_result($table, $ord_by, $query_limit, $where);
?>
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex align-items-center gap-2">
<p class="mb-0">전체 계정 수 : <b><?=$record_count; ?></b></p>
</div>
<p>전체 계정 수 : <b><?=$record_count; ?></b></p>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#add_modal">추가</button>
</div>
<div class="text-center">
@ -46,10 +46,9 @@ include_once FG_MANAGER_PATH."/head.php";
</thead>
<!-- 목록 출력 -->
<tbody>
<?php foreach($R as $R){
?>
<tr class="<?=($R['used'] == 1) ? "" : "unused"?> " >
<!-- <td class="text-center"><?=$R['idx']?></td> -->
<?php foreach($R as $R){ ?>
<tr class="<?=($R['used'] == 1) ? "" : "unused"?>">
<!--<td class="text-center"><?=$R['idx']?></td>-->
<td class="text-center align-middle"><?=$R['tname']?></td>
<td class="text-center"><?=$R['user_name']?></td>
<td class="text-center"><?=$R['user_id']?></td>

View File

@ -1,64 +0,0 @@
<?php
//if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once('_common.php');
include_once('../config.php');
$sql_common = "SELECT * FROM {$fg['annual_member_table']} AS a LEFT JOIN {$fg['annual_category_table']} AS b ON a.ca_id = b.ca_id";
$result = sql_query($sql_common);
$file_name = "annual_member_list_".date("ymd")."_".date("His").".xls"; // 파일명지정
header("Content-Type: application/vnd.ms-excel");
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Description: PHP Generated Data");
?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
.tit {background-color:#C0C0C0; height:30px; }
.no-text {mso-number-format:'\@'; text-align:center;}
</style>
<table cellspacing="0" cellpadding="0" border="1">
<thead>
<tr>
<th class="tit">회원번호</th>
<th class="tit">권종구분</th>
<th class="tit">상태</th>
<th class="tit">성명</th>
<th class="tit">연락처</th>
<th class="tit">생년월일</th>
<th class="tit">메모</th>
<th class="tit">시작일</th>
<th class="tit">종료일</th>
<th class="tit">이메일</th>
<th class="tit">주소</th>
<th class="tit">최종이용일</th>
<th class="tit">이용횟수</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) { // 반복문 시작
?>
<tr>
<td class="no-text"><?php echo $row['mem_no']; ?> </td>
<td class="no-text"><?php echo $row['ca_name']?> </td>
<td class="no-text"><?php echo $row['status']?> </td>
<td style="text-align:center"> <?php echo $row['name']?> </td>
<td class="no-text"><?php echo $row['tel']; ?></td>
<td style="text-align:center"> <?php echo $row['birth']?> </td>
<td style="text-align:center"> <?php echo $row['memo'];?> </td>
<td style="text-align:center"> <?php echo $row['sdate'];?> </td>
<td style="text-align:center"> <?php echo $row['edate']?> </td>
<td class="no-text"><?php echo $row['email']; ?> </td>
<td class="no-text"><?php echo $row['addr']; ?> </td>
<td class="no-text"><?php echo ($row['last_ent_date'] == '0000-00-00 00:00:00') ? '미이용' : date('Y-m-d', strtotime($row['last_ent_date'])); ?> </td>
<td class="no-text"><?php echo $row['ent_count']; ?> </td>
</tr>
<?php } // 반복문 종료 ?>
</tbody>
</table>

View File

@ -80,7 +80,7 @@ $set_annual_status = array("정상", "검토대기", "만료");
<p>전체 회원 수 : <b><?=$record_count?></b> | 검색 회원 수 : <?=$search_count ? $search_count : $record_count?></p>
</div>
<div class="d-flex flex-row-reverse column-gap-2">
<form method="post" action="annual_member_list.excel.php">
<form method="post" action="inc/annual_member_list_excel.php">
<button type="submit" class="btn btn-secondary" >엑셀저장</button>
</form>
<?php if($_SESSION['user_lv'] > "1"){ // 추가 권한 체크 ?>

View File

@ -49,7 +49,7 @@ if( isset($search_word) && $search_word ) { // 검색어가 있을때만 돌림
<th class="text-center">회원번호</th>
<th class="text-center">상태</th>
<th class="text-center">회원구분</th>
<!--<th class="text-center">대표성명</th>-->
<th class="text-center">대표성명</th>
<th class="text-center">성명</th>
<th class="text-center">연락처</th>
<th class="text-center">입장횟수</th>
@ -64,7 +64,7 @@ if( isset($search_word) && $search_word ) { // 검색어가 있을때만 돌림
<td class="text-center"><?=sprintf("%06d",$R['mem_no'])?></td>
<td class="text-center"><?=$R['status']?></td>
<td class="text-center"><?=$R['ca_name']?></td>
<!--<td class="text-center"><?=$R['rep_name']?></td>-->
<td class="text-center"><?=$R['rep_name']?></td>
<td class="text-center"><?=$R['name']?></td>
<td class="text-center"><?=$R['tel']?></td>
<td class="text-center"><?=$R['ent_count']?></td>

View File

@ -1,6 +1,4 @@
<?php
if (!isset($_SESSION['user_id'])) exit; //페이지 직접 실행 방지
include_once "_common.php";
// 테이블 존재 유무 확인 쿼리

View File

@ -2,6 +2,8 @@
include_once "_common.php";
if(!$_SESSION['user_id']) exit; // 로그인되어있지 않으면 확인 불가
$product_name = isset($_POST['product_name']) ? trim($_POST['product_name']) : exit;
$barcode = isset($_POST['barcode']) ? trim($_POST['barcode']) : exit;
$used = isset($_POST['used']) ? trim($_POST['used']) : exit;

View File

@ -2,8 +2,6 @@
// 베이커리 제품목록록
include_once "_common.php";
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once 'head.sub.php';
include_once FG_MANAGER_PATH."/head.php";
// 검색 변수 초기화

View File

@ -3,7 +3,6 @@
include_once "_common.php";
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once 'head.sub.php';
include_once FG_MANAGER_PATH."/head.php";
// 검색 변수 초기화
@ -141,7 +140,7 @@ if (!$authInfo) {
<thead class="table-light">
<tr class="align-middle">
<th class="text-center no-click">No.</th>
<th class="text-center" data-column="product_name" data-order="asc">품목 <span class="sort-icon fa fa-sort-up" data-column="product_name"></span></th>
<th class="text-center" data-column="product_name" data-order="asc">품목 <span class="sort-icon" data-column="product_name"></span></th>
<th class="text-center" data-column="barcode" data-order="asc">바코드 <span class="sort-icon" data-column="barcode"></span></th>
<th class="text-center" data-column="previous_stock" data-order="asc">전일재고 <span class="sort-icon" data-column="previous_stock"></span></th>
<th class="text-center" data-column="production" data-order="asc">생산 <span class="sort-icon" data-column="production"></span></th>
@ -254,11 +253,10 @@ if (!$authInfo) {
<?php $i++;
} // endforeach
$sumData = getBakeryInvenSummaryData($searchDate);
?>
</tbody>
<!-- 합계 데이터 출력 -->
<tfoot>
<!-- 합계 데이터 출력 -->
<tr>
<td colspan="3" class="text-center">합계</th>
<td class="text-end" id="total_prev_stock"><?=number_format($t_prev_stock)?></th>
@ -273,21 +271,6 @@ if (!$authInfo) {
<td class="text-end" id="total_payment_amount"><?=number_format($t_payment_amount)?></th>
<td class="text-end" id="total_current_stock"><?=number_format($t_current_stock)?></th>
</tr>
<!-- 누계 데이터 출력 -->
<tr>
<td colspan="3" class="text-center">누계</th>
<td class="text-end" id="summary_prev_stock"></th>
<td class="text-end" id="summary_production"><?=number_format($sumData['total_production'])?></th>
<td class="text-end" id="summary_inhouse_use"><?=number_format($sumData['total_inhouse_use'])?></th>
<td class="text-end" id="summary_recycling"><?=number_format($sumData['total_recycling'])?></th>
<td class="text-end" id="summary_disposal"><?=number_format($sumData['total_disposal'])?></th>
<td class="text-end" id="summary_sales"><?=number_format($sumData['total_sales'])?></th>
<td class="text-end" id="summary_unit_price"></th>
<td class="text-end" id="summary_sales_amount"><?=number_format($sumData['total_sales_amount'])?></th>
<td class="text-end" id="summary_menu_discount"><?=number_format($sumData['total_menu_discount'])?></th>
<td class="text-end" id="summary_payment_amount"><?=number_format($sumData['total_payment_amount'])?></th>
<td class="text-end" id="summary_current_stock"></th>
</tr>
</tfoot>
</table>
</div>

View File

@ -2,15 +2,10 @@
// 설정 파일 포함
include_once('_common.php');
if(!$_SESSION['user_id']) exit; // 로그인 되어있지 않으면 확인 불가
// 검색 날짜
$searchDate = $_POST['searchDate'];
$ord_by = $_POST['ordBy'];
$result = getBakeryInvenData($searchDate, $ord_by);
$authInfo = getAuthorInfo($searchDate);
// 누계 데이터 가져오기
$sumData = getBakeryInvenSummaryData($searchDate);
// UTF-8 BOM 추가
echo "\xEF\xBB\xBF";
@ -21,105 +16,26 @@ header("Content-Description: PHP Generated Data");
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
table {border-collapse:collapse; border:none;}
.head {background-color:#C0C0C0; border: 1px solid black;}
.foot {background-color:#C0C0C0; border: 1px solid black;}
.no-text {mso-number-format:'\@'; text-align: center; }
.line {border: 1px solid black;}
.tit { background-color:#C0C0C0; height:30px; }
.no-text { mso-number-format:'\@'; text-align:center; }
</style>
<table>
<table cellspacing="0" cellpadding="0" border="1">
<thead>
<tr>
<th>베이커리일일현황</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th>날짜</th>
<th><?=$searchDate?></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th>근무자</th>
<th><?=$authInfo['worker']?></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th>작성자</th>
<th><?=$authInfo['author']?></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th class="head">품목</th>
<th class="head">바코드</th>
<th class="head">전일재고</th>
<th class="head">생산</th>
<th class="head">업장사용</th>
<th class="head">재활용</th>
<th class="head">폐기</th>
<th class="head">판매수량</th>
<th class="head">판매단가</th>
<th class="head">판매금액</th>
<th class="head">메뉴별할인</th>
<th class="head">결제금액</th>
<th class="head">현재고</th>
<th class="tit">품목</th>
<th class="tit">바코드</th>
<th class="tit">전일재고</th>
<th class="tit">생산</th>
<th class="tit">업장사용</th>
<th class="tit">재활용</th>
<th class="tit">폐기</th>
<th class="tit">판매수량</th>
<th class="tit">판매단가</th>
<th class="tit">판매금액</th>
<th class="tit">메뉴별할인</th>
<th class="tit">결제금액</th>
<th class="tit">현재고</th>
</tr>
</thead>
<tbody>
@ -128,12 +44,11 @@ $t_prev_stock = $t_production = $t_inhouse_use = $t_recycling = $t_disposal = $t
// 데이터 출력
foreach ( $result as $row) {
$previous_stock = getPrevStock($searchDate, $row['barcode']);
?>
<tr>
<td><?=$row['product_name']?></td>
<td><?=$row['barcode']?></td>
<td><?=number_format($previous_stock)?></td>
<td><?=number_format(getPrevStock($searchDate, $row['barcode']))?></td>
<td><?=number_format($row['production'])?></td>
<td><?=number_format($row['inhouse_use'])?></td>
<td><?=number_format($row['recycling'])?></td>
@ -145,10 +60,10 @@ foreach ( $result as $row) {
<td><?=number_format($row['payment_amount'])?></td>
<td><?=number_format($row['current_stock'])?></td>
</tr>
<?php
<?php
// 합계 함수 처리
$t_prev_stock += $previous_stock;
$t_prev_stock += $row['previous_stock'];
$t_production += $row['production'];
$t_inhouse_use += $row['inhouse_use'];
$t_recycling += $row['recycling'];
@ -159,40 +74,23 @@ foreach ( $result as $row) {
$t_payment_amount += $row['payment_amount'];
$t_current_stock += $row['current_stock'];
}
?>
</tbody>
<tfoot class="table-group-divider">
<tr class="bakery_total">
<td class="foot">합계</td>
<td class="foot"></td>
<td class="foot"><?=number_format($t_prev_stock) ?></td>
<td class="foot"><?=number_format($t_production) ?></td>
<td class="foot"><?=number_format($t_inhouse_use) ?></td>
<td class="foot"><?=number_format($t_recycling) ?></td>
<td class="foot"><?=number_format($t_disposal) ?></td>
<td class="foot"><?=number_format($t_sales) ?></td>
<td class="foot"></td>
<td class="foot"><?=number_format($t_sales_amount) ?></td>
<td class="foot"><?=number_format($t_menu_discount) ?></td>
<td class="foot"><?=number_format($t_payment_amount) ?></td>
<td class="foot"><?=number_format($t_current_stock) ?></td>
</tr>
<tr>
<td class="foot">누계</th>
<td class="foot"></th>
<td class="foot"></th>
<td class="foot"><?=number_format($sumData['total_production'])?></th>
<td class="foot"><?=number_format($sumData['total_inhouse_use'])?></th>
<td class="foot"><?=number_format($sumData['total_recycling'])?></th>
<td class="foot"><?=number_format($sumData['total_disposal'])?></th>
<td class="foot"><?=number_format($sumData['total_sales'])?></th>
<td class="foot"></th>
<td class="foot"><?=number_format($sumData['total_sales_amount'])?></th>
<td class="foot"><?=number_format($sumData['total_menu_discount'])?></th>
<td class="foot"><?=number_format($sumData['total_payment_amount'])?></th>
<td class="foot"></th>
</tr>
</tfoot>
<tfoot class="table-group-divider">
<tr class="bakery_total">
<td>합계</td>
<td></td>
<td><?=number_format($t_prev_stock) ?></td>
<td><?=number_format($t_production) ?></td>
<td><?=number_format($t_inhouse_use) ?></td>
<td><?=number_format($t_recycling) ?></td>
<td><?=number_format($t_disposal) ?></td>
<td><?=number_format($t_sales) ?></td>
<td></td>
<td><?=number_format($t_sales_amount) ?></td>
<td><?=number_format($t_menu_discount) ?></td>
<td><?=number_format($t_payment_amount) ?></td>
<td><?=number_format($t_current_stock) ?></td>
</tr>
</tfoot>
</table>

View File

@ -1,269 +0,0 @@
<?php
// 베이커리 재고관리
include_once "_common.php";
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once 'head.sub.php';
include_once FG_MANAGER_PATH."/head.php";
// 검색 변수 초기화
!isset($search) ?? "";
!isset($where) ?? "";
!isset($search_count) ?? "";
$is_debug = false; // 디버깅 시 true로 변경
// ord_by 로 넘어온 값이 있으면 반영
$ord_by = isset($_REQUEST["ord_by"]) ? $_REQUEST["ord_by"] : "product_name ASC";
// 검색어 반영
$searchWord = $_GET["searchWord"] ?? "";
// 날짜 가져오기
$today = new DateTime();
$startDate = $_REQUEST["startDate"] ?? (clone $today)->modify('-7 days')->format('Y-m-d');
$endDate = $_REQUEST["endDate"] ?? (clone $today)->modify('-1 day')->format('Y-m-d');
// 최종 수정시간
$edit_datetime = date('Y-m-d H:i:s'); // 최종 수정 시간 업데이트
// 베이커리 계정인지 확인하고, 오늘 이후 날짜인 경우 생산-매출액란을 공란으로 출력하기 위한 변수
$is_bakery = ( $_SESSION['user_id'] == "bakery" ) ? true : false;
$is_bakery_input = ( strtotime($searchDate) >= strtotime(date("Y-m-d")) ) ? true : false;
// 합계 구하기
$totalBakeryInvenData = getBakeryInvenSumPeriod($startDate, $endDate, $searchWord);
// barcode별 그룹화된 상세 데이터를 구하기
$bakeryInvenData = getBakeryInvenDataPeriod($startDate, $endDate, $searchWord);
?>
<style>
/* 틀 고정
.tableWrapper {
overflow: auto;
height: 700px;
width: 100%;
}
#bakeryTable th {
position: sticky;
top: 0px;
}
*/
</style>
<div class="d-flex justify-content-between mb-3 ">
<div class="row align-items-start">
<h2>베이커리 기간별 현황</h2>
</div>
<div class="row align-items-end align-self-end only-print">
<p>조회일자 : <?=$startDate?> ~ <?=$endDate?></p>
</div>
</div>
<div class="d-flex justify-content-between mb-3 no-print">
<div class="row align-items-start flex-nowrap">
<div class="input-group">
<span class="input-group-text">시작일</span>
<input type="date" class="form-control" id="startDateInput" name="startDate" max="9999-12-31" value="<?= $startDate ?>">
<span class="input-group-text">종료일</span>
<input type="date" class="form-control" id="endDateInput" name="endDate" max="9999-12-31" value="<?= $endDate ?>">
</div>
</div>
<div class="row align-items-end">
<div class="input-group">
<input class="form-control" type="text" name="searchWord" id="searchWord" placeholder="상품명 검색" value="<?= htmlspecialchars($_GET['searchWord'] ?? '') ?>" />
<button class="btn btn-success" id="searchBtn" type="button">검색</button>
<button class="btn btn-primary" type="button" id="resetSearch">초기화</button>
</div>
</div>
<!--
<div class="row align-items-end">
<input type="file" id="inventoryFileInput" style="display:none;" accept=".xls,.xlsx" />
<div class="btn-group" role="group" aria-label="bakery-button">
<button type="button" class="btn btn-success" id="exportExcelButton">엑셀변환</button>
</div>
</div>
-->
</div>
<div class="table">
<h3>개요</h3>
<table class="table align-middle" id="bakeryTotalTable">
<thead class="table-light">
<tr class="align-middle">
<th class="text-center">품목</th>
<th class="text-center">생산</th>
<th class="text-center">업장사용</th>
<th class="text-center">재활용</th>
<th class="text-center">폐기</th>
<th class="text-center">판매</th>
<th class="text-center">매출액</th>
</tr>
</thead>
<tbody>
<tr class="align-middle">
<th class="text-center"><?=number_format(cntUsedBakeryItems())?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_production'])?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_inhouse_use'])?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_recycling'])?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_disposal'])?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_sales'])?></th>
<th class="text-center"><?=number_format($totalBakeryInvenData['t_payment_amount'])?></th>
</tr>
</tbody>
</table>
</div>
<div class="tableWrapper">
<h3>상세</h3>
<table class="table align-middle table-hover <?php if( $bakeryInvenData) echo 'table-striped'?> bakery" id="bakeryTable">
<colgroup>
<col width="30px">
<col width="150px">
<col width="70px">
<col width="70px">
<col width="70px">
<col width="70px">
<col width="70px">
<col width="70px">
</colgroup>
<!-- 테이블 제목 -->
<thead class="table-light">
<tr class="align-middle">
<th class="text-center no-click">No.</th>
<th class="text-center" data-column="product_name" data-order="asc">품목 <span class="sort-icon fa fa-sort-up" data-column="product_name"></span></th>
<th class="text-center" data-column="production" data-order="asc">생산 <span class="sort-icon" data-column="production"></span></th>
<th class="text-center" data-column="inhouse_use" data-order="asc">업장사용 <span class="sort-icon" data-column="inhouse_use"></span></th>
<th class="text-center" data-column="recycling" data-order="asc">재활용 <span class="sort-icon" data-column="recycling"></span></th>
<th class="text-center" data-column="disposal" data-order="asc">폐기 <span class="sort-icon" data-column="disposal"></span></th>
<th class="text-center" data-column="sales" data-order="asc">판매 <span class="sort-icon" data-column="sales"></span></th>
<th class="text-center" data-column="payment_amount" data-order="asc">매출액 <span class="sort-icon" data-column="payment_amount"></span></th>
</tr>
</thead>
<!-- 테이블 데이터 -->
<tbody class="table-group-divider" id="bakeryTableBody">
<?php
if ( $bakeryInvenData ) {
// 데이터 가져와서 뿌리기
$i = 1; // number 표시를 위한 변수
foreach ($bakeryInvenData as $row) {
?>
<tr id="row-<?=$row['barcode']?>">
<td class="text-center"><?=$i?></td>
<td class="text-left"><?=htmlspecialchars($row['product_name'])?></td>
<td class="text-end"><span class="value"><?=number_format($row['production'])?></span>
<input class="form-control text-end d-none" type="text" value="<?=$row['production']?>" id="production-<?=$row['barcode']?>" product_name="<?=$row['product_name']?>" aria-label="production" readonly>
</td>
<td class="text-end"><span class="value"><?=number_format($row['inhouse_use'])?></span>
<input class="form-control text-end d-none" type="text" value="<?=$row['inhouse_use']?>" id="inhouse_use-<?=$row['barcode']?>" product_name="<?=$row['product_name']?>" aria-label="inhouse_use" readonly>
</td>
<td class="text-end"><span class="value"><?=number_format($row['recycling'])?></span>
<input class="form-control text-end d-none" type="text" value="<?=$row['recycling']?>" id="recycling-<?=$row['barcode']?>" product_name="<?=$row['product_name']?>" aria-label="recycling" readonly>
</td>
<td class="text-end"><span class="value"><?=number_format($row['disposal'])?></span>
<input class="form-control text-end d-none" type="text" value="<?=$row['disposal']?>" id="disposal-<?=$row['barcode']?>" product_name="<?=$row['product_name']?>" aria-label="disposal" readonly>
</td>
<td class="text-end"><?=number_format($row['sales'])?></td>
<td class="text-end"><?=number_format($row['payment_amount'])?></td>
</tr>
<?php
$i++;
} // endforeach
?>
</tbody>
<!-- 합계 데이터 출력 -->
<tfoot class="no-print">
<tr>
<td colspan="2" class="text-center">합계</th>
<td class="text-end" id="total_production"><?=number_format($totalBakeryInvenData['t_production'])?></td>
<td class="text-end" id="total_inhouse_use"><?=number_format($totalBakeryInvenData['t_inhouse_use'])?></td>
<td class="text-end" id="total_recycling"><?=number_format($totalBakeryInvenData['t_recycling'])?></td>
<td class="text-end" id="total_disposal"><?=number_format($totalBakeryInvenData['t_disposal'])?></td>
<td class="text-end" id="total_sales"><?=number_format($totalBakeryInvenData['t_sales'])?></td>
<td class="text-end" id="total_payment_amount"><?=number_format($totalBakeryInvenData['t_payment_amount'])?></td>
</tr>
</tfoot>
<?php
} else {
// 데이터가 없을 경우 출력
echo "<tr class='align-middle'>";
echo "<td class='text-center' colspan='9'> 자료가 존재하지 않습니다 </td>";
echo "</tr></tbody>";
} // endif
?>
</table>
</div>
<script>
const startDateInput = document.getElementById('startDateInput');
const endDateInput = document.getElementById('endDateInput');
const searchInput = document.getElementById('searchWord');
const searchBtn = document.getElementById('searchBtn');
const resetBtn = document.getElementById('resetSearch');
// URL 쿼리 갱신 함수
function getUrlWithParams(paramsToUpdate = {}, paramsToDelete = []) {
const url = new URL(window.location.href);
// 업데이트
for (const key in paramsToUpdate) {
url.searchParams.set(key, paramsToUpdate[key]);
}
// 삭제
for (const key of paramsToDelete) {
url.searchParams.delete(key);
}
return url.toString();
}
// 날짜 변경 시
function onDateChange() {
const url = getUrlWithParams({
startDate: startDateInput.value,
endDate: endDateInput.value,
});
window.location.href = url;
}
// 검색 버튼 클릭 시
function onSearchClick() {
const url = getUrlWithParams({
startDate: startDateInput.value,
endDate: endDateInput.value,
searchWord: searchInput.value,
});
window.location.href = url;
}
// 검색어 입력창에서 엔터 입력 시 검색 실행
searchInput.addEventListener('keydown', function (e) {
if (e.key === 'Enter') {
e.preventDefault(); // 폼 제출 방지
onSearchClick(); // 검색 함수 호출
}
});
// 초기화 버튼 클릭 시
function onResetClick() {
const url = getUrlWithParams({}, ['searchWord']);
window.location.href = url;
}
// 이벤트 바인딩
startDateInput.addEventListener('change', onDateChange);
endDateInput.addEventListener('change', onDateChange);
searchBtn.addEventListener('click', onSearchClick);
resetBtn.addEventListener('click', onResetClick);
</script>
<?php
include_once "tail.sub.php";
include_once FG_MANAGER_PATH."/tail.php";

View File

@ -1,8 +0,0 @@
<?php
if (!isset($_SESSION['user_id'])) exit; //페이지 직접 실행 방지
// 권한부여 및 체크
if ( !in_array($_SESSION['user_id'], $pageAuth['bakery']) && !in_array($_SESSION['user_id'], $pageAuth['admin']) ) {
alert('권한이 없습니다'.$pageAuth['admin'].','.$pageAuth['bakery'].'만 이용할 수 있습니다.', false);
}
?>

View File

@ -1,6 +1,4 @@
<?php
if (!isset($_SESSION['user_id'])) exit; //페이지 직접 실행 방지
?>
<script>
$(document).ready(function() {
var ordBy = <?php echo json_encode(isset($ord_by) ? $ord_by : ''); ?>;
@ -73,21 +71,18 @@ $(document).ready(function() {
function attachThClickEvent() {
$('table').off('click', 'th'); // 기존 이벤트 제거
// #bakeryTable에만 정렬 이벤트 등록
$('#bakeryTable').on('click', 'th', function() {
$('table').on('click', 'th', function() {
if ($(this).hasClass('no-click')) {
return; // no-click 클래스 th는 무시
return; // no-click 클래스를 가진 th 요소는 클릭 이벤트를 무시하고 이후 코드 실행 안함
}
console.log('th clicked:', $(this).data('column')); // 로그 추가
const column = $(this).data('column');
let order = $(this).data('order') || 'asc';
let order = $(this).data('order') || 'asc'; // 기본값 'asc'
order = order === 'asc' ? 'desc' : 'asc';
$(this).data('order', order);
sortTable(column, order);
sortTable(column, order); // 테이블 정렬 함수 호출
});
// 다른 테이블(#bakeryTotalTable 등)은 클릭해도 정렬 이벤트 없음
}
function sortTable(column, order) {
@ -107,22 +102,9 @@ $(document).ready(function() {
$.each(rows, (index, row) => {
tbody.append(row);
// 정렬 후 No. 열의 값을 재설정
$(row).find('td').eq(0).text(index + 1);
});
// 아이콘 업데이트
// 모든 th의 .sort-icon 초기화 (모든 아이콘 초기화)
$('#bakeryTable th .sort-icon').removeClass('fa fa-sort-up fa-sort-down').text('');
// 정렬된 컬럼의 아이콘만 선택하기
const $icon = $(`#bakeryTable th[data-column="${column}"] > .sort-icon`);
if (order === 'asc') {
// FontAwesome 아이콘 클래스 사용 시
$icon.addClass('fa fa-sort-up').text('');
} else {
$icon.addClass('fa fa-sort-down').text('');
}
}
function getColumnIndex(column) {

View File

@ -40,14 +40,6 @@ $recnum = 15; // 출력할 아이템 수
$pagenum = 20; // 한 페이지에 출력할 페이지 수
$query_limit = "LIMIT ".(($p - 1) * $recnum).",".$recnum; // 출력할 아이템 수 만큼만 가져오기
// 권한설정
$pageAuth = [
'bakery' => ['bakery', 'firstgarden'],
'vip' => ['ticket', 'firstgarden', 'service', 'gift', 'heyum', 'dksdpwl', '39365260', 'reservation'],
'ticket' => ['ticket'],
'admin' => ['abc', '39365260']
];
// page 설정
// 페이지가 많지 않기 때문에 수동으로 배열을 만들었지만, 페이지가 많아지면 DB를 이용하는것이 편함
// 1차배열의 index 순으로 출력함. 특정 메뉴가 상단에 출력되게 하고 싶다면 순서를 바꿔줄 것
@ -144,4 +136,3 @@ $setpage = array(
'purl' => FG_MANAGER_URL.'/bakery/bakery_stock.php'
)
);

View File

@ -1,37 +0,0 @@
/* 전역 */
body {padding-top: 5em; font-size: 0.9em;}
/* 사이드바 폭 */
.offcanvas.show,.offcanvas.showing,.offcanvas.hiding {width: 250px; }
/* 로그인 */
.container-login button {margin-top: 20px; width: 100%;}
.container-login h2 {text-align: center;}
/* viplist 전체숫자 */
.viplist_head {}
.mod-label {width:200px;}
.unused td {color:gray !important}
/* 중복체크 */
.checkdup {height: 25px; text-align: right;}
/* 베이커리용 CSS */
.bakery tfoot {
font-weight: 600;
}
.sort-icon {
margin-left: 5px;
vertical-align: middle;
}
/* 인쇄시에만 출력되도록 */
.only-print { display: none !important; }
/* 프린트 시 출력되지 않도록 */
@media print {
.no-print { display: none !important; }
header, footer { display: none; }
/* 얘는 출력되어야 함 */
.only-print { display: block !important; }
}

17
manager/css/vip.css Normal file
View File

@ -0,0 +1,17 @@
/* 전역 */
body {padding-top: 5em; font-size: 0.9em;}
/* 사이드바 폭 */
.offcanvas.show,.offcanvas.showing,.offcanvas.hiding {width: 250px; }
/* 로그인 */
.container-login button {margin-top: 20px; width: 100%;}
.container-login h2 {text-align: center;}
/* viplist 전체숫자 */
.viplist_head {}
.mod-label {width:200px;}
.unused td {color:gray !important}
/* 중복체크 */
.checkdup {height: 25px; text-align: right;}

View File

@ -22,7 +22,7 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<link rel="stylesheet"href="<?=FG_MANAGER_URL?>/css/main.css">
<link rel="stylesheet"href="<?=FG_MANAGER_URL?>/css/vip.css">
<script src="<?=FG_MANAGER_URL?>/js/list.js"></script>
<script src="<?=FG_MANAGER_URL?>/js/ajax.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@ -37,7 +37,7 @@
$page = basename($_SERVER['PHP_SELF'], '.php'); // 로그인 했다면 현재 페이지 이름 구함
?>
<!-- 내비게이션 시작 -->
<nav class="navbar navbar-expand-lg bg-body-tertiary fixed-top d-flex p-2 no-print">
<nav class="navbar navbar-expand-lg bg-body-tertiary fixed-top d-flex p-2">
<div class="container-fluid">
<a class="navbar-brand" href="<?=FG_MANAGER_URL?>">퍼스트가든 관리페이지</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
@ -45,9 +45,6 @@
</button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 justify-content-end">
<?php if ( in_array($_SESSION['user_id'], $pageAuth['ticket']) || in_array($_SESSION['user_id'], $pageAuth['admin']) ) { ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
입장처리
@ -57,11 +54,6 @@
<li><a class="dropdown-item" href="<?=FG_MANAGER_URL.'/annual_member/annual_member_list_ent.php'?>">연간회원</a></li>
</ul>
</li>
<?php } ?>
<?php if ( in_array($_SESSION['user_id'], $pageAuth['vip']) || in_array($_SESSION['user_id'], $pageAuth['admin']) ) { ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
명단관리
@ -74,26 +66,17 @@
<li><a class="dropdown-item" href="<?=FG_MANAGER_URL.'/annual_member/annual_member_category.php'?>">연간회원 구분관리</a></li>
</ul>
</li>
<?php } ?>
<?php if ( in_array($_SESSION['user_id'], $pageAuth['bakery']) || in_array($_SESSION['user_id'], $pageAuth['admin']) ) { ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
베이커리
</a>
<ul class="dropdown-menu">
<li class="nav-item">
<a class="nav-link" href="<?=FG_MANAGER_URL.'/bakery/bakery_stock.php'?>">일일현황</a>
<a class="nav-link" href="<?=FG_MANAGER_URL.'/bakery/bakery_stock_view.php'?>">기간조회</a>
<a class="nav-link" href="<?=FG_MANAGER_URL.'/bakery/bakery_product_list.php'?>">제품목록관리</a>
</li>
</ul>
</li>
<?php } ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
베이커리
</a>
<ul class="dropdown-menu">
<li class="nav-item">
<a class="nav-link" href="<?=FG_MANAGER_URL.'/bakery/bakery_stock.php'?>">일일현황</a>
<a class="nav-link" href="<?=FG_MANAGER_URL.'/bakery/bakery_product_list.php'?>">제품목록관리</a>
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
관리자

View File

@ -1,7 +1,6 @@
<?php
include_once '_common.php'; // 그누보드 설정 파일 불러오기
include_once 'config.php';
include_once 'head.php';
// 로그인 체크
if( isset($_SESSION['user_id']) ) { // 로그인 했다면

View File

@ -315,123 +315,7 @@ function get_total_count($db_name) {
return $R;
}
function getBakeryInvenDataPeriod($start_date, $end_date, $searchWord = "", $ord_by = "a.date ASC, b.product_name ASC") {
global $fg;
// 검색 조건
$search_sql = "";
if ($searchWord !== "") {
$searchWord = sql_real_escape_string($searchWord);
$search_sql = "AND b.product_name LIKE '%{$searchWord}%'";
}
$query = "SELECT
b.product_name,
SUM(a.production) AS production,
SUM(a.inhouse_use) AS inhouse_use,
SUM(a.recycling) AS recycling,
SUM(a.disposal) AS disposal,
SUM(a.sales) AS sales,
SUM(a.payment_amount) AS payment_amount
FROM {$fg['bakery_inventory_table']} AS a
LEFT JOIN {$fg['bakery_product_table']} AS b
ON a.barcode = b.barcode
WHERE b.used = 1
AND a.date BETWEEN '{$start_date}' AND '{$end_date}'
{$search_sql}
GROUP BY a.barcode
ORDER BY {$ord_by}";
error_log($query);
$result = sql_query($query);
$R = array();
while ($row = sql_fetch_array($result)) {
$R[] = $row;
}
return $R;
}
// 기간별 합계 수량 구하기
function getBakeryInvenSumPeriod($start_date, $end_date, $searchWord = "") {
global $fg;
$search_sql = "";
if ($searchWord !== "") {
$searchWord = sql_real_escape_string($searchWord);
$search_sql = "AND b.product_name LIKE '%{$searchWord}%'";
}
$query = "SELECT
SUM(a.production) AS t_production,
SUM(a.inhouse_use) AS t_inhouse_use,
SUM(a.recycling) AS t_recycling,
SUM(a.disposal) AS t_disposal,
SUM(a.sales) AS t_sales,
SUM(a.payment_amount) AS t_payment_amount
FROM {$fg['bakery_inventory_table']} AS a
LEFT JOIN {$fg['bakery_product_table']} AS b
ON a.barcode = b.barcode
WHERE b.used = 1
AND a.date BETWEEN '{$start_date}' AND '{$end_date}'
{$search_sql}";
error_log($query);
return sql_fetch($query); // 결과 없으면 false 반환
}
// 누계 구하기
function getBakeryInvenSummaryData($date, $ord_by = "b.product_name ASC") {
global $fg;
// 해당 월의 시작일과 종료일 계산
$month_start = date('Y-m-01', strtotime($date));
$month_end = $date;
// 전월 마지막 날짜 계산
$prev_month_last_day = date('Y-m-t', strtotime($month_start . ' -1 month'));
// 전월 current_stock 조회
$prev_query = "
SELECT SUM(current_stock) AS total_previous_stock
FROM {$fg['bakery_inventory_table']} AS a
LEFT JOIN {$fg['bakery_product_table']} AS b
ON a.barcode = b.barcode
WHERE b.used = 1
AND a.date = '{$prev_month_last_day}'
";
$prev_result = sql_fetch($prev_query);
$total_previous_stock = $prev_result['total_previous_stock'] ?? '';
// 현재 월 누적 합산 조회
$query = "
SELECT
SUM(a.production) AS total_production,
SUM(a.inhouse_use) AS total_inhouse_use,
SUM(a.recycling) AS total_recycling,
SUM(a.disposal) AS total_disposal,
SUM(a.sales) AS total_sales,
SUM(a.sales_amount) AS total_sales_amount,
SUM(a.menu_discount) AS total_menu_discount,
SUM(a.payment_amount) AS total_payment_amount
FROM {$fg['bakery_inventory_table']} AS a
LEFT JOIN {$fg['bakery_product_table']} AS b
ON a.barcode = b.barcode
WHERE b.used = 1
AND a.date BETWEEN '{$month_start}' AND '{$month_end}'
";
$result = sql_fetch($query);
// previous_stock 추가
// $result['total_previous_stock'] = $total_previous_stock;
return $result;
}
// 전체 품명 불러오기
function getBakeryProductList($ord_by = "ASC") {
global $fg;
@ -445,21 +329,6 @@ function getBakeryInvenSummaryData($date, $ord_by = "b.product_name ASC") {
return $R;
}
// 사용 중인(used=1) 품목 수 구하기
function cntUsedBakeryItems() {
global $fg;
$query = "SELECT COUNT(*) AS cnt FROM {$fg['bakery_product_table']} WHERE used = 1";
error_log($query);
$result = sql_fetch($query);
$result = $result['cnt'];
return $result;
}
// 어제자 최종재고 불러오기
function getPrevStock($date, $barcode) {
global $fg;

View File

@ -35,17 +35,11 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
<label class="btn btn-outline-primary" for="search_group_all">전체</label>
<?php
$group_name = getVipCatName();
$show_all = isset($_REQUEST['show_all_cat']) ? true : false;
foreach ($group_name as $row) { // VIP구분 가지고 와서 뿌려주기
$inactive_class = ($row['gr_used'] == 0) ? ' inactive-cat' : '';
$display_style = ($row['gr_used'] == 0) ? 'display: none;' : '';
?>
<input type="radio" name="search_group" id="search_group_<?=$row['gr_id']?>" class="btn-check<?=$inactive_class?>" value="<?=$row['gr_id']?>" <?php if ($search_group === $row['gr_id']) echo "checked" ?> style="<?=$display_style?>">
<label class="btn btn-outline-primary category-label<?=$inactive_class?>" for="search_group_<?=$row['gr_id']?>" style="<?=($row['gr_used'] == 0) ? 'opacity: 0.5;' : ''?><?=$display_style?>"><?=$row['gr_name']?></label>
<?php } // endforeach ?>
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="toggleShowAllCat()" data-show-all="<?=($show_all) ? 'true' : 'false'?>">
<?=($show_all) ? '활성만 보기' : '모두보기'?>
</button>
<input type="radio" name="search_group" id="search_group_<?=$row['gr_id']?>" class="btn-check" value="<?=$row['gr_id']?>" <?php if ($search_group === $row['gr_id']) echo "checked" ?>>
<label class="btn btn-outline-primary" for="search_group_<?=$row['gr_id']?>"><?=$row['gr_name']?></label>
<?php } ?>
</div>
<div class="input-group col-md-6">
<span class="input-group-text" id="search_word">회원검색</span>
@ -163,7 +157,6 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
<col width="130px">
<col width="100px">
<col width="90px">
<col width="90px">
<col width="50px">
<col width="100px">
</colgroup>
@ -174,7 +167,6 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
<th class="text-center">성명</th>
<th class="text-center">연락처</th>
<th class="text-center">생년월일</th>
<th class="text-center">만료일</th>
<th class="text-center">최종이용일</th>
<th class="text-center">방문횟수</th>
<?php if($_SESSION['user_lv'] > "1"){ ?>
@ -183,46 +175,37 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
</tr>
</thead>
<tbody class="table-group-divider">
<?php foreach($R as $R) {
$today = date('Y-m-d');
$expire_date = $R['vip_date'];
$is_expired = ($expire_date != '9999-12-31' && strtotime($expire_date) < strtotime($today)) ? true : false;
$expired_class = $is_expired ? 'expired-vip' : '';
?>
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?> vip-row <?=$expired_class?>" style="cursor: pointer; height: 60px;" onclick="handleRowClick(event, '<?=$R['idx']?>')">
<td class="text-center align-middle"><?=$R['vip_card_no']?></td>
<td class="text-center align-middle"><?=$R['status']?></td>
<td class="text-center align-middle"><?=$R['vip_name']?></td>
<td class="text-center align-middle"><?=$R['vip_tel']?></td>
<td class="text-center align-middle"><?=$R['vip_birth']?></td>
<td class="text-center align-middle"><?=($R['vip_date'] == '9999-12-31')? '평생' : $R['vip_date']?></td>
<td class="text-center align-middle">
<?php foreach($R as $R) {?>
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?>">
<td class="text-center"><?=$R['vip_card_no']?></td>
<td class="text-center"><?=$R['status']?></td>
<td class="text-center"><?=$R['vip_name']?></td>
<td class="text-center"><?=$R['vip_tel']?></td>
<td class="text-center"><?=$R['vip_birth']?></td>
<td class="text-center">
<?php
$edate = $R['last_ent_date'];
echo ($edate == '0000-00-00 00:00:00')? '미이용' : date('Y-m-d',strtotime($edate));
?></td>
<td class="text-center align-middle"><?=$R['ent_count']?></td>
<td class="text-center align-middle d-flex justify-content-center gap-1 action-cell" onclick="event.stopPropagation();" style="min-height: 60px;">
<?php if($_SESSION['user_lv'] > "1"){ ?>
<?php if($R['status'] == '정상' || $R['status'] == '만료') { ?>
<a class="btn btn-danger btn-xs" href="#" onclick="event.preventDefault(); event.stopPropagation(); entMemWithConfirm('<?=$R['idx']?>', <?=$is_expired ? 'true' : 'false'?>);" role="button"><i class="fas fa-sign-in-alt"></i></a>
<button type="button" class="btn btn-success btn-xs" data-bs-toggle="modal" data-bs-target="#modify_modal_<?=$R['idx']?>" onclick="event.stopPropagation()"><i class="fa-solid fa-pen-to-square"></i></button>
<button type="button" class="btn btn-primary btn-xs" data-bs-toggle="modal" data-bs-target="#renew_modal_<?=$R['idx']?>" onclick="event.stopPropagation()"><i class="fa-solid fa-repeat"></i></button>
<?php } ?>
<?php if($_SESSION['user_lv'] === "4" && $R['status'] != "재발급"){ ?>
<a class="btn btn-danger btn-xs" href="#" onclick="event.preventDefault(); event.stopPropagation(); deleteItem('<?=$R['idx']?>');" role="button"><?=($R['status'] == '정상')? '<i class="fa-solid fa-trash-can"></i>' : '<i class="fa-solid fa-trash-can-arrow-up"></i>'?></a>
<?php } ?>
<?php } ?>
</td>
</tr>
<td class="text-center"><?=$R['ent_count']?></td>
<td class="text-center d-flex justify-content-center gap-1">
<?php if($_SESSION['user_lv'] > "1"){ ?>
<!-- 입장처리 버튼 -->
<?php if ($R['status'] == '정상') { ?>
<a class="btn btn-danger btn-xs" href="javascript:entMem('<?=$R['idx']?>')" role="button"><i class="fas fa-sign-in-alt"></i></a>
<?php } else { ?>
<i class="fas fa-times"></i>
<?php } ?>
<!-- 입장처리 버튼 끝 -->
<!-- 수정 모달 -->
<div id="modify_modal_<?=$R['idx']?>" class="modal fade" tabindex="-1" aria-labelledby="modify_modal_<?=$R['idx']?>" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-dialog modal modal-dialog-centered">
<div class="modal-content">
<form class="modify" id="modify_<?=$R['idx']?>">
<div class="modal-header">
<h5 class="modal-title">정보 보기/수정</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-start">
<input type="hidden" id="idx_<?=$R['idx']?>" name="idx" value="<?=$R['idx']?>" readonly>
@ -233,10 +216,7 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
if($R['status'] != "정상") {
$ro = "disabled";
echo "<p>폐기된 카드는 수정할 수 없습니다.</p>";
}
$gender = '';
if($R['status'] == "정상") {
$gender = $R['vip_gender'];
;
}
?>
<div class="input-group mb-1">
@ -274,7 +254,11 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
<div class="input-group mb-1">
<span class="input-group-text col-md-2" id="vip_name_<?=$R['idx']?>">고객명</span>
<input type="text" class="form-control" id="vip_name_<?=$R['idx']?>" name="vip_name" value="<?=$R['vip_name']?>" required <?=$ro?>>
<?php if($R['status'] == "정상") { ?>
<? // DB에서 성별값을 불러온다.
if($R['status'] == "정상") { // 정상 상태가 아니면 성별도 필요없음
$gender = $R['vip_gender']
?>
<!-- 불러온 성별에 따라 라디오버튼 선택하도록 -->
<input type="radio" class="btn-check" name="vip_gender" id="vip_gender_<?=$R['idx']?>_male" value="남" <?php if($gender == "남") echo "checked" ?> required>
<label class="btn btn-outline-primary" for="vip_gender_<?=$R['idx']?>_male">남</label>
<input type="radio" class="btn-check" name="vip_gender" id="vip_gender_<?=$R['idx']?>_female" value="여" <?php if($gender =="여") echo "checked" ?> required>
@ -302,113 +286,56 @@ $table = "{$fg['vip_list_table']} AS a LEFT JOIN {$fg['vip_category_table']} AS
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" <?=$ro?> >수정</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close" data-bs-target="#modify_modal_<?=$R['idx']?>">닫기</button>
</div>
</form>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- 재발급 모달 -->
<?php if ( $R['status'] === "정상" ) { ?>
<div id="renew_modal_<?=$R['idx']?>" class="modal fade" tabindex="-1" aria-labelledby="renew_modal_<?=$R['idx']?>" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form class="renew" id="renew_<?=$R['idx']?>">
<input type="hidden" id="idx_<?=$R['idx']?>" name="idx" value="<?=$R['idx']?>" readonly>
<input type="hidden" id="last_edit_name_<?=$R['idx']?>" name="last_edit_name" value="<?=$_SESSION['user_name']?>" readonly>
<div class="modal-header">
<h5 class="modal-title">재발급</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-start">
<div class="input-group">
<span class="input-group-text col-md-4" id="re_no_<?=$R['idx']?>">재발급 카드번호</span>
<input type="number" class="form-control" oninput="checkDupRc(this.value)" id="rc_no_<?=$R['idx']?>" name="rc_no" maxlength="6" value="" required>
<!-- 수정 모달 끝 -->
<!-- 수정 버튼 -->
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modify_modal_<?=$R['idx']?>"><i class="fa-solid fa-pen-to-square"></i></button>
<!-- 재발급 버튼 -->
<?php if ( $R['status'] === "정상" ) { ?>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#renew_modal_<?=$R['idx']?>"><i class="fa-solid fa-repeat"></i></button>
<div id="renew_modal_<?=$R['idx']?>" class="modal fade text-center ">
<div class="modal-dialog">
<div class="modal-content">
<form class="renew" id="renew_<?=$R['idx']?>">
<input type="hidden" id="idx_<?=$R['idx']?>" name="idx" value="<?=$R['idx']?>" readonly>
<input type="hidden" id="last_edit_name_<?=$R['idx']?>" name="last_edit_name" value="<?=$_SESSION['user_name']?>" readonly>
<div class="modal-header">
<h5 class="modal-title">재발급</h4>
</div>
<div class="input-group checkdup">
<span id="duplicate-rc-warning"></span>
<div class="modal-body text-start">
<div class="input-group">
<span class="input-group-text col-md-4" id="re_no_<?=$R['idx']?>">재발급 카드번호</span>
<input type="number" class="form-control" oninput="checkDupRc(this.value)" id="rc_no_<?=$R['idx']?>" name="rc_no" maxlength="6" value="" required>
</div>
<div class="input-group checkdup">
<span id="duplicate-rc-warning"></span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" id="renew_submit" class="btn btn-primary">확인</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>
</form>
</div>
<div class="modal-footer">
<button type="submit" id="renew_submit" class="btn btn-primary">확인</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close" data-bs-target="#renew_modal_<?=$R['idx']?>">닫기</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</div>
<?php } ?>
<?php } ?>
<!-- 폐기는 관리자만 -->
<?php if($_SESSION['user_lv'] === "4" && $R['status'] != "재발급"){ ?>
<a class="btn btn-danger" href="javascript:deleteItem('<?=$R['idx']?>')" role="button"><?=($R['status'] == '정상')? '<i class="fa-solid fa-trash-can"></i>' : '<i class="fa-solid fa-trash-can-arrow-up"></i>'?></a>
<?php }
} ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<style>
.expired-vip {
color: #777;
}
.expired-vip td {
color: #999 !important;
}
.vip-row:hover {
background-color: #f5f5f5;
}
.inactive-cat {
opacity: 0.6;
}
</style>
<script>
function handleRowClick(event, idx) {
// 작업 셀을 클릭했는지 확인
if (event.target.closest('.action-cell')) {
return;
}
const modal = new bootstrap.Modal(document.getElementById('modify_modal_' + idx));
modal.show();
}
function toggleShowAllCat() {
const btn = event.target;
const showAll = !btn.getAttribute('data-show-all') || btn.getAttribute('data-show-all') === 'false';
// 비활성 카테고리 input과 label 토글
const inactiveElements = document.querySelectorAll('.inactive-cat');
inactiveElements.forEach(elem => {
elem.style.display = showAll ? 'inline-block' : 'none';
});
// 버튼 텍스트 업데이트
btn.textContent = showAll ? '활성만 보기' : '모두보기';
btn.setAttribute('data-show-all', showAll ? 'true' : 'false');
// URL 업데이트 (새로고침 없음)
const url = new URL(window.location);
if (showAll) {
url.searchParams.set('show_all_cat', '1');
} else {
url.searchParams.delete('show_all_cat');
}
window.history.pushState({}, '', url.toString());
}
function openVipModal(idx) {
const modal = document.getElementById('modify_modal_' + idx);
if (modal) {
const bsModal = new bootstrap.Modal(modal);
bsModal.show();
}
}
function entMemWithConfirm(idx, isExpired) {
let confirmMsg = isExpired ? '만료된 회원입니다. 입장처리 하시겠습니까?' : '입장처리 하시겠습니까?';
if (confirm(confirmMsg)) {
entMem(idx);
}
}
</script>
<?php include_once FG_MANAGER_PATH."/tail.php";

View File

@ -14,15 +14,9 @@ if(isset($_POST['mode']) && trim($_POST['mode']) === "enter") {
$date = date("Y-m-d");
$datetime = date("Y-m-d H:i:s");
// 만료일 설정 로직
// 현재 최종이용일 + 1년
$vip_date = date("Y-m-d", strtotime($date . " +1 year"));
// 리스트 DB에 최종사용일자 및 만료일 업데이트
// 만료 상태였다면 정상으로 변경
$status_update = ($list['status'] === '만료') ? ", status='정상'" : '';
$listquery = "UPDATE {$fg['vip_list_table']} SET last_ent_date='{$date}', ent_count='{$ent_count}', vip_date='{$vip_date}'{$status_update} WHERE idx='{$idx}'";
// 리스트 DB에 최종사용일자 업데이트
$listquery = "UPDATE {$fg['vip_list_table']} SET last_ent_date='{$date}', ent_count='{$ent_count}' WHERE idx='{$idx}'";
$result = sql_query($listquery);
$data = array("isSuccess" => $result);
@ -36,8 +30,7 @@ if(isset($_POST['mode']) && trim($_POST['mode']) === "enter") {
// log 기록
$work = "VIP입장";
$status_changed = ($list['status'] === '만료') ? " (상태변경: 만료→정상)" : "";
$work_detail = "카드번호 : ".$list['vip_card_no']." 만료일 설정 : ".$vip_date." 처리자 : ".$_SESSION['user_name'].$status_changed;
$work_detail = "카드번호 : ".$list['vip_card_no']." 처리자 : ".$_SESSION['user_name'];
$logUpdate = log_update($work, $work_detail, $_SESSION['user_id'], $datetime);
if ($isDebug && !$logUpdate) echo '로그 등록 실패\n';

View File

@ -49,27 +49,22 @@ if( isset($search_word) && $search_word ) { // 검색어가 있을때만 돌림
<tr class="align-middle">
<th class="text-center">카드번호</th>
<th class="text-center">상태</th>
<!--<th class="text-center">회원구분</th>-->
<th class="text-center">회원구분</th>
<th class="text-center">성명</th>
<th class="text-center">연락처</th>
<th class="text-center">가입일</th>
<th class="text-center">입장횟수</th>
<th class="text-center">최종입장일</th>
<th class="text-center">만료일</th>
<th class="text-center">VIP만료일</th>
<th class="text-center">입장확인</th>
</tr>
</thead>
<tbody class="table-group-divider">
<?php foreach($R as $R) {
$today = date('Y-m-d');
$expire_date = $R['vip_date'];
$is_expired = ($expire_date != '9999-12-31' && strtotime($expire_date) < strtotime($today)) ? true : false;
$expired_class = $is_expired ? 'expired-vip' : '';
?>
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?> <?=$expired_class?>">
<?php foreach($R as $R) { ?>
<tr class="<?=($R['status'] != '정상') ? "unused" : "" ?>">
<td class="text-center"><?=sprintf("%06d",$R['vip_card_no'])?></td>
<td class="text-center"><?=$R['status']?></td>
<!--<td class="text-center"><?=$R['gr_name']?></td>-->
<td class="text-center"><?=$R['gr_name']?></td>
<td class="text-center"><?=$R['vip_name']?></td>
<td class="text-center"><?=$R['vip_tel']?></td>
<td class="text-center"><?=date('Y-m-d',strtotime($R['join_datetime']));?></td>
@ -81,8 +76,8 @@ if( isset($search_word) && $search_word ) { // 검색어가 있을때만 돌림
<?=($R['vip_date'] == "9999-12-31") ? "평생" : $R['vip_date']; ?>
</td>
<td class="text-center">
<?php if ($R['status'] == '정상' || $R['status'] == '만료' ) { ?>
<a class="btn btn-danger btn-xs" href="#" onclick="event.preventDefault(); entMemWithConfirm('<?=$R['idx']?>', <?=$is_expired ? 'true' : 'false'?>);" role="button"><i class="fas fa-sign-in-alt"></i></a>
<?php if ($R['status'] == '정상') { ?>
<a class="btn btn-danger btn-xs" href="javascript:entMem('<?=$R['idx']?>')" role="button"><i class="fas fa-sign-in-alt"></i></a>
<?php } else { ?>
<i class="fas fa-times"></i>
<?php } ?>
@ -98,24 +93,4 @@ if( isset($search_word) && $search_word ) { // 검색어가 있을때만 돌림
echo '<h2 style="margin-top: 30px; text-align: center;">검색 결과가 없습니다.</h2>'.PHP_EOL;
}
}
?>
<style>
.expired-vip {
color: #777;
}
.expired-vip td {
color: #999 !important;
}
</style>
<script>
function entMemWithConfirm(idx, isExpired) {
let confirmMsg = isExpired ? '만료된 카드입니다. 입장처리 하시겠습니까?' : '입장처리 하시겠습니까?';
if (confirm(confirmMsg)) {
entMem(idx);
}
}
</script>
<?php include_once FG_MANAGER_PATH."/tail.php";
include_once FG_MANAGER_PATH."/tail.php";

View File

@ -1,257 +0,0 @@
<?php
/**
* VIP 만료일 설정 페이지
* 방문횟수가 0인 경우 등록일 +1년을 만료일로 설정
* 방문횟수가 1 이상인 경우 최종이용일 +1년을 만료일로 설정
*/
include_once ('./_common.php');
include_once (FG_MANAGER_PATH.'/head.php');
if(!$_SESSION['user_id']) {
header('Location: '.FG_MANAGER_URL);
exit;
}
// 권한 체크 (관리자 이상만 가능)
if($_SESSION['user_lv'] < 3) {
die('권한이 없습니다.');
}
$isDebug = false; // 디버그 출력용 변수
$result_message = "";
$result_data = array();
$is_executed = false;
// AJAX 요청 처리
if(isset($_POST['ajax_mode'])) {
$ajax_mode = trim($_POST['ajax_mode']);
if ($ajax_mode === "bulk_set_expire_date") {
$status = isset($_POST['status']) ? trim($_POST['status']) : "정상";
$gr_id = isset($_POST['gr_id']) ? trim($_POST['gr_id']) : "";
// 검색 조건 만들기
$where = " WHERE status='{$status}'";
if (!empty($gr_id)) {
$where .= " AND gr_id='{$gr_id}'";
}
$squery = "SELECT * FROM {$fg['vip_list_table']}{$where}";
$result_list = sql_query($squery);
$updated_count = 0;
$error_count = 0;
$datetime = date("Y-m-d H:i:s");
while($list = sql_fetch_array($result_list)) {
$ent_count = $list['ent_count'];
// 만료일 설정 로직
if ($ent_count == 0) {
// 방문횟수가 0: 등록일 + 1년
$vip_date = date("Y-m-d", strtotime($list['join_datetime'] . " +1 year"));
} else {
// 방문횟수가 1 이상: 최종이용일 + 1년
$vip_date = date("Y-m-d", strtotime($list['last_ent_date'] . " +1 year"));
}
// 만료 여부 확인 (만료일이 오늘 이전이면 상태를 '만료'로 변경)
$today = date('Y-m-d');
$new_status = (strtotime($vip_date) < strtotime($today)) ? '만료' : '정상';
// DB 업데이트
$updateQuery = "UPDATE {$fg['vip_list_table']} SET vip_date='{$vip_date}', status='{$new_status}' WHERE idx='{$list['idx']}'";
$update_result = sql_query($updateQuery);
if ($update_result) {
$updated_count++;
} else {
$error_count++;
}
// log 기록
$work = "VIP만료일일괄설정";
$work_detail = "카드번호 : ".$list['vip_card_no']." 만료일 : ".$vip_date." 상태 : ".$new_status." 처리자 : ".$_SESSION['user_name'];
$logUpdate = log_update($work, $work_detail, $_SESSION['user_id'], $datetime);
}
$data = array(
"isSuccess" => true,
"updated_count" => $updated_count,
"error_count" => $error_count
);
header("Content-Type: application/json");
echo json_encode($data);
exit;
}
}
// 1회성 실행 모드 (GET/POST 쿼리 파라미터)
if(isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 'yes') {
$datetime = date("Y-m-d H:i:s");
$is_executed = true;
// 모든 VIP 정상 상태 데이터 조회
$squery = "SELECT * FROM {$fg['vip_list_table']} WHERE status='정상'";
$result_list = sql_query($squery);
$updated_count = 0;
$error_count = 0;
$details = array();
while($list = sql_fetch_array($result_list)) {
$ent_count = $list['ent_count'];
// 만료일 설정 로직
if ($ent_count == 0) {
// 방문횟수가 0: 등록일 + 1년
$vip_date = date("Y-m-d", strtotime($list['join_datetime'] . " +1 year"));
$logic_type = "등록일 기준";
} else {
// 방문횟수가 1 이상: 최종이용일 + 1년
$vip_date = date("Y-m-d", strtotime($list['last_ent_date'] . " +1 year"));
$logic_type = "최종이용일 기준";
}
// 만료 여부 확인 (만료일이 오늘 이전이면 상태를 '만료'로 변경)
$today = date('Y-m-d');
$new_status = (strtotime($vip_date) < strtotime($today)) ? '만료' : '정상';
// DB 업데이트
$updateQuery = "UPDATE {$fg['vip_list_table']} SET vip_date='{$vip_date}', status='{$new_status}' WHERE idx='{$list['idx']}'";
$update_result = sql_query($updateQuery);
if ($update_result) {
$updated_count++;
$details[] = array(
'card_no' => $list['vip_card_no'],
'name' => $list['vip_name'],
'old_date' => $list['vip_date'],
'new_date' => $vip_date,
'logic' => $logic_type,
'ent_count' => $ent_count,
'new_status' => $new_status,
'status_changed' => ($new_status !== $list['status']) ? 'O' : 'X'
);
} else {
$error_count++;
}
// log 기록
$work = "VIP만료일일괄설정";
$work_detail = "카드번호 : ".$list['vip_card_no']." 만료일 : ".$vip_date." (" . $logic_type . ") 상태 : ".$new_status." 처리자 : ".$_SESSION['user_name'];
$logUpdate = log_update($work, $work_detail, $_SESSION['user_id'], $datetime);
}
$result_message = "처리 완료: 업데이트 성공 {$updated_count}건, 실패 {$error_count}";
$result_data = $details;
}
?>
<style>
.expire-date-container {
max-width: 900px;
margin: 20px auto;
}
.result-table {
font-size: 12px;
}
.result-table td {
padding: 8px;
}
.success-bg {
background-color: #d4edda;
}
.error-bg {
background-color: #f8d7da;
}
</style>
<div class="expire-date-container">
<h2 class="mb-4">VIP 만료일 일괄 설정</h2>
<?php if($is_executed) { ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<strong>✓ 처리 완료!</strong>
<?= $result_message ?>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php if(count($result_data) > 0) { ?>
<div class="card mt-4">
<div class="card-header">
<h5>처리 결과 상세</h5>
</div>
<div class="card-body">
<table class="table table-sm result-table">
<thead>
<tr>
<th>카드번호</th>
<th>성명</th>
<th>이전 만료일</th>
<th>신규 만료일</th>
<th>설정 기준</th>
<th>방문횟수</th>
<th>신규 상태</th>
<th>상태변경</th>
</tr>
</thead>
<tbody>
<?php foreach($result_data as $item) { ?>
<tr class="success-bg">
<td><?= $item['card_no'] ?></td>
<td><?= $item['name'] ?></td>
<td><?= ($item['old_date'] == '9999-12-31') ? '평생' : $item['old_date'] ?></td>
<td><strong><?= $item['new_date'] ?></strong></td>
<td><?= $item['logic'] ?></td>
<td><?= $item['ent_count'] ?></td>
<td><?= $item['new_status'] ?></td>
<td><?= ($item['status_changed'] === 'O') ? '<span class="badge bg-warning">변경됨</span>' : '-' ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php } ?>
<div class="mt-4">
<a href="vip_list.php" class="btn btn-primary">VIP 목록으로 돌아가기</a>
</div>
<?php } else { ?>
<div class="card">
<div class="card-body">
<h5 class="card-title">작업 설명</h5>
<ul>
<li><strong>상태: 정상</strong>인 모든 VIP의 만료일을 설정합니다</li>
<li><strong>방문횟수가 0</strong>이면: <mark>등록일 + 1년</mark>을 만료일로 설정</li>
<li><strong>방문횟수가 1 이상</strong>이면: <mark>최종이용일 + 1년</mark>을 만료일로 설정</li>
<li>모든 변경사항은 로그에 기록됩니다</li>
</ul>
</div>
</div>
<div class="alert alert-warning mt-4" role="alert">
<strong>⚠️ 주의:</strong> 이 작업은 취소할 수 없습니다.
<br>현재 상태의 모든 정상 상태 VIP <?php
$check_count = get_num_rows("{$fg['vip_list_table']}", "WHERE status='정상'");
echo $check_count;
?>건의 만료일이 변경됩니다.
</div>
<div class="mt-4">
<form method="post" style="display: inline;">
<button type="submit" name="confirm" value="yes" class="btn btn-danger btn-lg">
<i class="fa-solid fa-exclamation-triangle"></i> 실행
</button>
</form>
<a href="vip_list.php" class="btn btn-secondary btn-lg">취소</a>
</div>
<?php } ?>
</div>
<?php include_once FG_MANAGER_PATH.'/tail.php';

View File

@ -23,14 +23,6 @@ jQuery(function($){
if( nhnkcp_settle_case == "naverpay" ){
if(typeof nhnkcp_pay_form.naverpay_direct !== "undefined") nhnkcp_pay_form.naverpay_direct.value = "Y";
var is_money = jQuery("input[name='od_settle_case']:checked" ).attr("data-money");
if (is_money) { // 머니/포인트 결제
jQuery(nhnkcp_pay_form).find("input[name='naverpay_point_direct']").val("Y");
} else { // 카드 결제
jQuery(nhnkcp_pay_form).find("input[name='naverpay_point_direct']").val("");
}
}
if( ! jQuery("form[name='sm_form']").length ){

View File

@ -37,7 +37,7 @@ include_once('./_common.php');
$tran_cd = isset($_POST["tran_cd"]) ? $_POST["tran_cd"] : ''; // 트랜잭션 코드
$ordr_idxx = isset($_POST["ordr_idxx"]) ? $_POST["ordr_idxx"] : ''; // 쇼핑몰 주문번호
$good_name = isset($_POST["good_name"]) ? $_POST["good_name"] : ''; // 상품명
$good_mny = isset($_POST["good_mny"]) ? (int) $_POST["good_mny"] : ''; // 결제 총금액
$good_mny = isset($_POST["good_mny"]) ? $_POST["good_mny"] : ''; // 결제 총금액
$buyr_name = isset($_POST["buyr_name"]) ? $_POST["buyr_name"] : ''; // 주문자명
$buyr_tel1 = isset($_POST["buyr_tel1"]) ? $_POST["buyr_tel1"] : ''; // 주문자 전화번호
$buyr_tel2 = isset($_POST["buyr_tel2"]) ? $_POST["buyr_tel2"] : ''; // 주문자 핸드폰 번호
@ -60,9 +60,9 @@ include_once('./_common.php');
$bask_cntx = isset($_POST["bask_cntx"]) ? $_POST["bask_cntx"] : ''; // 장바구니 상품수
$tablet_size = isset($_POST["tablet_size"]) ? $_POST["tablet_size"] : ''; // 모바일기기 화면비율
$comm_tax_mny = isset($_POST["comm_tax_mny"]) ? (int) $_POST["comm_tax_mny"] : ''; // 과세금액
$comm_vat_mny = isset($_POST["comm_vat_mny"]) ? (int) $_POST["comm_vat_mny"] : ''; // 부가세
$comm_free_mny = isset($_POST["comm_free_mny"]) ? (int) $_POST["comm_free_mny"] : ''; // 비과세금액
$comm_tax_mny = isset($_POST["comm_tax_mny"]) ? $_POST["comm_tax_mny"] : ''; // 과세금액
$comm_vat_mny = isset($_POST["comm_vat_mny"]) ? $_POST["comm_vat_mny"] : ''; // 부가세
$comm_free_mny = isset($_POST["comm_free_mny"]) ? $_POST["comm_free_mny"] : ''; // 비과세금액
$payco_direct = isset($_POST["payco_direct"]) ? $_POST["payco_direct"] : ''; // PAYCO 결제창 호출
$naverpay_direct = isset($_POST["naverpay_direct"]) ? $_POST["naverpay_direct"] : ''; // NAVERPAY 결제창 호출
@ -253,7 +253,7 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
echo make_order_field($data, $exclude);
foreach($_POST as $key=>$value) {
echo '<input type="hidden" name="'.get_text($key).'" value="'.get_text($value).'">'.PHP_EOL;
echo '<input type="hidden" name="'.$key.'" value="'.$value.'">'.PHP_EOL;
}
echo '</form>'.PHP_EOL;
@ -262,12 +262,12 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
<form name="sm_form" method="POST" accept-charset="euc-kr">
<input type="hidden" name="good_name" value="<?php echo get_text($good_name); ?>">
<input type="hidden" name="good_name" value="<?php echo $good_name; ?>">
<input type="hidden" name="good_mny" value="<?php echo $good_mny; ?>" >
<input type="hidden" name='buyr_name' value="<?php echo get_text($buyr_name); ?>">
<input type="hidden" name="buyr_tel1" value="<?php echo get_text($buyr_tel1); ?>">
<input type="hidden" name="buyr_tel2" value="<?php echo get_text($buyr_tel2); ?>">
<input type="hidden" name="buyr_mail" value="<?php echo get_text($buyr_mail); ?>">
<input type="hidden" name='buyr_name' value="<?php echo $buyr_name; ?>">
<input type="hidden" name="buyr_tel1" value="<?php echo $buyr_tel1; ?>">
<input type="hidden" name="buyr_tel2" value="<?php echo $buyr_tel2; ?>">
<input type="hidden" name="buyr_mail" value="<?php echo $buyr_mail; ?>">
<?php
// 가상계좌 입금 마감일을 설정하려면 아래 주석을 풀어서 사용해 주세요.
//$ipgm_date = date("Ymd", (G5_SERVER_TIME + 86400 * 5));
@ -279,7 +279,7 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
<?php } ?>
<?php if($naverpay_direct){ ?>
<input type="hidden" name="naverpay_direct" value="<?php echo get_text($naverpay_direct); ?>"> <!-- 네이버페이 결제창 호출 -->
<?php if(isset($_POST['naverpay_point_direct']) && $_POST['naverpay_point_direct'] && isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<?php } ?>
@ -294,13 +294,13 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
<!-- 요청 구분 -->
<input type="hidden" name="req_tx" value="pay">
<!-- 사이트 코드 -->
<input type="hidden" name="site_cd" value="<?php echo get_text($g_conf_site_cd); ?>">
<input type="hidden" name="site_cd" value="<?php echo $g_conf_site_cd; ?>">
<!-- 사이트 이름 -->
<input type="hidden" name="shop_name" value="<?php echo get_text($g_conf_site_name); ?>">
<input type="hidden" name="shop_name" value="<?php echo $g_conf_site_name; ?>">
<!-- 결제수단-->
<input type="hidden" name="pay_method" value="<?php echo get_text($pay_method); ?>">
<input type="hidden" name="pay_method" value="<?php echo $pay_method; ?>">
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo get_text($ordr_idxx); ?>">
<input type="hidden" name="ordr_idxx" value="<?php echo $ordr_idxx; ?>">
<!-- 최대 할부개월수 -->
<input type="hidden" name="quotaopt" value="12">
<!-- 통화 코드 -->
@ -311,29 +311,29 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
<!-- 반드시 가맹점 주문페이지의 URL을 입력 해주시기 바랍니다. -->
<input type="hidden" name="Ret_URL" value="<?php echo G5_MSHOP_URL; ?>/kcp/order_approval_form.php">
<!-- 인증시 필요한 파라미터(변경불가)-->
<input type="hidden" name="ActionResult" value="<?php echo get_text($ActionResult); ?>">
<input type="hidden" name="ActionResult" value="<?php echo $ActionResult; ?>">
<!-- 에스크로 사용유무 에스크로 사용 업체(가상계좌만 해당)는 Y로 세팅 해주시기 바랍니다.-->
<input type="hidden" name="escw_used" value="<?php echo get_text($escw_used); ?>">
<input type="hidden" name="escw_used" value="<?php echo $escw_used; ?>">
<!-- 에스크로 결제처리모드 -->
<input type="hidden" name="pay_mod" value="<?php echo ($default['de_escrow_use']?'O':'N'); ?>">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="<?php echo get_text($rcvr_name); ?>">
<input type="hidden" name="rcvr_name" value="<?php echo $rcvr_name; ?>">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="<?php echo get_text($rcvr_tel1); ?>">
<input type="hidden" name="rcvr_tel1" value="<?php echo $rcvr_tel1; ?>">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="<?php echo get_text($rcvr_tel2); ?>">
<input type="hidden" name="rcvr_tel2" value="<?php echo $rcvr_tel2; ?>">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="<?php echo get_text($rcvr_add1); ?>">
<input type="hidden" name="rcvr_add1" value="<?php echo $rcvr_add1; ?>">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="<?php echo get_text($rcvr_add2); ?>">
<input type="hidden" name="rcvr_add2" value="<?php echo $rcvr_add2; ?>">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="<?php echo get_text($rcvr_mail); ?>">
<input type="hidden" name="rcvr_mail" value="<?php echo $rcvr_mail; ?>">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="<?php echo get_text($rcvr_zipx); ?>">
<input type="hidden" name="rcvr_zipx" value="<?php echo $rcvr_zipx; ?>">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo get_text($bask_cntx); ?>">
<input type="hidden" name="bask_cntx" value="<?php echo $bask_cntx; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo get_text($good_info); ?>">
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
@ -343,7 +343,7 @@ if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo get_text($tablet_size); ?>"/>
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
@ -383,15 +383,15 @@ if($default['de_tax_flag_use']) {
}
?>
<input type="hidden" name="res_cd" value="<?php echo get_text($res_cd); ?>"> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value="<?php echo get_text($tran_cd); ?>"> <!-- 트랜잭션 코드 -->
<input type="hidden" name="enc_info" value="<?php echo get_text($enc_info); ?>"> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value="<?php echo get_text($enc_data); ?>"> <!-- 암호화 데이터 -->
<input type="hidden" name="res_cd" value="<?php echo $res_cd; ?>"> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value="<?php echo $tran_cd; ?>"> <!-- 트랜잭션 코드 -->
<input type="hidden" name="enc_info" value="<?php echo $enc_info; ?>"> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value="<?php echo $enc_data; ?>"> <!-- 암호화 데이터 -->
</form>
<div id="pay_fail">
<p>결제가 실패한 경우 아래 돌아가기 버튼을 클릭해주세요.</p>
<a href="<?php echo get_text($js_return_url); ?>">돌아가기</a>
<a href="<?php echo $js_return_url; ?>">돌아가기</a>
</div>
<div id="show_progress" style="display:none;">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt="" ></span>

View File

@ -23,9 +23,6 @@ $param_opt_3 = isset($_REQUEST['param_opt_3']) ? clean_xss_tags($_REQUEST['param
<input type="hidden" name="settle_method" value="">
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="A" > <!-- NAVERPAY 결제창 호출 -->
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->

Some files were not shown because too many files have changed in this diff Show More