php8.0 버전 호환 코드 적용 및 PHP 끝 태그 삭제 일괄적용
This commit is contained in:
@ -2,13 +2,19 @@
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
|
||||
$post_p_hash = isset($_POST['P_HASH']) ? $_POST['P_HASH'] : '';
|
||||
$post_enc_data = isset($_POST['enc_data']) ? $_POST['enc_data'] : '';
|
||||
$post_enc_info = isset($_POST['enc_info']) ? $_POST['enc_info'] : '';
|
||||
$post_tran_cd = isset($_POST['tran_cd']) ? $_POST['tran_cd'] : '';
|
||||
$post_lgd_paykey = isset($_POST['LGD_PAYKEY']) ? $_POST['LGD_PAYKEY'] : '';
|
||||
|
||||
//삼성페이 또는 lpay 또는 이니시스 카카오페이 요청으로 왔다면 현재 삼성페이 또는 lpay 또는 이니시스 카카오페이는 이니시스 밖에 없으므로 $default['de_pg_service'] 값을 이니시스로 변경한다.
|
||||
if( is_inicis_order_pay($od_settle_case) && !empty($_POST['P_HASH']) ){
|
||||
$default['de_pg_service'] = 'inicis';
|
||||
}
|
||||
|
||||
// 타 PG 사용시 NHN KCP 네이버페이로 결제 요청이 왔다면 $default['de_pg_service'] 값을 kcp 로 변경합니다.
|
||||
if(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp') && isset($_POST['enc_data']) && $_POST['enc_data'] && isset($_POST['site_cd']) && isset($_POST['nhnkcp_pay_case']) && $_POST['nhnkcp_pay_case'] === "naverpay"){
|
||||
if(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp') && $post_enc_data && isset($_POST['site_cd']) && isset($_POST['nhnkcp_pay_case']) && $_POST['nhnkcp_pay_case'] === "naverpay"){
|
||||
$default['de_pg_service'] = 'kcp';
|
||||
}
|
||||
|
||||
@ -29,13 +35,13 @@ if(get_session('ss_direct'))
|
||||
|
||||
// 결제등록 완료 체크
|
||||
if($od_settle_case != '무통장' && $od_settle_case != 'KAKAOPAY') {
|
||||
if($default['de_pg_service'] == 'kcp' && ($_POST['tran_cd'] == '' || $_POST['enc_info'] == '' || $_POST['enc_data'] == ''))
|
||||
if($default['de_pg_service'] == 'kcp' && ($post_tran_cd === '' || $post_enc_info === '' || $post_enc_data === ''))
|
||||
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
|
||||
|
||||
if($default['de_pg_service'] == 'lg' && !$_POST['LGD_PAYKEY'])
|
||||
if($default['de_pg_service'] == 'lg' && ! $post_lgd_paykey)
|
||||
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
|
||||
|
||||
if($default['de_pg_service'] == 'inicis' && !$_POST['P_HASH'])
|
||||
if($default['de_pg_service'] == 'inicis' && ! $post_p_hash)
|
||||
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
|
||||
}
|
||||
|
||||
@ -62,6 +68,10 @@ if(!isset($check_tmp['od_other_pay_type'])){
|
||||
// 변수 초기화
|
||||
$od_other_pay_type = '';
|
||||
|
||||
$od_temp_point = isset($_POST['od_temp_point']) ? (int) $_POST['od_temp_point'] : 0;
|
||||
$od_hope_date = isset($_POST['od_hope_date']) ? clean_xss_tags($_POST['od_hope_date'], 1, 1) : '';
|
||||
$ad_default = isset($_POST['ad_default']) ? (int) $_POST['ad_default'] : 0;
|
||||
|
||||
$error = "";
|
||||
// 장바구니 상품 재고 검사
|
||||
$sql = " select it_id,
|
||||
@ -99,11 +109,11 @@ if ($error != "")
|
||||
alert($error, $page_return_url);
|
||||
}
|
||||
|
||||
$i_price = (int)$_POST['od_price'];
|
||||
$i_send_cost = (int)$_POST['od_send_cost'];
|
||||
$i_send_cost2 = (int)$_POST['od_send_cost2'];
|
||||
$i_send_coupon = abs((int)$_POST['od_send_coupon']);
|
||||
$i_temp_point = (int)$_POST['od_temp_point'];
|
||||
$i_price = isset($_POST['od_price']) ? (int) $_POST['od_price'] : 0;
|
||||
$i_send_cost = isset($_POST['od_send_cost']) ? (int) $_POST['od_send_cost'] : 0;
|
||||
$i_send_cost2 = isset($_POST['od_send_cost2']) ? (int) $_POST['od_send_cost2'] : 0;
|
||||
$i_send_coupon = isset($_POST['od_send_coupon']) ? abs((int) $_POST['od_send_coupon']) : 0;
|
||||
$i_temp_point = isset($_POST['od_temp_point']) ? (int) $_POST['od_temp_point'] : 0;
|
||||
|
||||
|
||||
// 주문금액이 상이함
|
||||
@ -116,15 +126,14 @@ $cart_count = $row['cart_count'];
|
||||
$tot_od_price = $tot_ct_price;
|
||||
|
||||
// 쿠폰금액계산
|
||||
$tot_cp_price = 0;
|
||||
$tot_cp_price = $tot_it_cp_price = $tot_od_cp_price = 0;
|
||||
if($is_member) {
|
||||
// 상품쿠폰
|
||||
$tot_it_cp_price = $tot_od_cp_price = 0;
|
||||
$it_cp_cnt = count($_POST['cp_id']);
|
||||
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
|
||||
$arr_it_cp_prc = array();
|
||||
for($i=0; $i<$it_cp_cnt; $i++) {
|
||||
$cid = $_POST['cp_id'][$i];
|
||||
$it_id = $_POST['it_id'][$i];
|
||||
$cid = isset($_POST['cp_id'][$i]) ? $_POST['cp_id'][$i] : '';
|
||||
$it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
|
||||
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
|
||||
from {$g5['g5_shop_coupon_table']}
|
||||
where cp_id = '$cid'
|
||||
@ -133,7 +142,7 @@ if($is_member) {
|
||||
and cp_end >= '".G5_TIME_YMD."'
|
||||
and cp_method IN ( 0, 1 ) ";
|
||||
$cp = sql_fetch($sql);
|
||||
if(!$cp['cp_id'])
|
||||
if(! (isset($cp['cp_id']) && $cp['cp_id']))
|
||||
continue;
|
||||
|
||||
// 사용한 쿠폰인지
|
||||
@ -189,7 +198,7 @@ if($is_member) {
|
||||
$tot_od_price -= $tot_it_cp_price;
|
||||
|
||||
// 주문쿠폰
|
||||
if($_POST['od_cp_id']) {
|
||||
if(isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
|
||||
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
|
||||
from {$g5['g5_shop_coupon_table']}
|
||||
where cp_id = '{$_POST['od_cp_id']}'
|
||||
@ -235,7 +244,7 @@ $send_cost = get_sendcost($tmp_cart_id);
|
||||
$tot_sc_cp_price = 0;
|
||||
if($is_member && $send_cost > 0) {
|
||||
// 배송쿠폰
|
||||
if($_POST['sc_cp_id']) {
|
||||
if(isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
|
||||
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
|
||||
from {$g5['g5_shop_coupon_table']}
|
||||
where cp_id = '{$_POST['sc_cp_id']}'
|
||||
@ -279,7 +288,7 @@ $od_b_zip2 = substr($od_b_zip, 3);
|
||||
$zipcode = $od_b_zip1 . $od_b_zip2;
|
||||
$sql = " select sc_id, sc_price from {$g5['g5_shop_sendcost_table']} where sc_zip1 <= '$zipcode' and sc_zip2 >= '$zipcode' ";
|
||||
$tmp = sql_fetch($sql);
|
||||
if(!$tmp['sc_id'])
|
||||
if(! (isset($tmp['sc_id']) && $tmp['sc_id']))
|
||||
$send_cost2 = 0;
|
||||
else
|
||||
$send_cost2 = (int)$tmp['sc_price'];
|
||||
@ -531,10 +540,12 @@ if($tno) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_member)
|
||||
if ($is_member) {
|
||||
$od_pwd = $member['mb_password'];
|
||||
else
|
||||
} else {
|
||||
$post_od_pwd = isset($_POST['od_pwd']) ? $_POST['od_pwd'] : sha1(rand());
|
||||
$od_pwd = get_encrypt_string($_POST['od_pwd']);
|
||||
}
|
||||
|
||||
// 주문번호를 얻는다.
|
||||
$od_id = get_session('ss_order_id');
|
||||
@ -545,7 +556,7 @@ if( !$od_id ){
|
||||
}
|
||||
|
||||
$od_escrow = 0;
|
||||
if($escw_yn == 'Y')
|
||||
if(isset($escw_yn) && $escw_yn == 'Y')
|
||||
$od_escrow = 1;
|
||||
|
||||
// 복합과세 금액
|
||||
@ -553,9 +564,9 @@ $od_tax_mny = round($i_price / 1.1);
|
||||
$od_vat_mny = $i_price - $od_tax_mny;
|
||||
$od_free_mny = 0;
|
||||
if($default['de_tax_flag_use']) {
|
||||
$od_tax_mny = (int)$_POST['comm_tax_mny'];
|
||||
$od_vat_mny = (int)$_POST['comm_vat_mny'];
|
||||
$od_free_mny = (int)$_POST['comm_free_mny'];
|
||||
$od_tax_mny = isset($_POST['comm_tax_mny']) ? (int) $_POST['comm_tax_mny'] : 0;
|
||||
$od_vat_mny = isset($_POST['comm_vat_mny']) ? (int) $_POST['comm_vat_mny'] : 0;
|
||||
$od_free_mny = isset($_POST['comm_free_mny']) ? (int) $_POST['comm_free_mny'] : 0;
|
||||
}
|
||||
|
||||
$od_email = get_email_address($od_email);
|
||||
@ -731,11 +742,11 @@ $od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . " ";
|
||||
|
||||
// 쿠폰사용내역기록
|
||||
if($is_member) {
|
||||
$it_cp_cnt = count($_POST['cp_id']);
|
||||
$it_cp_cnt = (isset($_POST['cp_id']) && is_array($_POST['cp_id'])) ? count($_POST['cp_id']) : 0;
|
||||
for($i=0; $i<$it_cp_cnt; $i++) {
|
||||
$cid = $_POST['cp_id'][$i];
|
||||
$cp_it_id = $_POST['it_id'][$i];
|
||||
$cp_prc = (int)$arr_it_cp_prc[$cp_it_id];
|
||||
$cid = isset($_POST['cp_id'][$i]) ? $_POST['cp_id'][$i] : '';
|
||||
$cp_it_id = isset($_POST['it_id'][$i]) ? safe_replace_regex($_POST['it_id'][$i], 'it_id') : '';
|
||||
$cp_prc = isset($arr_it_cp_prc[$cp_it_id]) ? (int) $arr_it_cp_prc[$cp_it_id] : 0;
|
||||
|
||||
if(trim($cid)) {
|
||||
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
|
||||
@ -748,7 +759,6 @@ if($is_member) {
|
||||
}
|
||||
|
||||
// 쿠폰사용금액 cart에 기록
|
||||
$cp_prc = (int)$arr_it_cp_prc[$cp_it_id];
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set cp_price = '$cp_prc'
|
||||
where od_id = '$od_id'
|
||||
@ -759,7 +769,7 @@ if($is_member) {
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if($_POST['od_cp_id']) {
|
||||
if(isset($_POST['od_cp_id']) && $_POST['od_cp_id']) {
|
||||
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
|
||||
set cp_id = '{$_POST['od_cp_id']}',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
@ -769,7 +779,7 @@ if($is_member) {
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if($_POST['sc_cp_id']) {
|
||||
if(isset($_POST['sc_cp_id']) && $_POST['sc_cp_id']) {
|
||||
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
|
||||
set cp_id = '{$_POST['sc_cp_id']}',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
@ -960,5 +970,4 @@ if( $is_noti_pay ){
|
||||
return;
|
||||
}
|
||||
|
||||
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);
|
||||
?>
|
||||
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);
|
||||
Reference in New Issue
Block a user