Merge branch 'master' of github.com:gnuboard/yc4s

This commit is contained in:
rollydream
2013-03-26 15:02:04 +09:00
25 changed files with 160 additions and 101 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
data
dbconfig.php
log

View File

@ -757,9 +757,9 @@ $pg_anchor ="<ul class=\"anchor\">
</tr>
<tr>
<th scope="row">MYSQL USER</th>
<td><br/><?=$mysql_user?></td>
<td><?=G4_MYSQL_USER?></td>
<th scope="row">MYSQL DB</th>
<td><br/><?=$mysql_db?></td>
<td><?=G4_MYSQL_DB?></td>
</tr>
<tr>
<th scope="row">서버 IP</th>
@ -860,7 +860,7 @@ function byte_check(el_cont, el_byte)
</ul>
</div>
<script>
<script>
byte_check('de_sms_cont<?=$i?>', 'byte<?=$i?>');
</script>
<? } ?>

View File

@ -34,7 +34,7 @@ if ($sel_ca_id != "") {
if ($sel_field == "") $sel_field = "od_id";
$sql_common = " from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (a.on_uid=b.on_uid)
left join {$g4['yc4_cart_table']} b on (a.uq_id=b.uq_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@ -154,7 +154,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$list = $i%2;
echo "
<input type='hidden' name='od_id[$i]' value='{$row['od_id']}'>
<input type='hidden' name='on_uid[$i]' value='{$row['on_uid']}'>
<input type='hidden' name='uq_id[$i]' value='{$row['uq_id']}'>
<tr class='list$list center ht'>
<td><a href='./orderform.php?od_id={$row['od_id']}'>{$row['od_id']}</a></td>
<td>$row[od_name]</td>

View File

@ -36,18 +36,18 @@ for ($m=0; $m<count($_POST['od_id']); $m++)
$od_id = $_POST['od_id'][$m];
// 장바구니 상태가 '주문', '준비' 일 경우 '배송' 으로 상태를 변경
$on_uid = $_POST['on_uid'][$m];
$uq_id = $_POST['uq_id'][$m];
$sql = " update {$g4['yc4_cart_table']}
set ct_status = '배송'
where ct_status in ('주문', '준비')
and on_uid = '$on_uid' ";
and uq_id = '$uq_id' ";
sql_query($sql);
include "./ordermail.inc.php";
// 재고 반영
$sql2 = " select it_id, ct_id, ct_stock_use, ct_qty from {$g4['yc4_cart_table']}
where on_uid = '$on_uid'
where uq_id = '$uq_id'
and ct_stock_use = '0' ";
$result2 = sql_query($sql2);
for ($k=0; $row2=mysql_fetch_array($result2); $k++)
@ -58,7 +58,7 @@ for ($m=0; $m<count($_POST['od_id']); $m++)
$sql4 = " update {$g4['yc4_cart_table']}
set ct_stock_use = '1',
ct_history = CONCAT(ct_history,'\n배송일괄|$now|$REMOTE_ADDR')
where on_uid = '$on_uid'
where uq_id = '$uq_id'
and ct_id = '{$row2['ct_id']}' ";
sql_query($sql4);
}

View File

@ -33,7 +33,7 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (b.on_uid=a.on_uid)
left join {$g4['yc4_cart_table']} b on (b.uq_id=a.uq_id)
group by a.od_id
/*having misu <= 0 and a.od_invoice = '' and ordercancel = 0*/
/*having orderamount - receiptamount = 0 and a.od_invoice = ''*/
@ -103,7 +103,7 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (b.on_uid=a.on_uid)
left join {$g4['yc4_cart_table']} b on (b.uq_id=a.uq_id)
group by a.od_id
/* having receiptamount <= 0 */
having misu > 0

View File

@ -23,7 +23,7 @@ while (($item = fgetcsv($handle, 1000, ",")) !== FALSE)
if ($od_id && $od_invoice)
{
$sql = " select od_id, on_uid, dl_id, od_invoice from {$g4['yc4_order_table']} where od_id = '$od_id' ";
$sql = " select od_id, uq_id, dl_id, od_invoice from {$g4['yc4_order_table']} where od_id = '$od_id' ";
$row = sql_fetch($sql);
//echo $sql; echo "<br/>";
//print_r2($row);
@ -44,7 +44,7 @@ while (($item = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$sql = " update {$g4['yc4_cart_table']}
set ct_status = '$ct_status'
where on_uid = '{$row['on_uid']}'
where uq_id = '{$row['uq_id']}'
and ct_status in ('주문', '준비', '배송', '완료') ";
sql_query($sql);
}

View File

@ -20,7 +20,7 @@ function itemdelete($it_id)
$sql = " select b.od_id
from {$g4['yc4_cart_table']} a,
{$g4['yc4_order_table']} b
where a.on_uid = b.on_uid
where a.uq_id = b.uq_id
and a.it_id = '$it_id'
and a.ct_status != '쇼핑' ";
$result = sql_query($sql);

View File

@ -12,7 +12,7 @@ for ($i=0; $i<$cnt; $i++)
$ct_id = $_POST['ct_id'][$i];
$sql = " select * from {$g4['yc4_cart_table']}
where on_uid = '$on_uid'
where uq_id = '$uq_id'
and ct_id = '$ct_id' ";
$ct = sql_fetch($sql);
@ -55,7 +55,7 @@ for ($i=0; $i<$cnt; $i++)
{
$point_use = 0;
//insert_point($mb_id, (-1) * ($ct[ct_point] * $ct[ct_qty]), "주문번호 $od_id ($ct_id) 취소");
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$on_uid,$ct_id");
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$uq_id,$ct_id");
}
// 히스토리에 남김
@ -67,7 +67,7 @@ for ($i=0; $i<$cnt; $i++)
ct_stock_use = '$stock_use',
ct_status = '$ct_status',
ct_history = CONCAT(ct_history,'$ct_history')
where on_uid = '$on_uid'
where uq_id = '$uq_id'
and ct_id = '$ct_id' ";
sql_query($sql);
}

View File

@ -6,16 +6,16 @@ check_demo();
auth_check($auth[$sub_menu], "d");
if ($od_id && $on_uid)
if ($od_id && $uq_id)
{
// 장바구니 삭제
sql_query(" delete from {$g4['yc4_cart_table']} where on_uid = '$on_uid' ");
sql_query(" delete from {$g4['yc4_cart_table']} where uq_id = '$uq_id' ");
// 카드결제내역 삭제
sql_query(" delete from {$g4['yc4_card_history_table']} where od_id = '$od_id' and on_uid = '$on_uid' ");
sql_query(" delete from {$g4['yc4_card_history_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
// 주문서 삭제
sql_query(" delete from {$g4['yc4_order_table']} where od_id = '$od_id' and on_uid = '$on_uid' ");
sql_query(" delete from {$g4['yc4_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
}
if ($return_url)

View File

@ -45,14 +45,14 @@ if (!isset($order_not_point)) {
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 회원 ID 를 얻는다.
$tmp_row = sql_fetch("select od_id, mb_id from {$g4['yc4_order_table']} where on_uid = '{$row['on_uid']}' ");
$tmp_row = sql_fetch("select od_id, mb_id from {$g4['yc4_order_table']} where uq_id = '{$row['uq_id']}' ");
// 회원이면서 포인트가 0보다 크다면
if ($tmp_row['mb_id'] && $row['ct_point'] > 0)
{
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['on_uid']},{$row['ct_id']}");
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['uq_id']},{$row['ct_id']}");
}
sql_query("update {$g4['yc4_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");
@ -103,7 +103,7 @@ $sql = " select a.ct_id,
a.it_opt6,
b.it_name
from {$g4['yc4_cart_table']} a, {$g4['yc4_item_table']} b
where a.on_uid = '{$od['on_uid']}'
where a.uq_id = '{$od['uq_id']}'
and a.it_id = b.it_id
order by a.ct_id ";
$result = sql_query($sql);
@ -125,7 +125,7 @@ $result = sql_query($sql);
<form name=frmorderform method=post action='' style="margin:0px;">
<input type=hidden name=ct_status value=''>
<input type=hidden name=on_uid value='<? echo $od['on_uid'] ?>'>
<input type=hidden name=uq_id value='<? echo $od['uq_id'] ?>'>
<input type=hidden name=od_id value='<? echo $od_id ?>'>
<input type=hidden name=mb_id value='<? echo $od['mb_id'] ?>'>
<input type=hidden name=od_email value='<? echo $od['od_email'] ?>'>
@ -236,7 +236,7 @@ if ($od['od_receipt_point'] > 0)
<table width=100% cellpadding=0 cellspacing=0 border=0>
<!-- on_uid : <? echo $od[on_uid] ?> -->
<!-- uq_id : <? echo $od[uq_id] ?> -->
<tr><td colspan=8 height=2 bgcolor=#0E87F9></td></tr>
<tr align=center class=ht>
<td>주문번호</td>
@ -425,7 +425,7 @@ if ($od['od_receipt_point'] > 0)
if ($od["od_cash"])
echo "<a href=\"javascript:;\" onclick=\"window.open('https://admin.kcp.co.kr/Modules/Service/Cash/Cash_Bill_Common_View.jsp?cash_no={$od['od_cash_no']}', 'taxsave_receipt', 'width=360,height=647,scrollbars=0,menus=0');\">현금영수증 확인하기</a>";
else
echo "<a href=\"javascript:;\" onclick=\"window.open('".G4_SHOP_URL."/taxsave_kcp.php?od_id=$od_id&on_uid={$od['on_uid']}', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');\">현금영수증을 발급하시려면 클릭하십시오.</a>";
echo "<a href=\"javascript:;\" onclick=\"window.open('".G4_SHOP_URL."/taxsave_kcp.php?od_id=$od_id&uq_id={$od['uq_id']}', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');\">현금영수증을 발급하시려면 클릭하십시오.</a>";
echo "</td></tr>";
}
}
@ -765,7 +765,7 @@ if ($od['od_receipt_point'] > 0)
<p align=center>
<input type=submit class=btn1 value='주소정보 수정'>&nbsp;
<input type=button class=btn1 value=' 목 록 ' accesskey='l' onclick="document.location.href='./orderlist.php?<?=$qstr?>';">&nbsp;
<input type=button class=btn1 value='주문서 삭제' onclick="del('<?="./orderdelete.php?od_id={$od['od_id']}&on_uid={$od['on_uid']}&mb_id={$od['mb_id']}&$qstr"?>');">
<input type=button class=btn1 value='주문서 삭제' onclick="del('<?="./orderdelete.php?od_id={$od['od_id']}&uq_id={$od['uq_id']}&mb_id={$od['mb_id']}&$qstr"?>');">
</form>
<script language='javascript'>

View File

@ -26,7 +26,7 @@ if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (a.on_uid=b.on_uid)
left join {$g4['yc4_cart_table']} b on (a.uq_id=b.uq_id)
$sql_search ";
// 김선용 200805 : 조인 사용으로 전체카운트가 일정레코드 이상일 때 지연시간 문제가 심각하므로 변경
@ -168,7 +168,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$s_receipt_way .= $s_br."포인트";
$s_mod = icon("수정", "./orderform.php?od_id=$row[od_id]&$qstr");
$s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id={$row['od_id']}&on_uid={$row['on_uid']}&mb_id={$row['mb_id']}&$qstr');");
$s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id={$row['od_id']}&uq_id={$row['uq_id']}&mb_id={$row['mb_id']}&$qstr');");
$mb_nick = get_sideview($row['mb_id'], $row['od_name'], $row['od_email'], '');
@ -183,7 +183,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$list = $i%2;
echo "
<tr class='list$list ht'>
<td align=center title='주문일시 : {$row['od_time']}'><a href='".G4_SHOP_URL."/orderinquiryview.php?od_id={$row['od_id']}&on_uid={$row['on_uid']}'>{$row['od_id']}</a></td>
<td align=center title='주문일시 : {$row['od_time']}'><a href='".G4_SHOP_URL."/orderinquiryview.php?od_id={$row['od_id']}&uq_id={$row['uq_id']}'>{$row['od_id']}</a></td>
<!-- <td align=center><a href='{$_SERVER['PHP_SELF']}?sort1=$sort1&sort2=$sort2&sel_field=od_name&search={$row['od_name']}'><span title='$od_deposit_name'>".cut_str($row['od_name'],8,"")."</span></a></td> -->
<td align=center>$mb_nick</td>
<td align=center><a href='{$_SERVER['PHP_SELF']}?sort1=$sort1&sort2=$sort2&sel_field=mb_id&search={$row['mb_id']}'>{$row['mb_id']}</a></td>

View File

@ -26,7 +26,7 @@ if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (a.on_uid=b.on_uid)
left join {$g4['yc4_cart_table']} b on (a.uq_id=b.uq_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@ -163,7 +163,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$s_receipt_way .= $s_br."포인트";
$s_mod = icon("수정", "./orderform.php?od_id={$row['od_id']}&$qstr");
$s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id={$row['od_id']}&on_uid={$row['on_uid']}&mb_id={$row['mb_id']}&$qstr&list=2');");
$s_del = icon("삭제", "javascript:del('./orderdelete.php?od_id={$row['od_id']}&uq_id={$row['uq_id']}&mb_id={$row['mb_id']}&$qstr&list=2');");
if ($i>0)
echo "<tr><td colspan=12 height=1 bgcolor='#CCCCCC'></td></tr>";
@ -171,7 +171,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$list = $i%2;
echo "
<tr class='list$list ht'>
<td align=center title='주문일시 : {$row['od_time']}'><a href='".G4_SHOP_URL."/orderinquiryview.php?od_id={$row['od_id']}&on_uid={$row['on_uid']}'>{$row['od_id']}</a></td>
<td align=center title='주문일시 : {$row['od_time']}'><a href='".G4_SHOP_URL."/orderinquiryview.php?od_id={$row['od_id']}&uq_id={$row['uq_id']}'>{$row['od_id']}</a></td>
<td align=center><a href='{$_SERVER['PHP_SELF']}?sort1=$sort1&sort2=$sort2&sel_field=od_name&search={$row['od_name']}'><span title='$od_deposit_name'>".cut_str($row['od_name'],30,"")."</span></a></td>
<td align=center><a href='{$_SERVER['PHP_SELF']}?sort1=$sort1&sort2=$sort2&sel_field=mb_id&search={$row['mb_id']}'>{$row['mb_id']}</a></td>
<td align=center>{$row['itemcount']}건</td>
@ -197,7 +197,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql2 = " select c.it_name,
b.*
from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (a.on_uid = b.on_uid)
left join {$g4['yc4_cart_table']} b on (a.uq_id = b.uq_id)
left join {$g4['yc4_item_table']} c on (b.it_id = c.it_id)
where od_id = '{$row['od_id']}' ";
$result2 = sql_query($sql2);

View File

@ -26,7 +26,7 @@ if ($od_send_mail)
b.it_opt5_subject,
b.it_opt6_subject
from {$g4['yc4_cart_table']} a inner join {$g4['yc4_item_table']} b on (b.it_id=a.it_id)
where a.on_uid = '{$od['on_uid']}'
where a.uq_id = '{$od['uq_id']}'
order by a.ct_id ";
$result = sql_query($sql);
for ($i=0; $ct=mysql_fetch_array($result); $i++) {

View File

@ -41,7 +41,7 @@ if ($csv == 'csv')
$sql = " SELECT od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_name, od_b_tel, od_b_hp, it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice
FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b, {$g4['yc4_item_table']} c
where a.on_uid = b.on_uid
where a.uq_id = b.uq_id
and b.it_id = c.it_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
@ -97,7 +97,7 @@ if ($csv == 'xls')
$sql = " SELECT od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_name, od_b_tel, od_b_hp, it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.it_opt1, b.it_opt2, b.it_opt3, b.it_opt4, b.it_opt5, b.it_opt6
FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b, {$g4['yc4_item_table']} c
where a.on_uid = b.on_uid
where a.uq_id = b.uq_id
and b.it_id = c.it_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
@ -165,11 +165,11 @@ if ($csv == 'xls')
exit;
}
function get_order($on_uid)
function get_order($uq_id)
{
global $g4;
$sql = " select * from {$g4['yc4_order_table']} where on_uid = '$on_uid' ";
$sql = " select * from {$g4['yc4_order_table']} where uq_id = '$uq_id' ";
return sql_fetch($sql);
}
@ -180,14 +180,14 @@ if ($case == 1)
{
$fr_date = date_conv($fr_date);
$to_date = date_conv($to_date);
$sql = " SELECT DISTINCT a.on_uid FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b
where a.on_uid = b.on_uid
$sql = " SELECT DISTINCT a.uq_id FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b
where a.uq_id = b.uq_id
and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
}
else
{
$sql = " SELECT DISTINCT a.on_uid FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b
where a.on_uid = b.on_uid
$sql = " SELECT DISTINCT a.uq_id FROM {$g4['yc4_order_table']} a, {$g4['yc4_cart_table']} b
where a.uq_id = b.uq_id
and a.od_id between '$fr_od_id' and '$to_od_id' ";
}
if ($ct_status)
@ -237,7 +237,7 @@ $mod = 10;
$tot_total_amount = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$sql1 = " select * from {$g4['yc4_order_table']} where on_uid = '{$row['on_uid']}' ";
$sql1 = " select * from {$g4['yc4_order_table']} where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);
// 1.03.02
@ -287,7 +287,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
b.it_name
from {$g4['yc4_cart_table']} a, {$g4['yc4_item_table']} b
where a.it_id = b.it_id
and a.on_uid = '{$row['on_uid']}' ";
and a.uq_id = '{$row['uq_id']}' ";
if ($ct_status)
$sql2 .= " and a.ct_status = '$ct_status' ";
$sql2 .= " order by a.ct_id ";

View File

@ -27,7 +27,7 @@ if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['yc4_order_table']} a
left join {$g4['yc4_cart_table']} b on (a.on_uid = b.on_uid)
left join {$g4['yc4_cart_table']} b on (a.uq_id = b.uq_id)
left join {$g4['yc4_item_table']} c on (b.it_id = c.it_id)
$sql_search ";

View File

@ -54,7 +54,7 @@ function print_line($save)
<?
unset($save);
unset($tot);
$sql = " select on_uid,
$sql = " select uq_id,
SUBSTRING(od_time,1,10) as od_date,
od_send_cost,
od_receipt_bank,
@ -82,7 +82,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
from {$g4['yc4_cart_table']}
where on_uid = '{$row['on_uid']}' ";
where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -54,7 +54,7 @@ function print_line($save)
<?
unset($save);
unset($tot);
$sql = " select on_uid,
$sql = " select uq_id,
SUBSTRING(od_time,1,7) as od_date,
od_send_cost,
od_receipt_bank,
@ -82,7 +82,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
from {$g4['yc4_cart_table']}
where on_uid = '{$row['on_uid']}' ";
where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -31,7 +31,7 @@ unset($tot);
$sql = " select od_id,
mb_id,
od_name,
on_uid,
uq_id,
od_send_cost,
od_receipt_bank,
od_receipt_card,
@ -52,7 +52,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
from {$g4['yc4_cart_table']}
where on_uid = '{$row['on_uid']}' ";
where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);
if ($row['mb_id'] == '') { // 비회원일 경우는 주문자로 링크

View File

@ -49,7 +49,7 @@ function print_line($save)
<?
unset($save);
unset($tot);
$sql = " select on_uid,
$sql = " select uq_id,
SUBSTRING(od_time,1,4) as od_date,
od_send_cost,
od_receipt_bank,
@ -77,7 +77,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
from {$g4['yc4_cart_table']}
where on_uid = '{$row['on_uid']}' ";
where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -97,7 +97,7 @@ $g4[yc4_cardpg][dacom_xpay] = "https://pgweb.dacom.net";
$default = sql_fetch(" select * from {$g4['yc4_default_table']} ");
// uniqid 테이블이 없을 경우 생성
if(!sql_query(" select 1 from {$g4['uniqid_table']} limit 1 ", false)) {
if(!sql_query(" select uq_id from {$g4['uniqid_table']} limit 1 ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['uniqid_table']}` (
`uq_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`uq_id`)
@ -112,8 +112,10 @@ if(!$result) {
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `od_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_card_history_table']}` ADD `uq_id` BIGINT(20) unsigned NOT NULL AFTER `od_id` ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` MODIFY COLUMN od_id BIGINT(20) unsigned NOT NULL ", false);
sql_query(" ALTER TABLE `{$g4['yc4_card_history_table']}` MODIFY COLUMN od_id BIGINT(20) unsigned NOT NULL ", false);
sql_query(" ALTER TABLE `{$g4['yc4_cart_table']}` ADD INDEX uq_id (uq_id) ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` ADD UNIQUE uq_id (uq_id) ", false);
sql_query(" ALTER TABLE `{$g4['yc4_order_table']}` DROP INDEX index1", false);
}
//==============================================================================

View File

@ -1,4 +1,3 @@
<?
$g4_path = "../..";
include_once("$g4_path/common.php");
include_once("../../common.php");
?>

View File

@ -29,10 +29,8 @@ $s_uq_id = $tmp_uq_id;
include_once('./cartsub.inc.php');
// 새로운 주문번호 생성
if(!get_session('ss_order_uniqid')) {
set_session('ss_order_uniqid', get_uniqid());
}
$od_uq_id = get_session('ss_order_uniqid');
$od_id = get_uniqid();
set_session('ss_order_uniqid', $od_id);
if (file_exists("./settle_{$default['de_card_pg']}.inc.php")) {
include "./settle_{$default['de_card_pg']}.inc.php";
@ -168,7 +166,7 @@ $order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
*/
?>
<input type="hidden" name="pay_method" value="" />
<input type="hidden" name="ordr_idxx" value="<? echo $od_uq_id; ?>" />
<input type="hidden" name="ordr_idxx" value="<? echo $od_id; ?>" />
<input type="hidden" name="good_name" value="<? echo $goods; ?>" />
<input type="hidden" name="good_mny" value="<? echo $good_mny; ?>" />
<input type="hidden" name="buyr_name" value="" />
@ -619,9 +617,16 @@ $order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
</tr>
</table>
<p align=center>
<input type="image" src="<?=G4_SHOP_URL?>/img/btn_next2.gif" border=0 alt="다음">&nbsp;
<p align=center id="display_pay_button" style="display:none">
<input type="image" src="<?=G4_SHOP_URL?>/img/btn_next2.gif" border=0 alt="결제하기">&nbsp;
<a href='javascript:history.go(-1);'><img src="<?=G4_SHOP_URL?>/img/btn_back1.gif" alt="뒤로" border=0></a>
</p>
<!-- Payplus Plug-in 설치 안내 -->
<p id="display_setup_message" style="display:none">
<span class="red">결제를 계속 하시려면 상단의 노란색 표시줄을 클릭</span>하시거나<br/>
<a href="http://pay.kcp.co.kr/plugin/file_vista/PayplusWizard.exe"><span class="bold">[수동설치]</span></a>를 눌러 Payplus Plug-in을 설치하시기 바랍니다.<br/>
[수동설치]를 눌러 설치하신 경우 <span class="red bold">새로고침(F5)키</span>를 눌러 진행하시기 바랍니다.
</p>
</form>
<!-- <? if ($default[de_card_use] || $default[de_iche_use]) { echo "결제대행사 : $default[de_card_pg]"; } ?> -->
@ -844,7 +849,15 @@ function forderform_check(f)
f.rcvr_add1.value = f.od_b_addr1.value;
f.rcvr_add2.value = f.od_b_addr2.value;
return true;
if(f.pay_method.value != "무통장") {
if(jsf__pay( f )) {
return true;
} else {
return false;
}
} else {
return true;
}
}
// 구매자 정보와 동일합니다.

View File

@ -117,14 +117,15 @@ if ($od_settle_case == "무통장")
}
else if ($od_settle_case == "계좌이체")
{
include "./kcp/pp_ax_hub.php";
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_escrow1 = $tno;
$od_receipt_bank = $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_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;
$bank_name = iconv("cp949", "utf8", $bank_name);
@ -134,12 +135,13 @@ else if ($od_settle_case == "계좌이체")
}
else if ($od_settle_case == "가상계좌")
{
include "./kcp/pp_ax_hub.php";
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_receipt_point = 0;
$od_escrow1 = $tno;
$od_receipt_amount = 0;
$bankname = iconv("cp949", "utf8", $bankname);
$depositor = iconv("cp949", "utf8", $depositor);
@ -148,28 +150,30 @@ else if ($od_settle_case == "가상계좌")
}
else if ($od_settle_case == "휴대폰")
{
include "./kcp/pp_ax_hub.php";
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_bank = $i_amount;
$od_temp_point = $i_temp_point;
$od_escrow1 = $tno;
$od_receipt_hp = $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_hp_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;
$same_amount_check = true;
$pg_receipt_amount = $amount;
}
else if ($od_settle_case == "신용카드")
{
include "./kcp/pp_ax_hub.php";
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_card = $i_amount;
$od_temp_point = $i_temp_point;
$od_escrow1 = $tno;
$od_receipt_card = $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_card_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);
$card_name = iconv("cp949", "utf8", $card_name);
$od_bank_account = $card_name;
$same_amount_check = true;
@ -183,7 +187,7 @@ else
// 주문금액과 결제금액이 일치하는지 체크
if($same_amount_check) {
if((int)$i_amount !== (int)$pg_receipt_amount) {
include "./kcp/pp_ax_hub_cancel.php"; // 결제취소처리
include G4_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php'; // 결제취소처리
die("Receipt Amount Error");
}
@ -230,6 +234,10 @@ $sql = " insert {$g4['yc4_order_table']}
od_receipt_hp = '$od_receipt_hp',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
od_bank_time = '$od_bank_time',
od_card_time = '$od_card_time',
od_hp_time = '$od_hp_time',
od_escrow1 = '$od_escrow1',
od_shop_memo = '',
od_hope_date = '$od_hope_date',
od_time = '".G4_TIME_YMDHIS."',
@ -256,11 +264,14 @@ if ($is_member && $od_receipt_point) {
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
}
// PG 결제내역기록
include_once(G4_SHOP_PATH.'/kcp/pp_ax_hub_result.php');
$od_memo = nl2br(htmlspecialchars2(stripslashes($od_memo))) . "&nbsp;";
include_once('./ordermail1.inc.php');
include_once('./ordermail2.inc.php');
include_once(G4_SHOP_PATH.'/ordermail1.inc.php');
include_once(G4_SHOP_PATH.'/ordermail2.inc.php');
// SMS BEGIN --------------------------------------------------------
// 쇼핑몰 운영자가 수신자가 됨
@ -287,14 +298,17 @@ if ($default['de_sms_use2'] && $receive_number)
// SMS END --------------------------------------------------------
// order_confirm 에서 사용하기 위해 tmp에 넣고
// orderview 에서 사용하기 위해 tmp에 넣고
set_session('ss_temp_uq_id', $tmp_uq_id);
// ss_uq_id 기존자료 세션에서 제거
if (get_session("ss_direct"))
set_session("ss_uq_direct", "");
else
set_session("ss_uq_id", "");
// 주문번호제거
set_session('ss_order_uniqid', '');
goto_url(G4_SHOP_URL.'./orderinquiryview.php?od_id='.$od_id.'&amp;uq_id='.$tmp_uq_id);
// ss_uq_id 기존자료 세션에서 제거
if (get_session('ss_direct'))
set_session('ss_uq_direct', '');
else
set_session('ss_uq_id', '');
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uq_id='.$tmp_uq_id);
?>

View File

@ -6,7 +6,7 @@ $token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
if (!$is_member) {
if (get_session("ss_uq_id_inquiry") != $_GET['uq_id'])
if (get_session("ss_temp_uq_id") != $_GET['uq_id'])
alert("직접 링크로는 주문서 조회가 불가합니다.\\n\\n주문조회 화면을 통하여 조회하시기 바랍니다.");
}
@ -34,6 +34,13 @@ $s_page = 'orderinquiryview.php';
include './cartsub.inc.php';
?>
<script>
var openwin = window.open( './kcp/proc_win.html', 'proc_win', '' );
if(openwin != null) {
openwin.close();
}
</script>
<br>
<div align=right><img src='<?=G4_SHOP_URL?>/img/status01.gif' align=absmiddle> : 주문대기, <img src='<?=G4_SHOP_URL?>/img/status02.gif' align=absmiddle> : 상품준비중, <img src='<?=G4_SHOP_URL?>/img/status03.gif' align=absmiddle> : 배송중, <img src='<?=G4_SHOP_URL?>/img/status04.gif' align=absmiddle> : 배송완료</div>
@ -357,6 +364,27 @@ if ($default['de_taxsave_use']) {
</table>
<br><br>
<? if ($od['od_settle_case'] == '가상계좌' && $default['de_card_test'] && $is_admin) {
preg_match("/(\s[^\s]+\s)/", $od['od_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<center>
<div style="width:500px">
<fieldset>
<legend>모의입금처리</legend>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<input type="text" name="e_trade_no" value="<?=$od['od_escrow1']?>" size="80"><br />
<input type="text" name="deposit_no" value="<?=$deposit_no?>" size="80"><br />
<input type="text" name="req_name" value="<?=$od['od_name']?>" size="80"><br />
<input type="text" name="noti_url" value="<?=G4_SHOP_URL?>/settle_kcp_common.php" size="80"><br /><br />
<input type="submit" value="입금통보 테스트">
</form>
</fieldset>
</div>
</center>
<? } ?>
<?
include_once('./_tail.php');
?>

View File

@ -1,7 +1,7 @@
<?
include_once('./_common.php');
include_once(G4_LIB_PATH.'/etc.lib.php');
include_once(G4_LIB_PATH..'/mailer.lib.php');
include_once(G4_LIB_PATH.'/mailer.lib.php');
/*------------------------------------------------------------------------------
※ KCP 에서 가맹점의 결과처리 페이지로 데이터를 전송할 때에, 아래와 같은
@ -10,22 +10,24 @@ include_once(G4_LIB_PATH..'/mailer.lib.php');
REMOTE ADDRESS 체크를 하여, 아래의 IP 이외의 다른 경로를 통해서 전송된
데이터에 대해서는 결과처리를 하지 마시기 바랍니다.
------------------------------------------------------------------------------*/
switch ($_SERVER['REMOTE_ADDR']) {
case '203.238.36.58' :
case '203.238.36.160' :
case '203.238.36.161' :
case '203.238.36.173' :
case '203.238.36.178' :
break;
default :
$super_admin = get_admin('super');
$egpcs_str = "ENV[" . serialize($_ENV) . "] "
. "GET[" . serialize($_GET) . "]"
. "POST[" . serialize($_POST) . "]"
. "COOKIE[" . serialize($_COOKIE) . "]"
. "SESSION[" . serialize($_SESSION) . "]";
mailer('경고', 'waring', $super_admin['mb_email'], '올바르지 않은 접속 보고', "{$_SERVER['PHP_SELF']}{$_SERVER['REMOTE_ADDR']}".G4_TIME_YMDHIS." 에 접속을 시도하였습니다.\n\n" . $egpcs_str, 2);
exit;
if(!$default['de_card_test']) {
switch ($_SERVER['REMOTE_ADDR']) {
case '203.238.36.58' :
case '203.238.36.160' :
case '203.238.36.161' :
case '203.238.36.173' :
case '203.238.36.178' :
break;
default :
$super_admin = get_admin('super');
$egpcs_str = "ENV[" . serialize($_ENV) . "] "
. "GET[" . serialize($_GET) . "]"
. "POST[" . serialize($_POST) . "]"
. "COOKIE[" . serialize($_COOKIE) . "]"
. "SESSION[" . serialize($_SESSION) . "]";
mailer('경고', 'waring', $super_admin['mb_email'], '올바르지 않은 접속 보고', "{$_SERVER['PHP_SELF']}{$_SERVER['REMOTE_ADDR']}".G4_TIME_YMDHIS." 에 접속을 시도하였습니다.\n\n" . $egpcs_str, 2);
exit;
}
}
/* ============================================================================== */