제품 사용처리 기능

This commit is contained in:
2025-11-25 17:43:13 +09:00
parent d91360d10e
commit a7f551aa05
7 changed files with 396 additions and 331 deletions

View File

@ -231,6 +231,7 @@ 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}
@ -963,6 +964,20 @@ 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}

View File

@ -68,8 +68,7 @@ $sql = " select it_id,
cp_price,
ct_notax,
ct_send_cost,
it_sc_type,
ct_id
it_sc_type
from {$g5['g5_shop_cart_table']}
where od_id = '{$od['od_id']}'
group by it_id
@ -108,20 +107,10 @@ 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; ?>
@ -130,6 +119,8 @@ 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']) { ?>
@ -165,20 +156,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>
<!-- 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>
@ -188,46 +168,21 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
// 상품이미지
$image = get_it_image($row['it_id'], 50, 50);
// 상품의 옵션정보
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);
} 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']}' ");
}
// 합계금액 계산
$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']}'";
$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']}' ";
$sum = sql_fetch($sql);
// 배송비
@ -259,10 +214,8 @@ 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'] = $sum['price'];
$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
$ct_point['stotal'] = $opt['ct_point'] * $opt['ct_qty'];
?>
<tr>
<?php if($k == 0) { ?>
@ -280,15 +233,6 @@ 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">
@ -299,49 +243,9 @@ 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>
<?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 } ?>
<!-- } -->
<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>
</tr>
<?php
$chk_cnt++;
@ -360,19 +264,20 @@ 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>
@ -440,9 +345,7 @@ 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>
@ -454,9 +357,7 @@ 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>
@ -510,7 +411,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<tr>
<th scope="row">입금자</th>
<td><?php echo get_text($print_od_deposit_name); ?></td>
<td><?php echo get_text($od['od_deposit_name']); ?></td>
</tr>
<tr>
<th scope="row">입금확인일시</th>
@ -607,7 +508,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
switch($od['od_pg']) {
case 'lg':
$pg_url = 'https://app.tosspayments.com';
$pg_test = '토스페이먼츠(구버전)';
$pg_test = '토스페이먼츠';
if ($default['de_card_test']) {
$pg_url = 'https://pgweb.tosspayments.com/tmert';
$pg_test .= ' 테스트 ';
@ -621,14 +522,6 @@ 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;
case 'toss':
$pg_url = 'https://app.tosspayments.com';
$pg_test = '토스페이먼츠 ';
break;
default:
$pg_url = 'http://admin8.kcp.co.kr';
$pg_test = 'KCP';
@ -675,17 +568,11 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<th scope="row">결제취소/환불액</th>
<td><?php echo display_price($od['od_refund_price']); ?></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>
@ -695,10 +582,6 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<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>
@ -717,7 +600,6 @@ 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'] == '계좌이체')) {
?>
@ -741,23 +623,9 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$od['od_id'].'\',\''.$od['od_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} else if($od['od_pg'] == 'toss') {
$cash_receipt_script = 'window.open(\'https://dashboard.tosspayments.com/receipt/mids/si_'.$config['cf_lg_mid'].'/orders/'.$od['od_id'].'/cash-receipt?ref=dashboard\',\'receipt\',\'width=430,height=700\');';
} 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';
@ -827,12 +695,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>
@ -932,22 +799,14 @@ 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>
@ -967,7 +826,6 @@ 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>
@ -979,11 +837,6 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<?php } ?>
<?php } ?>
<!-- } -->
</tbody>
</table>
</div>
@ -1036,7 +889,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">
@ -1051,11 +904,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>
@ -1085,8 +938,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"><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="hidden" name="od_addr_jibeon" value="<?php echo get_text($od['od_addr_jibeon']); ?>"><br>
</td>
</tr>
@ -1101,14 +954,14 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tbody>
</table>
</div>
</section>
<br><br>
<h3>사용자(수령자) 정보</h3>
<section id="anc_sodr_taker" class="compare_right">
<h3>받으시는 분</h3>
<div class="tbl_frm01">
<table>
<caption>사용자(수령자) 정보</caption>
<caption>받으시는 분 정보</caption>
<colgroup>
<col class="grid_4">
<col>
@ -1132,12 +985,13 @@ 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" 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']); ?>">
<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>
</td>
</tr>
@ -1159,41 +1013,6 @@ 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">
@ -1259,7 +1078,7 @@ function form_submit(f)
var msg = "";
<?php if (is_cancel_shop_pg_order($od)) { ?>
<?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']) )) { ?>
if(status == "취소" || status == "반품" || status == "품절") {
var $ct_chk = $("input[name^=ct_chk]");
var chk_cnt = $ct_chk.length;

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 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); ?>">
<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">

View File

@ -0,0 +1,158 @@
<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

@ -12,8 +12,8 @@ $where = array();
// 퍼스트가든용
// 특정 카테고리만 노출 제외를 위한 부분
$ca_id = "20"; // 특정 카테고리 선택
$sel_ca_id = "NOT ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
$ca_id = "30"; // 분류 선택
$sel_ca_id = "ca_id = $ca_id "; // 특정 카테고리 노출만 하려면 NOT을 지운다. 카테고리는 '분류관리'에서 확인, 최상위 카테고리 기준. 값을 추가할땐 or 을 사용하면 될듯.
$tot_ct_qty = 0;
$where[] = "$sel_ca_id"; // 배열에 검색문을 넣어준다
$od_status = '입금'; //입금처리 된것만 출력한다.
@ -176,73 +176,96 @@ 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>유아</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><?=$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>
<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>
</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" 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" id="th_odrer" style="width:240px;">상품명</th>
<th scope="col" id="th_odrer">옵션</th>
<th scope="col" style="width:85px;">단가</th>
<th scope="col" style="width:62px;">주문수량</th>
<th scope="col" style="width:85px;">합계</th>
@ -253,19 +276,21 @@ if(!sql_query(" SELECT mb_id FROM {$g5['g5_shop_order_delete_table']} LIMIT 1 ",
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$chk_od_id == "false";
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>
@ -274,11 +299,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 echo substr($row['od_receipt_time'],0,10) ?></td>
<td headers="th_ordnum" class="td_odrnum2"><?php echo $row['it_name'] ?></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 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">
@ -296,16 +321,20 @@ 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 } ?>
</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']);
@ -313,6 +342,9 @@ 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)
@ -321,7 +353,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="7">합 계</th>
<th scope="row" colspan="6">합 계</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>-->

View File

@ -0,0 +1,27 @@
<?
$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

@ -199,3 +199,17 @@ 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); //핸드폰번호만 이용한다면 이것만있어도됨
}
}