Merge branch 'patch'

This commit is contained in:
chicpro
2015-09-18 12:30:32 +09:00
777 changed files with 76277 additions and 248 deletions

View File

@ -161,6 +161,9 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<li><a href="<?php echo G5_BBS_URL ?>/register.php" id="snb_join">회원가입</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/login.php" id="snb_login">로그인</a></li>
<?php } ?>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li><a href="<?php echo G5_SHOP_URL ?>/" id="snb_shop">쇼핑몰</a></li>
<?php } ?>
</ul>
</div>

View File

@ -1,9 +1,15 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined('_SHOP_')) {
$pop_division = 'comm';
} else {
$pop_division = 'shop';
}
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' )
and nw_device IN ( 'both', 'mobile' ) and nw_division IN ( 'both', '".$pop_division."' )
order by nw_id asc ";
$result = sql_query($sql, false);
?>

7
mobile/shop/_common.php Normal file
View File

@ -0,0 +1,7 @@
<?php
include_once('../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
?>

4
mobile/shop/_head.php Normal file
View File

@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/shop.head.php');
?>

4
mobile/shop/_tail.php Normal file
View File

@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/shop.tail.php');
?>

251
mobile/shop/cart.php Normal file
View File

@ -0,0 +1,251 @@
<?php
include_once('./_common.php');
$g5['title'] = '장바구니';
include_once(G5_MSHOP_PATH.'/_head.php');
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
a.ct_send_cost,
a.it_sc_type,
b.ca_id
from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.od_id = '$s_cart_id' ";
$sql .= " group by a.it_id ";
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$cart_count = mysql_num_rows($result);
?>
<script src="<?php echo G5_JS_URL; ?>/shop.js"></script>
<div id="sod_bsk">
<form name="frmcartlist" id="sod_bsk_list" method="post" action="<?php echo $cart_action_url; ?>">
<?php if($cart_count) { ?>
<div id="sod_chk">
<label for="ct_all" class="sound_only">상품 전체</label>
<input type="checkbox" name="ct_all" value="1" id="ct_all" checked>
전체상품 선택
</div>
<?php } ?>
<ul class="sod_list">
<?php
$tot_point = 0;
$tot_sell_price = 0;
$it_send_cost = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) 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 = '$s_cart_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
$continue_ca_id = $row['ca_id'];
}
$a1 = '<a href="./item.php?it_id='.$row['it_id'].'"><strong>';
$a2 = '</strong></a>';
$image_width = 80;
$image_height = 80;
$image = get_it_image($row['it_id'], $image_width, $image_height);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$mod_options = '<button type="button" id="mod_opt_'.$row['it_id'].'" class="mod_btn mod_options">선택사항수정</button>';
$it_name .= '<div class="sod_opt">'.$it_options.'</div>';
}
// 배송비
switch($row['ct_send_cost'])
{
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id);
if($sendcost == 0)
$ct_send_cost = '무료';
}
$point = $sum['point'];
$sell_price = $sum['price'];
?>
<li class="sod_li">
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<div class="li_chk">
<label for="ct_chk_<?php echo $i; ?>" class="sound_only">상품선택</label>
<input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" id="ct_chk_<?php echo $i; ?>" checked>
</div>
<div class="li_name">
<?php echo $it_name; ?>
<span class="total_img"><?php echo $image; ?></span>
<div class="li_mod" style="padding-left:<?php echo $image_width + 20; ?>px;"><?php echo $mod_options; ?></div>
</div>
<div class="li_prqty">
<span class="prqty_price li_prqty_sp"><span>판매가 </span><?php echo number_format($row['ct_price']); ?></span>
<span class="prqty_qty li_prqty_sp"><span>수량 </span><?php echo number_format($sum['qty']); ?></span>
<span class="prqty_sc li_prqty_sp"><span>배송비 </span><?php echo $ct_send_cost; ?></span>
</div>
<div class="li_total">
<span class="total_price total_span"><span>소계 </span><strong><?php echo number_format($sell_price); ?></strong></span>
<span class="total_point total_span"><span>적립포인트 </span><strong><?php echo number_format($sum['point']); ?></strong></span>
</div>
</li>
<?php
$tot_point += $point;
$tot_sell_price += $sell_price;
} // for 끝
if ($i == 0) {
echo '<li class="empty_list">장바구니에 담긴 상품이 없습니다.</li>';
} else {
// 배송비 계산
$send_cost = get_sendcost($s_cart_id, 0);
}
?>
</ul>
<?php
$tot_price = $tot_sell_price + $send_cost; // 총계 = 주문상품금액합계 + 배송비
if ($tot_price > 0 || $send_cost > 0) {
?>
<dl id="sod_bsk_tot">
<?php if ($send_cost > 0) { // 배송비가 0 보다 크다면 (있다면) ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<?php } ?>
<?php if ($tot_price > 0) { ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원</strong></dd>
<dt>포인트</dt>
<dd><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
<?php } ?>
</dl>
<?php } ?>
<div id="sod_bsk_act" class="btn_confirm">
<?php if ($i == 0) { ?>
<a href="<?php echo G5_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a>
<?php } else { ?>
<input type="hidden" name="url" value="<?php echo G5_SHOP_URL; ?>/orderform.php">
<input type="hidden" name="act" value="">
<input type="hidden" name="records" value="<?php echo $i; ?>">
<a href="<?php echo G5_SHOP_URL; ?>/list.php?ca_id=<?php echo $continue_ca_id; ?>" class="btn01">쇼핑 계속하기</a>
<button type="button" onclick="return form_check('buy');" class="btn_submit">주문하기</button>
<div><button type="button" onclick="return form_check('seldelete');" class="btn01">선택삭제</button>
<button type="button" onclick="return form_check('alldelete');" class="btn01">비우기</button></div>
<?php } ?>
</div>
</form>
</div>
<script>
$(function() {
var close_btn_idx;
// 선택사항수정
$(".mod_options").click(function() {
var it_id = $(this).attr("id").replace("mod_opt_", "");
var $this = $(this);
close_btn_idx = $(".mod_options").index($(this));
$.post(
"./cartoption.php",
{ it_id: it_id },
function(data) {
$("#mod_option_frm").remove();
$this.after("<div id=\"mod_option_frm\"></div>");
$("#mod_option_frm").html(data);
price_calculate();
}
);
});
// 모두선택
$("input[name=ct_all]").click(function() {
if($(this).is(":checked"))
$("input[name^=ct_chk]").attr("checked", true);
else
$("input[name^=ct_chk]").attr("checked", false);
});
// 옵션수정 닫기
$(document).on("click", "#mod_option_close", function() {
$("#mod_option_frm").remove();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
$("#win_mask").click(function () {
$("#mod_option_frm").remove();
$("#win_mask").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
});
function form_check(act) {
var f = document.frmcartlist;
var cnt = f.records.value;
if (act == "buy")
{
f.act.value = act;
f.submit();
}
else if (act == "alldelete")
{
f.act.value = act;
f.submit();
}
else if (act == "seldelete")
{
if($("input[name^=ct_chk]:checked").size() < 1) {
alert("삭제하실 상품을 하나이상 선택해 주십시오.");
return false;
}
f.act.value = act;
f.submit();
}
return true;
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

155
mobile/shop/category.php Normal file
View File

@ -0,0 +1,155 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function get_mshop_category($ca_id, $len)
{
global $g5;
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']}
where ca_use = '1' ";
if($ca_id)
$sql .= " and ca_id like '$ca_id%' ";
$sql .= " and length(ca_id) = '$len' order by ca_order, ca_id ";
return $sql;
}
?>
<button type="button" id="hd_ct">분류</button>
<div id="category">
<div class="ct_wr">
<ul class="cate_tab">
<li><a href="#" class="ct_tab_sl">CATEGORY</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/mypage.php">MY PAGE</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/cart.php">CART</a></li>
</ul>
<?php
$mshop_ca_href = G5_SHOP_URL.'/list.php?ca_id=';
$mshop_ca_res1 = sql_query(get_mshop_category('', 2));
for($i=0; $mshop_ca_row1=sql_fetch_array($mshop_ca_res1); $i++) {
if($i == 0)
echo '<ul class="cate">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row1['ca_id']; ?>"><?php echo get_text($mshop_ca_row1['ca_name']); ?></a>
<?php
$mshop_ca_res2 = sql_query(get_mshop_category($mshop_ca_row1['ca_id'], 4));
if(mysql_num_rows($mshop_ca_res2))
echo '<button class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row1['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($j=0; $mshop_ca_row2=sql_fetch_array($mshop_ca_res2); $j++) {
if($j == 0)
echo '<ul class="sub_cate sub_cate1">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row2['ca_id']; ?>">- <?php echo get_text($mshop_ca_row2['ca_name']); ?></a>
<?php
$mshop_ca_res3 = sql_query(get_mshop_category($mshop_ca_row2['ca_id'], 6));
if(mysql_num_rows($mshop_ca_res3))
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row2['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($k=0; $mshop_ca_row3=sql_fetch_array($mshop_ca_res3); $k++) {
if($k == 0)
echo '<ul class="sub_cate sub_cate2">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row3['ca_id']; ?>">- <?php echo get_text($mshop_ca_row3['ca_name']); ?></a>
<?php
$mshop_ca_res4 = sql_query(get_mshop_category($mshop_ca_row3['ca_id'], 8));
if(mysql_num_rows($mshop_ca_res4))
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row3['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($m=0; $mshop_ca_row4=sql_fetch_array($mshop_ca_res4); $m++) {
if($m == 0)
echo '<ul class="sub_cate sub_cate3">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row4['ca_id']; ?>">- <?php echo get_text($mshop_ca_row4['ca_name']); ?></a>
<?php
$mshop_ca_res5 = sql_query(get_mshop_category($mshop_ca_row4['ca_id'], 10));
if(mysql_num_rows($mshop_ca_res5))
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row4['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($n=0; $mshop_ca_row5=sql_fetch_array($mshop_ca_res5); $n++) {
if($n == 0)
echo '<ul class="sub_cate sub_cate4">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row5['ca_id']; ?>">- <?php echo get_text($mshop_ca_row5['ca_name']); ?></a>
</li>
<?php
}
if($n > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
}
if($m > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
}
if($k > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
}
if($j > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
}
if($i > 0)
echo '</ul>'.PHP_EOL;
else
echo '<p>등록된 분류가 없습니다.</p>'.PHP_EOL;
?>
<button type="button" class="pop_close"><span class="sound_only">카테고리 </span>닫기</button>
</div>
</div>
<script>
$(function (){
var $category = $("#category");
$("#hd_ct").on("click", function() {
$category.css("display","block");
});
$("#category .pop_close").on("click", function(){
$category.css("display","none");
});
$("button.sub_ct_toggle").on("click", function() {
var $this = $(this);
$sub_ul = $(this).closest("li").children("ul.sub_cate");
if($sub_ul.size() > 0) {
var txt = $this.text();
if($sub_ul.is(":visible")) {
txt = txt.replace(/닫기$/, "열기");
$this
.removeClass("ct_cl")
.text(txt);
} else {
txt = txt.replace(/열기$/, "닫기");
$this
.addClass("ct_cl")
.text(txt);
}
$sub_ul.toggle();
}
});
});
</script>

76
mobile/shop/coupon.php Normal file
View File

@ -0,0 +1,76 @@
<?php
include_once('./_common.php');
if ($is_guest)
alert_close('회원만 조회하실 수 있습니다.');
$g5['title'] = $member['mb_nick'].' 님의 쿠폰 내역';
include_once(G5_PATH.'/head.sub.php');
$sql = " select cp_id, cp_subject, cp_method, cp_target, cp_start, cp_end, cp_type, cp_price
from {$g5['g5_shop_coupon_table']}
where mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
order by cp_no ";
$result = sql_query($sql);
?>
<!-- 쿠폰 내역 시작 { -->
<div id="scp_list" class="new_win">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<div class="win_desc">
<ul>
<?php
$cp_count = 0;
for($i=0; $row=sql_fetch_array($result); $i++) {
if(is_used_coupon($member['mb_id'], $row['cp_id']))
continue;
if($row['cp_method'] == 1) {
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$row['cp_target']}' ";
$ca = sql_fetch($sql);
$cp_target = $ca['ca_name'].'의 상품할인';
} else if($row['cp_method'] == 2) {
$cp_target = '결제금액 할인';
} else if($row['cp_method'] == 3) {
$cp_target = '배송비 할인';
} else {
$sql = " select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['cp_target']}' ";
$it = sql_fetch($sql);
$cp_target = $it['it_name'].' 상품할인';
}
if($row['cp_type'])
$cp_price = $row['cp_price'].'%';
else
$cp_price = number_format($row['cp_price']).'원';
$cp_count++;
?>
<li>
<div class="li_title"><?php echo $row['cp_subject']; ?></div>
<div class="li_pd">
<span class="pd_price"><?php echo $cp_price; ?></span>
<span class="pd_date"><?php echo substr($row['cp_start'], 2, 8); ?> ~ <?php echo substr($row['cp_end'], 2, 8); ?></span>
</div>
<div class="li_target">
<?php echo $cp_target; ?>
</div>
</li>
<?php
}
if(!$cp_count)
echo '<li class="empty_list">사용할 수 있는 쿠폰이 없습니다.</li>';
?>
</ul>
</div>
<div class="win_btn"><button type="button" onclick="window.close();">창닫기</button></div>
</div>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

86
mobile/shop/event.php Normal file
View File

@ -0,0 +1,86 @@
<?php
include_once('./_common.php');
$sql = " select * from {$g5['g5_shop_event_table']}
where ev_id = '$ev_id'
and ev_use = 1 ";
$ev = sql_fetch($sql);
if (!$ev['ev_id'])
alert('등록된 이벤트가 없습니다.');
$g5['title'] = $ev['ev_subject'];
include_once(G5_MSHOP_PATH.'/_head.php');
if ($is_admin)
echo '<div class="sev_admin"><a href="'.G5_ADMIN_URL.'/shop_admin/itemeventform.php?w=u&amp;ev_id='.$ev['ev_id'].'" class="btn_admin">이벤트 관리</a></div>';
?>
<!-- 이벤트 시작 { -->
<?php
// 상단 HTML
echo '<div id="sev_hhtml">'.conv_content($ev['ev_head_html'], 1).'</div>';
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , b.it_order, b.it_id desc';
else
$order_by = 'b.it_order, b.it_id desc';
if ($skin)
$ev['ev_skin'] = $skin;
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
// 리스트 유형별로 출력
$list_file = G5_SHOP_SKIN_PATH."/{$ev['ev_mobile_skin']}";
if (file_exists($list_file))
{
include G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $ev['ev_mobile_list_mod'] * $ev['ev_mobile_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list(G5_MSHOP_SKIN_PATH.'/'.$ev['ev_mobile_skin'], $ev['ev_mobile_list_mod'], $ev['ev_mobile_list_row'], $ev['ev_mobile_img_width'], $ev['ev_mobile_img_height']);
$list->set_event($ev['ev_id']);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div align="center">'.$ev['ev_mobile_skin'].' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr .= 'skin='.$skin.'&amp;ev_id='.$ev_id.'&amp;sort='.$sort.'&amp;sortodr='.$sortodr;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page=");
?>
<?php
// 하단 HTML
echo '<div id="sev_thtml">'.conv_content($ev['ev_tail_html'], 1).'</div>';
?>
<!-- } 이벤트 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

BIN
mobile/shop/img/add.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
mobile/shop/img/cart.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

BIN
mobile/shop/img/cate.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

BIN
mobile/shop/img/cate_op.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

BIN
mobile/shop/img/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

BIN
mobile/shop/img/del_btn.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

BIN
mobile/shop/img/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
mobile/shop/img/paging.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
mobile/shop/img/sch.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

BIN
mobile/shop/img/sch2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

BIN
mobile/shop/img/select.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

140
mobile/shop/index.php Normal file
View File

@ -0,0 +1,140 @@
<?php
include_once('./_common.php');
define("_INDEX_", TRUE);
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<script src="<?php echo G5_JS_URL; ?>/swipe.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.mobile.main.js"></script>
<?php echo display_banner('메인', 'mainbanner.10.skin.php'); ?>
<div id="sidx" class="swipe">
<div id="sidx_slide" class="swipe-wrap">
<?php if($default['de_mobile_type1_list_use']) { ?>
<div class="sct_wrap">
<header>
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=1">HIT ITEM</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 히트상품 모음</p>
</header>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(1);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type2_list_use']) { ?>
<div class="sct_wrap">
<header>
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=2">RECOMMEND ITEM</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 추천상품 모음</p>
</header>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(2);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type3_list_use']) { ?>
<div class="sct_wrap">
<header>
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=3">NEW ITEM</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 최신상품 모음</p>
</header>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(3);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type4_list_use']) { ?>
<div class="sct_wrap">
<header>
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=4">BEST ITEM</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 인기상품 모음</p>
</header>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(4);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type5_list_use']) { ?>
<div class="sct_wrap">
<header>
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=5">SALE ITEM</a></h2>
<p class="sct_wrap_hdesc"><?php echo $config['cf_title']; ?> 할인상품 모음</p>
</header>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(5);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
</div>
</div>
<?php include_once(G5_MSHOP_SKIN_PATH.'/main.event.skin.php'); // 이벤트 ?>
<script>
$(function() {
$("#sidx").swipeSlide({
slides: ".swipe-wrap > div",
buttons: ".mli_btn > button",
startSlide: 0,
auto: 0
});
});
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,7 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
?>

View File

@ -0,0 +1,27 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<form name="sm_form" method="POST" action="" accept-charset="euc-kr">
<input type="hidden" name="P_OID" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_GOODS" value="<?php echo $goods; ?>">
<input type="hidden" name="P_AMT" value="<?php echo $tot_price; ?>">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_MOBILE" value="">
<input type="hidden" name="P_EMAIL" value="">
<input type="hidden" name="P_MID" value="<?php echo $default['de_inicis_mid']; ?>">
<input type="hidden" name="P_NEXT_URL" value="<?php echo $next_url; ?>">
<input type="hidden" name="P_NOTI_URL" value="<?php echo $noti_url; ?>">
<input type="hidden" name="P_RETURN_URL" value="">
<input type="hidden" name="P_HPP_METHOD" value="2">
<input type="hidden" name="P_RESERVED" value="bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow; ?>">
<input type="hidden" name="P_NOTI" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_QUOTABASE" value="01:02:03:04:05:06:07:08:09:10:11:12"> <!-- 할부기간 설정 01은 일시불 -->
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="P_TAX" value="">
<input type="hidden" name="P_TAXFREE" value="">
<?php } ?>
</form>

View File

@ -0,0 +1,30 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="P_HASH" value="">
<input type="hidden" name="P_TYPE" value="">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_AUTH_DT" value="">
<input type="hidden" name="P_AUTH_NO" value="">
<input type="hidden" name="P_HPP_CORP" value="">
<input type="hidden" name="P_APPL_NUM" value="">
<input type="hidden" name="P_VACT_NUM" value="">
<input type="hidden" name="P_VACT_NAME" value="">
<input type="hidden" name="P_VACT_BANK" value="">
<input type="hidden" name="P_CARD_ISSUER" value="">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>

View File

@ -0,0 +1,3 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

View File

@ -0,0 +1,100 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
$oid = trim($_REQUEST['P_NOTI']);
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$oid' ";
$row = sql_fetch($sql);
$data = unserialize($row['dt_data']);
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
if($_REQUEST['P_STATUS'] != '00') {
alert('오류 : '.iconv_utf8($_REQUEST['P_RMESG1']).' 코드 : '.$_REQUEST['P_STATUS'], $page_return_url);
} else {
$post_data = array(
'P_MID' => $default['de_inicis_mid'],
'P_TID' => $_REQUEST['P_TID']
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $_REQUEST['P_REQ_URL']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
if(!$return)
alert('KG이니시스와 통신 오류로 결제등록 요청을 완료하지 못했습니다.\\n결제등록 요청을 다시 시도해 주십시오.', $page_return_url);
// 결과를 배열로 변환
parse_str($return, $ret);
$PAY = array_map('trim', $ret);
if($PAY['P_STATUS'] != '00')
alert('오류 : '.iconv_utf8($PAY['P_RMESG1']).' 코드 : '.$PAY['P_STATUS'], $page_return_url);
// TID, AMT 를 세션으로 주문완료 페이지 전달
$hash = md5($PAY['P_TID'].$PAY['P_MID'].$PAY['P_AMT']);
set_session('P_TID', $PAY['P_TID']);
set_session('P_AMT', $PAY['P_AMT']);
set_session('P_HASH', $hash);
}
$g5['title'] = 'KG 이니시스 결제';
$g5['body_script'] = ' onload="setPAYResult();"';
include_once(G5_PATH.'/head.sub.php');
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_AUTH_NO', 'P_HPP_CORP', 'P_APPL_NUM', 'P_VACT_NUM', 'P_VACT_NAME', 'P_VACT_BANK', 'P_CARD_ISSUER', 'P_UNAME');
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.$PAY['P_STATUS'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_HASH" value="'.$hash.'">'.PHP_EOL;
echo '<input type="hidden" name="P_TYPE" value="'.$PAY['P_TYPE'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_AUTH_DT" value="'.$PAY['P_AUTH_DT'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_AUTH_NO" value="'.$PAY['P_AUTH_NO'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_HPP_CORP" value="'.$PAY['P_HPP_CORP'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_APPL_NUM" value="'.$PAY['P_APPL_NUM'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_VACT_NUM" value="'.$PAY['P_VACT_NUM'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_VACT_NAME" value="'.iconv_utf8($PAY['P_VACT_NAME']).'">'.PHP_EOL;
echo '<input type="hidden" name="P_VACT_BANK" value="'.$BANK_CODE[$PAY['P_VACT_BANK_CODE']].'">'.PHP_EOL;
echo '<input type="hidden" name="P_CARD_ISSUER" value="'.$CARD_CODE[$PAY['P_CARD_ISSUER_CODE']].'">'.PHP_EOL;
echo '<input type="hidden" name="P_UNAME" value="'.iconv_utf8($PAY['P_UNAME']).'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
<div id="show_progress">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt=""></span>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
<script type="text/javascript">
function setPAYResult() {
setTimeout( function() {
document.forderform.submit();
}, 300);
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,41 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
// 세션비교
$hash = md5(get_session('P_TID').$default['de_inicis_mid'].get_session('P_AMT'));
if($hash != $_POST['P_HASH'])
alert('결제 정보가 일치하지 않습니다. 올바른 방법으로 이용해 주십시오.');
//최종결제요청 결과 성공 DB처리
$tno = get_session('P_TID');
$amount = get_session('P_AMT');
$app_time = $_POST['P_AUTH_DT'];
$pay_method = $_POST['P_TYPE'];
$pay_type = $PAY_METHOD[$pay_method];
$depositor = $_POST['P_UNAME'];
$commid = $_POST['P_HPP_CORP'];
$mobile_no = $_POST['P_APPL_NUM'];
$app_no = $_POST['P_AUTH_NO'];
$card_name = $_POST['P_CARD_ISSUER'];
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
switch($pay_type) {
case '계좌이체':
$bank_name = $_POST['P_VACT_BANK'];
break;
case '가상계좌':
$bankname = $_POST['P_VACT_BANK'];
$account = $_POST['P_VACT_NUM'].' '.$_POST['P_VACT_NAME'];
$app_no = $_POST['P_VACT_NUM'];
break;
default:
break;
}
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
?>

View File

@ -0,0 +1,79 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$oid' ";
$row = sql_fetch($sql);
$data = unserialize($row['dt_data']);
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
$sql = " select * from {$g5['g5_shop_inicis_log_table']} where oid = '$oid' ";
$row = sql_fetch($sql);
if(!$row['oid'])
alert('결제 정보가 존재하지 않습니다.\\n\\n올바른 방법으로 이용해 주십시오.', $page_return_url);
if($row['P_STATUS'] != '00')
alert('오류 : '.$row['P_RMESG1'].' 코드 : '.$row['P_STATUS'], $page_return_url);
$PAY = array_map('trim', $row);
// TID, AMT 를 세션으로 주문완료 페이지 전달
$hash = md5($PAY['P_TID'].$PAY['P_MID'].$PAY['P_AMT']);
set_session('P_TID', $PAY['P_TID']);
set_session('P_AMT', $PAY['P_AMT']);
set_session('P_HASH', $hash);
// 로그 삭제
@sql_query(" delete from {$g5['g5_shop_inicis_log_table']} where oid = '$oid' ");
$g5['title'] = 'KG 이니시스 결제';
$g5['body_script'] = ' onload="setPAYResult();"';
include_once(G5_PATH.'/head.sub.php');
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK');
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.$PAY['P_STATUS'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_HASH" value="'.$hash.'">'.PHP_EOL;
echo '<input type="hidden" name="P_TYPE" value="'.$PAY['P_TYPE'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_AUTH_DT" value="'.$PAY['P_AUTH_DT'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_VACT_BANK" value="'.$PAY['P_FN_NM'].'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
<div id="pay_working" 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>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
<script type="text/javascript">
function setPAYResult() {
setTimeout( function() {
document.forderform.submit();
}, 300);
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,218 @@
<?php
include_once('./_common.php');
//*******************************************************************************
// FILE NAME : mx_rnoti.php
// FILE DESCRIPTION :
// 이니시스 smart phone 결제 결과 수신 페이지 샘플
// 기술문의 : ts@inicis.com
// HISTORY
// 2010. 02. 25 최초작성
// 2010 06. 23 WEB 방식의 가상계좌 사용시 가상계좌 채번 결과 무시 처리 추가(APP 방식은 해당 없음!!)
// WEB 방식일 경우 이미 P_NEXT_URL 에서 채번 결과를 전달 하였으므로,
// 이니시스에서 전달하는 가상계좌 채번 결과 내용을 무시 하시기 바랍니다.
//*******************************************************************************
$PGIP = $_SERVER['REMOTE_ADDR'];
if($PGIP == "211.219.96.165" || $PGIP == "118.129.210.25") //PG에서 보냈는지 IP로 체크
{
// 이니시스 NOTI 서버에서 받은 Value
$P_TID; // 거래번호
$P_MID; // 상점아이디
$P_AUTH_DT; // 승인일자
$P_STATUS; // 거래상태 (00:성공, 01:실패)
$P_TYPE; // 지불수단
$P_OID; // 상점주문번호
$P_FN_CD1; // 금융사코드1
$P_FN_CD2; // 금융사코드2
$P_FN_NM; // 금융사명 (은행명, 카드사명, 이통사명)
$P_AMT; // 거래금액
$P_UNAME; // 결제고객성명
$P_RMESG1; // 결과코드
$P_RMESG2; // 결과메시지
$P_NOTI; // 노티메시지(상점에서 올린 메시지)
$P_AUTH_NO; // 승인번호
$P_SRC_CODE; // 앱연동 결제구분
$P_TID = $_POST['P_TID'];
$P_MID = $_POST['P_MID'];
$P_AUTH_DT = $_POST['P_AUTH_DT'];
$P_STATUS = $_POST['P_STATUS'];
$P_TYPE = $_POST['P_TYPE'];
$P_OID = $_POST['P_OID'];
$P_FN_CD1 = $_POST['P_FN_CD1'];
$P_FN_CD2 = $_POST['P_FN_CD2'];
$P_FN_NM = $_POST['P_FN_NM'];
$P_AMT = $_POST['P_AMT'];
$P_UNAME = $_POST['P_UNAME'];
$P_RMESG1 = $_POST['P_RMESG1'];
$P_RMESG2 = $_POST['P_RMESG2'];
$P_NOTI = $_POST['P_NOTI'];
$P_AUTH_NO = $_POST['P_AUTH_NO'];
$P_SRC_CODE = $_POST['P_SRC_CODE'];
//WEB 방식의 경우 가상계좌 채번 결과 무시 처리
//(APP 방식의 경우 해당 내용을 삭제 또는 주석 처리 하시기 바랍니다.)
if($P_TYPE == "VBANK") //결제수단이 가상계좌이며
{
if($P_STATUS != "02") //입금통보 "02" 가 아니면(가상계좌 채번 : 00 또는 01 경우)
{
echo "OK";
return;
}
// 입금결과 처리
$sql = " select pp_id, od_id from {$g5['g5_shop_personalpay_table']} where pp_id = '$P_OID' and pp_tno = '$P_TID' ";
$row = sql_fetch($sql);
$result = false;
$receipt_time = $P_AUTH_DT;
if($row['pp_id']) {
// 개인결제 UPDATE
$sql = " update {$g5['g5_shop_personalpay_table']}
set pp_receipt_price = '$P_AMT',
pp_receipt_time = '$receipt_time'
where pp_id = '$P_OID'
and pp_tno = '$P_TID' ";
sql_query($sql, false);
if($row['od_id']) {
// 주문서 UPDATE
$receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $receipt_time);
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = od_receipt_price + '$P_AMT',
od_receipt_time = '$receipt_time',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$row['pp_id']." 로 결제완료 - ".$receipt_time."\")
where od_id = '{$row['od_id']}' ";
$result = sql_query($sql, FALSE);
}
} else {
// 주문서 UPDATE
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = '$P_AMT',
od_receipt_time = '$receipt_time'
where od_id = '$P_OID'
and od_tno = '$P_TID' ";
$result = sql_query($sql, FALSE);
}
if($result) {
if($row['od_id'])
$od_id = $row['od_id'];
else
$od_id = $P_OID;
// 주문정보 체크
$sql = " select count(od_id) as cnt
from {$g5['g5_shop_order_table']}
where od_id = '$od_id'
and od_status = '주문' ";
$row = sql_fetch($sql);
if($row['cnt'] == 1) {
// 미수금 정보 업데이트
$info = get_order_info($od_id);
$sql = " update {$g5['g5_shop_order_table']}
set od_misu = '{$info['od_misu']}' ";
if($info['od_misu'] == 0)
$sql .= " , od_status = '입금' ";
$sql .= " where od_id = '$od_id' ";
sql_query($sql, FALSE);
// 장바구니 상태변경
if($info['od_misu'] == 0) {
$sql = " update {$g5['g5_shop_cart_table']}
set ct_status = '입금'
where od_id = '$od_id' ";
sql_query($sql, FALSE);
}
}
}
if($result) {
echo "OK";
return;
} else {
echo "FAIL";
return;
}
}
$PageCall_time = date("H:i:s");
$value = array(
"PageCall time" => $PageCall_time,
"P_TID" => $P_TID,
"P_MID" => $P_MID,
"P_AUTH_DT" => $P_AUTH_DT,
"P_STATUS" => $P_STATUS,
"P_TYPE" => $P_TYPE,
"P_OID" => $P_OID,
"P_FN_CD1" => $P_FN_CD1,
"P_FN_CD2" => $P_FN_CD2,
"P_FN_NM" => $P_FN_NM,
"P_AMT" => $P_AMT,
"P_UNAME" => $P_UNAME,
"P_RMESG1" => $P_RMESG1,
"P_RMESG2" => $P_RMESG2,
"P_NOTI" => $P_NOTI,
"P_AUTH_NO" => $P_AUTH_NO,
"P_SRC_CODE" => $P_SRC_CODE
);
// 결과 incis log 테이블 기록
if($P_TYPE == 'BANK' || $P_SRC_CODE == 'A') {
$sql = " insert into {$g5['g5_shop_inicis_log_table']}
set oid = '$P_OID',
P_TID = '$P_TID',
P_MID = '$P_MID',
P_AUTH_DT = '$P_AUTH_DT',
P_STATUS = '$P_STATUS',
P_TYPE = '$P_TYPE',
P_OID = '$P_OID',
P_FN_NM = '".iconv_utf8($P_FN_NM)."',
P_AMT = '$P_AMT',
P_RMESG1 = '".iconv_utf8($P_RMESG1)."' ";
@sql_query($sql);
}
// 결제처리에 관한 로그 기록
//writeLog($value);
/***********************************************************************************
' 위에서 상점 데이터베이스에 등록 성공유무에 따라서 성공시에는 "OK"를 이니시스로 실패시는 "FAIL" 을
' 리턴하셔야합니다. 아래 조건에 데이터베이스 성공시 받는 FLAG 변수를 넣으세요
' (주의) OK를 리턴하지 않으시면 이니시스 지불 서버는 "OK"를 수신할때까지 계속 재전송을 시도합니다
' 기타 다른 형태의 echo "" 는 하지 않으시기 바랍니다
'***********************************************************************************/
echo 'OK';
}
function writeLog($msg)
{
$file = G5_SHOP_PATH."/inicis/log/noti_input_".date("Ymd").".log";
if(!($fp = fopen($path.$file, "a+"))) return 0;
ob_start();
print_r($msg);
$ob_msg = ob_get_contents();
ob_clean();
if(fwrite($fp, " ".$ob_msg."\n") === FALSE)
{
fclose($fp);
return 0;
}
fclose($fp);
return 1;
}
?>

221
mobile/shop/item.php Normal file
View File

@ -0,0 +1,221 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/iteminfo.lib.php');
$it_id = trim($_GET['it_id']);
// 분류사용, 상품사용하는 상품의 정보를 얻음
$sql = " select a.*,
b.ca_name,
b.ca_use
from {$g5['g5_shop_item_table']} a,
{$g5['g5_shop_category_table']} b
where a.it_id = '$it_id'
and a.ca_id = b.ca_id ";
$it = sql_fetch($sql);
if (!$it['it_id'])
alert('자료가 없습니다.');
if (!($it['ca_use'] && $it['it_use'])) {
if (!$is_admin)
alert('판매가능한 상품이 아닙니다.');
}
// 분류 테이블에서 분류 상단, 하단 코드를 얻음
$sql = " select ca_mobile_skin_dir, ca_include_head, ca_include_tail, ca_cert_use, ca_adult_use
from {$g5['g5_shop_category_table']}
where ca_id = '{$it['ca_id']}' ";
$ca = sql_fetch($sql);
// 본인인증, 성인인증체크
if(!$is_admin) {
$msg = shop_member_cert_check($it_id, 'item');
if($msg)
alert($msg, G5_SHOP_URL);
}
// 오늘 본 상품 저장 시작
// tv 는 today view 약자
$saved = false;
$tv_idx = (int)get_session("ss_tv_idx");
if ($tv_idx > 0) {
for ($i=1; $i<=$tv_idx; $i++) {
if (get_session("ss_tv[$i]") == $it_id) {
$saved = true;
break;
}
}
}
if (!$saved) {
$tv_idx++;
set_session("ss_tv_idx", $tv_idx);
set_session("ss_tv[$tv_idx]", $it_id);
}
// 오늘 본 상품 저장 끝
// 조회수 증가
if (get_cookie('ck_it_id') != $it_id) {
sql_query(" update {$g5['g5_shop_item_table']} set it_hit = it_hit + 1 where it_id = '$it_id' "); // 1증가
set_cookie("ck_it_id", $it_id, time() + 3600); // 1시간동안 저장
}
// 이전 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']}
where it_id > '$it_id'
and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."'
and it_use = '1'
order by it_id asc
limit 1 ";
$row = sql_fetch($sql);
if ($row['it_id']) {
$prev_title = '이전상품 <span>'.$row['it_name'].'</span>';
$prev_href = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'" id="siblings_prev">';
$prev_href2 = '</a>';
} else {
$prev_title = '';
$prev_href = '';
$prev_href2 = '';
}
// 다음 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']}
where it_id < '$it_id'
and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."'
and it_use = '1'
order by it_id desc
limit 1 ";
$row = sql_fetch($sql);
if ($row['it_id']) {
$next_title = '다음 상품 <span>'.$row['it_name'].'</span>';
$next_href = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'" id="siblings_next">';
$next_href2 = '</a>';
} else {
$next_title = '';
$next_href = '';
$next_href2 = '';
}
// 관리자가 확인한 사용후기의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
if ($default['de_mobile_rel_list_use']) {
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1')
where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
}
// 상품품절체크
if(G5_SOLDOUT_CHECK)
$is_soldout = is_soldout($it['it_id']);
// 주문가능체크
$is_orderable = true;
if(!$it['it_use'] || $it['it_tel_inq'] || $is_soldout)
$is_orderable = false;
if($is_orderable) {
// 선택 옵션
$option_item = get_item_options($it['it_id'], $it['it_option_subject']);
// 추가 옵션
$supply_item = get_item_supply($it['it_id'], $it['it_supply_subject']);
// 상품 선택옵션 수
$option_count = 0;
if($it['it_option_subject']) {
$temp = explode(',', $it['it_option_subject']);
$option_count = count($temp);
}
// 상품 추가옵션 수
$supply_count = 0;
if($it['it_supply_subject']) {
$temp = explode(',', $it['it_supply_subject']);
$supply_count = count($temp);
}
}
// 스킨경로
$skin_dir = G5_MSHOP_SKIN_PATH;
$ca_dir_check = true;
if($it['it_mobile_skin']) {
if(preg_match('#^theme/(.+)$#', $it['it_mobile_skin'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$it['it_skin'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';
if(is_file($form_skin_file))
$ca_dir_check = false;
}
}
if($ca_dir_check) {
if($ca['ca_mobile_skin_dir']) {
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';
if(!is_file($form_skin_file))
$skin_dir = G5_MSHOP_SKIN_PATH;
} else {
$skin_dir = G5_MSHOP_SKIN_PATH;
}
}
}
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
$g5['title'] = $it['it_name'].' &gt; '.$it['ca_name'];
include_once(G5_MSHOP_PATH.'/_head.php');
// 상단 HTML
echo '<div id="sit_hhtml">'.conv_content($it['it_mobile_head_html'], 1).'</div>';
?>
<?php if($is_orderable) { ?>
<script src="<?php echo G5_JS_URL; ?>/shop.js"></script>
<?php } ?>
<?php
if (G5_HTTPS_DOMAIN)
$action_url = G5_HTTPS_DOMAIN.'/'.G5_SHOP_DIR.'/cartupdate.php';
else
$action_url = G5_SHOP_URL.'/cartupdate.php';
?>
<div id="sit">
<?php
// 상품 구입폼
include_once($skin_dir.'/item.form.skin.php');
?>
</div>
<?php
// 하단 HTML
echo conv_content($it['it_mobile_tail_html'], 1);
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

87
mobile/shop/iteminfo.php Normal file
View File

@ -0,0 +1,87 @@
<?php
include_once('./_common.php');
$it_id = $_GET['it_id'];
$info = $_GET['info'];
// 분류사용, 상품사용하는 상품의 정보를 얻음
$sql = " select a.*,
b.ca_name,
b.ca_use
from {$g5['g5_shop_item_table']} a,
{$g5['g5_shop_category_table']} b
where a.it_id = '$it_id'
and a.ca_id = b.ca_id ";
$it = sql_fetch($sql);
if (!$it['it_id'])
alert('자료가 없습니다.');
if (!($it['ca_use'] && $it['it_use'])) {
if (!$is_admin)
alert('판매가능한 상품이 아닙니다.');
}
// 분류 테이블에서 분류 상단, 하단 코드를 얻음
$sql = " select ca_mobile_skin_dir, ca_include_head, ca_include_tail, ca_cert_use, ca_adult_use
from {$g5['g5_shop_category_table']}
where ca_id = '{$it['ca_id']}' ";
$ca = sql_fetch($sql);
$g5['title'] = $it['it_name'].' &gt; '.$it['ca_name'];
include_once(G5_PATH.'/head.sub.php');
// 관리자가 확인한 사용후기의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
function pg_anchor($info) {
global $default;
global $it_id, $item_use_count, $item_qa_count, $item_relation_count;
$href = G5_SHOP_URL.'/iteminfo.php?it_id='.$it_id;
?>
<ul class="sanchor">
<li><a href="<?php echo $href; ?>" <?php if ($info == '') echo 'class="sanchor_on"'; ?>>DETAIL</a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=dvr" <?php if ($info == 'dvr') echo 'class="sanchor_on"'; ?>>INFO</a></li><?php } ?>
<li><a href="<?php echo $href; ?>&amp;info=use" <?php if ($info == 'use') echo 'class="sanchor_on"'; ?>>REVIEW<span class="item_use_count"><?php echo $item_use_count; ?></span></a></li>
<li><a href="<?php echo $href; ?>&amp;info=qa" <?php if ($info == 'qa') echo 'class="sanchor_on"'; ?>>Q&amp;A<span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
</ul>
<?php
}
?>
<div id="menu_list">
<?php echo pg_anchor($info); ?>
</div>
<div id="info_content" class="new_win">
<?php
switch($info) {
case 'use':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.itemuse.skin.php');
break;
case 'qa':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.itemqa.skin.php');
break;
case 'dvr':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.delivery.skin.php');
break;
case 'ex':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.change.skin.php');
break;
default:
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.info.skin.php');
break;
}
?>
</div>
<div class="close_btn"><button type="button" id="iteminfo_close" onclick="self.close();">창닫기</button></div>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

31
mobile/shop/itemqa.php Normal file
View File

@ -0,0 +1,31 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$itemqa_list = "./itemqalist.php";
$itemqa_form = "./itemqaform.php?it_id=".$it_id;
$itemqa_formupdate = "./itemqaformupdate.php?it_id=".$it_id;
$sql_common = " from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
$sql = "select * $sql_common order by iq_id desc limit $from_record, $rows ";
$result = sql_query($sql);
$itemqa_skin = G5_MSHOP_SKIN_PATH.'/itemqa.skin.php';
if(!file_exists($itemqa_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqa_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqa_skin);
}
?>

View File

@ -0,0 +1,64 @@
<?php
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
if (!$is_member) {
alert_close("상품문의는 회원만 작성 가능합니다.");
}
$w = trim($_REQUEST['w']);
$it_id = trim($_REQUEST['it_id']);
$iq_id = trim($_REQUEST['iq_id']);
// 상품정보체크
$sql = " select it_id from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
if(!$row['it_id'])
alert_close('상품정보가 존재하지 않습니다.');
$chk_secret = '';
if($w == '') {
$qa['iq_email'] = $member['mb_email'];
$qa['iq_hp'] = $member['mb_hp'];
}
if ($w == "u")
{
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' ");
if (!$qa) {
alert_close("상품문의 정보가 없습니다.");
}
$it_id = $qa['it_id'];
if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) {
alert_close("자신의 상품문의만 수정이 가능합니다.");
}
if($qa['iq_secret'])
$chk_secret = 'checked="checked"';
}
include_once(G5_PATH.'/head.sub.php');
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && !G5_IS_MOBILE) {
$is_dhtml_editor = true;
}
$editor_html = editor_html('iq_question', get_text($qa['iq_question'], 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('iq_question', $is_dhtml_editor);
$editor_js .= chk_editor_js('iq_question', $is_dhtml_editor);
$itemqaform_skin = G5_MSHOP_SKIN_PATH.'/itemqaform.skin.php';
if(!file_exists($itemqaform_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqaform_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqaform_skin);
}
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,67 @@
<?php
include_once('./_common.php');
$sfl = trim($_REQUEST['sfl']);
$stx = trim($_REQUEST['stx']);
$g5['title'] = 'Q&amp;A';
include_once(G5_MSHOP_PATH.'/_head.php');
$sql_common = " from `{$g5['g5_shop_item_qa_table']}` a join `{$g5['g5_shop_item_table']}` b on (a.it_id=b.it_id) ";
$sql_search = " where (1) ";
if(!$sfl)
$sfl = 'b.it_name';
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "a.it_id" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.iq_name" :
case "a.mb_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.iq_id";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";
$sql = " select count(*) as cnt
$sql_common
$sql_search
$sql_order ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, b.it_name
$sql_common
$sql_search
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
$itemqalist_skin = G5_MSHOP_SKIN_PATH.'/itemqalist.skin.php';
if(!file_exists($itemqalist_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqalist_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqalist_skin);
}
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,67 @@
<?php
include_once('./_common.php');
if (!$is_member)
alert_close('회원만 메일을 발송할 수 있습니다.');
// 스팸을 발송할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
$sql = " select it_name from {$g5['g5_shop_item_table']} where it_id='$it_id' ";
$it = sql_fetch($sql);
if (!$it['it_name'])
alert_close("등록된 상품이 아닙니다.");
$g5['title'] = $it['it_name'].' - 추천하기';
include_once(G5_PATH.'/head.sub.php');
?>
<div id="sit_rec_new" class="new_win">
<h1 id="win_title"><?php echo $g5['title']; ?></h1>
<form name="fitemrecommend" method="post" action="./itemrecommendmail.php" autocomplete="off" onsubmit="return fitemrecommend_check(this);">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="it_id" value="<?php echo $it_id; ?>">
<div class="tbl_frm01 tbl_wrap">
<table>
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="to_email">추천받는 분 E-mail</label></th>
<td><input type="email" name="to_email" id="to_email" required class="frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="subject">제목</label></th>
<td><input type="text" name="subject" id="subject" required class="frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="content">내용</label></th>
<td><textarea name="content" id="content" required></textarea></td>
</tr>
</tbody>
</table>
</div>
<div class="win_btn">
<input type="submit" id="btn_submit" value="보내기" class="btn_submit">
<a href="javascript:window.close();">창닫기</a>
</div>
</form>
</div>
<script>
function fitemrecommend_check(f)
{
return true;
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

31
mobile/shop/itemuse.php Normal file
View File

@ -0,0 +1,31 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$itemuse_list = "./itemuselist.php";
$itemuse_form = "./itemuseform.php?it_id=".$it_id;
$itemuse_formupdate = "./itemuseformupdate.php?it_id=".$it_id;
$sql_common = " from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
$sql = "select * $sql_common order by is_id desc limit $from_record, $rows ";
$result = sql_query($sql);
$itemuse_skin = G5_MSHOP_SKIN_PATH.'/itemuse.skin.php';
if(!file_exists($itemuse_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuse_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuse_skin);
}
?>

View File

@ -0,0 +1,59 @@
<?php
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
if (!$is_member) {
alert_close("사용후기는 회원만 작성 가능합니다.");
}
$w = trim($_REQUEST['w']);
$it_id = trim($_REQUEST['it_id']);
$is_id = trim($_REQUEST['is_id']);
// 상품정보체크
$sql = " select it_id from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
if(!$row['it_id'])
alert_close('상품정보가 존재하지 않습니다.');
if ($w == "") {
$is_score = 5;
// 사용후기 작성 설정에 따른 체크
check_itemuse_write($it_id, $member['mb_id']);
} else if ($w == "u") {
$use = sql_fetch(" select * from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' ");
if (!$use) {
alert_close("사용후기 정보가 없습니다.");
}
$it_id = $use['it_id'];
$is_score = $use['is_score'];
if (!$is_admin && $use['mb_id'] != $member['mb_id']) {
alert_close("자신의 사용후기만 수정이 가능합니다.");
}
}
include_once(G5_PATH.'/head.sub.php');
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && !G5_IS_MOBILE) {
$is_dhtml_editor = true;
}
$editor_html = editor_html('is_content', get_text($use['is_content'], 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('is_content', $is_dhtml_editor);
$editor_js .= chk_editor_js('is_content', $is_dhtml_editor);
$itemuseform_skin = G5_MSHOP_SKIN_PATH.'/itemuseform.skin.php';
if(!file_exists($itemuseform_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuseform_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuseform_skin);
}
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,67 @@
<?php
include_once('./_common.php');
$sfl = trim($_REQUEST['sfl']);
$stx = trim($_REQUEST['stx']);
$g5['title'] = 'REVIEW';
include_once(G5_MSHOP_PATH.'/_head.php');
$sql_common = " from `{$g5['g5_shop_item_use_table']}` a join `{$g5['g5_shop_item_table']}` b on (a.it_id=b.it_id) ";
$sql_search = " where a.is_confirm = '1' ";
if(!$sfl)
$sfl = 'b.it_name';
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "a.it_id" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.is_name" :
case "a.mb_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.is_id";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";
$sql = " select count(*) as cnt
$sql_common
$sql_search
$sql_order ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
$sql_common
$sql_search
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
$itemuselist_skin = G5_MSHOP_SKIN_PATH.'/itemuselist.skin.php';
if(!file_exists($itemuselist_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuselist_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuselist_skin);
}
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,193 @@
<?php
/* ============================================================================== */
/* = PAGE : 라이브버리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Co., Ltd. All Rights Reserved. = */
/* = -------------------------------------------------------------------------- = */
/* + 이 모듈에 대한 수정을 금합니다. + */
/* ============================================================================== */
/* ============================================================================== */
/* + SOAP 연동 CALSS + */
/* ============================================================================== */
class ApproveReq
{
public $accessCredentialType; // AccessCredentialType
public $baseRequestType; // BaseRequestType
public $escrow; // boolean
public $orderID; // string
public $paymentAmount; // string
public $paymentMethod; // string
public $productName; // string
public $returnUrl; // string
public $siteCode; // string
}
class ApproveRes
{
public $approvalKey; // string
public $baseResponseType; // BaseResponseType
public $payUrl; // string
}
class approve
{
public $req; // ApproveReq
}
class approveResponse
{
public $return; // ApproveRes
}
class AccessCredentialType
{
public $accessLicense; // string
public $signature; // string
public $timestamp; // string
}
class BaseRequestType
{
public $detailLevel; // string
public $requestApp; // string
public $requestID; // string
public $userAgent; // string
public $version; // string
}
class BaseResponseType
{
public $detailLevel; // string
public $error; // ErrorType
public $messageID; // string
public $release; // string
public $requestID; // string
public $responseType; // string
public $timestamp; // string
public $version; // string
public $warningList; // ErrorType
}
class ErrorType
{
public $code; // string
public $detail; // string
public $message; // string
}
class PayService extends SoapClient
{
private static $classmap = array(
'ApproveReq' => 'ApproveReq',
'ApproveRes' => 'ApproveRes',
'approve' => 'approve',
'approveResponse' => 'approveResponse',
'AccessCredentialType' => 'AccessCredentialType',
'BaseRequestType' => 'BaseRequestType',
'BaseResponseType' => 'BaseResponseType',
'ErrorType' => 'ErrorType',
);
var $chatsetType;
var $accessCredentialType;
var $baseRequestType;
var $approveReq;
var $approveResponse;
var $resCD;
var $resMsg;
public function PayService( $wsdl = "", $options = array() )
{
foreach( self::$classmap as $key => $value )
{
if ( !isset( $options[ 'classmap' ][ $key ] ) )
{
$options[ 'classmap' ][ $key ] = $value;
}
}
parent::__construct( $wsdl, $options );
$accessCredentialType = null;
$baseRequestType = null;
$approveReq = null;
$resCD = "95XX";
$resMsg = "연동 오류";
}
public function setCharSet( $charsetType )
{
$this->chatsetType = $charsetType;
}
public function setAccessCredentialType( $accessLicense,
$signature,
$timestamp )
{
$this->accessCredentialType = new AccessCredentialType();
$this->accessCredentialType->accessLicense = $accessLicense;
$this->accessCredentialType->signature = $signature;
$this->accessCredentialType->timestamp = $timestamp;
}
public function setBaseRequestType( $detailLevel,
$requestApp,
$requestID,
$userAgent,
$version )
{
$this->baseRequestType = new BaseRequestType();
$this->baseRequestType->detailLevel = $detailLevel;
$this->baseRequestType->requestApp = $requestApp;
$this->baseRequestType->requestID = $requestID;
$this->baseRequestType->userAgent = $userAgent;
$this->baseRequestType->version = $version;
}
public function setApproveReq( $escrow,
$orderID,
$paymentAmount,
$paymentMethod,
$productName,
$returnUrl,
$siteCode )
{
$this->approveReq = new ApproveReq();
$productName_utf8 = ( $this->chatsetType == "euc-kr" ) ? iconv( "EUC-KR", "UTF-8", $productName ) : $productName;
$this->approveReq->accessCredentialType = $this->accessCredentialType;
$this->approveReq->baseRequestType = $this->baseRequestType;
$this->approveReq->escrow = $escrow;
$this->approveReq->orderID = $orderID;
$this->approveReq->paymentAmount = $paymentAmount;
$this->approveReq->paymentMethod = $paymentMethod;
$this->approveReq->productName = $productName_utf8;
$this->approveReq->returnUrl = $returnUrl;
$this->approveReq->siteCode = $siteCode;
}
public function approve()
{
$approve = new approve();
$approve->req = $this->approveReq;
$this->approveResponse = $this->__soapCall( "approve", array( $approve ),
array( 'uri' => 'http://webservice.act.webpay.service.kcp.kr',
'soapaction' => ''
)
);
$this->resCD = $this->approveResponse->return->baseResponseType->error->code;
$this->resMsg = $this->approveResponse->return->baseResponseType->error->message;
return $this->approveResponse->return;
}
}
?>

View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax21="http://payment.domain.webpay.service.kcp.kr/xsd" xmlns:ns="http://webservice.act.webpay.service.kcp.kr" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ax22="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<wsdl:types>
<xs:schema xmlns:ax23="http://domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://payment.domain.webpay.service.kcp.kr/xsd">
<xs:import namespace="http://domain.webpay.service.kcp.kr/xsd"/>
<xs:complexType name="ApproveReq">
<xs:sequence>
<xs:element minOccurs="0" name="accessCredentialType" nillable="true" type="ax22:AccessCredentialType"/>
<xs:element minOccurs="0" name="baseRequestType" nillable="true" type="ax22:BaseRequestType"/>
<xs:element minOccurs="0" name="escrow" type="xs:boolean"/>
<xs:element minOccurs="0" name="orderID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="paymentAmount" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="paymentMethod" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="productName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="returnUrl" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="siteCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApproveRes">
<xs:sequence>
<xs:element minOccurs="0" name="approvalKey" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="baseResponseType" nillable="true" type="ax22:BaseResponseType"/>
<xs:element minOccurs="0" name="payUrl" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ax24="http://payment.domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<xs:import namespace="http://payment.domain.webpay.service.kcp.kr/xsd"/>
<xs:element name="approve">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="req" nillable="true" type="ax24:ApproveReq"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="approveResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApproveRes"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.webpay.service.kcp.kr/xsd">
<xs:complexType name="AccessCredentialType">
<xs:sequence>
<xs:element minOccurs="0" name="accessLicense" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="signature" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timestamp" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseRequestType">
<xs:sequence>
<xs:element minOccurs="0" name="detailLevel" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestApp" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="userAgent" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseResponseType">
<xs:sequence>
<xs:element minOccurs="0" name="detailLevel" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="error" nillable="true" type="ax22:ErrorType"/>
<xs:element minOccurs="0" name="messageID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="release" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="responseType" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timestamp" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="warningList" nillable="true" type="ax22:ErrorType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ErrorType">
<xs:sequence>
<xs:element minOccurs="0" name="code" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="detail" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="approveRequest">
<wsdl:part name="parameters" element="ns:approve"/>
</wsdl:message>
<wsdl:message name="approveResponse">
<wsdl:part name="parameters" element="ns:approveResponse"/>
</wsdl:message>
<wsdl:portType name="PayServicePortType">
<wsdl:operation name="approve">
<wsdl:input message="ns:approveRequest" wsaw:Action="urn:approve"/>
<wsdl:output message="ns:approveResponse" wsaw:Action="urn:approveResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PayServiceSoap11Binding" type="ns:PayServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PayServiceSoap12Binding" type="ns:PayServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap12:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PayServiceHttpBinding" type="ns:PayServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="approve">
<http:operation location="PayService/approve"/>
<wsdl:input>
<mime:content type="text/xml" part="approve"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="approve"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PayService">
<wsdl:port name="PayServiceHttpSoap11Endpoint" binding="ns:PayServiceSoap11Binding">
<soap:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpSoap12Endpoint" binding="ns:PayServiceSoap12Binding">
<soap12:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpEndpoint" binding="ns:PayServiceHttpBinding">
<http:address location="https://devpggw.kcp.co.kr:8100/services/KCPPaymentService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,7 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
?>

View File

@ -0,0 +1,112 @@
var isIE = false;
var req01_AJAX;
var READY_STATE_UNINITIALIZED = 0;
var READY_STATE_LOADING = 1;
var READY_STATE_LOADED = 2;
var READY_STATE_INTERACTIVE = 3;
var READY_STATE_COMPLETE = 4;
var PayUrl ="";
function displayElement( targetObj, targetText, targetColor )
{
if ( targetObj.childNodes.length > 0 )
{
targetObj.replaceChild( document.createTextNode( targetText ), targetObj.childNodes[ 0 ] );
} else
{
targetObj.appendChild( document.createTextNode( targetText ) );
}
targetObj.style.color = targetColor;
}
function clearElement( targetObj )
{
for ( i = ( targetObj.childNodes.length - 1 ); i >= 0; i-- )
{
targetObj.removeChild( targetObj.childNodes[ i ] );
}
}
function initRequest()
{
if ( window.XMLHttpRequest )
{
return new XMLHttpRequest();
} else if ( window.ActiveXObject )
{
isIE = true;
return new ActiveXObject( "Microsoft.XMLHTTP" );
}
}
function sendRequest( url )
{
req01_AJAX = null;
req01_AJAX = initRequest();
if ( req01_AJAX )
{
req01_AJAX.onreadystatechange = process_AJAX;
req01_AJAX.open( "POST", url, true );
req01_AJAX.send( null );
}
}
function kcp_AJAX()
{
var url = "./order_approval.php";
var form = document.sm_form;
var params = "?site_cd=" + form.site_cd.value
+ "&ordr_idxx=" + form.ordr_idxx.value
+ "&good_mny=" + form.good_mny.value
+ "&pay_method=" + form.pay_method.value
+ "&escw_used=" + form.escw_used.value
+ "&good_name=" + form.good_name.value
+ "&Ret_URL=" + form.Ret_URL.value;
sendRequest( url + params );
}
function process_AJAX()
{
if ( req01_AJAX.readyState == READY_STATE_COMPLETE )
{
if ( req01_AJAX.status == 200 )
{
var result = null;
if ( req01_AJAX.responseText != null )
{
var txt = req01_AJAX.responseText.split(",");
if( txt[0].replace(/^\s*/,'').replace(/\s*$/,'') == '0000' )
{
document.getElementById("approval").value = txt[1].replace(/^\s*/,'').replace(/\s*$/,'');
PayUrl = txt[2].replace(/^\s*/,'').replace(/\s*$/,'');
//alert("성공적으로 거래가 등록 되었습니다.");
call_pay_form();
}
else
{
alert("실패 되었습니다.[" + txt[3].replace(/^\s*/,'').replace(/\s*$/,'') + "]");
}
}
}
else
{
alert( req01_AJAX.responseText );
}
}
else if ( req01_AJAX.readyState == READY_STATE_UNINITIALIZED )
{
}
else if ( req01_AJAX.readyState == READY_STATE_LOADING )
{
}
else if ( req01_AJAX.readyState == READY_STATE_LOADED )
{
}
else if ( req01_AJAX.readyState == READY_STATE_INTERACTIVE )
{
}
}

View File

@ -0,0 +1,54 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php');
require_once(G5_MSHOP_PATH.'/kcp/KCPComLibrary.php'); // library [수정불가]
?>
<?php
// 쇼핑몰 페이지에 맞는 문자셋을 지정해 주세요.
$charSetType = 'utf-8'; // UTF-8인 경우 "utf-8"로 설정
$siteCode = $_GET[ 'site_cd' ];
$orderID = $_GET[ 'ordr_idxx' ];
$paymentMethod = $_GET[ 'pay_method' ];
$escrow = ( $_GET[ 'escw_used' ] == 'Y' ) ? true : false;
$productName = $_GET[ 'good_name' ];
// 아래 두값은 POST된 값을 사용하지 않고 서버에 SESSION에 저장된 값을 사용하여야 함.
$paymentAmount = $_GET[ 'good_mny' ]; // 결제 금액
$returnUrl = $_GET[ 'Ret_URL' ];
// Access Credential 설정
$accessLicense = '';
$signature = '';
$timestamp = '';
// Base Request Type 설정
$detailLevel = '0';
$requestApp = 'WEB';
$requestID = $orderID;
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$version = '0.1';
try
{
$payService = new PayService( $g_wsdl );
$payService->setCharSet( $charSetType );
$payService->setAccessCredentialType( $accessLicense, $signature, $timestamp );
$payService->setBaseRequestType( $detailLevel, $requestApp, $requestID, $userAgent, $version );
$payService->setApproveReq( $escrow, $orderID, $paymentAmount, $paymentMethod, $productName, $returnUrl, $siteCode );
$approveRes = $payService->approve();
printf( "%s,%s,%s,%s", $payService->resCD, $approveRes->approvalKey,
$approveRes->payUrl, $payService->resMsg );
}
catch (SoapFault $ex )
{
printf( "%s,%s,%s,%s", "95XX", "", "", "연동 오류 (PHP SOAP 모듈 설치 필요)" );
}
?>

View File

@ -0,0 +1,374 @@
<?php
include_once('./_common.php');
/* ============================================================================== */
/* = PAGE : 결제 요청 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = 이 페이지는 주문 페이지를 통해서 결제자가 결제 요청을 하는 페이지 = */
/* = 입니다. 아래의 ※ 필수, ※ 옵션 부분과 매뉴얼을 참조하셔서 연동을 = */
/* = 진행하여 주시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
/* = 연동시 오류가 발생하는 경우 아래의 주소로 접속하셔서 확인하시기 바랍니다.= */
/* = 접속 주소 : http://testpay.kcp.co.kr/pgsample/FAQ/search_error.jsp = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */
?>
<?php
/* ============================================================================== */
/* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = 테스트 및 실결제 연동시 site_conf_inc.php파일을 수정하시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php'); // 환경설정 파일 include
?>
<?php
/* = -------------------------------------------------------------------------- = */
/* = 환경 설정 파일 Include END = */
/* ============================================================================== */
?>
<?php
/* kcp와 통신후 kcp 서버에서 전송되는 결제 요청 정보*/
$req_tx = $_POST[ "req_tx" ]; // 요청 종류
$res_cd = $_POST[ "res_cd" ]; // 응답 코드
$tran_cd = $_POST[ "tran_cd" ]; // 트랜잭션 코드
$ordr_idxx = $_POST[ "ordr_idxx" ]; // 쇼핑몰 주문번호
$good_name = $_POST[ "good_name" ]; // 상품명
$good_mny = $_POST[ "good_mny" ]; // 결제 총금액
$buyr_name = $_POST[ "buyr_name" ]; // 주문자명
$buyr_tel1 = $_POST[ "buyr_tel1" ]; // 주문자 전화번호
$buyr_tel2 = $_POST[ "buyr_tel2" ]; // 주문자 핸드폰 번호
$buyr_mail = $_POST[ "buyr_mail" ]; // 주문자 E-mail 주소
$use_pay_method = $_POST[ "use_pay_method" ]; // 결제 방법
$enc_info = $_POST[ "enc_info" ]; // 암호화 정보
$enc_data = $_POST[ "enc_data" ]; // 암호화 데이터
$rcvr_name = $_POST[ "rcvr_name" ]; // 수취인 이름
$rcvr_tel1 = $_POST[ "rcvr_tel1" ]; // 수취인 전화번호
$rcvr_tel2 = $_POST[ "rcvr_tel2" ]; // 수취인 휴대폰번호
$rcvr_mail = $_POST[ "rcvr_mail" ]; // 수취인 E-Mail
$rcvr_zipx = $_POST[ "rcvr_zipx" ]; // 수취인 우편번호
$rcvr_add1 = $_POST[ "rcvr_add1" ]; // 수취인 주소
$rcvr_add2 = $_POST[ "rcvr_add2" ]; // 수취인 상세주소
/* 주문폼에서 전송되는 정보 */
$ipgm_date = $_POST[ "ipgm_date" ]; // 입금마감일
$settle_method = $_POST[ "settle_method" ]; // 결제방법
$good_info = $_POST[ "good_info" ]; // 에스크로 상품정보
$bask_cntx = $_POST[ "bask_cntx" ]; // 장바구니 상품수
$tablet_size = $_POST[ "tablet_size" ]; // 모바일기기 화면비율
$comm_tax_mny = $_POST[ "comm_tax_mny" ]; // 과세금액
$comm_vat_mny = $_POST[ "comm_vat_mny" ]; // 부가세
$comm_free_mny = $_POST["comm_free_mny" ]; // 비과세금액
$payco_direct = $_POST["payco_direct" ]; // PAYCO 결제창 호출
/*
* 기타 파라메터 추가 부분 - Start -
*/
$param_opt_1 = $_POST[ "param_opt_1" ]; // 기타 파라메터 추가 부분
$param_opt_2 = $_POST[ "param_opt_2" ]; // 기타 파라메터 추가 부분
$param_opt_3 = $_POST[ "param_opt_3" ]; // 기타 파라메터 추가 부분
/*
* 기타 파라메터 추가 부분 - End -
*/
/* kcp 데이터 캐릭터셋 변환 */
if($res_cd != '') {
$good_name = iconv('euc-kr', 'utf-8', $good_name);
$buyr_name = iconv('euc-kr', 'utf-8', $buyr_name);
$rcvr_name = iconv('euc-kr', 'utf-8', $rcvr_name);
$rcvr_add1 = iconv('euc-kr', 'utf-8', $rcvr_add1);
$rcvr_add2 = iconv('euc-kr', 'utf-8', $rcvr_add2);
}
switch($settle_method)
{
case '신용카드':
$pay_method = 'CARD';
$ActionResult = 'card';
break;
case '계좌이체':
$pay_method = 'BANK';
$ActionResult = 'acnt';
break;
case '휴대폰':
$pay_method = 'MOBX';
$ActionResult = 'mobx';
break;
case '가상계좌':
$pay_method = 'VCNT';
$ActionResult = 'vcnt';
break;
case '간편결제':
$pay_method = 'CARD';
$ActionResult = 'card';
break;
default:
$pay_method = '';
$ActionResult = '';
break;
}
if(get_session('ss_personalpay_id') && get_session('ss_personalpay_hash')) {
$js_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
} else {
$js_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$js_return_url .= '?sw_direct=1';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<title>스마트폰 웹 결제창</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="No-Cache">
<meta http-equiv="Pragma" content="No-Cache">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10">
<meta name="HandheldFriendly" content="true">
<meta name="format-detection" content="telephone=no">
<style type="text/css">
.LINE { background-color:#afc3ff }
.HEAD { font-family:"굴림","굴림체"; font-size:9pt; color:#065491; background-color:#eff5ff; text-align:left; padding:3px; }
.TEXT { font-family:"굴림","굴림체"; font-size:9pt; color:#000000; background-color:#FFFFFF; text-align:left; padding:3px; }
B { font-family:"굴림","굴림체"; font-size:13pt; color:#065491;}
INPUT { font-family:"굴림","굴림체"; font-size:9pt; }
SELECT{font-size:9pt;}
.COMMENT { font-family:"굴림","굴림체"; font-size:9pt; line-height:160% }
</style>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G5_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<script language="javascript">
/* kcp web 결제창 호출 (변경불가)*/
function call_pay_form()
{
var v_frm = document.sm_form;
layer_cont_obj = document.getElementById("content");
layer_receipt_obj = document.getElementById("layer_receipt");
layer_cont_obj.style.display = "none";
layer_receipt_obj.style.display = "block";
v_frm.target = "frm_receipt";
v_frm.action = PayUrl;
if(v_frm.Ret_URL.value == "")
{
/* Ret_URL값은 현 페이지의 URL 입니다. */
alert("연동시 Ret_URL을 반드시 설정하셔야 됩니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
v_frm.submit();
}
/* kcp 통신을 통해 받은 암호화 정보 체크 후 결제 요청*/
function chk_pay()
{
/*kcp 결제서버에서 가맹점 주문페이지로 폼값을 보내기위한 설정(변경불가)*/
self.name = "tar_opener";
var sm_form = document.sm_form;
if (sm_form.res_cd.value == "3001" )
{
alert("사용자가 취소하였습니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
else if (sm_form.res_cd.value == "3000" )
{
alert("30만원 이상 결제 할수 없습니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
if (sm_form.enc_data.value != "" && sm_form.enc_info.value != "" && sm_form.tran_cd.value !="" )
{
document.getElementById("pay_fail").style.display = "none";
document.getElementById("show_progress").style.display = "block";
setTimeout( function() {
document.forderform.submit();
}, 300);
} else {
kcp_AJAX();
}
}
</script>
</head>
<body onload="chk_pay();">
<div id="content">
<?php
if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
// 제외할 필드
$exclude = array('req_tx', 'res_cd', 'tran_cd', 'ordr_idxx', 'good_mny', 'good_name', 'buyr_name', 'buyr_tel1', 'buyr_tel2', 'buyr_mail', 'enc_info', 'enc_data', 'use_pay_method', 'rcvr_name', 'rcvr_tel1', 'rcvr_tel2', 'rcvr_mail', 'rcvr_zipx', 'rcvr_add1', 'rcvr_add2', 'param_opt_1', 'param_opt_2', 'param_opt_3');
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$ordr_idxx' ";
$row = sql_fetch($sql);
$data = unserialize($row['dt_data']);
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
}
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
foreach($_POST as $key=>$value) {
echo '<input type="hidden" name="'.$key.'" value="'.$value.'">'.PHP_EOL;
}
echo '</form>'.PHP_EOL;
}
?>
<form name="sm_form" method="POST" accept-charset="euc-kr">
<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 $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; ?>">
<input type="hidden" name="ipgm_date" value="<?php echo $ipgm_date; ?>">
<input type="hidden" name="payco_direct" value="<?php echo $payco_direct; ?>"> <!-- PAYCO 결제창 호출 -->
<!-- 필수 사항 -->
<!-- 요청 구분 -->
<input type="hidden" name="req_tx" value="pay">
<!-- 사이트 코드 -->
<input type="hidden" name="site_cd" value="<?php echo $g_conf_site_cd; ?>">
<!-- 사이트 이름 -->
<input type="hidden" name="shop_name" value="<?php echo $g_conf_site_name; ?>">
<!-- 결제수단-->
<input type="hidden" name="pay_method" value="<?php echo $pay_method; ?>">
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $ordr_idxx; ?>">
<!-- 최대 할부개월수 -->
<input type="hidden" name="quotaopt" value="12">
<!-- 통화 코드 -->
<input type="hidden" name="currency" value="410">
<!-- 결제등록 키 -->
<input type="hidden" name="approval_key" id="approval">
<!-- 리턴 URL (kcp와 통신후 결제를 요청할 수 있는 암호화 데이터를 전송 받을 가맹점의 주문페이지 URL) -->
<!-- 반드시 가맹점 주문페이지의 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 $ActionResult; ?>">
<!-- 에스크로 사용유무 에스크로 사용 업체(가상계좌만 해당)는 Y로 세팅 해주시기 바랍니다.-->
<input type="hidden" name="escw_used" value="Y">
<!-- 에스크로 결제처리모드 -->
<input type="hidden" name="pay_mod" value="<?php echo ($default['de_escrow_use']?'O':'N'); ?>">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="<?php echo $rcvr_name; ?>">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="<?php echo $rcvr_tel1; ?>">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="<?php echo $rcvr_tel2; ?>">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="<?php echo $rcvr_add1; ?>">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="<?php echo $rcvr_add2; ?>">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="<?php echo $rcvr_mail; ?>">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="<?php echo $rcvr_zipx; ?>">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo $bask_cntx; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
<input type="hidden" name="param_opt_1" value="<?php echo $param_opt_1; ?>"/>
<input type="hidden" name="param_opt_2" value="<?php echo $param_opt_2; ?>"/>
<input type="hidden" name="param_opt_3" value="<?php echo $param_opt_3; ?>"/>
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
<input type="hidden" name="used_card" value="CClg:ccDI">
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
-->
<input type="hidden" name="kcp_noint" value="<?php echo ($default['de_card_noint_use'] ? '' : 'N'); ?>">
<?php
if($default['de_tax_flag_use']) {
/* KCP는 과세상품과 비과세상품을 동시에 판매하는 업체들의 결제관리에 대한 편의성을 제공해드리고자,
복합과세 전용 사이트코드를 지원해 드리며 총 금액에 대해 복합과세 처리가 가능하도록 제공하고 있습니다
복합과세 전용 사이트 코드로 계약하신 가맹점에만 해당이 됩니다
상품별이 아니라 금액으로 구분하여 요청하셔야 합니다
총결제 금액은 과세금액 + 부과세 + 비과세금액의 합과 같아야 합니다.
(good_mny = comm_tax_mny + comm_vat_mny + comm_free_mny) */
?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php
}
?>
<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 $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>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</div>
<!-- 스마트폰에서 KCP 결제창을 레이어 형태로 구현-->
<div id="layer_receipt" style="position:absolute; left:1px; top:1px; width:100%;height:100%; z-index:1; display:none;">
<table width="100%" height="100%" border="-" cellspacing="0" cellpadding="0" style="text-align:center">
<tr height="100%" width="100%">
<td>
<iframe name="frm_receipt" frameborder="0" border="0" width="100%" height="100%" scrolling="auto"></iframe>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,95 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 무통장 입금만 사용할 때는 아래 코드 실행되지 않음
if(!($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use']))
return;
?>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G5_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<form name="sm_form" method="POST" action="<?php echo G5_MSHOP_URL; ?>/kcp/order_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value="">
<input type="hidden" name="buyr_mail" value="">
<input type="hidden" name="ipgm_date" value="<?php echo $ipgm_date; ?>">
<input type="hidden" name="settle_method" value="">
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 결제등록 키 -->
<input type="hidden" name="approval_key" id="approval">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo (int)$goods_count + 1; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
<input type="hidden" name="param_opt_1" value="<?php echo $param_opt_1; ?>"/>
<input type="hidden" name="param_opt_2" value="<?php echo $param_opt_2; ?>"/>
<input type="hidden" name="param_opt_3" value="<?php echo $param_opt_3; ?>"/>
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
<input type="hidden" name='used_card' value="CClg:ccDI">
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
-->
<input type="hidden" name="kcp_noint" value="<?php echo ($default['de_card_noint_use'] ? '' : 'N'); ?>">
<?php
if($default['de_tax_flag_use']) {
/* KCP는 과세상품과 비과세상품을 동시에 판매하는 업체들의 결제관리에 대한 편의성을 제공해드리고자,
복합과세 전용 사이트코드를 지원해 드리며 총 금액에 대해 복합과세 처리가 가능하도록 제공하고 있습니다
복합과세 전용 사이트 코드로 계약하신 가맹점에만 해당이 됩니다
상품별이 아니라 금액으로 구분하여 요청하셔야 합니다
총결제 금액은 과세금액 + 부과세 + 비과세금액의 합과 같아야 합니다.
(good_mny = comm_tax_mny + comm_vat_mny + comm_free_mny)
복합과세는 order_approval_form.php 파일의 의해 적용됨
아래 필드는 order_approval_form.php 파일로 전송하는 것
*/
?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php
}
?>
</form>

View File

@ -0,0 +1,50 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="req_tx" value=""> <!-- 요청 구분 -->
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value=""> <!-- 트랜잭션 코드 -->
<input type="hidden" name="ordr_idxx" value=""> <!-- 주문번호 -->
<input type="hidden" name="good_mny" value=""> <!-- 결제금액 -->
<input type="hidden" name="good_name" value=""> <!-- 상품명 -->
<input type="hidden" name="buyr_name" value=""> <!-- 주문자명 -->
<input type="hidden" name="buyr_tel1" value=""> <!-- 주문자 전화번호 -->
<input type="hidden" name="buyr_tel2" value=""> <!-- 주문자 휴대폰번호 -->
<input type="hidden" name="buyr_mail" value=""> <!-- 주문자 E-mail -->
<input type="hidden" name="enc_info" value=""> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value=""> <!-- 암호화 데이터 -->
<input type="hidden" name="use_pay_method" value=""> <!-- 요청된 결제 수단 -->
<input type="hidden" name="rcvr_name" value=""> <!-- 수취인 이름 -->
<input type="hidden" name="rcvr_tel1" value=""> <!-- 수취인 전화번호 -->
<input type="hidden" name="rcvr_tel2" value=""> <!-- 수취인 휴대폰번호 -->
<input type="hidden" name="rcvr_mail" value=""> <!-- 수취인 E-Mail -->
<input type="hidden" name="rcvr_zipx" value=""> <!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add1" value=""> <!-- 수취인 주소 -->
<input type="hidden" name="rcvr_add2" value=""> <!-- 수취인 상세 주소 -->
<input type="hidden" name="param_opt_1" value="">
<input type="hidden" name="param_opt_2" value="">
<input type="hidden" name="param_opt_3" value="">
<input type="hidden" name="disp_tax_yn" value="N">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록요청" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
<?php
// 무통장 입금만 사용할 때는 주문하기 버튼 보이게
if(!($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'])) {
?>
<script>
document.getElementById("show_req_btn").style.display = "none";
document.getElementById("show_pay_btn").style.display = "";
</script>
<?php } ?>

View File

@ -0,0 +1,48 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<section id="sod_frm_escrow">
<h2>에스크로 안내</h2>
<form name="escrow_foot" method="post" action="http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp">
<input type="hidden" name="site_cd" value="<?php echo $default['de_kcp_mid']; ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align='center'><img src="<?php echo G5_SHOP_URL; ?>/img/marks_escrow/escrow_foot.gif" width="290" height="92" border="0" usemap="#Map"></td>
</tr>
<tr>
<td style='line-height:150%;'>
<br>
<strong>에스크로(escrow) 제도란?</strong>
<br>상거래 시에, 판매자와 구매자의 사이에 신뢰할 수 있는 중립적인 제삼자(여기서는 <a href='http://kcp.co.kr' target='_blank'>KCP</a>)가 중개하여
금전 또는 물품을 거래를 하도록 하는 것, 또는 그러한 서비스를 말한다. 거래의 안전성을 확보하기 위해 이용된다.
(2006.4.1 전자상거래 소비자보호법에 따른 의무 시행)
<br><br>
현금 거래에만 해당(에스크로 결제를 선택했을 경우에만 해당)되며,
신용카드로 구매하는 거래, 배송이 필요하지 않은 재화 등을 구매하는 거래(컨텐츠 등)에는 해당되지 않는다.
<br>
<br>
</td>
</tr>
</table>
<map name="Map" id="Map">
<area shape="rect" coords="5,62,74,83" href="javascript:escrow_foot_check()" alt="가입사실확인">
</map>
</form>
</section>
<script>
function escrow_foot_check()
{
var status = "width=500 height=450 menubar=no,scrollbars=no,resizable=no,status=no";
var obj = window.open('', 'escrow_foot_pop', status);
document.escrow_foot.method = "post";
document.escrow_foot.target = "escrow_foot_pop";
document.escrow_foot.action = "http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp";
document.escrow_foot.submit();
}
</script>
<!-- <?php if ($default['de_card_use'] || $default['de_iche_use']) { echo "결제대행사 : KCP"; } ?> -->

View File

@ -0,0 +1,276 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* ============================================================================== */
/* = PAGE : 지불 요청 및 결과 처리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = 연동시 오류가 발생하는 경우 아래의 주소로 접속하셔서 확인하시기 바랍니다.= */
/* = 접속 주소 : http://testpay.kcp.co.kr/pgsample/FAQ/search_error.jsp = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = 테스트 및 실결제 연동시 site_conf_inc.php파일을 수정하시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php'); // 환경설정 파일 include
require "pp_ax_hub_lib.php"; // library [수정불가]
/* = -------------------------------------------------------------------------- = */
/* = 환경 설정 파일 Include END = */
/* ============================================================================== */
?>
<?php
/* ============================================================================== */
/* = 01. 지불 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
$req_tx = $_POST[ "req_tx" ]; // 요청 종류
$tran_cd = $_POST[ "tran_cd" ]; // 처리 종류
/* = -------------------------------------------------------------------------- = */
$cust_ip = getenv( "REMOTE_ADDR" ); // 요청 IP
$ordr_idxx = $_POST[ "ordr_idxx" ]; // 쇼핑몰 주문번호
$good_name = addslashes($_POST[ "good_name" ]); // 상품명
$good_mny = $_POST[ "good_mny" ]; // 결제 총금액
/* = -------------------------------------------------------------------------- = */
$res_cd = ""; // 응답코드
$res_msg = ""; // 응답메시지
$tno = $_POST[ "tno" ]; // KCP 거래 고유 번호
/* = -------------------------------------------------------------------------- = */
$buyr_name = addslashes($_POST[ "buyr_name" ]); // 주문자명
$buyr_tel1 = $_POST[ "buyr_tel1" ]; // 주문자 전화번호
$buyr_tel2 = $_POST[ "buyr_tel2" ]; // 주문자 핸드폰 번호
$buyr_mail = $_POST[ "buyr_mail" ]; // 주문자 E-mail 주소
/* = -------------------------------------------------------------------------- = */
$mod_type = $_POST[ "mod_type" ]; // 변경TYPE VALUE 승인취소시 필요
$mod_desc = $_POST[ "mod_desc" ]; // 변경사유
/* = -------------------------------------------------------------------------- = */
$use_pay_method = $_POST[ "use_pay_method" ]; // 결제 방법
$bSucc = ""; // 업체 DB 처리 성공 여부
/* = -------------------------------------------------------------------------- = */
$app_time = ""; // 승인시간 (모든 결제 수단 공통)
$amount = ""; // KCP 실제 거래 금액
$total_amount = 0; // 복합결제시 총 거래금액
/* = -------------------------------------------------------------------------- = */
$card_cd = ""; // 신용카드 코드
$card_name = ""; // 신용카드 명
$app_no = ""; // 신용카드 승인번호
$noinf = ""; // 신용카드 무이자 여부
$quota = ""; // 신용카드 할부개월
/* = -------------------------------------------------------------------------- = */
$bank_name = ""; // 은행명
$bank_code = ""; // 은행코드
/* = -------------------------------------------------------------------------- = */
$bankname = ""; // 입금할 은행명
$depositor = ""; // 입금할 계좌 예금주 성명
$account = ""; // 입금할 계좌 번호
/* = -------------------------------------------------------------------------- = */
$pnt_issue = ""; // 결제 포인트사 코드
$pt_idno = ""; // 결제 및 인증 아이디
$pnt_amount = ""; // 적립금액 or 사용금액
$pnt_app_time = ""; // 승인시간
$pnt_app_no = ""; // 승인번호
$add_pnt = ""; // 발생 포인트
$use_pnt = ""; // 사용가능 포인트
$rsv_pnt = ""; // 적립 포인트
/* = -------------------------------------------------------------------------- = */
$commid = ""; // 통신사 코드
$mobile_no = ""; // 휴대폰 번호
/* = -------------------------------------------------------------------------- = */
$tk_van_code = ""; // 발급사 코드
$tk_app_no = ""; // 상품권 승인 번호
/* = -------------------------------------------------------------------------- = */
$cash_yn = $_POST[ "cash_yn" ]; // 현금영수증 등록 여부
$cash_authno = ""; // 현금 영수증 승인 번호
$cash_tr_code = $_POST[ "cash_tr_code" ]; // 현금 영수증 발행 구분
$cash_id_info = $_POST[ "cash_id_info" ]; // 현금 영수증 등록 번호
/* ============================================================================== */
/* ============================================================================== */
/* = 02. 인스턴스 생성 및 초기화 = */
/* = -------------------------------------------------------------------------- = */
/* = 결제에 필요한 인스턴스를 생성하고 초기화 합니다. = */
/* = -------------------------------------------------------------------------- = */
$c_PayPlus = new C_PP_CLI;
$c_PayPlus->mf_clear();
/* ------------------------------------------------------------------------------ */
/* = 02. 인스턴스 생성 및 초기화 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 03. 처리 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
/* = -------------------------------------------------------------------------- = */
/* = 03-1. 승인 요청 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
$c_PayPlus->mf_set_encx_data( $_POST[ "enc_data" ], $_POST[ "enc_info" ] );
}
/* = -------------------------------------------------------------------------- = */
/* = 03-2. 취소/매입 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ( $req_tx == "mod" )
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
}
/* ------------------------------------------------------------------------------ */
/* = 03. 처리 요청 정보 설정 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 04. 실행 = */
/* = -------------------------------------------------------------------------- = */
if ( $tran_cd != "" )
{
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, $g_conf_log_level, 0, 0, $g_conf_key_dir, $g_conf_log_dir ); // 응답 전문 처리
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
}
else
{
$c_PayPlus->m_res_cd = "9562";
$c_PayPlus->m_res_msg = "연동 오류|tran_cd값이 설정되지 않았습니다.";
}
if ($res_cd != '0000')
{
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
/*
echo "<script>
var openwin = window.open( './kcp/proc_win.php', 'proc_win', '' );
openwin.close();
</script>";
*/
if(isset($_POST['pp_id']) && $_POST['pp_id']) {
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
} else {
$page_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$page_return_url .= '?sw_direct=1';
}
alert("$res_cd : $res_msg", $page_return_url);
exit;
}
/* = -------------------------------------------------------------------------- = */
/* = 04. 실행 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 05. 승인 결과 값 추출 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // KCP 실제 거래 금액
$pnt_issue = $c_PayPlus->mf_get_res_data( "pnt_issue" ); // 결제 포인트사 코드
/* = -------------------------------------------------------------------------- = */
/* = 05-1. 신용카드 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "100000000000" )
{
$card_cd = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드
$card_name = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$app_no = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호
$noinf = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 )
$quota = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수
}
/* = -------------------------------------------------------------------------- = */
/* = 05-2. 계좌이체 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "010000000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인시간
$bank_name = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명
$bank_code = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드
}
/* = -------------------------------------------------------------------------- = */
/* = 05-3. 가상계좌 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "001000000000" )
{
$bankname = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름
$depositor = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주
$account = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-4. 포인트 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000100000000" )
{
$pt_idno = $c_PayPlus->mf_get_res_data( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트
}
/* = -------------------------------------------------------------------------- = */
/* = 05-5. 휴대폰 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000010000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간
$commid = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드
$mobile_no = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-6. 상품권 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000000001000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간
$tk_van_code = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드
$tk_app_no = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-7. 현금영수증 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_tr_code = $c_PayPlus->mf_get_res_data( "cash_tr_code" ); // 현금영수증 등록구분
/* = -------------------------------------------------------------------------- = */
/* = 05-8. 에스크로 여부 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$escw_yn = $c_PayPlus->mf_get_res_data( "escw_yn" ); // 에스크로 여부
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05. 승인 결과 처리 END = */
/* ============================================================================== */
?>

View File

@ -0,0 +1,54 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// locale ko_KR.euc-kr 로 설정
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
/* ============================================================================== */
/* = 07. 승인 결과 DB처리 실패시 : 자동취소 = */
/* = -------------------------------------------------------------------------- = */
/* = 승인 결과를 DB 작업 하는 과정에서 정상적으로 승인된 건에 대해 = */
/* = DB 작업을 실패하여 DB update 가 완료되지 않은 경우, 자동으로 = */
/* = 승인 취소 요청을 하는 프로세스가 구성되어 있습니다. = */
/* = = */
/* = DB 작업이 실패 한 경우, bSucc 라는 변수(String)의 값을 "false" = */
/* = 로 설정해 주시기 바랍니다. (DB 작업 성공의 경우에는 "false" 이외의 = */
/* = 값을 설정하시면 됩니다.) = */
/* = -------------------------------------------------------------------------- = */
$bSucc = "false"; // DB 작업 실패 또는 금액 불일치의 경우 "false" 로 세팅
/* = -------------------------------------------------------------------------- = */
/* = 07-1. DB 작업 실패일 경우 자동 승인 취소 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
if ( $bSucc == "false" )
{
$c_PayPlus->mf_clear();
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", "STSC" ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $cancel_msg ); // 변경 사유
$c_PayPlus->mf_do_tx( "", $g_conf_home_dir, $g_conf_site_cd,
$g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
$ordr_idxx, $cust_ip, $g_conf_log_level,
0, 0 );
$res_cd = $c_PayPlus->m_res_cd;
$res_msg = $c_PayPlus->m_res_msg;
}
}
} // End of [res_cd = "0000"]
/* ============================================================================== */
// locale 설정 초기화
setlocale(LC_CTYPE, '');
?>

View File

@ -0,0 +1,295 @@
<?php
/* ============================================================================== */
/* = PAGE : 라이브버리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Inc. All Rights Reserverd. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 지불 연동 CLASS = */
/* ============================================================================== */
class C_PP_CLI
{
var $m_payx_common;
var $m_payx_card;
var $m_ordr_data;
var $m_rcvr_data;
var $m_escw_data;
var $m_modx_data;
var $m_encx_data;
var $m_encx_info;
/* -------------------------------------------------------------------- */
/* - 처리 결과 값 - */
/* -------------------------------------------------------------------- */
var $m_res_data;
var $m_res_cd;
var $m_res_msg;
/* -------------------------------------------------------------------- */
/* - 생성자 - */
/* -------------------------------------------------------------------- */
function C_PP_CLI()
{
$this->m_payx_common = "";
$this->m_payx_card = "";
$this->m_ordr_data = "";
$this->m_rcvr_data = "";
$this->m_escw_data = "";
$this->m_modx_data = "";
$this->m_encx_data = "";
$this->m_encx_info = "";
}
function mf_init( $mode )
{
if ( $mode == "1" )
{
if ( !extension_loaded( 'pp_cli_dl_php' ) )
{
dl( "pp_cli_dl_php.so" );
}
}
}
function mf_clear()
{
$this->m_payx_common = "";
$this->m_payx_card = "";
$this->m_ordr_data = "";
$this->m_rcvr_data = "";
$this->m_escw_data = "";
$this->m_modx_data = "";
$this->m_encx_data = "";
$this->m_encx_info = "";
}
function mf_gen_trace_no( $site_cd, $ip, $mode )
{
if ( $mode == "1" )
{
$trace_no = lfPP_CLI_DL__gen_trace_no( $site_cd, $ip );
}
else
{
$trace_no = "";
}
return $trace_no;
}
/* -------------------------------------------------------------------- */
/* - FUNC : ENC DATA 정보 설정 함수 - */
/* -------------------------------------------------------------------- */
function mf_set_payx_common_data( $name, $val )
{
if ( $val != "" )
{
$this->m_payx_common .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_payx_card_data( $name, $val )
{
if ( $val != "" )
{
$this->m_payx_card .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_ordr_data( $name, $val )
{
if ( $val != "" )
{
$this->m_ordr_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_rcvr_data( $name, $val )
{
if ( $val != "" )
{
$this->m_rcvr_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_escw_data( $name, $val )
{
if ( $val != "" )
{
$this->m_escw_data .= ( $name . '=' . $val . chr( 29 ) );
}
}
function mf_set_modx_data( $name, $val )
{
if ( $val != "" )
{
$this->m_modx_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_encx_data( $encx_data, $encx_info )
{
$this->m_encx_data = $encx_data;
$this->m_encx_info = $encx_info;
}
/* -------------------------------------------------------------------- */
/* - FUNC : 지불 처리 함수 - */
/* -------------------------------------------------------------------- */
function mf_do_tx( $trace_no, $home_dir, $site_cd,
$site_key, $tx_cd, $pub_key_str,
$pa_url, $pa_port, $user_agent,
$ordr_idxx, $cust_ip,
$log_level, $opt, $mode,
$key_dir, $log_dir)
{
$payx_data = $this->mf_get_payx_data();
$ordr_data = $this->mf_get_data( "ordr_data", $this->m_ordr_data );
$rcvr_data = $this->mf_get_data( "rcvr_data", $this->m_rcvr_data );
$escw_data = $this->mf_get_data( "escw_data", $this->m_escw_data );
$modx_data = $this->mf_get_data( "mod_data", $this->m_modx_data );
if ( $mode == "1" )
{
$res_data = lfPP_CLI_DL__do_tx_2( $trace_no, $home_dir, $site_cd,
$site_key, $tx_cd, $pub_key_str,
$pa_url, $pa_port, $user_agent,
$ordr_idxx,
$payx_data, $ordr_data,
$rcvr_data, $escw_data,
$modx_data,
$this->m_encx_data, $this->m_encx_info,
$log_level, $opt );
}
else
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$bin_exe = $home_dir.'/bin/pp_cli_exe ';
$res_data = $this->mf_exec($bin_exe . "\"".
"site_cd=" . $site_cd . "," .
"site_key=" . $site_key . "," .
"tx_cd=" . $tx_cd . "," .
"pa_url=" . $pa_url . "," .
"pa_port=" . $pa_port . "," .
"ordr_idxx=" . $ordr_idxx . "," .
"enc_data=" . $this->m_encx_data . "," .
"enc_info=" . $this->m_encx_info . "," .
"trace_no=" . $trace_no . "," .
"cust_ip=" . $cust_ip . "," .
"key_path=" . $key_dir . "," .
"log_path=" . $log_dir . "," .
"log_level=" . $log_level . "," .
"plan_data=" . $payx_data .
$ordr_data .
$rcvr_data .
$escw_data .
$modx_data .
"\"") ;
}
else
{
if(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir.'/bin/pp_cli';
else
$bin_exe = $home_dir.'/bin/pp_cli_x64';
$res_data = $this->mf_exec( $bin_exe,
"-h",
"home=" . $home_dir . "," .
"site_cd=" . $site_cd . "," .
"site_key=" . $site_key . "," .
"tx_cd=" . $tx_cd . "," .
"pa_url=" . $pa_url . "," .
"pa_port=" . $pa_port . "," .
"ordr_idxx=" . $ordr_idxx . "," .
"payx_data=" . $payx_data . "," .
"ordr_data=" . $ordr_data . "," .
"rcvr_data=" . $rcvr_data . "," .
"escw_data=" . $escw_data . "," .
"modx_data=" . $modx_data . "," .
"enc_data=" . $this->m_encx_data . "," .
"enc_info=" . $this->m_encx_info . "," .
"trace_no=" . $trace_no . "," .
"cust_ip=" . $cust_ip . "," .
"log_level=" . $log_level . "," .
"opt=" . $opt . "" );
}
if ( $res_data == "" )
{
$res_data = "res_cd=9502" . chr( 31 ) . "res_msg=연동 모듈 호출 오류";
}
}
parse_str( str_replace( chr( 31 ), "&", $res_data ), $this->m_res_data );
$this->m_res_cd = $this->m_res_data[ "res_cd" ];
$this->m_res_msg = $this->m_res_data[ "res_msg" ];
}
/* -------------------------------------------------------------------- */
/* - FUNC : 처리 결과 값을 리턴하는 함수 - */
/* -------------------------------------------------------------------- */
function mf_get_res_data( $name )
{
return $this->m_res_data[ $name ];
}
function mf_get_payx_data()
{
if ( $this->m_payx_common != "" || $this->m_payx_card != "" )
{
$my_data = "payx_data=";
}
if ( $this->m_payx_common != "" )
{
$my_data .= "common=" . $this->m_payx_common . chr( 30 );
}
if ( $this->m_payx_card != "" )
{
$my_data .= ( "card=" . $this->m_payx_card . chr( 30 ) );
}
return $my_data;
}
function mf_get_data( $data_name, $data )
{
if ( $data != "" )
{
$my_data = $data_name . "=" . $data;
}
else
{
$my_data = "";
}
return $my_data;
}
function mf_exec()
{
$arg = func_get_args();
if ( is_array( $arg[0] ) ) $arg = $arg[0];
$exec_cmd = array_shift( $arg );
while ( list(,$i) = each($arg) )
{
$exec_cmd .= " " . escapeshellarg( $i );
}
$rt = exec( $exec_cmd );
return $rt;
}
}
?>

View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax21="http://payment.domain.webpay.service.kcp.kr/xsd" xmlns:ns="http://webservice.act.webpay.service.kcp.kr" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ax22="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<wsdl:documentation>
KCP Payment Service
</wsdl:documentation>
<wsdl:types>
<xs:schema xmlns:ax23="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://payment.domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:import namespace="http://domain.webpay.service.kcp.kr/xsd"/>
<xs:complexType name="ApproveReq">
<xs:sequence>
<xs:element name="accessCredentialType" minOccurs="0" type="ax22:AccessCredentialType" nillable="true"/>
<xs:element name="baseRequestType" minOccurs="0" type="ax22:BaseRequestType" nillable="true"/>
<xs:element name="escrow" minOccurs="0" type="xs:boolean"/>
<xs:element name="orderID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="paymentAmount" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="paymentMethod" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="productName" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="returnUrl" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="siteCode" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApproveRes">
<xs:sequence>
<xs:element name="approvalKey" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="baseResponseType" minOccurs="0" type="ax22:BaseResponseType" nillable="true"/>
<xs:element name="payUrl" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ax24="http://payment.domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:import namespace="http://payment.domain.webpay.service.kcp.kr/xsd"/>
<xs:element name="approve">
<xs:complexType>
<xs:sequence>
<xs:element name="req" minOccurs="0" type="ax24:ApproveReq" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="approveResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" minOccurs="0" type="ax24:ApproveRes" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema targetNamespace="http://domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:complexType name="AccessCredentialType">
<xs:sequence>
<xs:element name="accessLicense" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="signature" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="timestamp" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseRequestType">
<xs:sequence>
<xs:element name="detailLevel" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestApp" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="userAgent" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="version" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseResponseType">
<xs:sequence>
<xs:element name="detailLevel" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="error" minOccurs="0" type="ax22:ErrorType" nillable="true"/>
<xs:element name="messageID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="release" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="responseType" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="timestamp" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="version" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="warningList" maxOccurs="unbounded" minOccurs="0" type="ax22:ErrorType" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ErrorType">
<xs:sequence>
<xs:element name="code" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="detail" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="message" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="approveRequest">
<wsdl:part name="parameters" element="ns:approve"/>
</wsdl:message>
<wsdl:message name="approveResponse">
<wsdl:part name="parameters" element="ns:approveResponse"/>
</wsdl:message>
<wsdl:portType name="KCPPaymentServicePortType">
<wsdl:operation name="approve">
<wsdl:input message="ns:approveRequest" wsaw:Action="urn:approve"/>
<wsdl:output message="ns:approveResponse" wsaw:Action="urn:approveResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="KCPPaymentServiceSoap11Binding" type="ns:KCPPaymentServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="KCPPaymentServiceSoap12Binding" type="ns:KCPPaymentServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap12:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="KCPPaymentServiceHttpBinding" type="ns:KCPPaymentServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="approve">
<http:operation location="KCPPaymentService/approve"/>
<wsdl:input>
<mime:content type="text/xml" part="approve"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="approve"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="KCPPaymentService">
<wsdl:port name="KCPPaymentServiceHttpSoap11Endpoint" binding="ns:KCPPaymentServiceSoap11Binding">
<soap:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="KCPPaymentServiceHttpSoap12Endpoint" binding="ns:KCPPaymentServiceSoap12Binding">
<soap12:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="KCPPaymentServiceHttpEndpoint" binding="ns:KCPPaymentServiceHttpBinding">
<http:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@ -0,0 +1,29 @@
<?php
include_once('./_common.php');
$it_id = $_GET['it_id'];
$no = $_GET['no'];
$sql = " select it_id, it_name, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
from {$g5['g5_shop_item_table']} where it_id='$it_id' ";
$row = sql_fetch_array(sql_query($sql));
if(!$row['it_id'])
alert_close('상품정보가 존재하지 않습니다.');
$imagefile = G5_DATA_PATH.'/item/'.$row['it_img'.$no];
$imagefileurl = G5_DATA_URL.'/item/'.$row['it_img'.$no];
$size = getimagesize($imagefile);
$g5['title'] = "{$row['it_name']} ($it_id)";
include_once(G5_PATH.'/head.sub.php');
$skin = G5_MSHOP_SKIN_PATH.'/largeimage.skin.php';
if(is_file($skin))
include_once($skin);
else
echo '<p>'.str_replace(G5_PATH.'/', '', $skin).'파일이 존재하지 않습니다.</p>';
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,7 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
?>

View File

@ -0,0 +1,3 @@
<!-- 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 중단하였을 , 사용자에게 보여지는 페이지입니다. -->
사용자가 ISP(국민/BC) 카드결제을 중단하였습니다.

View File

@ -0,0 +1,22 @@
<?php
// 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 성공하였을 때, 사용자에게 보여지는 페이지입니다.
include_once('./_common.php');
$LGD_OID = $_GET['LGD_OID'];
echo "LGD_OID = ".$LGD_OID;
// 결제성공시에만, 고객사에서 생성한 주문번호 (LGD_OID)를 해당페이지로 전송합니다.
// LGD_KVPMISPNOTEURL 에서 수신한 결제결과값과 연동하여 사용자에게 보여줄 결제완료화면을 구성하시기 바라며,
// 결제결과는 LGD_KVPMISPNOTEURL 로 먼저 전송되므로 해당건의 DB연동된 결과를 이용하여 결제완료여부를 보이도록 합니다.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// 만약, 고객사에서 'App To App' 방식으로 국민, BC카드사에서 받은 결제 승인을 받고 고객사의 앱을 실행하고자 할때
// 고객사 앱은 initilize function에 응답받는 Custom URL을 호출하면 됩니다.
// ex) window.location.href = smartxpay://TID=1234567890&OID=0987654321
//
// window.location.href = "고객사 앱명://" 로 호출하시면 됩니다.
////////////////////////////////////////////////////////////////////////////////////////////////////////
?>

153
mobile/shop/lg/note_url.php Normal file
View File

@ -0,0 +1,153 @@
<?php
include_once('./_common.php');
/*
* 공통결제결과 정보
*/
$LGD_RESPCODE = ""; // 응답코드: 0000(성공) 그외 실패
$LGD_RESPMSG = ""; // 응답메세지
$LGD_MID = ""; // 상점아이디
$LGD_OID = ""; // 주문번호
$LGD_AMOUNT = ""; // 거래금액
$LGD_TID = ""; // LG유플러스에서 부여한 거래번호
$LGD_PAYTYPE = ""; // 결제수단코드
$LGD_PAYDATE = ""; // 거래일시(승인일시/이체일시)
$LGD_HASHDATA = ""; // 해쉬값
$LGD_FINANCECODE = ""; // 결제기관코드(카드종류/은행코드/이통사코드)
$LGD_FINANCENAME = ""; // 결제기관이름(카드이름/은행이름/이통사이름)
$LGD_ESCROWYN = ""; // 에스크로 적용여부
$LGD_TIMESTAMP = ""; // 타임스탬프
$LGD_FINANCEAUTHNUM = ""; // 결제기관 승인번호(신용카드, 계좌이체, 상품권)
/*
* 신용카드 결제결과 정보
*/
$LGD_CARDNUM = ""; // 카드번호(신용카드)
$LGD_CARDINSTALLMONTH = ""; // 할부개월수(신용카드)
$LGD_CARDNOINTYN = ""; // 무이자할부여부(신용카드) - '1'이면 무이자할부 '0'이면 일반할부
$LGD_TRANSAMOUNT = ""; // 환율적용금액(신용카드)
$LGD_EXCHANGERATE = ""; // 환율(신용카드)
/*
* 휴대폰
*/
$LGD_PAYTELNUM = ""; // 결제에 이용된전화번호
/*
* 계좌이체, 무통장
*/
$LGD_ACCOUNTNUM = ""; // 계좌번호(계좌이체, 무통장입금)
$LGD_CASTAMOUNT = ""; // 입금총액(무통장입금)
$LGD_CASCAMOUNT = ""; // 현입금액(무통장입금)
$LGD_CASFLAG = ""; // 무통장입금 플래그(무통장입금) - 'R':계좌할당, 'I':입금, 'C':입금취소
$LGD_CASSEQNO = ""; // 입금순서(무통장입금)
$LGD_CASHRECEIPTNUM = ""; // 현금영수증 승인번호
$LGD_CASHRECEIPTSELFYN = ""; // 현금영수증자진발급제유무 Y: 자진발급제 적용, 그외 : 미적용
$LGD_CASHRECEIPTKIND = ""; // 현금영수증 종류 0: 소득공제용 , 1: 지출증빙용
/*
* OK캐쉬백
*/
$LGD_OCBSAVEPOINT = ""; // OK캐쉬백 적립포인트
$LGD_OCBTOTALPOINT = ""; // OK캐쉬백 누적포인트
$LGD_OCBUSABLEPOINT = ""; // OK캐쉬백 사용가능 포인트
/*
* 구매정보
*/
$LGD_BUYER = ""; // 구매자
$LGD_PRODUCTINFO = ""; // 상품명
$LGD_BUYERID = ""; // 구매자 ID
$LGD_BUYERADDRESS = ""; // 구매자 주소
$LGD_BUYERPHONE = ""; // 구매자 전화번호
$LGD_BUYEREMAIL = ""; // 구매자 이메일
$LGD_BUYERSSN = ""; // 구매자 주민번호
$LGD_PRODUCTCODE = ""; // 상품코드
$LGD_RECEIVER = ""; // 수취인
$LGD_RECEIVERPHONE = ""; // 수취인 전화번호
$LGD_DELIVERYINFO = ""; // 배송지
$LGD_RESPCODE = $_POST["LGD_RESPCODE"];
$LGD_RESPMSG = $_POST["LGD_RESPMSG"];
$LGD_MID = $_POST["LGD_MID"];
$LGD_OID = $_POST["LGD_OID"];
$LGD_AMOUNT = $_POST["LGD_AMOUNT"];
$LGD_TID = $_POST["LGD_TID"];
$LGD_PAYTYPE = $_POST["LGD_PAYTYPE"];
$LGD_PAYDATE = $_POST["LGD_PAYDATE"];
$LGD_HASHDATA = $_POST["LGD_HASHDATA"];
$LGD_FINANCECODE = $_POST["LGD_FINANCECODE"];
$LGD_FINANCENAME = $_POST["LGD_FINANCENAME"];
$LGD_ESCROWYN = $_POST["LGD_ESCROWYN"];
$LGD_TRANSAMOUNT = $_POST["LGD_TRANSAMOUNT"];
$LGD_EXCHANGERATE = $_POST["LGD_EXCHANGERATE"];
$LGD_CARDNUM = $_POST["LGD_CARDNUM"];
$LGD_CARDINSTALLMONTH = $_POST["LGD_CARDINSTALLMONTH"];
$LGD_CARDNOINTYN = $_POST["LGD_CARDNOINTYN"];
$LGD_TIMESTAMP = $_POST["LGD_TIMESTAMP"];
$LGD_FINANCEAUTHNUM = $_POST["LGD_FINANCEAUTHNUM"];
$LGD_PAYTELNUM = $_POST["LGD_PAYTELNUM"];
$LGD_ACCOUNTNUM = $_POST["LGD_ACCOUNTNUM"];
$LGD_CASTAMOUNT = $_POST["LGD_CASTAMOUNT"];
$LGD_CASCAMOUNT = $_POST["LGD_CASCAMOUNT"];
$LGD_CASFLAG = $_POST["LGD_CASFLAG"];
$LGD_CASSEQNO = $_POST["LGD_CASSEQNO"];
$LGD_CASHRECEIPTNUM = $_POST["LGD_CASHRECEIPTNUM"];
$LGD_CASHRECEIPTSELFYN = $_POST["LGD_CASHRECEIPTSELFYN"];
$LGD_CASHRECEIPTKIND = $_POST["LGD_CASHRECEIPTKIND"];
$LGD_OCBSAVEPOINT = $_POST["LGD_OCBSAVEPOINT"];
$LGD_OCBTOTALPOINT = $_POST["LGD_OCBTOTALPOINT"];
$LGD_OCBUSABLEPOINT = $_POST["LGD_OCBUSABLEPOINT"];
$LGD_BUYER = $_POST["LGD_BUYER"];
$LGD_PRODUCTINFO = $_POST["LGD_PRODUCTINFO"];
$LGD_BUYERID = $_POST["LGD_BUYERID"];
$LGD_BUYERADDRESS = $_POST["LGD_BUYERADDRESS"];
$LGD_BUYERPHONE = $_POST["LGD_BUYERPHONE"];
$LGD_BUYEREMAIL = $_POST["LGD_BUYEREMAIL"];
$LGD_BUYERSSN = $_POST["LGD_BUYERSSN"];
$LGD_PRODUCTCODE = $_POST["LGD_PRODUCTCODE"];
$LGD_RECEIVER = $_POST["LGD_RECEIVER"];
$LGD_RECEIVERPHONE = $_POST["LGD_RECEIVERPHONE"];
$LGD_DELIVERYINFO = $_POST["LGD_DELIVERYINFO"];
$LGD_MERTKEY = $config['cf_lg_mert_key']; //LG유플러스에서 발급한 상점키로 변경해 주시기 바랍니다.
$LGD_HASHDATA2 = md5($LGD_MID.$LGD_OID.$LGD_AMOUNT.$LGD_RESPCODE.$LGD_TIMESTAMP.$LGD_MERTKEY);
/*
* 상점 처리결과 리턴메세지
*
* OK : 상점 처리결과 성공
* 그외 : 상점 처리결과 실패
*
* ※ 주의사항 : 성공시 'OK' 문자이외의 다른문자열이 포함되면 실패처리 되오니 주의하시기 바랍니다.
*/
$resultMSG = "결제결과 상점 DB처리(NOTE_URL) 결과값을 입력해 주시기 바랍니다.";
if ($LGD_HASHDATA2 == $LGD_HASHDATA) { //해쉬값 검증이 성공하면
if($LGD_RESPCODE == "0000"){ //결제가 성공이면
/*
* 거래성공 결과 상점 처리(DB) 부분
* 상점 결과 처리가 정상이면 "OK"
*/
//if( 결제성공 상점처리결과 성공 )
$resultMSG = "OK";
}else { //결제가 실패이면
/*
* 거래실패 결과 상점 처리(DB) 부분
* 상점결과 처리가 정상이면 "OK"
*/
//if( 결제실패 상점처리결과 성공 )
$resultMSG = "OK";
}
} else { //해쉬값 검증이 실패이면
/*
* hashdata검증 실패 로그를 처리하시기 바랍니다.
*/
$resultMSG = "결제결과 상점 DB처리(NOTE_URL) 해쉬값 검증이 실패하였습니다.";
}
echo $resultMSG;
?>

View File

@ -0,0 +1,19 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<form name="sm_form" method="POST" action="<?php echo G5_MSHOP_URL; ?>/lg/xpay_approval.php">
<input type="hidden" name="LGD_OID" id="LGD_OID" value="<?php echo $od_id; ?>"> <!-- 주문번호 -->
<input type="hidden" name="LGD_BUYER" id="LGD_BUYER" value=""> <!-- 구매자 -->
<input type="hidden" name="LGD_PRODUCTINFO" id="LGD_PRODUCTINFO" value="<?php echo $goods; ?>"> <!-- 상품정보 -->
<input type="hidden" name="LGD_AMOUNT" id="LGD_AMOUNT" value=""> <!-- 결제금액 -->
<input type="hidden" name="LGD_CUSTOM_FIRSTPAY" id="LGD_CUSTOM_FIRSTPAY" value=""> <!-- 결제수단 -->
<input type="hidden" name="LGD_BUYEREMAIL" id="LGD_BUYEREMAIL" value=""> <!-- 구매자 이메일 -->
<input type="hidden" name="LGD_TAXFREEAMOUNT" id="LGD_TAXFREEAMOUNT" value="<?php echo $comm_free_mny; ?>"> <!-- 결제금액 중 면세금액 -->
<input type="hidden" name="LGD_BUYERID" id="LGD_BUYERID" value="<?php echo $LGD_BUYERID; ?>"> <!-- 구매자ID -->
<input type="hidden" name="LGD_CASHRECEIPTYN" id="LGD_CASHRECEIPTYN" value="N"> <!-- 현금영수증 사용 설정 -->
<input type="hidden" name="LGD_BUYERPHONE" id="LGD_BUYERPHONE" value=""> <!-- 구매자 휴대폰번호 -->
<input type="hidden" name="LGD_EASYPAY_ONLY" id="LGD_EASYPAY_ONLY" value=""> <!-- 페이나우 결제 호출 -->
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
</form>

View File

@ -0,0 +1,20 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="LGD_PAYKEY" id="LGD_PAYKEY"> <!-- LG유플러스 PAYKEY(인증후 자동셋팅)-->
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록요청" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>

View File

@ -0,0 +1,3 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

View File

@ -0,0 +1,80 @@
<?php
include_once('./_common.php');
/*
xpay_approval.php 에서 세션에 저장했던 파라미터 값이 유효한지 체크
세션 유지 시간(로그인 유지시간)을 적당히 유지 하거나 세션을 사용하지 않는 경우 DB처리 하시기 바랍니다.
*/
if(!isset($_SESSION['PAYREQ_MAP'])){
alert('세션이 만료 되었거나 유효하지 않은 요청 입니다.', G5_SHOP_URL);
}
$payReqMap = $_SESSION['PAYREQ_MAP']; //결제 요청시, Session에 저장했던 파라미터 MAP
$g5['title'] = 'LG 유플러스 eCredit서비스 결제';
$g5['body_script'] = ' onload="setLGDResult();"';
include_once(G5_PATH.'/head.sub.php');
$LGD_RESPCODE = $_REQUEST['LGD_RESPCODE'];
$LGD_RESPMSG = $_REQUEST['LGD_RESPMSG'];
$LGD_PAYKEY = '';
$LGD_OID = $payReqMap['LGD_OID'];
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$LGD_OID' ";
$row = sql_fetch($sql);
$data = unserialize($row['dt_data']);
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
if($LGD_RESPCODE == '0000') {
$LGD_PAYKEY = $_REQUEST['LGD_PAYKEY'];
$payReqMap['LGD_RESPCODE'] = $LGD_RESPCODE;
$payReqMap['LGD_RESPMSG'] = $LGD_RESPMSG;
$payReqMap['LGD_PAYKEY'] = $LGD_PAYKEY;
} else {
alert('LGD_RESPCODE:' . $LGD_RESPCODE . ' ,LGD_RESPMSG:' . $LGD_RESPMSG, $page_return_url); //인증 실패에 대한 처리 로직 추가
}
?>
<?php
$exclude = array('res_cd', 'LGD_PAYKEY');
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.$LGD_RESPCODE.'">'.PHP_EOL;
echo '<input type="hidden" name="LGD_PAYKEY" value="'.$LGD_PAYKEY.'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
<div>
<div id="show_progress">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt=""></span>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</div>
<script type="text/javascript">
function setLGDResult() {
setTimeout( function() {
document.forderform.submit();
}, 300);
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

View File

@ -0,0 +1,170 @@
<?php
include_once('./_common.php');
require_once(G5_MSHOP_PATH.'/settle_lg.inc.php');
/*
* 1. 기본결제 인증요청 정보 변경
*
* 기본정보를 변경하여 주시기 바랍니다.(파라미터 전달시 POST를 사용하세요)
*/
$LGD_OID = $_POST['LGD_OID']; //주문번호(상점정의 유니크한 주문번호를 입력하세요)
$LGD_AMOUNT = $_POST['LGD_AMOUNT']; //결제금액("," 를 제외한 결제금액을 입력하세요)
$LGD_BUYER = $_POST['LGD_BUYER']; //구매자명
$LGD_PRODUCTINFO = $_POST['LGD_PRODUCTINFO']; //상품명
$LGD_BUYEREMAIL = $_POST['LGD_BUYEREMAIL']; //구매자 이메일
$LGD_CUSTOM_FIRSTPAY = $_POST['LGD_CUSTOM_FIRSTPAY']; //상점정의 초기결제수단
$LGD_TAXFREEAMOUNT = $_POST['LGD_TAXFREEAMOUNT']; //비과세 금액
$LGD_CASHRECEIPTYN = $_POST['LGD_CASHRECEIPTYN']; //현금영수증 사용설정
$LGD_BUYERID = $_POST['LGD_BUYERID']; //구매자 ID
$LGD_BUYERPHONE = $_POST['LGD_BUYERPHONE']; //구매자 휴대폰번호
$LGD_EASYPAY_ONLY = $_POST['LGD_EASYPAY_ONLY']; //페이나우결제창 호출
$LGD_RETURNURL = G5_MSHOP_URL.'/lg/returnurl.php';
$LGD_KVPMISPNOTEURL = G5_MSHOP_URL.'/lg/note_url.php';
$LGD_KVPMISPWAPURL = G5_MSHOP_URL.'/lg/mispwapurl.php?LGD_OID='.$LGD_OID; //ISP 카드 결제시, URL 대신 앱명 입력시, 앱호출함
$LGD_KVPMISPCANCELURL = G5_MSHOP_URL.'/lg/cancel_url.php';
$LGD_MTRANSFERWAPURL = G5_MSHOP_URL.'/lg/returnurl.php';
$LGD_MTRANSFERCANCELURL = G5_MSHOP_URL.'/lg/cancel_url.php';
$LGD_MTRANSFERNOTEURL = G5_MSHOP_URL.'/lg/note_url.php';
if(preg_match('/iPhone|iPad/', $_SERVER['HTTP_USER_AGENT']))
$LGD_MTRANSFERAUTOAPPYN = 'N';
else
$LGD_MTRANSFERAUTOAPPYN = 'A';
/*
*************************************************
* 2. MD5 해쉬암호화 (수정하지 마세요) - BEGIN
*
* MD5 해쉬암호화는 거래 위변조를 막기위한 방법입니다.
*************************************************
*
* 해쉬 암호화 적용( LGD_MID + LGD_OID + LGD_AMOUNT + LGD_TIMESTAMP + LGD_MERTKEY )
* LGD_MID : 상점아이디
* LGD_OID : 주문번호
* LGD_AMOUNT : 금액
* LGD_TIMESTAMP : 타임스탬프
* LGD_MERTKEY : 상점MertKey (mertkey는 상점관리자 -> 계약정보 -> 상점정보관리에서 확인하실수 있습니다)
*
* MD5 해쉬데이터 암호화 검증을 위해
* LG유플러스에서 발급한 상점키(MertKey)를 환경설정 파일(lgdacom/conf/mall.conf)에 반드시 입력하여 주시기 바랍니다.
*/
$xpay = new XPay($configPath, $CST_PLATFORM);
// Mert Key 설정
$xpay->set_config_value('t'.$LGD_MID, $config['cf_lg_mert_key']);
$xpay->set_config_value($LGD_MID, $config['cf_lg_mert_key']);
$xpay->Init_TX($LGD_MID);
$LGD_HASHDATA = md5($LGD_MID.$LGD_OID.$LGD_AMOUNT.$LGD_TIMESTAMP.$xpay->config[$LGD_MID]);
$LGD_CUSTOM_PROCESSTYPE = "TWOTR";
/*
*************************************************
* 2. MD5 해쉬암호화 (수정하지 마세요) - END
*************************************************
*/
$CST_WINDOW_TYPE = "submit"; // 수정불가
$payReqMap['CST_PLATFORM'] = $CST_PLATFORM; // 테스트, 서비스 구분
$payReqMap['CST_WINDOW_TYPE'] = $CST_WINDOW_TYPE; // 수정불가
$payReqMap['CST_MID'] = $CST_MID; // 상점아이디
$payReqMap['LGD_MID'] = $LGD_MID; // 상점아이디
$payReqMap['LGD_OID'] = $LGD_OID; // 주문번호
$payReqMap['LGD_BUYER'] = $LGD_BUYER; // 구매자
$payReqMap['LGD_PRODUCTINFO'] = $LGD_PRODUCTINFO; // 상품정보
$payReqMap['LGD_AMOUNT'] = $LGD_AMOUNT; // 결제금액
$payReqMap['LGD_BUYEREMAIL'] = $LGD_BUYEREMAIL; // 구매자 이메일
$payReqMap['LGD_CUSTOM_SKIN'] = $LGD_CUSTOM_SKIN; // 결제창 SKIN
$payReqMap['LGD_CUSTOM_PROCESSTYPE'] = $LGD_CUSTOM_PROCESSTYPE; // 트랜잭션 처리방식
$payReqMap['LGD_TIMESTAMP'] = $LGD_TIMESTAMP; // 타임스탬프
$payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬암호값
$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지
$payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요)
$payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
$payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식
$payReqMap['LGD_ENCODING'] = "UTF-8";
$payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8";
$payReqMap['LGD_ENCODING_RETURNURL'] = "UTF-8";
$payReqMap['LGD_TAXFREEAMOUNT'] = $LGD_TAXFREEAMOUNT;
$payReqMap['LGD_CASHRECEIPTYN'] = $LGD_CASHRECEIPTYN;
$payReqMap['LGD_BUYERPHONE'] = $LGD_BUYERPHONE;
$payReqMap['LGD_BUYERID'] = $LGD_BUYERID;
$payReqMap['LGD_EASYPAY_ONLY'] = $LGD_EASYPAY_ONLY;
/*
****************************************************
* 안드로이드폰 신용카드 ISP(국민/BC)결제에만 적용 (시작)*
****************************************************
(주의)LGD_CUSTOM_ROLLBACK 의 값을 "Y"로 넘길 경우, LG U+ 전자결제에서 보낸 ISP(국민/비씨) 승인정보를 고객서버의 note_url에서 수신시 "OK" 리턴이 안되면 해당 트랜잭션은 무조건 롤백(자동취소)처리되고,
LGD_CUSTOM_ROLLBACK 의 값 을 "C"로 넘길 경우, 고객서버의 note_url에서 "ROLLBACK" 리턴이 될 때만 해당 트랜잭션은 롤백처리되며 그외의 값이 리턴되면 정상 승인완료 처리됩니다.
만일, LGD_CUSTOM_ROLLBACK 의 값이 "N" 이거나 null 인 경우, 고객서버의 note_url에서 "OK" 리턴이 안될시, "OK" 리턴이 될 때까지 3분간격으로 2시간동안 승인결과를 재전송합니다.
*/
$payReqMap['LGD_CUSTOM_ROLLBACK'] = ""; // 비동기 ISP에서 트랜잭션 처리여부
$payReqMap['LGD_KVPMISPNOTEURL'] = $LGD_KVPMISPNOTEURL; // 비동기 ISP(ex. 안드로이드) 승인결과를 받는 URL
$payReqMap['LGD_KVPMISPWAPURL'] = $LGD_KVPMISPWAPURL; // 비동기 ISP(ex. 안드로이드) 승인완료후 사용자에게 보여지는 승인완료 URL
$payReqMap['LGD_KVPMISPCANCELURL'] = $LGD_KVPMISPCANCELURL; // ISP 앱에서 취소시 사용자에게 보여지는 취소 URL
/*
****************************************************
* 안드로이드폰 신용카드 ISP(국민/BC)결제에만 적용 (끝) *
****************************************************
*/
// 안드로이드 에서 신용카드 적용 ISP(국민/BC)결제에만 적용 (선택)
// $payReqMap['LGD_KVPMISPAUTOAPPYN'] = "Y";
// Y: 안드로이드에서 ISP신용카드 결제시, 고객사에서 'App To App' 방식으로 국민, BC카드사에서 받은 결제 승인을 받고 고객사의 앱을 실행하고자 할때 사용
// 가상계좌(무통장) 결제연동을 하시는 경우 할당/입금 결과를 통보받기 위해 반드시 LGD_CASNOTEURL 정보를 LG 유플러스에 전송해야 합니다 .
$payReqMap['LGD_CASNOTEURL'] = $LGD_CASNOTEURL; // 가상계좌 NOTEURL
// 계좌이체 파라미터
//$payReqMap['LGD_MTRANSFERWAPURL'] = $LGD_MTRANSFERWAPURL;
//$payReqMap['LGD_MTRANSFERCANCELURL'] = $LGD_MTRANSFERCANCELURL;
$payReqMap['LGD_MTRANSFERNOTEURL'] = $LGD_MTRANSFERNOTEURL;
$payReqMap['LGD_MTRANSFERAUTOAPPYN'] = $LGD_MTRANSFERAUTOAPPYN;
//Return URL에서 인증 결과 수신 시 셋팅될 파라미터 입니다.*/
$payReqMap['LGD_RESPCODE'] = "";
$payReqMap['LGD_RESPMSG'] = "";
$payReqMap['LGD_PAYKEY'] = "";
$_SESSION['PAYREQ_MAP'] = $payReqMap;
$g5['title'] = 'LG 유플러스 eCredit서비스 결제';
$g5['body_script'] = ' onload="launchCrossPlatform();"';
include_once(G5_PATH.'/head.sub.php');
?>
<script language="javascript" src="http://xpay.uplus.co.kr/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<script type="text/javascript">
/*
* iframe으로 결제창을 호출하시기를 원하시면 iframe으로 설정 (변수명 수정 불가)
*/
var LGD_window_type = '<?php echo $CST_WINDOW_TYPE; ?>';
/*
* 수정불가
*/
function launchCrossPlatform(){
lgdwin = open_paymentwindow(document.getElementById('LGD_PAYINFO'), '<?php echo $CST_PLATFORM; ?>', LGD_window_type);
}
/*
* FORM 명만 수정 가능
*/
function getFormObject() {
return document.getElementById("LGD_PAYINFO");
}
</script>
<form method="post" name="LGD_PAYINFO" id="LGD_PAYINFO" action="">
<?php
foreach ($payReqMap as $key => $value) {
echo'"<input type="hidden" name="'.$key.'" id="'.$key.'" value="'.$value.'">';
}
?>
</form>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

172
mobile/shop/list.php Normal file
View File

@ -0,0 +1,172 @@
<?php
include_once('./_common.php');
$sql = " select *
from {$g5['g5_shop_category_table']}
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca['ca_id'])
alert('등록된 분류가 없습니다.', G5_SHOP_URL);
// 테마미리보기 스킨 등의 변수 재설정
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true) {
$ca['ca_mobile_skin'] = (isset($tconfig['ca_mobile_skin']) && $tconfig['ca_mobile_skin']) ? $tconfig['ca_mobile_skin'] : $ca['ca_mobile_skin'];
$ca['ca_mobile_img_width'] = (isset($tconfig['ca_mobile_img_width']) && $tconfig['ca_mobile_img_width']) ? $tconfig['ca_mobile_img_width'] : $ca['ca_mobile_img_width'];
$ca['ca_mobile_img_height'] = (isset($tconfig['ca_mobile_img_height']) && $tconfig['ca_mobile_img_height']) ? $tconfig['ca_mobile_img_height'] : $ca['ca_mobile_img_height'];
$ca['ca_mobile_list_mod'] = (isset($tconfig['ca_mobile_list_mod']) && $tconfig['ca_mobile_list_mod']) ? $tconfig['ca_mobile_list_mod'] : $ca['ca_mobile_list_mod'];
$ca['ca_mobile_list_row'] = (isset($tconfig['ca_mobile_list_row']) && $tconfig['ca_mobile_list_row']) ? $tconfig['ca_mobile_list_row'] : $ca['ca_mobile_list_row'];
}
// 본인인증, 성인인증체크
if(!$is_admin) {
$msg = shop_member_cert_check($ca_id, 'list');
if($msg)
alert($msg, G5_SHOP_URL);
}
$g5['title'] = $ca['ca_name'];
include_once(G5_MSHOP_PATH.'/_head.php');
// 스킨경로
$skin_dir = G5_MSHOP_SKIN_PATH;
if($ca['ca_mobile_skin_dir']) {
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
if(!is_file($skin_file))
$skin_dir = G5_MSHOP_SKIN_PATH;
} else {
$skin_dir = G5_MSHOP_SKIN_PATH;
}
}
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
?>
<script>
var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
</script>
<script src="<?php echo G5_JS_URL; ?>/shop.mobile.list.js"></script>
<div id="sct">
<?php
// 상단 HTML
echo '<div id="sct_hhtml">'.conv_content($ca['ca_mobile_head_html'], 1).'</div>';
$cate_skin = $skin_dir.'/listcategory.skin.php';
if(!is_file($cate_skin))
$cate_skin = G5_MSHOP_SKIN_PATH.'/listcategory.skin.php';
include $cate_skin;
// 테마미리보기 베스트상품 재설정
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true) {
if(isset($theme_config['ca_mobile_list_best_mod']))
$theme_config['ca_mobile_list_best_mod'] = (isset($tconfig['ca_mobile_list_best_mod']) && $tconfig['ca_mobile_list_best_mod']) ? $tconfig['ca_mobile_list_best_mod'] : 0;
if(isset($theme_config['ca_mobile_list_best_row']))
$theme_config['ca_mobile_list_best_row'] = (isset($tconfig['ca_mobile_list_best_row']) && $tconfig['ca_mobile_list_best_row']) ? $tconfig['ca_mobile_list_best_row'] : 0;
}
// 분류 Best Item
$list_mod = (isset($theme_config['ca_mobile_list_best_mod']) && $theme_config['ca_mobile_list_best_mod']) ? (int)$theme_config['ca_mobile_list_best_mod'] : $ca['ca_mobile_list_mod'];
$list_row = (isset($theme_config['ca_mobile_list_best_row']) && $theme_config['ca_mobile_list_best_row']) ? (int)$theme_config['ca_mobile_list_best_row'] : $ca['ca_mobile_list_row'];
$limit = $list_mod * $list_row;
$best_skin = G5_MSHOP_SKIN_PATH.'/list.best.10.skin.php';
$sql = " select *
from {$g5['g5_shop_item_table']}
where ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' )
and it_use = '1'
and it_type4 = '1'
order by it_order, it_id desc
limit 0, $limit ";
$list = new item_list($best_skin, $list_mod, $list_row, $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
$list->set_query($sql);
$list->set_mobile(true);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_price', true);
echo $list->run();
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
$error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
// 리스트 스킨
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
if (file_exists($skin_file)) {
$sort_skin = $skin_dir.'/list.sort.skin.php';
if(!is_file($sort_skin))
$sort_skin = G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
include $sort_skin;
// 총몇개
$items = $ca['ca_mobile_list_mod'] * $ca['ca_mobile_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list($skin_file, $ca['ca_mobile_list_mod'], $ca['ca_mobile_list_row'], $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
$list->set_category($ca['ca_id'], 1);
$list->set_category($ca['ca_id'], 2);
$list->set_category($ca['ca_id'], 3);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_price', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
}
else
{
echo '<div class="sct_nofile">'.str_replace(G5_PATH.'/', '', $skin_file).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
if($i > 0 && $total_count > $items) {
$qstr1 .= 'ca_id='.$ca_id;
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1;
?>
<div class="li_more">
<p id="item_load_msg"><img src="<?php echo G5_SHOP_CSS_URL; ?>/img/loading.gif" alt="로딩이미지" ><br>잠시만 기다려주세요.</p>
<div class="li_more_btn">
<button type="button" id="btn_more_item" data-url="<?php echo $ajax_url; ?>" data-page="<?php echo $page; ?>">MORE ITEM +</button>
</div>
</div>
<?php } ?>
<?php
// 하단 HTML
echo '<div id="sct_thtml">'.conv_content($ca['ca_mobile_tail_html'], 1).'</div>';
?>
</div>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
echo "\n<!-- {$ca['ca_mobile_skin']} -->\n";
?>

77
mobile/shop/listtype.php Normal file
View File

@ -0,0 +1,77 @@
<?php
include_once('./_common.php');
$type = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $_REQUEST['type']);
if ($type == 1) $g5['title'] = '히트상품';
else if ($type == 2) $g5['title'] = '추천상품';
else if ($type == 3) $g5['title'] = '최신상품';
else if ($type == 4) $g5['title'] = '인기상품';
else if ($type == 5) $g5['title'] = '세일상품';
else
alert('상품유형이 아닙니다.');
include_once(G5_MSHOP_PATH.'/_head.php');
// 한페이지에 출력하는 이미지수 = $list_mod * $list_row
// 모바일에서는 계산된 이미지수가 중요함
$list_mod = 3; // 한줄에 이미지 몇개씩 출력? 단, 모바일환경에서는 사용되지 않음.
$list_row = 5; // 한 페이지에 몇라인씩 출력?
$img_width = 230; // 출력이미지 폭
$img_height = 230; // 출력이미지 높이
?>
<?php
// 상품 출력순서가 있다면
$order_by = ' it_order, it_id desc ';
if ($sort != '')
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
if (!$skin)
$skin = 'list.10.skin.php';
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
// 리스트 유형별로 출력
$list_file = G5_MSHOP_SKIN_PATH.'/'.$skin;
if (file_exists($list_file)) {
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $list_mod * $list_row;
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list();
$list->set_type($type);
$list->set_list_skin($list_file);
$list->set_list_mod($list_mod);
$list->set_list_row($list_row);
$list->set_img_size($img_width, $img_height);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div align="center">'.$skin.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr .= '&amp;type='.$type.'&amp;sort='.$sort;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page=");
?>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

117
mobile/shop/mypage.php Normal file
View File

@ -0,0 +1,117 @@
<?php
include_once('./_common.php');
if (!$is_member)
goto_url(G5_BBS_URL."/login.php?url=".urlencode(G5_SHOP_URL."/mypage.php"));
$g5['title'] = '마이페이지';
include_once(G5_MSHOP_PATH.'/_head.php');
// 쿠폰
$cp_count = 0;
$sql = " select cp_id
from {$g5['g5_shop_coupon_table']}
where mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."' ";
$res = sql_query($sql);
for($k=0; $cp=sql_fetch_array($res); $k++) {
if(!is_used_coupon($member['mb_id'], $cp['cp_id']))
$cp_count++;
}
?>
<div id="smb_my">
<section id="smb_my_ov">
<h2>회원정보 개요</h2>
<ul>
<li class="my_cou">보유쿠폰<a href="<?php echo G5_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp_count); ?></a></li>
<li class="my_point">보유포인트
<a href="<?php echo G5_BBS_URL; ?>/point.php" target="_blank" class="win_point"><?php echo number_format($member['mb_point']); ?>점</a></li>
</ul>
<dl>
<dt>연락처</dt>
<dd><?php echo ($member['mb_tel'] ? $member['mb_tel'] : '미등록'); ?></dd>
<dt>E-Mail</dt>
<dd><?php echo ($member['mb_email'] ? $member['mb_email'] : '미등록'); ?></dd>
<dt>최종접속일시</dt>
<dd><?php echo $member['mb_today_login']; ?></dd>
<dt>회원가입일시</dt>
<dd><?php echo $member['mb_datetime']; ?></dd>
<dt class="ov_addr">주소</dt>
<dd class="ov_addr"><?php echo sprintf("(%s%s)", $member['mb_zip1'], $member['mb_zip2']).' '.print_address($member['mb_addr1'], $member['mb_addr2'], $member['mb_addr3'], $member['mb_addr_jibeon']); ?></dd>
</dl>
</section>
<section id="smb_my_od">
<h2><a href="<?php echo G5_SHOP_URL; ?>/orderinquiry.php">최근 주문내역</a></h2>
<?php
// 최근 주문내역
define("_ORDERINQUIRY_", true);
$limit = " limit 0, 5 ";
include G5_MSHOP_PATH.'/orderinquiry.sub.php';
?>
</section>
<section id="smb_my_wish">
<h2><a href="<?php echo G5_SHOP_URL; ?>/wishlist.php">최근 위시리스트</a></h2>
<ul>
<?php
$sql = " select *
from {$g5['g5_shop_wish_table']} a,
{$g5['g5_shop_item_table']} b
where a.mb_id = '{$member['mb_id']}'
and a.it_id = b.it_id
order by a.wi_id desc
limit 0, 3 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
{
$image_w = 50;
$image_h = 50;
$image = get_it_image($row['it_id'], $image_w, $image_h, true);
$list_left_pad = $image_w + 10;
?>
<li style="padding-left:<?php echo $list_left_pad + 10; ?>px">
<div class="wish_img"><?php echo $image; ?></div>
<div class="wish_info">
<a href="./item.php?it_id=<?php echo $row['it_id']; ?>" class="info_link"><?php echo stripslashes($row['it_name']); ?></a>
<span class="info_date"><?php echo substr($row['wi_time'], 2, 8); ?></span>
</div>
</li>
<?php
}
if ($i == 0)
echo '<li class="empty_list">보관 내역이 없습니다.</list>';
?>
</ul>
</section>
</div>
<script>
$(function() {
$(".win_coupon").click(function() {
var new_win = window.open($(this).attr("href"), "win_coupon", "left=100,top=100,width=700, height=600, scrollbars=1");
new_win.focus();
return false;
});
});
function member_leave()
{
return confirm('정말 회원에서 탈퇴 하시겠습니까?')
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,115 @@
<?php
include_once('./_common.php');
$g5['title'] = '배송지 목록';
include_once(G5_PATH.'/head.sub.php');
$order_action_url = G5_HTTPS_SHOP_URL.'/orderaddressupdate.php';
?>
<form name="forderaddress" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
<div id="sod_addr" class="new_win">
<h1 id="win_title">배송지 목록</h1>
<div class="win_desc">
<ul>
<?php
$sep = chr(30);
for($i=0; $row=sql_fetch_array($result); $i++) {
$addr = $row['ad_name'].$sep.$row['ad_tel'].$sep.$row['ad_hp'].$sep.$row['ad_zip1'].$sep.$row['ad_zip2'].$sep.$row['ad_addr1'].$sep.$row['ad_addr2'].$sep.$row['ad_addr3'].$sep.$row['ad_jibeon'].$sep.$row['ad_subject'];
?>
<li>
<div class="addr_chk" rowspan="3">
<input type="hidden" name="ad_id[<?php echo $i; ?>]" value="<?php echo $row['ad_id'];?>">
<label for="chk_<?php echo $i;?>" class="sound_only">배송지선택</label>
<input type="checkbox" name="chk[]" value="<?php echo $i;?>" id="chk_<?php echo $i;?>">
</div>
<div class="addr_title">
<label for="ad_subject<?php echo $i;?>" class="sound_only">배송지명</label>
<input type="text" name="ad_subject[<?php echo $i; ?>]" value="<?php echo $row['ad_subject']; ?>" id="ad_subject" class="frm_input" maxlength="20">
</div>
<div class="addr_default">
<input type="radio" name="ad_default" value="<?php echo $row['ad_id'];?>" id="ad_default<?php echo $i;?>" <?php if($row['ad_default']) echo 'checked="checked"';?>>
<label for="ad_default<?php echo $i;?>">기본배송지 설정</label>
</div>
<div class="addr_addr"><?php echo print_address($row['ad_addr1'], $row['ad_addr2'], $row['ad_addr3'], $row['ad_jibeon']); ?></div>
<div class="addr_name"><?php echo $row['ad_name']; ?></div>
<div class="addr_tel"><?php echo $row['ad_tel']; ?> / <?php echo $row['ad_hp']; ?></div>
<div class="addr_btn">
<input type="hidden" value="<?php echo $addr; ?>">
<button type="button" id="btn_sel" class="sel_address">선택</button>
<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?w=d&amp;ad_id=<?php echo $row['ad_id']; ?>" id="btn_del" class="del_address">삭제</a>
</div>
</li>
<?php
}
?>
</ul>
</div>
<div class="win_btn">
<input type="submit" name="act_button" value="선택수정" class="btn_submit">
<button type="button" onclick="self.close();">닫기</button>
</div>
</div>
</form>
<?php echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<script>
$(function() {
$(".sel_address").on("click", function() {
var addr = $(this).siblings("input").val().split(String.fromCharCode(30));
var f = window.opener.forderform;
f.od_b_name.value = addr[0];
f.od_b_tel.value = addr[1];
f.od_b_hp.value = addr[2];
f.od_b_zip.value = addr[3] + addr[4];
f.od_b_addr1.value = addr[5];
f.od_b_addr2.value = addr[6];
f.od_b_addr3.value = addr[7];
f.od_b_addr_jibeon.value = addr[8];
f.ad_subject.value = addr[9];
var zip1 = addr[3].replace(/[^0-9]/g, "");
var zip2 = addr[4].replace(/[^0-9]/g, "");
if(zip1 != "" && zip2 != "") {
var code = String(zip1) + String(zip2);
if(window.opener.zipcode != code) {
window.opener.zipcode = code;
window.opener.calculate_sendcost(code);
}
}
window.close();
});
$(".del_address").on("click", function() {
return confirm("배송지 목록을 삭제하시겠습니까?");
});
// 전체선택 부분
$("#chk_all").on("click", function() {
if($(this).is(":checked")) {
$("input[name^='chk[']").attr("checked", true);
} else {
$("input[name^='chk[']").attr("checked", false);
}
});
$(".btn_submit").on("click", function() {
if($("input[name^='chk[']:checked").length==0 ){
alert("수정하실 항목을 하나 이상 선택하세요.");
return false;
}
});
});
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

1506
mobile/shop/orderform.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,809 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');
//print_r2($_POST); exit;
$page_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$page_return_url .= '?sw_direct=1';
// 결제등록 완료 체크
if($od_settle_case != '무통장') {
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'])
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
if($default['de_pg_service'] == 'inicis' && !$_POST['P_HASH'])
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
}
// 장바구니가 비어있는가?
if (get_session('ss_direct'))
$tmp_cart_id = get_session('ss_cart_direct');
else
$tmp_cart_id = get_session('ss_cart_id');
if (get_cart_count($tmp_cart_id) == 0)// 장바구니에 담기
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G5_SHOP_URL.'/cart.php');
$error = "";
// 장바구니 상품 재고 검사
$sql = " select it_id,
ct_qty,
it_name,
io_id,
io_type,
ct_option
from {$g5['g5_shop_cart_table']}
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 상품에 대한 현재고수량
if($row['io_id']) {
$it_stock_qty = (int)get_option_stock_qty($row['it_id'], $row['io_id'], $row['io_type']);
} else {
$it_stock_qty = (int)get_it_stock_qty($row['it_id']);
}
// 장바구니 수량이 재고수량보다 많다면 오류
if ($row['ct_qty'] > $it_stock_qty)
$error .= "{$row['ct_option']} 의 재고수량이 부족합니다. 현재고수량 : $it_stock_qty\\n\\n";
}
if($i == 0)
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G5_SHOP_URL.'/cart.php');
if ($error != "")
{
$error .= "다른 고객님께서 {$od_name}님 보다 먼저 주문하신 경우입니다. 불편을 끼쳐 죄송합니다.";
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 = (int)$_POST['od_send_coupon'];
$i_temp_point = (int)$_POST['od_temp_point'];
// 주문금액이 상이함
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_price,
COUNT(distinct it_id) as cart_count
from {$g5['g5_shop_cart_table']} where od_id = '$tmp_cart_id' and ct_select = '1' ";
$row = sql_fetch($sql);
$tot_ct_price = $row['od_price'];
$cart_count = $row['cart_count'];
$tot_od_price = $tot_ct_price;
// 쿠폰금액계산
$tot_cp_price = 0;
if($is_member) {
// 상품쿠폰
$tot_it_cp_price = $tot_od_cp_price = 0;
$it_cp_cnt = count($_POST['cp_id']);
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$it_id = $_POST['it_id'][$i];
$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'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
and cp_method IN ( 0, 1 ) ";
$cp = sql_fetch($sql);
if(!$cp['cp_id'])
continue;
// 사용한 쿠폰인지
if(is_used_coupon($member['mb_id'], $cp['cp_id']))
continue;
// 분류할인인지
if($cp['cp_method']) {
$sql2 = " select it_id, ca_id, ca_id2, ca_id3
from {$g5['g5_shop_item_table']}
where it_id = '$it_id' ";
$row2 = sql_fetch($sql2);
if(!$row2['it_id'])
continue;
if($row2['ca_id'] != $cp['cp_target'] && $row2['ca_id2'] != $cp['cp_target'] && $row2['ca_id3'] != $cp['cp_target'])
continue;
} else {
if($cp['cp_target'] != $it_id)
continue;
}
// 상품금액
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g5['g5_shop_cart_table']}
where od_id = '$tmp_cart_id'
and it_id = '$it_id'
and ct_select = '1' ";
$ct = sql_fetch($sql);
$item_price = $ct['sum_price'];
if($cp['cp_minimum'] > $item_price)
continue;
$dc = 0;
if($cp['cp_type']) {
$dc = floor(($item_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($item_price < $dc)
continue;
$tot_it_cp_price += $dc;
$arr_it_cp_prc[$it_id] = $dc;
}
$tot_od_price -= $tot_it_cp_price;
// 주문쿠폰
if($_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']}'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
and cp_method = '2' ";
$cp = sql_fetch($sql);
// 사용한 쿠폰인지
$cp_used = is_used_coupon($member['mb_id'], $cp['cp_id']);
$dc = 0;
if(!$cp_used && $cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($tot_od_price < $dc)
die('Order coupon error.');
$tot_od_cp_price = $dc;
$tot_od_price -= $tot_od_cp_price;
}
}
$tot_cp_price = $tot_it_cp_price + $tot_od_cp_price;
}
if ((int)($row['od_price'] - $tot_cp_price) !== $i_price) {
die("Error.");
}
// 배송비가 상이함
$send_cost = get_sendcost($tmp_cart_id);
$tot_sc_cp_price = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if($_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']}'
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
and cp_method = '3' ";
$cp = sql_fetch($sql);
// 사용한 쿠폰인지
$cp_used = is_used_coupon($member['mb_id'], $cp['cp_id']);
$dc = 0;
if(!$cp_used && $cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) {
if($cp['cp_type']) {
$dc = floor(($send_cost * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($dc > $send_cost)
$dc = $send_cost;
$tot_sc_cp_price = $dc;
}
}
}
if ((int)($send_cost - $tot_sc_cp_price) !== (int)($i_send_cost - $i_send_coupon)) {
die("Error..");
}
// 추가배송비가 상이함
$od_b_zip = preg_replace('/[^0-9]/', '', $od_b_zip);
$od_b_zip1 = substr($od_b_zip, 0, 3);
$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'])
$send_cost2 = 0;
else
$send_cost2 = (int)$tmp['sc_price'];
if($send_cost2 !== $i_send_cost2)
die("Error...");
// 결제포인트가 상이함
// 회원이면서 포인트사용이면
$temp_point = 0;
if ($is_member && $config['cf_use_point'])
{
if($member['mb_point'] >= $default['de_settle_min_point']) {
$temp_point = (int)$default['de_settle_max_point'];
if($temp_point > (int)$tot_od_price)
$temp_point = (int)$tot_od_price;
if($temp_point > (int)$member['mb_point'])
$temp_point = (int)$member['mb_point'];
$point_unit = (int)$default['de_settle_point_unit'];
$temp_point = (int)((int)($temp_point / $point_unit) * $point_unit);
}
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error....");
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.', $page_return_url);
}
$i_price = $i_price + $i_send_cost + $i_send_cost2 - $i_temp_point - $i_send_coupon;
$order_price = $tot_od_price + $send_cost + $send_cost2 - $tot_sc_cp_price - $od_temp_point;
$od_status = '주문';
if ($od_settle_case == "무통장")
{
$od_receipt_point = $i_temp_point;
$od_receipt_price = 0;
$od_misu = $i_price - $od_receipt_price;
if($od_misu == 0) {
$od_status = '입금';
$od_receipt_time = G5_TIME_YMDHIS;
}
}
else if ($od_settle_case == "계좌이체")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bank_name = iconv("cp949", "utf-8", $bank_name);
break;
}
$od_tno = $tno;
$od_receipt_price = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $od_settle_case;
$od_deposit_name = $od_name;
$od_bank_account = $bank_name;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
if($od_misu == 0)
$od_status = '입금';
}
else if ($od_settle_case == "가상계좌")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bankname = iconv("cp949", "utf-8", $bankname);
$depositor = iconv("cp949", "utf-8", $depositor);
break;
}
$od_receipt_point = $i_temp_point;
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_price = 0;
$od_bank_account = $bankname.' '.$account;
$od_deposit_name = $depositor;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
}
else if ($od_settle_case == "휴대폰")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
break;
}
$od_tno = $tno;
$od_receipt_price = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $commid.' '.$mobile_no;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
if($od_misu == 0)
$od_status = '입금';
}
else if ($od_settle_case == "신용카드")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name);
break;
}
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_price = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $card_name;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
if($od_misu == 0)
$od_status = '입금';
}
else if ($od_settle_case == "간편결제")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name);
break;
}
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_price = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $card_name;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
if($od_misu == 0)
$od_status = '입금';
}
else
{
die("od_settle_case Error!!!");
}
// 주문금액과 결제금액이 일치하는지 체크
if($tno) {
if((int)$order_price !== (int)$pg_price) {
$cancel_msg = '결제금액 불일치';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("Receipt Amount Error");
}
}
if ($is_member)
$od_pwd = $member['mb_password'];
else
$od_pwd = get_encrypt_string($_POST['od_pwd']);
// 주문번호를 얻는다.
$od_id = get_session('ss_order_id');
$od_escrow = 0;
if($escw_yn == 'Y')
$od_escrow = 1;
// 복합과세 금액
$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_pg = $default['de_pg_service'];
$od_email = get_email_address($od_email);
$od_name = clean_xss_tags($od_name);
$od_tel = clean_xss_tags($od_tel);
$od_hp = clean_xss_tags($od_hp);
$od_zip = preg_replace('/[^0-9]/', '', $od_zip);
$od_zip1 = substr($od_zip, 0, 3);
$od_zip2 = substr($od_zip, 3);
$od_addr1 = clean_xss_tags($od_addr1);
$od_addr2 = clean_xss_tags($od_addr2);
$od_addr3 = clean_xss_tags($od_addr3);
$od_addr_jibeon = preg_match("/^(N|R)$/", $od_addr_jibeon) ? $od_addr_jibeon : '';
$od_b_name = clean_xss_tags($od_b_name);
$od_b_tel = clean_xss_tags($od_b_tel);
$od_b_hp = clean_xss_tags($od_b_hp);
$od_b_addr1 = clean_xss_tags($od_b_addr1);
$od_b_addr2 = clean_xss_tags($od_b_addr2);
$od_b_addr3 = clean_xss_tags($od_b_addr3);
$od_b_addr_jibeon = preg_match("/^(N|R)$/", $od_b_addr_jibeon) ? $od_b_addr_jibeon : '';
$od_memo = clean_xss_tags($od_memo);
$od_deposit_name = clean_xss_tags($od_deposit_name);
// 주문서에 입력
$sql = " insert {$g5['g5_shop_order_table']}
set od_id = '$od_id',
mb_id = '{$member['mb_id']}',
od_pwd = '$od_pwd',
od_name = '$od_name',
od_email = '$od_email',
od_tel = '$od_tel',
od_hp = '$od_hp',
od_zip1 = '$od_zip1',
od_zip2 = '$od_zip2',
od_addr1 = '$od_addr1',
od_addr2 = '$od_addr2',
od_addr3 = '$od_addr3',
od_addr_jibeon = '$od_addr_jibeon',
od_b_name = '$od_b_name',
od_b_tel = '$od_b_tel',
od_b_hp = '$od_b_hp',
od_b_zip1 = '$od_b_zip1',
od_b_zip2 = '$od_b_zip2',
od_b_addr1 = '$od_b_addr1',
od_b_addr2 = '$od_b_addr2',
od_b_addr3 = '$od_b_addr3',
od_b_addr_jibeon = '$od_b_addr_jibeon',
od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo',
od_cart_count = '$cart_count',
od_cart_price = '$tot_ct_price',
od_cart_coupon = '$tot_it_cp_price',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_price',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_price',
od_receipt_price = '$od_receipt_price',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
od_receipt_time = '$od_receipt_time',
od_misu = '$od_misu',
od_pg = '$od_pg',
od_tno = '$od_tno',
od_app_no = '$od_app_no',
od_escrow = '$od_escrow',
od_tax_flag = '{$default['de_tax_flag_use']}',
od_tax_mny = '$od_tax_mny',
od_vat_mny = '$od_vat_mny',
od_free_mny = '$od_free_mny',
od_status = '$od_status',
od_shop_memo = '',
od_hope_date = '$od_hope_date',
od_time = '".G5_TIME_YMDHIS."',
od_mobile = '1',
od_ip = '$REMOTE_ADDR',
od_settle_case = '$od_settle_case'
";
$result = sql_query($sql, false);
// 주문정보 입력 오류시 결제 취소
if(!$result) {
if($tno) {
$cancel_msg = '주문정보 입력 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
}
// 관리자에게 오류 알림 메일발송
$error = 'order';
include G5_SHOP_PATH.'/ordererrormail.php';
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($default['de_pg_service']).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
}
// 장바구니 상태변경
// 신용카드로 주문하면서 신용카드 포인트 사용하지 않는다면 포인트 부여하지 않음
$cart_status = $od_status;
$sql_card_point = "";
if ($od_receipt_price > 0 && !$default['de_card_point']) {
$sql_card_point = " , ct_point = '0' ";
}
$sql = "update {$g5['g5_shop_cart_table']}
set od_id = '$od_id',
ct_status = '$cart_status'
$sql_card_point
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql, false);
// 주문정보 입력 오류시 결제 취소
if(!$result) {
if($tno) {
$cancel_msg = '주문상태 변경 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
}
// 관리자에게 오류 알림 메일발송
$error = 'status';
include G5_SHOP_PATH.'/ordererrormail.php';
// 주문삭제
sql_query(" delete from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
die('<p>고객님의 주문 정보를 처리하는 중 오류가 발생해서 주문이 완료되지 않았습니다.</p><p>'.strtoupper($default['de_pg_service']).'를 이용한 전자결제(신용카드, 계좌이체, 가상계좌 등)은 자동 취소되었습니다.');
}
// 회원이면서 포인트를 사용했다면 포인트 테이블에 사용을 추가
if ($is_member && $od_receipt_point)
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
$od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
// 쿠폰사용내역기록
if($is_member) {
$it_cp_cnt = count($_POST['cp_id']);
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];
if(trim($cid)) {
$sql = " insert into {$g5['g5_shop_coupon_log_table']}
set cp_id = '$cid',
mb_id = '{$member['mb_id']}',
od_id = '$od_id',
cp_price = '$cp_prc',
cl_datetime = '".G5_TIME_YMDHIS."' ";
sql_query($sql);
}
// 쿠폰사용금액 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'
and it_id = '$cp_it_id'
and ct_select = '1'
order by ct_id asc
limit 1 ";
sql_query($sql);
}
if($_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']}',
od_id = '$od_id',
cp_price = '$tot_od_cp_price',
cl_datetime = '".G5_TIME_YMDHIS."' ";
sql_query($sql);
}
if($_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']}',
od_id = '$od_id',
cp_price = '$tot_sc_cp_price',
cl_datetime = '".G5_TIME_YMDHIS."' ";
sql_query($sql);
}
}
include_once(G5_SHOP_PATH.'/ordermail1.inc.php');
include_once(G5_SHOP_PATH.'/ordermail2.inc.php');
// SMS BEGIN --------------------------------------------------------
// 주문고객과 쇼핑몰관리자에게 SMS 전송
if($config['cf_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3'])) {
$is_sms_send = false;
// 충전식일 경우 잔액이 있는지 체크
if($config['cf_icode_id'] && $config['cf_icode_pw']) {
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
if($userinfo['code'] == 0) {
if($userinfo['payment'] == 'C') { // 정액제
$is_sms_send = true;
} else {
$minimum_coin = 100;
if(defined('G5_ICODE_COIN'))
$minimum_coin = intval(G5_ICODE_COIN);
if((int)$userinfo['coin'] >= $minimum_coin)
$is_sms_send = true;
}
}
}
if($is_sms_send) {
$sms_contents = array($default['de_sms_cont2'], $default['de_sms_cont3']);
$recv_numbers = array($od_hp, $default['de_sms_hp']);
$send_numbers = array($default['de_admin_company_tel'], $od_hp);
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$sms_count = 0;
for($s=0; $s<count($sms_contents); $s++) {
$sms_content = $sms_contents[$s];
$recv_number = preg_replace("/[^0-9]/", "", $recv_numbers[$s]);
$send_number = preg_replace("/[^0-9]/", "", $send_numbers[$s]);
$sms_content = str_replace("{이름}", $od_name, $sms_content);
$sms_content = str_replace("{보낸분}", $od_name, $sms_content);
$sms_content = str_replace("{받는분}", $od_b_name, $sms_content);
$sms_content = str_replace("{주문번호}", $od_id, $sms_content);
$sms_content = str_replace("{주문금액}", number_format($tot_ct_price + $od_send_cost + $od_send_cost2), $sms_content);
$sms_content = str_replace("{회원아이디}", $member['mb_id'], $sms_content);
$sms_content = str_replace("{회사명}", $default['de_admin_company_name'], $sms_content);
$idx = 'de_sms_use'.($s + 2);
if($default[$idx] && $recv_number) {
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
$sms_count++;
}
}
// 무통장 입금 때 고객에게 계좌정보 보냄
if($od_settle_case == '무통장' && $default['de_sms_use2'] && $od_misu > 0) {
$sms_content = $od_name."님의 입금계좌입니다.\n금액:".number_format($od_misu)."\n계좌:".$od_bank_account."\n".$default['de_admin_company_name'];
$recv_number = preg_replace("/[^0-9]/", "", $od_hp);
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']);
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", $sms_content), "");
$sms_count++;
}
if($sms_count > 0)
$SMS->Send();
}
}
// SMS END --------------------------------------------------------
// orderview 에서 사용하기 위해 session에 넣고
$uid = md5($od_id.G5_TIME_YMDHIS.$REMOTE_ADDR);
set_session('ss_orderview_uid', $uid);
// 주문 정보 임시 데이터 삭제
$sql = " delete from {$g5['g5_shop_order_data_table']} where od_id = '$od_id' and dt_pg = '$od_pg' ";
sql_query($sql);
// 주문번호제거
set_session('ss_order_id', '');
// 기존자료 세션에서 제거
if (get_session('ss_direct'))
set_session('ss_cart_direct', '');
// 배송지처리
if($is_member) {
$sql = " select * from {$g5['g5_shop_order_address_table']}
where mb_id = '{$member['mb_id']}'
and ad_name = '$od_b_name'
and ad_tel = '$od_b_tel'
and ad_hp = '$od_b_hp'
and ad_zip1 = '$od_b_zip1'
and ad_zip2 = '$od_b_zip2'
and ad_addr1 = '$od_b_addr1'
and ad_addr2 = '$od_b_addr2'
and ad_addr3 = '$od_b_addr3' ";
$row = sql_fetch($sql);
// 기본배송지 체크
if($ad_default) {
$sql = " update {$g5['g5_shop_order_address_table']}
set ad_default = '0'
where mb_id = '{$member['mb_id']}' ";
sql_query($sql);
}
if($row['ad_id']){
$sql = " update {$g5['g5_shop_order_address_table']}
set ad_default = '$ad_default',
ad_subject = '$ad_subject',
ad_jibeon = '$od_b_addr_jibeon'
where mb_id = '{$member['mb_id']}'
and ad_id = '{$row['ad_id']}' ";
} else {
$sql = " insert into {$g5['g5_shop_order_address_table']}
set mb_id = '{$member['mb_id']}',
ad_subject = '$ad_subject',
ad_default = '$ad_default',
ad_name = '$od_b_name',
ad_tel = '$od_b_tel',
ad_hp = '$od_b_hp',
ad_zip1 = '$od_b_zip1',
ad_zip2 = '$od_b_zip2',
ad_addr1 = '$od_b_addr1',
ad_addr2 = '$od_b_addr2',
ad_addr3 = '$od_b_addr3',
ad_jibeon = '$od_b_addr_jibeon' ";
}
sql_query($sql);
}
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
?>

View File

@ -0,0 +1,72 @@
<?php
include_once('./_common.php');
define("_ORDERINQUIRY_", true);
$od_pwd = get_encrypt_string($od_pwd);
// 회원인 경우
if ($is_member)
{
$sql_common = " from {$g5['g5_shop_order_table']} where mb_id = '{$member['mb_id']}' ";
}
else if ($od_id && $od_pwd) // 비회원인 경우 주문서번호와 비밀번호가 넘어왔다면
{
$sql_common = " from {$g5['g5_shop_order_table']} where od_id = '$od_id' and od_pwd = '$od_pwd' ";
}
else // 그렇지 않다면 로그인으로 가기
{
goto_url(G5_BBS_URL.'/login.php?url='.urlencode(G5_SHOP_URL.'/orderinquiry.php'));
}
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 비회원 주문확인시 비회원의 모든 주문이 다 출력되는 오류 수정
// 조건에 맞는 주문서가 없다면
if ($total_count == 0)
{
if ($is_member) // 회원일 경우는 메인으로 이동
alert('주문이 존재하지 않습니다.', G5_SHOP_URL);
else // 비회원일 경우는 이전 페이지로 이동
alert('주문이 존재하지 않습니다.');
}
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
// 비회원 주문확인의 경우 바로 주문서 상세조회로 이동
if (!$is_member)
{
$sql = " select od_id, od_time, od_ip from {$g5['g5_shop_order_table']} where od_id = '$od_id' and od_pwd = '$od_pwd' ";
$row = sql_fetch($sql);
if ($row['od_id']) {
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
set_session('ss_orderview_uid', $uid);
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$row['od_id'].'&amp;uid='.$uid);
}
}
$g5['title'] = '주문내역조회';
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<div id="sod_v">
<p id="sod_v_info">주문서번호 링크를 누르시면 주문상세내역을 조회하실 수 있습니다.</p>
<?php
$limit = " limit $from_record, $rows ";
include G5_MSHOP_PATH.'/orderinquiry.sub.php';
?>
<?php echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
</div>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,90 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
?>
<?php if (!$limit) { ?>총 <?php echo $cnt; ?> 건<?php } ?>
<div id="sod_inquiry">
<ul>
<?php
$sql = " select *,
(od_cart_coupon + od_coupon + od_send_coupon) as couponprice
from {$g5['g5_shop_order_table']}
where mb_id = '{$member['mb_id']}'
order by od_id desc
$limit ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 주문상품
$sql = " select it_name, ct_option
from {$g5['g5_shop_cart_table']}
where od_id = '{$row['od_id']}'
order by io_type, ct_id
limit 1 ";
$ct = sql_fetch($sql);
$ct_name = get_text($ct['it_name']).' '.get_text($ct['ct_option']);
$sql = " select count(*) as cnt
from {$g5['g5_shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$ct2 = sql_fetch($sql);
if($ct2['cnt'] > 1)
$ct_name .= ' 외 '.($ct2['cnt'] - 1).'건';
switch($row['od_status']) {
case '주문':
$od_status = '입금확인중';
break;
case '입금':
$od_status = '입금완료';
break;
case '준비':
$od_status = '상품준비중';
break;
case '배송':
$od_status = '상품배송';
break;
case '완료':
$od_status = '배송완료';
break;
default:
$od_status = '주문취소';
break;
}
$od_invoice = '';
if($row['od_delivery_company'] && $row['od_invoice'])
$od_invoice = get_text($row['od_delivery_company']).' '.get_text($row['od_invoice']);
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
?>
<li>
<div class="inquiry_idtime">
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&amp;uid=<?php echo $uid; ?>" class="idtime_link"><?php echo $row['od_id']; ?></a>
<span class="idtime_time"><?php echo substr($row['od_time'],2,8); ?></span>
</div>
<div class="inquiry_name">
<?php echo $ct_name; ?>
</div>
<div class="inquiry_price">
<?php echo display_price($row['od_receipt_price']); ?>
</div>
<div class="inquiry_inv">
<span class="inv_status"><?php echo $od_status; ?></span>
<span class="inv_inv"><?php echo $od_invoice; ?></span>
</div>
</li>
<?php
}
if ($i == 0)
echo '<li class="empty_list">주문 내역이 없습니다.</li>';
?>
</ul>
</div>

View File

@ -0,0 +1,728 @@
<?php
include_once('./_common.php');
// 불법접속을 할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
if (!$is_member) {
if (get_session('ss_orderview_uid') != $_GET['uid'])
alert("직접 링크로는 주문서 조회가 불가합니다.\\n\\n주문조회 화면을 통하여 조회하시기 바랍니다.", G5_SHOP_URL);
}
$sql = "select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
if($is_member && !$is_admin)
$sql .= " and mb_id = '{$member['mb_id']}' ";
$od = sql_fetch($sql);
if (!$od['od_id'] || (!$is_member && md5($od['od_id'].$od['od_time'].$od['od_ip']) != get_session('ss_orderview_uid'))) {
alert("조회하실 주문서가 없습니다.", G5_SHOP_URL);
}
// 결제방법
$settle_case = $od['od_settle_case'];
$g5['title'] = '주문상세내역';
include_once(G5_MSHOP_PATH.'/_head.php');
// LG 현금영수증 JS
if($od['od_pg'] == 'lg') {
if($default['de_card_test']) {
echo '<script language="JavaScript" src="http://pgweb.uplus.co.kr:7085/WEB_SERVER/js/receipt_link.js"></script>'.PHP_EOL;
} else {
echo '<script language="JavaScript" src="http://pgweb.uplus.co.kr/WEB_SERVER/js/receipt_link.js"></script>'.PHP_EOL;
}
}
?>
<div id="sod_fin">
<div id="sod_fin_no">주문번호 <strong><?php echo $od_id; ?></strong></div>
<section class="sod_fin_list">
<h2>주문하신 상품</h2>
<?php
$st_count1 = $st_count2 = 0;
$custom_cancel = false;
$sql = " select it_id, it_name, cp_price, ct_send_cost, it_sc_type
from {$g5['g5_shop_cart_table']}
where od_id = '$od_id'
group by it_id
order by ct_id ";
$result = sql_query($sql);
?>
<ul id="sod_list_inq" class="sod_list">
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$image_width = 50;
$image_height = 50;
$image = get_it_image($row['it_id'], 50, 50, '', '', $row['it_name']);
// 옵션항목
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price
from {$g5['g5_shop_cart_table']}
where od_id = '$od_id'
and it_id = '{$row['it_id']}'
order by io_type asc, ct_id asc ";
$res = sql_query($sql);
// 합계금액 계산
$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_id' ";
$sum = sql_fetch($sql);
// 배송비
switch($row['ct_send_cost'])
{
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id);
if($sendcost == 0)
$ct_send_cost = '무료';
}
?>
<li class="sod_li">
<div class="li_name_od">
<a href="./item.php?it_id=<?php echo $row['it_id']; ?>"><strong><?php echo $row['it_name']; ?></strong></a>
</div>
<?php
for($k=0; $opt=sql_fetch_array($res); $k++) {
if($opt['io_type'])
$opt_price = $opt['io_price'];
else
$opt_price = $opt['ct_price'] + $opt['io_price'];
$sell_price = $opt_price * $opt['ct_qty'];
$point = $opt['ct_point'] * $opt['ct_qty'];
?>
<div class="li_opt"><?php echo $opt['ct_option']; ?></div>
<div class="li_prqty">
<span class="prqty_price li_prqty_sp"><span>판매가 </span><?php echo number_format($opt_price); ?></span>
<span class="prqty_qty li_prqty_sp"><span>수량 </span><?php echo number_format($opt['ct_qty']); ?></span>
<span class="prqty_sc li_prqty_sp"><span>배송비 </span><?php echo $ct_send_cost; ?></span>
<span class="prqty_stat li_prqty_sp"><span>상태 </span><?php echo $opt['ct_status']; ?></span>
</div>
<div class="li_total" style="padding-left:<?php echo $image_width + 10; ?>px;height:auto !important;height:<?php echo $image_height; ?>px;min-height:<?php echo $image_height; ?>px">
<a href="./item.php?it_id=<?php echo $row['it_id']; ?>" class="total_img"><?php echo $image; ?></a>
<span class="total_price total_span"><span>주문금액 </span><?php echo number_format($sell_price); ?></span>
<span class="total_point total_span"><span>적립포인트 </span><?php echo number_format($point); ?></span>
</div>
<?php
$tot_point += $point;
$st_count1++;
if($opt['ct_status'] == '주문')
$st_count2++;
}
?>
</li>
<?php
}
// 주문 상품의 상태가 모두 주문이면 고객 취소 가능
if($st_count1 > 0 && $st_count1 == $st_count2)
$custom_cancel = true;
?>
</ul>
<div id="sod_sts_wrap">
<span class="sound_only">상품 상태 설명</span>
<button type="button" id="sod_sts_explan_open" class="btn_frmline">상태설명보기</button>
<div id="sod_sts_explan">
<dl id="sod_fin_legend">
<dt>주문</dt>
<dd>주문이 접수되었습니다.</dd>
<dt>입금</dt>
<dd>입금(결제)이 완료 되었습니다.</dd>
<dt>준비</dt>
<dd>상품 준비 중입니다.</dd>
<dt>배송</dt>
<dd>상품 배송 중입니다.</dd>
<dt>완료</dt>
<dd>상품 배송이 완료 되었습니다.</dd>
</dl>
<button type="button" id="sod_sts_explan_close" class="btn_frmline">상태설명닫기</button>
</div>
</div>
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$tot_price = $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']
- $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon']
- $od['od_cancel_price'];
?>
<dl id="sod_bsk_tot">
<dt class="sod_bsk_dvr">주문총액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_price']); ?> 원</strong></dd>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">결제할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost2'] > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_cancel_price'] > 0) { ?>
<dt class="sod_bsk_dvr">취소금액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cancel_price']); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원</strong></dd>
<dt class="sod_bsk_point">포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
</dl>
</section>
<div id="sod_fin_view">
<h2>결제/배송 정보</h2>
<?php
$receipt_price = $od['od_receipt_price']
+ $od['od_receipt_point'];
$cancel_price = $od['od_cancel_price'];
$misu = true;
$misu_price = $tot_price - $receipt_price - $cancel_price;
if ($misu_price == 0 && ($od['od_cart_price'] > $od['od_cancel_price'])) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($receipt_price);
}
// 결제정보처리
if($od['od_receipt_price'] > 0)
$od_receipt_price = display_price($od['od_receipt_price']);
else
$od_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
$disp_receipt = false;
$easy_pay_name = '';
if($od['od_settle_case'] == '신용카드') {
$app_no_subj = '승인번호';
$app_no = $od['od_app_no'];
$disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '간편결제') {
$app_no_subj = '승인번호';
$app_no = $od['od_app_no'];
$disp_bank = false;
switch($od['od_pg']) {
case 'lg':
$easy_pay_name = 'PAYNOW';
break;
case 'inicis':
$easy_pay_name = 'KPAY';
break;
case 'kcp':
$easy_pay_name = 'PAYCO';
break;
default:
break;
}
} else if($od['od_settle_case'] == '휴대폰') {
$app_no_subj = '휴대폰번호';
$app_no = $od['od_bank_account'];
$disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '가상계좌' || $od['od_settle_case'] == '계좌이체') {
$app_no_subj = '거래번호';
$app_no = $od['od_tno'];
}
?>
<section id="sod_fin_pay">
<h3>결제정보</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_2">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $od_id; ?></td>
</tr>
<tr>
<th scope="row">주문일시</th>
<td><?php echo $od['od_time']; ?></td>
</tr>
<tr>
<th scope="row">결제방식</th>
<td><?php echo ($easy_pay_name ? $easy_pay_name.'('.$od['od_settle_case'].')' : $od['od_settle_case']); ?></td>
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $od_receipt_price; ?></td>
</tr>
<?php
if($od['od_receipt_price'] > 0)
{
?>
<tr>
<th scope="row">결제일시</th>
<td><?php echo $od['od_receipt_time']; ?></td>
</tr>
<?php
}
// 승인번호, 휴대폰번호, 거래번호
if($app_no_subj)
{
?>
<tr>
<th scope="row"><?php echo $app_no_subj; ?></th>
<td><?php echo $app_no; ?></td>
</tr>
<?php
}
// 계좌정보
if($disp_bank)
{
?>
<tr>
<th scope="row">입금자명</th>
<td><?php echo get_text($od['od_deposit_name']); ?></td>
</tr>
<tr>
<th scope="row">입금계좌</th>
<td><?php echo get_text($od['od_bank_account']); ?></td>
</tr>
<?php
}
if($disp_receipt) {
?>
<tr>
<th scope="row">영수증</th>
<td>
<?php
if($od['od_settle_case'] == '휴대폰')
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $od['od_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $hp_receipt_script; ?>">영수증 출력</a>
<?php
}
if($od['od_settle_case'] == '신용카드')
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $od['od_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$card_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'card_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=470,height=815,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
<?php
}
?>
<td>
</td>
</tr>
<?php
}
if ($od['od_receipt_point'] > 0)
{
?>
<tr>
<th scope="row">포인트사용</th>
<td><?php echo display_point($od['od_receipt_point']); ?></td>
</tr>
<?php
}
if ($od['od_refund_price'] > 0)
{
?>
<tr>
<th scope="row">환불 금액</th>
<td><?php echo display_price($od['od_refund_price']); ?></td>
</tr>
<?php
}
// 현금영수증 발급을 사용하는 경우에만
if ($default['de_taxsave_use']) {
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($misu_price == 0 && $od['od_receipt_price'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == '가상계좌')) {
?>
<tr>
<th scope="row">현금영수증</th>
<td>
<?php
if ($od['od_cash'])
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
switch($od['od_settle_case']) {
case '계좌이체':
$trade_type = 'BANK';
break;
case '가상계좌':
$trade_type = 'CAS';
break;
default:
$trade_type = 'CR';
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$od['od_id'].'\',\''.$od['od_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} 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 {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
$cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\''.G5_CASH_RECEIPT_URL.$default['de_kcp_mid'].'&orderid='.$od_id.'&bill_yn=Y&authno='.$cash['receipt_no'].'\', \'taxsave_receipt\', \'width=360,height=647,scrollbars=0,menus=0\');';
}
?>
<a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a>
<?php
}
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_orderer">
<h3>주문하신 분</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_2">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo get_text($od['od_name']); ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo get_text($od['od_tel']); ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo get_text($od['od_hp']); ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo get_text(sprintf("(%s%s)", $od['od_zip1'], $od['od_zip2']).' '.print_address($od['od_addr1'], $od['od_addr2'], $od['od_addr3'], $od['od_addr_jibeon'])); ?></td>
</tr>
<tr>
<th scope="row">E-mail</th>
<td><?php echo get_text($od['od_email']); ?></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_receiver">
<h3>받으시는 분</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_2">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo get_text($od['od_b_name']); ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo get_text($od['od_b_tel']); ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo get_text($od['od_b_hp']); ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo get_text(sprintf("(%s%s)", $od['od_b_zip1'], $od['od_b_zip2']).' '.print_address($od['od_b_addr1'], $od['od_b_addr2'], $od['od_b_addr3'], $od['od_b_addr_jibeon'])); ?></td>
</tr>
<?php
// 희망배송일을 사용한다면
if ($default['de_hope_date_use'])
{
?>
<tr>
<th scope="row">희망배송일</th>
<td><?php echo substr($od['od_hope_date'],0,10).' ('.get_yoil($od['od_hope_date']).')' ;?></td>
</tr>
<?php }
if ($od['od_memo'])
{
?>
<tr>
<th scope="row">전하실 말씀</th>
<td><?php echo conv_content($od['od_memo'], 0); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_dvr">
<h3>배송정보</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_2">
<col>
</colgroup>
<tbody>
<?php
if ($od['od_invoice'] && $od['od_delivery_company'])
{
?>
<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 $od['od_invoice_time']; ?></td>
</tr>
<?php
}
else
{
?>
<tr>
<td class="empty_table" colspan="2">아직 배송하지 않았거나 배송정보를 입력하지 못하였습니다.</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</section>
</div>
<section id="sod_fin_tot">
<h2>결제합계</h2>
<ul>
<li>
총 구매액
<strong><?php echo display_price($tot_price); ?></strong>
</li>
<?php
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>
<li id="alrdy">
결제액
<strong><?php echo $wanbul; ?></strong>
</li>
</ul>
</section>
<section id="sod_fin_cancel">
<h2>주문취소</h2>
<?php
// 취소한 내역이 없다면
if ($cancel_price == 0) {
if ($custom_cancel) {
?>
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
<div id="sod_fin_cancelfrm">
<form method="post" action="<?php echo G5_SHOP_URL; ?>/orderinquirycancel.php" onsubmit="return fcancel_check(this);">
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<label for="cancel_memo">취소사유</label>
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input required" maxlength="100">
<input type="submit" value="확인" class="btn_frmline">
</form>
</div>
<?php
}
} else {
?>
<p>주문 취소, 반품, 품절된 내역이 있습니다.</p>
<?php } ?>
</section>
<?php if ($od['od_settle_case'] == '가상계좌' && $od['od_misu'] > 0 && $default['de_card_test'] && $is_admin && $od['od_pg'] == 'kcp') {
preg_match("/\s{1}([^\s]+)\s?/", $od['od_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<div id="kcp_acc_test" class="odf_tbl">
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<table>
<caption>모의입금처리</caption>
<colgroup>
<col class="grid_2">
<col>
</colgroup>
<tbody>
<tr>
<th scope="col"><label for="e_trade_no">KCP 거래번호</label></th>
<td><input type="text" name="e_trade_no" value="<?php echo $od['od_tno']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="deposit_no">입금계좌</label></th>
<td><input type="text" name="deposit_no" value="<?php echo $deposit_no; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="req_name">입금자명</label></th>
<td><input type="text" name="req_name" value="<?php echo $od['od_deposit_name']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="noti_url">입금통보 URL</label></th>
<td><input type="text" name="noti_url" value="<?php echo G5_SHOP_URL; ?>/settle_kcp_common.php"></td>
</tr>
</tbody>
</table>
<div id="sod_fin_test" class="btn_confirm">
<input type="submit" value="입금통보 테스트" class="btn_submit">
</div>
</form>
</div>
<?php } ?>
</div>
<script>
$(function() {
$("#sod_sts_explan_open").on("click", function() {
var $explan = $("#sod_sts_explan");
if($explan.is(":animated"))
return false;
if($explan.is(":visible")) {
$explan.slideUp(200);
$("#sod_sts_explan_open").text("상태설명보기");
} else {
$explan.slideDown(200);
$("#sod_sts_explan_open").text("상태설명닫기");
}
});
$("#sod_sts_explan_close").on("click", function() {
var $explan = $("#sod_sts_explan");
if($explan.is(":animated"))
return false;
$explan.slideUp(200);
$("#sod_sts_explan_open").text("상태설명보기");
});
});
function fcancel_check(f)
{
if(!confirm("주문을 정말 취소하시겠습니까?"))
return false;
var memo = f.cancel_memo.value;
if(memo == "") {
alert("취소사유를 입력해 주십시오.");
return false;
}
return true;
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,59 @@
<?php
include_once('./_common.php');
$g5['title'] = '개인결제 리스트';
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<!-- 상품 목록 시작 { -->
<div id="sct">
<?php
// 리스트 유형별로 출력
$list_file = G5_MSHOP_SKIN_PATH.'/personalpay.skin.php';
if (file_exists($list_file)) {
$list_mod = 3;
$list_row = 5;
$img_width = 230;
$img_height = 230;
$sql_common = " from {$g5['g5_shop_personalpay_table']}
where pp_use = '1'
and pp_tno = '' ";
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $list_mod * $list_row;
$sql = "select COUNT(*) as cnt $sql_common ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$sql = " select *
$sql_common
order by pp_id desc
limit $from_record, $items";
$result = sql_query($sql);
include $list_file;
}
else
{
echo '<p class="sct_nofile">personalpay.skin.php 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
}
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr.'&amp;page=');
?>
</div>
<!-- } 상품 목록 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,357 @@
<?php
include_once('./_common.php');
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '$pp_id' and pp_use = '1' and pp_price > 0 ";
$pp = sql_fetch($sql);
if(!$pp['pp_id'])
alert('개인결제 정보가 존재하지 않습니다.');
if($pp['pp_tno'])
alert('이미 결제하신 개인결제 내역입니다.');
$g5['title'] = $pp['pp_name'].'님 개인결제';
include_once(G5_MSHOP_PATH.'/_head.php');
$action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
require_once(G5_MSHOP_PATH.'/settle_'.$default['de_pg_service'].'.inc.php');
// 결제등록 요청시 사용할 입금마감일
$ipgm_date = date("Ymd", (G5_SERVER_TIME + 86400 * 5));
$tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정(갤럭시탭,아이패드 - 1.85, 스마트폰 - 1.0)
// 개인결제 체크를 위한 hash
$hash_data = md5($pp['pp_id'].$pp['pp_price'].$pp['pp_time']);
set_session('ss_personalpay_id', $pp['pp_id']);
set_session('ss_personalpay_hash', $hash_data);
// 에스크로 상품정보
if($default['de_escrow_use']) {
$good_info .= "seq=1".chr(31);
$good_info .= "ordr_numb={$pp_id}_".sprintf("%04d", 1).chr(31);
$good_info .= "good_name=".addslashes($pp['pp_name'].'님 개인결제').chr(31);
$good_info .= "good_cntx=1".chr(31);
$good_info .= "good_amtx=".$pp['pp_price'].chr(31);
}
// 주문폼과 공통 사용을 위해 추가
$od_id = $pp_id;
$tot_price = $pp['pp_price'];
$goods = $pp['pp_name'].'님 개인결제';
?>
<div id="sod_approval_frm">
<?php
// 결제대행사별 코드 include (결제등록 필드)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.1.php');
?>
</div>
<div id="sod_frm">
<form name="forderform" method="post" action="<?php echo $action_url; ?>" autocomplete="off">
<input type="hidden" name="pp_id" value="<?php echo $pp['pp_id']; ?>">
<section id="sod_frm_orderer">
<h2>개인결제정보</h2>
<div class="odf_tbl">
<table>
<tbody>
<?php if(trim($pp['pp_content'])) { ?>
<tr>
<th>상세내용</th>
<td><?php echo conv_content($pp['pp_content'], 0); ?></td>
</tr>
<?php } ?>
<tr>
<th>결제금액</th>
<td><?php echo display_price($pp['pp_price']); ?></td>
</tr>
<tr>
<th scope="row"><label for="pp_name">이름</label></th>
<td><input type="text" name="pp_name" value="<?php echo $pp['pp_name']; ?>" id="pp_name" required class="required frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="pp_email">이메일</label></th>
<td><input type="email" name="pp_email" value="<?php echo $member['mb_email']; ?>" id="pp_email" required class="required frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="pp_hp">휴대폰</label></th>
<td><input type="text" name="pp_hp" value="<?php echo $member['mb_hp']; ?>" id="pp_hp" class="frm_input"></td>
</tr>
</tbody>
</table>
</div>
<?php
$multi_settle == 0;
$checked = '';
$escrow_title = "";
if ($default['de_escrow_use']) {
$escrow_title = "에스크로 ";
}
if ($default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use']) {
echo '<fieldset id="sod_frm_paysel">';
echo '<legend>결제방법 선택</legend>';
echo '<ul>';
}
// 가상계좌 사용
if ($default['de_vbank_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_vbank" name="pp_settle_case" value="가상계좌" '.$checked.'> <label for="pp_settle_vbank">'.$escrow_title.'가상계좌</label></li>'.PHP_EOL;
$checked = '';
}
// 계좌이체 사용
if ($default['de_iche_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_iche" name="pp_settle_case" value="계좌이체" '.$checked.'> <label for="pp_settle_iche">'.$escrow_title.'계좌이체</label></li>'.PHP_EOL;
$checked = '';
}
// 휴대폰 사용
if ($default['de_hp_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_hp" name="pp_settle_case" value="휴대폰" '.$checked.'> <label for="pp_settle_hp">휴대폰</label></li>'.PHP_EOL;
$checked = '';
}
// 신용카드 사용
if ($default['de_card_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_card" name="pp_settle_case" value="신용카드" '.$checked.'> <label for="pp_settle_card">신용카드</label></li>'.PHP_EOL;
$checked = '';
}
if ($default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use']) {
echo '</ul>';
echo '</fieldset>';
}
?>
<?php
if ($multi_settle == 0)
echo '<p>결제할 방법이 없습니다.<br>운영자에게 알려주시면 감사하겠습니다.</p>';
?>
</section>
<?php
// 결제대행사별 코드 include (결제대행사 정보 필드 및 주분버튼)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.2.php');
?>
<div id="show_progress" style="display:none;">
<img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt="">
<span>결제진행 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</form>
<?php
if ($default['de_escrow_use']) {
// 결제대행사별 코드 include (에스크로 안내)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.3.php');
}
?>
</div>
<script>
/* 결제방법에 따른 처리 후 결제등록요청 실행 */
var settle_method = "";
function pay_approval()
{
var f = document.sm_form;
var pf = document.forderform;
// 필드체크
if(!payfield_check(pf))
return false;
// 금액체크
if(!payment_check(pf))
return false;
<?php if($default['de_pg_service'] == 'kcp') { ?>
f.buyr_name.value = pf.pp_name.value;
f.buyr_mail.value = pf.pp_email.value;
f.buyr_tel1.value = pf.pp_hp.value;
f.buyr_tel2.value = pf.pp_hp.value;
f.rcvr_name.value = pf.pp_name.value;
f.rcvr_tel1.value = pf.pp_hp.value;
f.rcvr_tel2.value = pf.pp_hp.value;
f.rcvr_mail.value = pf.pp_email.value;
f.settle_method.value = settle_method;
<?php } else if($default['de_pg_service'] == 'lg') { ?>
var pay_method = "";
switch(settle_method) {
case "계좌이체":
pay_method = "SC0030";
break;
case "가상계좌":
pay_method = "SC0040";
break;
case "휴대폰":
pay_method = "SC0060";
break;
case "신용카드":
pay_method = "SC0010";
break;
}
f.LGD_CUSTOM_FIRSTPAY.value = pay_method;
f.LGD_BUYER.value = pf.pp_name.value;
f.LGD_BUYEREMAIL.value = pf.pp_email.value;
f.LGD_BUYERPHONE.value = pf.pp_hp.value;
f.LGD_AMOUNT.value = f.good_mny.value;
<?php if($default['de_tax_flag_use']) { ?>
f.LGD_TAXFREEAMOUNT.value = pf.comm_free_mny.value;
<?php } ?>
<?php } else if($default['de_pg_service'] == 'inicis') { ?>
var paymethod = "";
var width = 330;
var height = 480;
var xpos = (screen.width - width) / 2;
var ypos = (screen.width - height) / 2;
var position = "top=" + ypos + ",left=" + xpos;
var features = position + ", width=320, height=440";
switch(settle_method) {
case "계좌이체":
paymethod = "bank";
break;
case "가상계좌":
paymethod = "vbank";
break;
case "휴대폰":
paymethod = "mobile";
break;
case "신용카드":
paymethod = "wcard";
break;
}
f.P_AMT.value = f.good_mny.value;
f.P_UNAME.value = pf.pp_name.value;
f.P_MOBILE.value = pf.pp_hp.value;
f.P_EMAIL.value = pf.pp_email.value;
<?php if($default['de_tax_flag_use']) { ?>
f.P_TAX.value = pf.comm_vat_mny.value;
f.P_TAXFREE = pf.comm_free_mny.value;
<?php } ?>
f.P_RETURN_URL.value = "<?php echo $return_url.$pp_id; ?>";
f.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
<?php } ?>
//var new_win = window.open("about:blank", "tar_opener", "scrollbars=yes,resizable=yes");
//f.target = "tar_opener";
// 주문 정보 임시저장
var order_data = $(pf).serialize();
var save_result = "";
$.ajax({
type: "POST",
data: order_data,
url: g5_url+"/shop/ajax.orderdatasave.php",
cache: false,
async: false,
success: function(data) {
save_result = data;
}
});
if(save_result) {
alert(save_result);
return false;
}
f.submit();
}
function forderform_check()
{
var f = document.forderform;
// 필드체크
if(!payfield_check(f))
return false;
// 금액체크
if(!payment_check(f))
return false;
if(f.res_cd.value != "0000") {
alert("결제등록요청 후 결제해 주십시오.");
return false;
}
document.getElementById("display_pay_button").style.display = "none";
document.getElementById("show_progress").style.display = "block";
setTimeout(function() {
f.submit();
}, 300);
}
// 결제폼 필드체크
function payfield_check(f)
{
var settle_case = document.getElementsByName("pp_settle_case");
var settle_check = false;
for (i=0; i<settle_case.length; i++)
{
if (settle_case[i].checked)
{
settle_check = true;
settle_method = settle_case[i].value;
break;
}
}
if (!settle_check)
{
alert("결제방식을 선택하십시오.");
return false;
}
return true;
}
// 결제체크
function payment_check(f)
{
var tot_price = <?php echo (int)$pp['pp_price']; ?>;
if (document.getElementById("pp_settle_iche")) {
if (document.getElementById("pp_settle_iche").checked) {
if (tot_price < 150) {
alert("계좌이체는 150원 이상 결제가 가능합니다.");
return false;
}
}
}
if (document.getElementById("pp_settle_card")) {
if (document.getElementById("pp_settle_card").checked) {
if (tot_price < 1000) {
alert("신용카드는 1000원 이상 결제가 가능합니다.");
return false;
}
}
}
if (document.getElementById("pp_settle_hp")) {
if (document.getElementById("pp_settle_hp").checked) {
if (tot_price < 350) {
alert("휴대폰은 350원 이상 결제가 가능합니다.");
return false;
}
}
}
return true;
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,241 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
// 결제등록 완료 체크
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'])
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
if($default['de_pg_service'] == 'inicis' && !$_POST['P_HASH'])
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
// 개인결제 정보
$pp_check = false;
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '{$_POST['pp_id']}' and pp_use = '1' ";
$pp = sql_fetch($sql);
if(!$pp['pp_id'])
alert('개인결제 정보가 존재하지 않습니다.', G5_SHOP_URL.'/personalpay.php');
if($pp['pp_tno'])
alert('이미 결제하신 개인결제 내역입니다.', G5_SHOP_URL);
$hash_data = md5($_POST['pp_id'].$_POST['good_mny'].$pp['pp_time']);
if($_POST['pp_id'] != get_session('ss_personalpay_id') || $hash_data != get_session('ss_personalpay_hash'))
die('개인결제 정보가 올바르지 않습니다.');
if ($pp_settle_case == "계좌이체")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bank_name = iconv("cp949", "utf-8", $bank_name);
break;
}
$pp_tno = $tno;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_deposit_name = $pp_name;
$pp_bank_account = $bank_name;
$pg_price = $amount;
}
else if ($pp_settle_case == "가상계좌")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bankname = iconv("cp949", "utf-8", $bankname);
$depositor = iconv("cp949", "utf-8", $depositor);
break;
}
$pp_tno = $tno;
$pp_app_no = $app_no;
$pp_receipt_price = 0;
$pp_bank_account = $bankname.' '.$account;
$pp_deposit_name = $depositor;
$pg_price = $amount;
}
else if ($pp_settle_case == "휴대폰")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
break;
}
$pp_tno = $tno;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_bank_account = $commid.' '.$mobile_no;
$pg_price = $amount;
}
else if ($pp_settle_case == "신용카드")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name);
break;
}
$pp_tno = $tno;
$pp_app_no = $app_no;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_bank_account = $card_name;
$pg_price = $amount;
}
else
{
die("od_settle_case Error!!!");
}
// 주문금액과 결제금액이 일치하는지 체크
if((int)$pp['pp_price'] !== (int)$pg_price) {
$cancel_msg = '결제금액 불일치';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("Receipt Amount Error");
}
$pp_pg = $default['de_pg_service'];
// 결제정보 입력
$sql = " update {$g5['g5_shop_personalpay_table']}
set pp_pg = '$pp_pg',
pp_tno = '$pp_tno',
pp_app_no = '$app_no',
pp_receipt_price = '$pp_receipt_price',
pp_settle_case = '$pp_settle_case',
pp_bank_account = '$pp_bank_account',
pp_deposit_name = '$pp_deposit_name',
pp_receipt_time = '$pp_receipt_time',
pp_receipt_ip = '{$_SERVER['REMOTE_ADDR']}'
where pp_id = '{$pp['pp_id']}' ";
$result = sql_query($sql, false);
// 결제정보 입력 오류시 결제 취소
if(!$result) {
$cancel_msg = '결제정보 입력 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
}
// 주문번호가 있으면 결제정보 반영
if($pp_receipt_price > 0 && $pp['pp_id'] && $pp['od_id']) {
$od_escrow = 0;
if($escw_yn == 'Y')
$od_escrow = 1;
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = od_receipt_price + '$pp_receipt_price',
od_receipt_time = '$pp_receipt_time',
od_pg = '$pp_pg',
od_tno = '$pp_tno',
od_app_no = '$app_no',
od_escrow = '$od_escrow',
od_settle_case = '$pp_settle_case',
od_deposit_name = '$pp_deposit_name',
od_bank_account = '$pp_bank_account',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$pp['pp_id']." 로 결제완료 - ".$pp_receipt_time."\")
where od_id = '{$pp['od_id']}' ";
$result = sql_query($sql, false);
// 결제정보 입력 오류시 kcp 결제 취소
if(!$result) {
$cancel_msg = '결제정보 입력 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
}
// 미수금 정보 업데이트
$info = get_order_info($pp['od_id']);
$sql = " update {$g5['g5_shop_order_table']}
set od_misu = '{$info['od_misu']}' ";
if($info['od_misu'] == 0)
$sql .= " , od_status = '입금' ";
$sql .= " where od_id = '{$pp['od_id']}' ";
sql_query($sql, FALSE);
// 장바구니 상태변경
if($info['od_misu'] == 0) {
$sql = " update {$g5['g5_shop_cart_table']}
set ct_status = '입금'
where od_id = '{$pp['od_id']}' ";
sql_query($sql, FALSE);
}
}
// 주문 정보 임시 데이터 삭제
$sql = " delete from {$g5['g5_shop_order_data_table']} where od_id = '{$pp['pp_id']}' and dt_pg = '$pp_pg' ";
sql_query($sql);
// 개인결제번호제거
set_session('ss_personalpay_id', '');
set_session('ss_personalpay_hash', '');
$uid = md5($pp['pp_id'].$pp['pp_time'].$_SERVER['REMOTE_ADDR']);
set_session('ss_personalpay_uid', $uid);
goto_url(G5_SHOP_URL.'/personalpayresult.php?pp_id='.$pp['pp_id'].'&amp;uid='.$uid);
?>

View File

@ -0,0 +1,313 @@
<?php
include_once('./_common.php');
$sql = "select * from {$g5['g5_shop_personalpay_table']} where pp_id = '$pp_id' ";
$pp = sql_fetch($sql);
if (!$pp['pp_id'] || (md5($pp['pp_id'].$pp['pp_time'].$_SERVER['REMOTE_ADDR']) != get_session('ss_personalpay_uid'))) {
alert("조회하실 개인결제 내역이 없습니다.", G5_SHOP_URL);
}
// 결제방법
$settle_case = $pp['pp_settle_case'];
$g5['title'] = '개인결제상세내역';
include_once(G5_MSHOP_PATH.'/_head.php');
// LG 현금영수증 JS
if($pp['pp_pg'] == 'lg') {
if($default['de_card_test']) {
echo '<script language="JavaScript" src="http://pgweb.uplus.co.kr:7085/WEB_SERVER/js/receipt_link.js"></script>'.PHP_EOL;
} else {
echo '<script language="JavaScript" src="http://pgweb.uplus.co.kr/WEB_SERVER/js/receipt_link.js"></script>'.PHP_EOL;
}
}
?>
<div id="sod_fin">
<p id="sod_fin_no">개인결제번호 <strong><?php echo $pp_id; ?></strong></p>
<section id="sod_fin_view">
<h2>결제 정보</h2>
<?php
$misu = true;
if ($pp['pp_price'] == $pp['pp_receipt_price']) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($pp['pp_receipt_price']);
}
$misu_price = $pp['pp_price'] - $pp['pp_receipt_price'];
// 결제정보처리
if($pp['pp_receipt_price'] > 0)
$pp_receipt_price = display_price($pp['pp_receipt_price']);
else
$pp_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
$disp_receipt = false;
if($pp['pp_settle_case'] == '신용카드') {
$app_no_subj = '승인번호';
$app_no = $pp['pp_app_no'];
$disp_bank = false;
$disp_receipt = true;
} else if($pp['pp_settle_case'] == '휴대폰') {
$app_no_subj = '휴대폰번호';
$app_no = $pp['pp_bank_account'];
$disp_bank = false;
$disp_receipt = true;
} else if($pp['pp_settle_case'] == '가상계좌' || $pp['pp_settle_case'] == '계좌이체') {
$app_no_subj = '거래번호';
$app_no = $pp['pp_tno'];
}
?>
<section id="sod_fin_pay">
<h3>결제정보</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<?php if($pp['od_id']) { ?>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $pp['od_id']; ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row">결제방식</th>
<td><?php echo $pp['pp_settle_case']; ?></td>
</tr>
<?php if($pp['pp_receipt_price'] > 0) { ?>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $pp_receipt_price; ?></td>
</tr>
<tr>
<th scope="row">결제일시</th>
<td><?php echo is_null_time($pp['pp_receipt_time']) ? '' : $pp['pp_receipt_time']; ?></td>
</tr>
<?php
}
// 승인번호, 휴대폰번호, 거래번호
if($app_no_subj)
{
?>
<tr>
<th scope="row"><?php echo $app_no_subj; ?></th>
<td><?php echo $app_no; ?></td>
</tr>
<?php
}
// 계좌정보
if($disp_bank)
{
?>
<tr>
<th scope="row">입금자명</th>
<td><?php echo get_text($pp['pp_deposit_name']); ?></td>
</tr>
<tr>
<th scope="row">입금계좌</th>
<td><?php echo get_text($pp['pp_bank_account']); ?></td>
</tr>
<?php
}
if($disp_receipt) {
?>
<tr>
<th scope="row">영수증</th>
<td>
<?php
if($pp['pp_settle_case'] == '휴대폰')
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $pp['pp_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $hp_receipt_script; ?>">영수증 출력</a>
<?php
}
if($pp['pp_settle_case'] == '신용카드')
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $pp['pp_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$card_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'card_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=470,height=815,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
<?php
}
?>
<td>
</td>
</tr>
<?php
}
// 현금영수증 발급을 사용하는 경우에만
if ($default['de_taxsave_use']) {
$is_cash_receipt = true;
// 주문내역이 있으면 현금영수증 발급하지 않음
if($pp['od_id']) {
$sql = " select count(od_id) as cnt from {$g5['g5_shop_order_table']} where od_id = '{$pp['od_id']}' ";
$row = sql_fetch($sql);
if($row['cnt'] > 0)
$is_cash_receipt = false;
}
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($is_cash_receipt && $misu_price == 0 && $pp['pp_receipt_price'] && ($pp['pp_settle_case'] == '계좌이체' || $pp['pp_settle_case'] == '가상계좌')) {
?>
<tr>
<th scope="row">현금영수증</th>
<td>
<?php
if ($pp['pp_cash'])
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
switch($pp['pp_settle_case']) {
case '계좌이체':
$trade_type = 'BANK';
break;
case '가상계좌':
$trade_type = 'CAS';
break;
default:
$trade_type = 'CR';
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$pp['pp_id'].'\',\''.$pp['pp_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} 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\');';
} else {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
$cash = unserialize($pp['pp_cash_info']);
$cash_receipt_script = 'window.open(\''.G5_CASH_RECEIPT_URL.$default['de_kcp_mid'].'&orderid='.$pp_id.'&bill_yn=Y&authno='.$cash['receipt_no'].'\', \'taxsave_receipt\', \'width=360,height=647,scrollbars=0,menus=0\');';
}
?>
<a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a>
<?php
}
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?tx=personalpay&od_id=<?php echo $pp_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</section>
</section>
<section id="sod_fin_tot">
<h2>결제합계</h2>
<ul>
<li>
총 주문액
<strong><?php echo display_price($pp['pp_price']); ?></strong>
</li>
<?php
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>
<li id="alrdy">
결제액
<strong><?php echo $wanbul; ?></strong>
</li>
</ul>
</section>
<?php if ($pp['pp_settle_case'] == '가상계좌' && $pp['pp_receipt_price'] == 0 && $default['de_card_test'] && $is_admin && $pp['pp_pg'] == 'kcp') {
preg_match("/\s{1}([^\s]+)\s?/", $pp['pp_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<div class="tbl_frm01 tbl_wrap">
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<table>
<caption>모의입금처리</caption>
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="col"><label for="e_trade_no">KCP 거래번호</label></th>
<td><input type="text" name="e_trade_no" value="<?php echo $pp['pp_tno']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="deposit_no">입금계좌</label></th>
<td><input type="text" name="deposit_no" value="<?php echo $deposit_no; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="req_name">입금자명</label></th>
<td><input type="text" name="req_name" value="<?php echo $pp['pp_deposit_name']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="noti_url">입금통보 URL</label></th>
<td><input type="text" name="noti_url" value="<?php echo G5_SHOP_URL; ?>/settle_kcp_common.php"></td>
</tr>
</tbody>
</table>
<div id="sod_fin_test" class="btn_confirm">
<input type="submit" value="입금통보 테스트" class="btn_submit">
</div>
</form>
</div>
<?php } ?>
</div>
<!-- } 개인결제상세내역 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

245
mobile/shop/search.php Normal file
View File

@ -0,0 +1,245 @@
<?php
include_once('./_common.php');
$g5['title'] = "상품 검색 결과";
include_once(G5_MSHOP_PATH.'/_head.php');
// QUERY 문에 공통적으로 들어가는 내용
// 상품명에 검색어가 포한된것과 상품판매가능인것만
$sql_common = " from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b ";
$where = array();
$where[] = " (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) ";
$search_all = true;
// 상세검색 이라면
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']))
$search_all = false;
$q = utf8_strcut(get_search_string(trim($_GET['q'])), 30, "");
$qname = isset($_GET['qname']) ? trim($_GET['qname']) : '';
$qexplan = isset($_GET['qexplan']) ? trim($_GET['qexplan']) : '';
$qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
if (isset($_GET['qsort'])) {
$qsort = trim($_GET['qsort']);
$qsort = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $qsort);
} else {
$qsort = '';
}
if (isset($_GET['qorder'])) {
$qorder = preg_match("/^(asc|desc)$/i", $qorder) ? $qorder : '';
} else {
$qorder = '';
}
if(!($qname || $qexplan || $qid))
$search_all = true;
// 검색범위 checkbox 처리
$qname_check = false;
$qexplan_check = false;
$qid_check = false;
if($search_all) {
$qname_check = true;
$qexplan_check = true;
$qid_check = true;
} else {
if($qname)
$qname_check = true;
if($qexplan)
$qexplan_check = true;
if($qid)
$qid_check = true;
}
if ($q) {
$arr = explode(" ", $q);
$detail_where = array();
for ($i=0; $i<count($arr); $i++) {
$word = trim($arr[$i]);
if (!$word) continue;
$concat = array();
if ($search_all || $qname)
$concat[] = "a.it_name";
if ($search_all || $qexplan)
$concat[] = "a.it_explan2";
if ($search_all || $qid)
$concat[] = "a.it_id";
$concat_fields = "concat(".implode(",' ',",$concat).")";
$detail_where[] = $concat_fields." like '%$word%' ";
// 인기검색어
insert_popular($concat, $word);
}
$where[] = "(".implode(" and ", $detail_where).")";
}
if ($qcaid)
$where[] = " a.ca_id like '$qcaid%' ";
if ($qfrom && $qto)
$where[] = " a.it_price between '$qfrom' and '$qto' ";
$sql_where = " where " . implode(" and ", $where);
// 상품 출력순서가 있다면
$qsort = strtolower($qsort);
$qorder = strtolower($qorder);
$order_by = "";
// 아래의 $qsort 필드만 정렬이 가능하게 하여 다른 필드로 하여금 유추해 볼수 없게함
if (($qsort == "it_sum_qty" || $qsort == "it_price" || $qsort == "it_use_avg" || $qsort == "it_use_cnt" || $qsort == "it_update_time") &&
($qorder == "asc" || $qorder == "desc")) {
$order_by = ' order by ' . $qsort . ' ' . $qorder . ' , it_order, it_id desc';
}
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $default['de_mobile_search_list_mod'] * $default['de_mobile_search_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
// 검색된 내용이 몇행인지를 얻는다
$sql = " select COUNT(*) as cnt $sql_common $sql_where ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$total_page = ceil($total_count / $items); // 전체 페이지 계산
?>
<!-- 검색 시작 { -->
<div id="ssch">
<!-- 상세검색 항목 시작 { -->
<div id="ssch_frm">
<form name="frmdetailsearch">
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
<div>
<strong>검색범위</strong>
<input type="checkbox" name="qname" id="ssch_qname" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
<input type="checkbox" name="qexplan" id="ssch_qexplan" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan"><span class="sound_only">상품</span>설명</label>
<input type="checkbox" name="qid" id="ssch_qid" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid"><span class="sound_only">상품</span>코드</label><br>
</div>
<div>
<strong>상품가격 (원)</strong>
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input"> ~
<label for="ssch_qto" class="sound_only">최대 가격</label>
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input"> 까지<br>
</div>
<div>
<label for="ssch_q" class="ssch_lbl">검색어</label>
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" maxlength="30">
<input type="submit" value="검색" class="btn_submit">
</div>
<p>
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
</p>
</form>
<ul id="ssch_sort">
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
</ul>
<div id="ssch_ov">
검색 결과 <b><?php echo $total_count; ?></b>건
</div>
</div>
<!-- } 상세검색 항목 끝 -->
<!-- 검색된 분류 시작 { -->
<div id="ssch_cate">
<ul>
<?php
$sql = " select b.ca_id, b.ca_name, count(*) as cnt $sql_common $sql_where group by b.ca_id order by b.ca_id ";
$result = sql_query($sql);
$total_cnt = 0;
for ($i=0; $row=sql_fetch_array($result); $i++) {
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
$total_cnt += $row['cnt'];
}
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
?>
</ul>
</div>
<!-- } 검색된 분류 끝 -->
<!-- 검색결과 시작 { -->
<div>
<?php
// 리스트 유형별로 출력
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
$list_file = G5_MSHOP_SKIN_PATH.'/'.$default['de_mobile_search_list_skin'];
if (file_exists($list_file)) {
$list = new item_list($list_file, $default['de_mobile_search_list_mod'], $default['de_mobile_search_list_row'], $default['de_mobile_search_img_width'], $default['de_mobile_search_img_height']);
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
}
else
{
$i = 0;
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
}
if ($i==0)
{
echo '<div>'.$error.'</div>';
}
$query_string = 'qname='.$qname.'&amp;qexplan='.$qexplan.'&amp;qid='.$qid;
if($qfrom && $qto) $query_string .= '&amp;qfrom='.$qfrom.'&amp;qto='.$qto;
$query_string .= '&amp;qcaid='.$qcaid.'&amp;q='.urlencode($q);
$query_string .='&amp;qsort='.$qsort.'&amp;qorder='.$qorder;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&amp;page=');
?>
</div>
<!-- } 검색결과 끝 -->
</div>
<!-- } 검색 끝 -->
<script>
function set_sort(qsort, qorder)
{
var f = document.frmdetailsearch;
f.qsort.value = qsort;
f.qorder.value = qorder;
f.submit();
}
function set_ca_id(qcaid)
{
var f = document.frmdetailsearch;
f.qcaid.value = qcaid;
f.submit();
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -0,0 +1,97 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// curl 체크
if (!function_exists('curl_init')) {
alert('cURL 모듈이 설치되어 있지 않습니다.\\n상점관리자에게 문의해 주십시오.');
}
if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$default['de_inicis_mid'] = 'iniescrow0';
$default['de_inicis_admin_key'] = '1111';
}
else {
// 일반결제 테스트
$default['de_inicis_mid'] = 'INIpayTest';
$default['de_inicis_admin_key'] = '1111';
}
}
else {
$default['de_inicis_mid'] = "SIR".$default['de_inicis_mid'];
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$useescrow = '&useescrow=Y';
}
else {
// 일반결제 테스트
$useescrow = '';
}
}
$BANK_CODE = array(
'03' => '기업은행',
'04' => '국민은행',
'05' => '외환은행',
'07' => '수협중앙회',
'11' => '농협중앙회',
'20' => '우리은행',
'23' => 'SC 제일은행',
'31' => '대구은행',
'32' => '부산은행',
'34' => '광주은행',
'37' => '전북은행',
'39' => '경남은행',
'53' => '한국씨티은행',
'71' => '우체국',
'81' => '하나은행',
'88' => '신한은행',
'D1' => '동양종합금융증권',
'D2' => '현대증권',
'D3' => '미래에셋증권',
'D4' => '한국투자증권',
'D5' => '우리투자증권',
'D6' => '하이투자증권',
'D7' => 'HMC 투자증권',
'D8' => 'SK 증권',
'D9' => '대신증권',
'DA' => '하나대투증권',
'DB' => '굿모닝신한증권',
'DC' => '동부증권',
'DD' => '유진투자증권',
'DE' => '메리츠증권',
'DF' => '신영증권'
);
$CARD_CODE = array(
'01' => '외환',
'03' => '롯데',
'04' => '현대',
'06' => '국민',
'11' => 'BC',
'12' => '삼성',
'14' => '신한',
'15' => '한미',
'16' => 'NH',
'17' => '하나 SK',
'21' => '해외비자',
'22' => '해외마스터',
'23' => 'JCB',
'24' => '해외아멕스',
'25' => '해외다이너스'
);
$PAY_METHOD = array(
'ISP' => '신용카드',
'CARD' => '신용카드',
'BANK' => '계좌이체',
'MOBILE' => '휴대폰',
'VBANK' => '가상계좌'
);
$noti_url = G5_MSHOP_URL.'/inicis/settle_common.php';
$next_url = G5_MSHOP_URL.'/inicis/pay_approval.php';
$return_url = G5_MSHOP_URL.'/inicis/pay_return.php?oid=';
?>

View File

@ -0,0 +1,57 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$g_conf_home_dir = G5_SHOP_PATH.'/kcp'; // BIN 절대경로 입력 (bin전까지)
$g_conf_site_name = $default['de_admin_company_name'];
$g_conf_log_level = '3'; // 변경불가
$g_conf_gw_port = '8090'; // 포트번호(변경불가)
$g_conf_key_dir = '';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$g_conf_log_dir = G5_SHOP_PATH.'/kcp/log';
$g_conf_key_dir = G5_SHOP_PATH.'/kcp/bin/pub.key';
}
if ($default['de_card_test']) {
// 결제 테스트
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$default['de_kcp_mid'] = "T0007";
$default['de_kcp_site_key'] = '4Ho4YsuOZlLXUZUdOxM1Q7X__';
}
else {
// 일반결제 테스트
$default['de_kcp_mid'] = "T0000";
$default['de_kcp_site_key'] = '3grptw1.zW0GSo4PQdaGvsF__';
}
$g_wsdl = "KCPPaymentService.wsdl";
$g_conf_gw_url = "testpaygw.kcp.co.kr";
}
else {
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
$g_wsdl = "real_KCPPaymentService.wsdl";
$g_conf_gw_url = "paygw.kcp.co.kr";
}
$g_conf_site_cd = $default['de_kcp_mid'];
$g_conf_site_key = $default['de_kcp_site_key'];
// 테스트 결제 때 PAYCO site_cd, site_key 재설정
if($default['de_card_test'] && ($_POST['settle_method'] == '간편결제' || $_POST['od_settle_case'] == '간편결제')) {
$g_conf_site_cd = 'S6729';
$g_conf_site_key = '';
}
if(!(preg_match("/^T000/", $g_conf_site_cd) || $default['de_card_test'])) {
if (!preg_match("/^SR/", $g_conf_site_cd)) {
alert("SR 로 시작하지 않는 KCP SITE CODE 는 지원하지 않습니다.");
}
}
// KCP SITE KEY 입력 체크
if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use']) {
if(trim($default['de_kcp_site_key']) == '')
alert('KCP SITE KEY를 입력해 주십시오.');
}
?>

View File

@ -0,0 +1,35 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
require_once(G5_LGXPAY_PATH.'/lgdacom/XPayClient.php');
class XPay extends XPayClient
{
public function set_config_value($key, $val)
{
$this->config[$key] = $val;
}
}
/*
* 1. 기본결제 인증요청 정보 변경
*
* 기본정보를 변경하여 주시기 바랍니다.(파라미터 전달시 POST를 사용하세요)
*/
$CST_PLATFORM = $default['de_card_test'] ? 'test' : 'service'; //LG유플러스 결제 서비스 선택(test:테스트, service:서비스)
$CST_MID = 'si_'.$config['cf_lg_mid']; //상점아이디(LG유플러스으로 부터 발급받으신 상점아이디를 입력하세요)
//테스트 아이디는 't'를 반드시 제외하고 입력하세요.
$LGD_MID = (('test' == $CST_PLATFORM) ? 't' : '').$CST_MID; //상점아이디(자동생성)
$LGD_TIMESTAMP = date('YmdHis'); //타임스탬프
$LGD_BUYERIP = $_SERVER['REMOTE_ADDR']; //구매자IP
$LGD_BUYERID = ''; //구매자ID
$LGD_CUSTOM_SKIN = 'SMART_XPAY2'; //상점정의 결제창 스킨 (red, purple, yellow)
$LGD_MERTKEY = ''; //상점MertKey(mertkey는 상점관리자 -> 계약정보 -> 상점정보관리에서 확인하실수 있습니다)
$configPath = G5_LGXPAY_PATH.'/lgdacom'; //LG유플러스에서 제공한 환경파일("/conf/lgdacom.conf") 위치 지정.
/*
* 가상계좌(무통장) 결제 연동을 하시는 경우 아래 LGD_CASNOTEURL 을 설정하여 주시기 바랍니다.
*/
$LGD_CASNOTEURL = G5_SHOP_URL.'/settle_lg_common.php';
?>

93
mobile/shop/shop.head.php Normal file
View File

@ -0,0 +1,93 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_MSHOP_PATH.'/shop.head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
?>
<header id="hd">
<?php if ((!$bo_table || $w == 's' ) && defined('_INDEX_')) { ?><h1><?php echo $config['cf_title'] ?></h1><?php } ?>
<div id="skip_to_container"><a href="#container">본문 바로가기</a></div>
<?php if(defined('_INDEX_')) { // index에서만 실행
include G5_MOBILE_PATH.'/newwin.inc.php'; // 팝업레이어
} ?>
<ul id="hd_tnb">
<?php if ($is_member) { ?>
<?php if ($is_admin) { ?>
<li><a href="<?php echo G5_ADMIN_URL ?>/shop_admin/"><b>관리자</b></a></li>
<?php } else { ?>
<li><a href="<?php echo G5_BBS_URL; ?>/member_confirm.php?url=register_form.php">정보수정</a></li>
<?php } ?>
<li><a href="<?php echo G5_BBS_URL; ?>/logout.php?url=shop">LOGOUT</a></li>
<?php } else { ?>
<li><a href="<?php echo G5_BBS_URL; ?>/login.php?url=<?php echo $urlencode; ?>">LOGIN</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/register.php" id="snb_join">JOIN</a></li>
<?php } ?>
<li><a href="<?php echo G5_SHOP_URL; ?>/mypage.php">MY PAGE</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/cart.php" class="tnb_cart"><span></span>CART</a></li>
</ul>
<div id="logo"><a href="<?php echo G5_SHOP_URL; ?>/"><img src="<?php echo G5_DATA_URL; ?>/common/mobile_logo_img" alt="<?php echo $config['cf_title']; ?> 메인"></a></div>
<?php include_once(G5_MSHOP_PATH.'/category.php'); // 분류 ?>
<button type="button" id="hd_sch_open">검색<span class="sound_only"> 열기</span></button>
<form name="frmsearch1" action="<?php echo G5_SHOP_URL; ?>/search.php" onsubmit="return search_submit(this);">
<aside id="hd_sch">
<div class="sch_inner">
<h2>상품 검색</h2>
<label for="sch_str" class="sound_only">상품명<strong class="sound_only"> 필수</strong></label>
<input type="text" name="q" value="<?php echo stripslashes(get_text(get_search_string($q))); ?>" id="sch_str" required class="frm_input">
<input type="submit" value="검색" class="btn_submit">
<button type="button" class="pop_close"><span class="sound_only">검색 </span>닫기</button>
</div>
</aside>
</form>
<script>
$(function (){
var $hd_sch = $("#hd_sch");
$("#hd_sch_open").click(function(){
$hd_sch.css("display","block");
});
$("#hd_sch .pop_close").click(function(){
$hd_sch.css("display","none");
});
});
function search_submit(f) {
if (f.q.value.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.q.select();
f.q.focus();
return false;
}
return true;
}
</script>
<ul id="hd_mb">
<li><a href="<?php echo G5_BBS_URL; ?>/faq.php">FAQ</a></li>
<li><a href="<?php echo G5_BBS_URL; ?>/qalist.php">1:1문의</a></li>
<li><a href="<?php echo G5_URL; ?>/">커뮤니티</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/personalpay.php">개인결제</a></li>
</ul>
</header>
<div id="container">
<?php if ((!$bo_table || $w == 's' ) && !defined('_INDEX_')) { ?><h1 id="container_title"><?php echo $g5['title'] ?></h1><?php } ?>

49
mobile/shop/shop.tail.php Normal file
View File

@ -0,0 +1,49 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_MSHOP_PATH.'/shop.tail.php');
return;
}
$admin = get_admin("super");
// 사용자 화면 우측과 하단을 담당하는 페이지입니다.
// 우측, 하단 화면을 꾸미려면 이 파일을 수정합니다.
?>
</div><!-- container End -->
<div id="ft">
<h2><?php echo $config['cf_title']; ?> 정보</h2>
<p>
<span><b>회사명</b> <?php echo $default['de_admin_company_name']; ?></span>
<span><b>주소</b> <?php echo $default['de_admin_company_addr']; ?></span><br>
<span><b>사업자 등록번호</b> <?php echo $default['de_admin_company_saupja_no']; ?></span><br>
<span><b>대표</b> <?php echo $default['de_admin_company_owner']; ?></span>
<span><b>전화</b> <?php echo $default['de_admin_company_tel']; ?></span>
<span><b>팩스</b> <?php echo $default['de_admin_company_fax']; ?></span><br>
<!-- <span><b>운영자</b> <?php echo $admin['mb_name']; ?></span><br> -->
<span><b>통신판매업신고번호</b> <?php echo $default['de_admin_tongsin_no']; ?></span><br>
<span><b>개인정보관리책임자</b> <?php echo $default['de_admin_info_name']; ?></span>
<?php if ($default['de_admin_buga_no']) echo '<span><b>부가통신사업신고번호</b> '.$default['de_admin_buga_no'].'</span>'; ?><br>
Copyright &copy; 2001-2013 <?php echo $default['de_admin_company_name']; ?>. All Rights Reserved.
</p>
<a href="#" id="ft_to_top">상단으로</a>
</div>
<?php
$sec = get_microtime() - $begin_time;
$file = $_SERVER['SCRIPT_NAME'];
if ($config['cf_analytics']) {
echo $config['cf_analytics'];
}
?>
<script src="<?php echo G5_JS_URL; ?>/sns.js"></script>
<?php
include_once(G5_PATH.'/tail.sub.php');
?>

130
mobile/shop/wishlist.php Normal file
View File

@ -0,0 +1,130 @@
<?php
include_once('./_common.php');
if (!$is_member)
goto_url(G5_BBS_URL."/login.php?url=".urlencode(G5_SHOP_URL.'/wishlist.php'));
$g5['title'] = "위시리스트";
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<div id="sod_ws">
<form name="fwishlist" method="post" action="./cartupdate.php">
<input type="hidden" name="act" value="multi">
<input type="hidden" name="sw_direct" value="">
<input type="hidden" name="prog" value="wish">
<ul id="wish_li">
<?php
$sql = " select a.wi_id, a.wi_time, b.*
from {$g5['g5_shop_wish_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.mb_id = '{$member['mb_id']}'
order by a.wi_id desc ";
$result = sql_query($sql);
for ($i=0; $row = mysql_fetch_array($result); $i++) {
$out_cd = '';
$sql = " select count(*) as cnt from {$g5['g5_shop_item_option_table']} where it_id = '{$row['it_id']}' and io_type = '0' ";
$tmp = sql_fetch($sql);
if($tmp['cnt'])
$out_cd = 'no';
$it_price = get_price($row);
if ($row['it_tel_inq']) $out_cd = 'tel_inq';
$image = get_it_image($row['it_id'], 50, 50);
?>
<li>
<div class="wish_img"><?php echo $image; ?></div>
<div class="wish_info">
<a href="<?php echo G5_SHOP_URL; ?>/item.php?it_id=<?php echo $row['it_id']; ?>"><?php echo stripslashes($row['it_name']); ?></a>
<span class="info_date">보관일 <?php echo substr($row['wi_time'], 2, 8); ?></span>
</div>
<div class="wish_chk">
<?php
// 품절검사
if(is_soldout($row['it_id']))
{
?>
<span class="sold_out">품절</span>
<?php } else { //품절이 아니면 체크할수 있도록한다 ?>
<input type="checkbox" name="chk_it_id[<?php echo $i; ?>]" value="1" onclick="out_cd_check(this, '<?php echo $out_cd; ?>');">
<?php } ?>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="io_type[<?php echo $row['it_id']; ?>][0]" value="0">
<input type="hidden" name="io_id[<?php echo $row['it_id']; ?>][0]" value="">
<input type="hidden" name="io_value[<?php echo $row['it_id']; ?>][0]" value="<?php echo $row['it_name']; ?>">
<input type="hidden" name="ct_qty[<?php echo $row['it_id']; ?>][0]" value="1">
</div>
<span class="wish_del"><a href="<?php echo G5_SHOP_URL; ?>/wishupdate.php?w=d&amp;wi_id=<?php echo $row['wi_id']; ?>">삭제</a></span>
</li>
<?php
}
if ($i == 0)
echo '<li class="empty_table">위시리스트가 비었습니다.</li>';
?>
</ul>
<div id="sod_ws_act">
<button type="submit" class="btn02" onclick="return fwishlist_check(document.fwishlist,'direct_buy');">BUY NOW</button>
<button type="submit" class="btn01" onclick="return fwishlist_check(document.fwishlist,'');">CART</button>
</div>
</form>
</div>
<script>
<!--
function out_cd_check(fld, out_cd)
{
if (out_cd == 'no'){
alert("옵션이 있는 상품입니다.\n\n상품을 클릭하여 상품페이지에서 옵션을 선택한 후 주문하십시오.");
fld.checked = false;
return;
}
if (out_cd == 'tel_inq'){
alert("이 상품은 전화로 문의해 주십시오.\n\n장바구니에 담아 구입하실 수 없습니다.");
fld.checked = false;
return;
}
}
function fwishlist_check(f, act)
{
var k = 0;
var length = f.elements.length;
for(i=0; i<length; i++) {
if (f.elements[i].checked) {
k++;
}
}
if(k == 0)
{
alert("상품을 하나 이상 체크 하십시오");
return false;
}
if (act == "direct_buy")
{
f.sw_direct.value = 1;
}
else
{
f.sw_direct.value = 0;
}
return true;
}
//-->
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
?>

View File

@ -35,12 +35,79 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
</div>
</section>
</form>
<?php // 쇼핑몰 사용시 여기부터 ?>
<?php if ($default['de_level_sell'] == 1) { // 상품구입 권한 ?>
<!-- 주문하기, 신청하기 -->
<?php if (preg_match("/orderform.php/", $url)) { ?>
<section id="mb_login_notmb">
<h2>비회원 구매</h2>
<p>
비회원으로 주문하시는 경우 포인트는 지급하지 않습니다.
</p>
<div id="guest_privacy">
<?php echo $default['de_guest_privacy']; ?>
</div>
<label for="agree">개인정보수집에 대한 내용을 읽었으며 이에 동의합니다.</label>
<input type="checkbox" id="agree" value="1">
<div class="btn_confirm">
<a href="javascript:guest_submit(document.flogin);" class="btn02">비회원으로 구매하기</a>
</div>
<script>
function guest_submit(f)
{
if (document.getElementById('agree')) {
if (!document.getElementById('agree').checked) {
alert("개인정보수집에 대한 내용을 읽고 이에 동의하셔야 합니다.");
return;
}
}
f.url.value = "<?php echo $url; ?>";
f.action = "<?php echo $url; ?>";
f.submit();
}
</script>
</section>
<?php } else if (preg_match("/orderinquiry.php$/", $url)) { ?>
<fieldset id="mb_login_od">
<legend>비회원 주문조회</legend>
<form name="forderinquiry" method="post" action="<?php echo urldecode($url); ?>" autocomplete="off">
<label for="od_id" class="od_id sound_only">주문번호<strong class="sound_only"> 필수</strong></label>
<input type="text" name="od_id" value="<?php echo $od_id ?>" id="od_id" placeholder="주문번호" required class="frm_input required" size="20">
<label for="id_pwd" class="od_pwd sound_only">비밀번호<strong class="sound_only"> 필수</strong></label>
<input type="password" name="od_pwd" size="20" id="od_pwd" placeholder="비밀번호" required class="frm_input required">
<input type="submit" value="확인" class="btn_submit">
</form>
</fieldset>
<section id="mb_login_odinfo">
<h2>비회원 주문조회 안내</h2>
<p>메일로 발송해드린 주문서의 <strong>주문번호</strong> 및 주문 시 입력하신 <strong>비밀번호</strong>를 정확히 입력해주십시오.</p>
</section>
<?php } ?>
<?php } ?>
<?php // 쇼핑몰 사용시 여기까지 반드시 복사해 넣으세요 ?>
<div class="btn_confirm">
<a href="<?php echo G5_URL ?>/">메인으로 돌아가기</a>
</div>
</form>
</div>
<script>

View File

@ -0,0 +1,32 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//----------------------------------------------------------
// SMS 문자전송 시작
//----------------------------------------------------------
$sms_contents = $default['de_sms_cont1'];
$sms_contents = str_replace("{이름}", $mb_name, $sms_contents);
$sms_contents = str_replace("{회원아이디}", $mb_id, $sms_contents);
$sms_contents = str_replace("{회사명}", $default['de_admin_company_name'], $sms_contents);
// 핸드폰번호에서 숫자만 취한다
$receive_number = preg_replace("/[^0-9]/", "", $mb_hp); // 수신자번호 (회원님의 핸드폰번호)
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
if ($w == "" && $default['de_sms_use1'] && $receive_number)
{
if ($config['cf_sms_use'] == 'icode')
{
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
$SMS = new SMS; // SMS 연결
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_contents)), "");
$SMS->Send();
}
}
//----------------------------------------------------------
// SMS 문자전송 끝
//----------------------------------------------------------
?>

View File

@ -37,6 +37,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
감사합니다.
</p>
<?php if($default['de_member_reg_coupon_use'] && get_session('ss_member_reg_coupon') == 1) { ?>
<p id="result_coupon">
<?php echo $mb['mb_name']; ?>님께 주문시 사용하실 수 있는 <strong><?php echo display_price($default['de_member_reg_coupon_price']); ?> 할인<?php echo ($default['de_member_reg_coupon_minimum'] ? '(주문금액 '.display_price($default['de_member_reg_coupon_minimum']).' 이상)' : ''); ?> 쿠폰</strong>이 발행됐습니다.<br>
발행된 할인 쿠폰 내역은 마이페이지에서 확인하실 수 있습니다.
</p>
<?php } ?>
<div class="btn_confirm">
<a href="<?php echo G5_URL ?>/" class="btn02">메인으로</a>
</div>

View File

@ -97,6 +97,8 @@
#reg_result #result_email {margin:20px 0;padding:10px 50px;border-top:1px solid #eee;border-bottom:1px solid #eee;background:#fff;line-height:2em}
#reg_result #result_email span {display:inline-block;width:150px}
#reg_result #result_email strong {color:#e8180c;font-size:1.2em}
#reg_result #result_coupon {margin:20px 0;padding:10px 50px;border-top:1px solid #eee;border-bottom:1px solid #eee;background:#fff;line-height:2em}
#reg_result #result_coupon strong {color:#ff3061;font-weight:normal}
#reg_result p {line-height:1.8em}
#reg_result .btn_confirm {margin:50px 0}
@ -119,6 +121,19 @@
#mb_login section {margin:30px 0;padding:15px 10px;border:1px solid #cfded8;background:#f7f7f7}
#mb_login section div {text-align:right}
#mb_login_notmb {margin:30px 0;padding:15px 10px;border:1px solid #cfded8;background:#f7f7f7}
#mb_login_notmb #guest_privacy {margin:0 0 10px;padding:10px;height:150px;border:1px solid #e9e9e9;background:#fff;overflow:auto}
#mb_login_notmb .btn_confirm {margin:20px 0 0;text-align:right}
#mb_login_od {position:relative;margin:20px 5px;border-bottom:0;background:#fff}
#mb_login_od legend {position:absolute;font-size:0;line-height:0;overflow:hidden}
#mb_login_od .od_id {position:absolute;top:26px;left:95px}
#mb_login_od .od_pwd {position:absolute;top:52px;left:95px}
#mb_login_od .frm_input {display:block;margin-bottom:5px;padding:0;width:80%;height:1.8em;line-height:1.8em}
#mb_login_od .btn_submit {position:absolute;top:0;right:0;padding:0 !important;width:18%;height:4em !important;text-align:center}
#mb_login_odinfo {margin:0 0 30px;padding:20px;border:1px solid #cfded8;background:#f7f7f7}
#mb_login_odinfo div {text-align:right}
/* 쪽지 */
#memo_view_contents {margin:0 auto 20px;width:90%}
#memo_view_contents h1 {position:absolute;font-size:0;line-height:0;overflow:hidden}
@ -187,4 +202,5 @@
#profile table {margin-bottom:0}
#profile section {padding:10px 20px}
#profile h2 {margin:0}
#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px}

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

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