#282 uq_id 필드 제거

This commit is contained in:
chicpro
2013-08-23 10:39:16 +09:00
parent 8ae41a2213
commit 523c6e5e31
44 changed files with 216 additions and 269 deletions

View File

@ -34,7 +34,7 @@ if ($sel_ca_id != "") {
if ($sel_field == "") $sel_field = "od_id";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.uq_id=b.uq_id)
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@ -171,7 +171,6 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<tr>
<td>
<input type="hidden" name="od_id[<?php echo $i; ?>]" value="<?php echo $row['od_id']; ?>">
<input type="hidden" name="uq_id[<?php echo $i; ?>]" value="<?php echo $row['uq_id']; ?>">
<input type="hidden" name="od_tno[<?php echo $i; ?>]" value="<?php echo $row['od_tno']; ?>">
<input type="hidden" name="od_escrow[<?php echo $i; ?>]" value="<?php echo $row['od_escrow']; ?>">
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>"><?php echo $row['od_id']; ?></a>

View File

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

View File

@ -35,7 +35,7 @@ $pg_anchor = '<ul class="anchor">
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
left join {$g4['shop_cart_table']} b on (b.od_id=a.od_id)
group by a.od_id
/*having misu <= 0 and a.od_invoice = '' and ordercancel = 0*/
/*having orderamount - receiptamount = 0 and a.od_invoice = ''*/
@ -100,7 +100,7 @@ $pg_anchor = '<ul class="anchor">
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
left join {$g4['shop_cart_table']} b on (b.od_id=a.od_id)
group by a.od_id
/* having receiptamount <= 0 */
having misu > 0

View File

@ -44,7 +44,7 @@ for ($i=0; $i<$cnt; $i++)
$ct_id = $_POST['ct_id'][$k];
$sql = " select * from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and ct_id = '$ct_id' ";
$ct = sql_fetch($sql);
if(!$ct['ct_id'])
@ -76,7 +76,7 @@ for ($i=0; $i<$cnt; $i++)
$sql = " update {$g4['shop_cart_table']}
set ct_qty = '$ct_qty'
where ct_id = '$ct_id'
and uq_id = '$uq_id' ";
and od_id = '$od_id' ";
sql_query($sql);
$mod_history .= G4_TIME_YMDHIS.' '.$ct['ct_option'].' 수량변경 '.$ct['ct_qty'].' -> '.$ct_qty."\n";
}
@ -141,7 +141,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,$uq_id,$ct_id");
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$ct_id");
}
// 히스토리에 남김
@ -153,7 +153,7 @@ for ($i=0; $i<$cnt; $i++)
ct_stock_use = '$stock_use',
ct_status = '$ct_status',
ct_history = CONCAT(ct_history,'$ct_history')
where uq_id = '$uq_id'
where od_id = '$od_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 && $uq_id)
if ($od_id)
{
// 장바구니 삭제
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$uq_id' ");
sql_query(" delete from {$g4['shop_cart_table']} where od_id = '$od_id' ");
// 카드결제내역 삭제
sql_query(" delete from {$g4['shop_card_history_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
sql_query(" delete from {$g4['shop_card_history_table']} where od_id = '$od_id' ");
// 주문서 삭제
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' ");
}
if ($return_url)

View File

@ -43,14 +43,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['shop_order_table']} where uq_id = '{$row['uq_id']}' ");
$tmp_row = sql_fetch("select od_id, mb_id from {$g4['shop_order_table']} where od_id = '{$row['od_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['uq_id']},{$row['ct_id']}");
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['ct_id']}");
}
sql_query("update {$g4['shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");
@ -95,7 +95,7 @@ $sql = " select it_id,
cp_amount,
ct_notax
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
where od_id = '{$od['od_id']}'
and ct_num = '0'
order by ct_id ";
$result = sql_query($sql);
@ -123,7 +123,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<?php } ?>
<form name="frmorderform" method="post" action="./ordercartupdate.php" onsubmit="return form_submit(this);">
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
<input type="hidden" name="mb_id" value="<?php echo $od['mb_id']; ?>">
<input type="hidden" name="od_email" value="<?php echo $od['od_email']; ?>">
@ -172,7 +171,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
// 상품의 옵션정보
$sql = " select ct_id, it_id, ct_price, ct_qty, ct_option, ct_status, ct_stock_use, ct_point_use, ct_send_cost, io_type, io_price
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
where od_id = '{$od['od_id']}'
and it_id = '{$row['it_id']}'
order by ct_num ";
$res = sql_query($sql);
@ -291,7 +290,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
</thead>
<tbody>
<tr>
<td class="td_odrnum2"><?php echo $od['od_id']; ?><!-- uq_id : <?php echo $od['uq_id']; ?> --></td>
<td class="td_odrnum2"><?php echo $od['od_id']; ?></td>
<td class="td_payby"><?php echo $s_receipt_way; ?></td>
<td class="td_bignum"><?php echo display_price($amount['정상']); ?></td>
<td class="td_bignum"><?php echo display_point($od['od_receipt_point']); ?></td>
@ -332,7 +331,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
break;
}
$sql = " select it_name, ct_option from {$g4['shop_cart_table']} where uq_id = '{$od['uq_id']}' and ct_id = '$rq_ct_id' ";
$sql = " select it_name, ct_option from {$g4['shop_cart_table']} where od_id = '{$od['od_id']}' and ct_id = '$rq_ct_id' ";
$rq_ct = sql_fetch($sql);
$rq_subject = $rq_row['rq_time'].' '.$rq_ct['it_name'].' '.$rq_ct['ct_option'];
if($rq_item_count > 1)
@ -340,7 +339,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
$rq_subject .= ' '.$type.'요청';
if($rq_row['rq_id'] != $rq_id) {
$order_href = './orderform.php?od_id='.$od['od_id'].'&amp;uq_id='.$od['uq_id'].'&amp;rq_id='.$rq_row['rq_id'].'&amp;'.$qstr.'#anc_sodr_request';
$order_href = './orderform.php?od_id='.$od['od_id'].'&amp;rq_id='.$rq_row['rq_id'].'&amp;'.$qstr.'#anc_sodr_request';
$rq_subject = '<a href="'.$order_href.'">'.$rq_subject.'</a>';
}
@ -550,7 +549,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<?php if ($od['od_cash']) { ?>
<a href="javascript:;" onclick="window.open('https://admin.kcp.co.kr/Modules/Service/Cash/Cash_Bill_Common_View.jsp?cash_no=<?php echo $od['od_cash_no']; ?>', 'taxsave_receipt', 'width=360,height=647,scrollbars=0,menus=0');">현금영수증 확인</a>
<?php } else { ?>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>&amp;uq_id=<?php echo $od['uq_id']; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증 발급</a>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증 발급</a>
<?php } ?>
</td>
</tr>
@ -929,7 +928,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
</div>
<div class="btn_confirm">
<a href="./orderdelete.php?od_id=<?php echo $od['od_id']; ?>&amp;uq_id=<?php echo $od['uq_id']; ?>&amo;mb_id=<?php echo $od['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return del_confirm();">주문서 삭제</a>
<a href="./orderdelete.php?od_id=<?php echo $od['od_id']; ?>&amo;mb_id=<?php echo $od['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return del_confirm();">주문서 삭제</a>
<a href="./orderlist.php?<?php echo $qstr; ?>">목록</a>
</div>

View File

@ -24,12 +24,12 @@ if ($search != "")
$page = 1;
}
if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sel_field == "") $sel_field = "a.od_id";
if ($sort1 == "") $sort1 = "a.od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.uq_id=b.uq_id)
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_search ";
// 김선용 200805 : 조인 사용으로 전체카운트가 일정레코드 이상일 때 지연시간 문제가 심각하므로 변경
@ -37,7 +37,7 @@ $sql_common = " from {$g4['shop_order_table']} a
$result = sql_query(" select DISTINCT od_id ".$sql_common);
$total_count = mysql_num_rows($result);
*/
$sql = " select count(distinct od_id) as cnt " . $sql_common;
$sql = " select count(distinct a.od_id) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
@ -103,7 +103,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="a.od_id" <?php echo get_selected($sel_field, 'a.od_id'); ?>>주문번호</option>
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?>>주문자전화</option>
@ -234,7 +234,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<td><?php echo $s_receipt_way; ?></td>
<td class="td_mng">
<a href="./orderform.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;<?php echo $qstr; ?>"><span class="sound_only"><?php echo $lines[$i]['od_id']; ?> </span>수정</a>
<a href="./orderdelete.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;uq_id=<?php echo $lines[$i]['uq_id']; ?>&amp;mb_id=<?php echo $lines[$i]['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><span class="sound_only"><?php echo $lines[$i]['od_id']; ?> </span>삭제</a>
<a href="./orderdelete.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;mb_id=<?php echo $lines[$i]['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><span class="sound_only"><?php echo $lines[$i]['od_id']; ?> </span>삭제</a>
</td>
</tr>
<?php

View File

@ -21,12 +21,12 @@ if ($search != "")
$page = 1;
}
if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sel_field == "") $sel_field = "a.od_id";
if ($sort1 == "") $sort1 = "a.od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.uq_id=b.uq_id)
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@ -78,7 +78,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="a.od_id" <?php echo get_selected($sel_field, 'a.od_id'); ?>>주문번호</option>
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_b_name" <?php echo get_selected($sel_field, 'od_b_name'); ?>>받는분</option>
@ -102,7 +102,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
</div>
<ul class="sort_odr">
<li><a href="<?php echo title_sort("od_id", 1)."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("a.od_id", 1)."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_name")."&amp;$qstr1"; ?>">주문자<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("itemcount", 1)."&amp;$qstr1"; ?>">건수<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("orderamount", 1)."&amp;$qstr1"; ?>">주문합계<span class="sound_only"> 순 정렬</span></a></li>
@ -198,7 +198,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
// 상품개별출력
$sql2 = " select it_id, it_name
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}'
where od_id = '{$row['od_id']}'
and ct_num = '0'
order by ct_num ";
$result2 = sql_query($sql2);
@ -229,7 +229,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
// 옵션항목
$sql3 = " select *
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}'
where od_id = '{$row['od_id']}'
and it_id = '{$row2['it_id']}'
order by ct_num ";
$result3 = sql_query($sql3);
@ -267,7 +267,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<div class="sodr_mng">
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>">주문 수정</a>
|
<a href="./orderdelete.php?od_id=<?php echo $row['od_id']; ?>&amp;uq_id=<?php echo $row['uq_id']; ?>&amp;mb_id=<?php echo $row['mb_id']; ?>&amp;<?php echo $qstr; ?>&amp;list=2" onclick="return delete_confirm();">주문 삭제</a>
<a href="./orderdelete.php?od_id=<?php echo $row['od_id']; ?>&amp;mb_id=<?php echo $row['mb_id']; ?>&amp;<?php echo $qstr; ?>&amp;list=2" onclick="return delete_confirm();">주문 삭제</a>
</div>
</li>

View File

@ -19,7 +19,7 @@ if ($od_send_mail)
$sql = " select *
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
where od_id = '{$od['od_id']}'
order by 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, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost
FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.uq_id = b.uq_id ";
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
@ -99,7 +99,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, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost
FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.uq_id = b.uq_id ";
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
@ -162,11 +162,11 @@ if ($csv == 'xls')
exit;
}
function get_order($uq_id)
function get_order($od_id)
{
global $g4;
$sql = " select * from {$g4['shop_order_table']} where uq_id = '$uq_id' ";
$sql = " select * from {$g4['shop_order_table']} where od_id = '$od_id' ";
return sql_fetch($sql);
}
@ -177,14 +177,14 @@ if ($case == 1)
{
$fr_date = date_conv($fr_date);
$to_date = date_conv($to_date);
$sql = " SELECT DISTINCT a.uq_id FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.uq_id = b.uq_id
$sql = " SELECT DISTINCT a.od_id FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.od_id = b.od_id
and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
}
else
{
$sql = " SELECT DISTINCT a.uq_id FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.uq_id = b.uq_id
$sql = " SELECT DISTINCT a.od_id FROM {$g4['shop_order_table']} a, {$g4['shop_cart_table']} b
where a.od_id = b.od_id
and a.od_id between '$fr_od_id' and '$to_od_id' ";
}
if ($ct_status)
@ -213,7 +213,7 @@ if (mysql_num_rows($result) == 0)
$tot_total_amount = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$sql1 = " select * from {$g4['shop_order_table']} where uq_id = '{$row['uq_id']}' ";
$sql1 = " select * from {$g4['shop_order_table']} where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
// 1.03.02
@ -275,7 +275,7 @@ if (mysql_num_rows($result) == 0)
<?php
$sql2 = " select *
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
where od_id = '{$row['od_id']}' ";
if ($ct_status)
$sql2 .= " and ct_status = '$ct_status' ";
$sql2 .= " order by ct_id ";

View File

@ -8,7 +8,7 @@ $item = explode(',', $rq['ct_id']);
$sql = " select ct_id, it_id, it_name, ct_option, ct_price, ct_qty, io_type, io_price, ct_status, ct_notax
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
where od_id = '{$od['od_id']}'
order by ct_id ";
$result = sql_query($sql);
?>

View File

@ -96,7 +96,7 @@ if($rq['rq_parent']) {
// 요청상품
$sql = " select ct_id, it_id, it_name, ct_option, ct_price, ct_qty, io_type, io_price, ct_status
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
where od_id = '{$od['od_id']}'
order by ct_id ";
$result = sql_query($sql);

View File

@ -53,7 +53,7 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == '') { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, b.uq_id, b.od_temp_amount, b.od_name
$sql = " select a.*, b.od_temp_amount, b.od_name
$sql_common
order by $sst $sod, a.rq_id desc
limit $from_record, $rows ";
@ -165,7 +165,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
if($tmp['rq_time'])
$done_date = substr($tmp['rq_time'], 2, 8);
$order_href = './orderform.php?od_id='.$row['od_id'].'&amp;uq_id='.$row['uq_id'].'&amp;rq_id='.$row['rq_id'].'&amp;rq_type='.$rq_type.'&amp;'.$qstr;
$order_href = './orderform.php?od_id='.$row['od_id'].'&amp;rq_id='.$row['rq_id'].'&amp;rq_type='.$rq_type.'&amp;'.$qstr;
?>
<tr>

View File

@ -23,12 +23,12 @@ if ($search != "") {
$page = 1;
}
if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sel_field == "") $sel_field = "a.od_id";
if ($sort1 == "") $sort1 = "a.od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.uq_id = b.uq_id)
left join {$g4['shop_cart_table']} b on (a.od_id = b.od_id)
left join {$g4['shop_item_table']} c on (b.it_id = c.it_id)
$sql_search ";
@ -105,7 +105,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="a.od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
<option value="od_deposit_name" <?php echo get_selected($sel_field, 'od_deposit_name'); ?>>입금자</option>
@ -128,7 +128,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
</div>
<ul class="sort_odr">
<li><a href="<?php echo title_sort("od_id")."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></th>
<li><a href="<?php echo title_sort("a.od_id")."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></th>
<li><a href="<?php echo title_sort("it_name")."&amp;$qstr1"; ?>">상품명<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_name")."&amp;$qstr1"; ?>">주문자<span class="sound_only"> 순 정렬</span></a></th>
<li><a href="<?php echo title_sort("mb_id")."&amp;$qstr1"; ?>">회원ID<span class="sound_only"> 순 정렬</span></a></li>
@ -170,9 +170,6 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
$href = $_SERVER['PHP_SELF'].'?sort1='.$sort1.'&amp;sort2='.$sort2.'&amp;sel_field=c.it_id&amp;search='.$lines[$i]['it_id'];
$it_name = '<a href="'.$href.'">'.cut_str($lines[$i]['it_name'],35).'</a><br>';
$it_name .= print_item_options($lines[$i]['it_id'], $lines[$i]['it_opt1'], $lines[$i]['it_opt2'], $lines[$i]['it_opt3'], $lines[$i]['it_opt4'], $lines[$i]['it_opt5'], $lines[$i]['it_opt6']);
$s_mod = icon("수정", "");
$od_mobile = '';
if($lines[$i]['od_mobile'])

View File

@ -35,7 +35,7 @@ function print_line($save)
unset($save);
unset($tot);
$lines = $lines1 = array();
$sql = " select uq_id,
$sql = " select od_id,
SUBSTRING(od_time,1,10) as od_date,
od_send_cost,
od_settle_case,
@ -56,7 +56,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -35,7 +35,7 @@ function print_line($save)
unset($save);
unset($tot);
$lines = $lines1 = array();
$sql = " select uq_id,
$sql = " select od_id,
SUBSTRING(od_time,1,7) as od_date,
od_send_cost,
od_settle_case,
@ -56,7 +56,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -14,7 +14,6 @@ $lines = $lines1 = array();
$sql = " select od_id,
mb_id,
od_name,
uq_id,
od_send_cost,
od_settle_case,
od_receipt_amount,
@ -34,7 +33,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -30,7 +30,7 @@ function print_line($save)
$lines = $lines1 = array();
unset($save);
unset($tot);
$sql = " select uq_id,
$sql = " select od_id,
SUBSTRING(od_time,1,4) as od_date,
od_send_cost,
od_settle_case,
@ -51,7 +51,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];

View File

@ -414,4 +414,10 @@ if(!sql_query(" select od_tax_mny from {$g4['shop_order_table']} limit 1 ", fals
ADD `od_vat_mny` INT(11) NOT NULL DEFAULT '0' AFTER `od_tax_mny`,
ADD `od_free_mny` INT(11) NOT NULL DEFAULT '0' AFTER `od_vat_mny` ", true);
}
// cart uq_id를 od_id로 변경
if(!sql_query(" select od_id from {$g4['shop_cart_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
CHANGE `uq_id` `od_id` BIGINT(2) UNSIGNED NOT NULL ", true);
}
?>

View File

@ -30,7 +30,6 @@ DROP TABLE IF EXISTS `shop_card_history`;
CREATE TABLE IF NOT EXISTS `shop_card_history` (
`cd_id` int(11) NOT NULL AUTO_INCREMENT,
`od_id` bigint(20) unsigned NOT NULL,
`uq_id` bigint(20) unsigned NOT NULL,
`cd_mall_id` varchar(20) NOT NULL DEFAULT '',
`cd_amount` int(11) NOT NULL DEFAULT '0',
`cd_app_no` varchar(20) NOT NULL DEFAULT '',
@ -55,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `shop_card_history` (
DROP TABLE IF EXISTS `shop_cart`;
CREATE TABLE IF NOT EXISTS `shop_cart` (
`ct_id` int(11) NOT NULL AUTO_INCREMENT,
`uq_id` bigint(20) unsigned NOT NULL,
`od_id` bigint(20) unsigned NOT NULL,
`mb_id` varchar(255) NOT NULL DEFAULT '',
`it_id` varchar(20) NOT NULL DEFAULT '',
`it_name` varchar(255) NOT NULL DEFAULT '',
@ -79,7 +78,7 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
`ct_direct` tinyint(4) NOT NULL DEFAULT '0',
`ct_select` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`ct_id`),
KEY `uq_id` (`uq_id`),
KEY `od_id` (`od_id`),
KEY `ct_num` (`ct_num`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -581,7 +580,6 @@ CREATE TABLE IF NOT EXISTS `shop_onlinecalc` (
DROP TABLE IF EXISTS `shop_order`;
CREATE TABLE IF NOT EXISTS `shop_order` (
`od_id` bigint(20) unsigned NOT NULL,
`uq_id` bigint(20) unsigned NOT NULL,
`mb_id` varchar(20) NOT NULL DEFAULT '',
`od_pwd` varchar(255) NOT NULL DEFAULT '',
`od_name` varchar(20) NOT NULL DEFAULT '',
@ -639,7 +637,6 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_mobile` tinyint(4) NOT NULL DEFAULT '0',
`od_ip` varchar(25) NOT NULL DEFAULT '',
PRIMARY KEY (`od_id`),
UNIQUE KEY `uq_id` (`uq_id`),
KEY `index2` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@ -336,11 +336,11 @@ class item_list
// 장바구니 건수 검사
function get_cart_count($uq_id)
function get_cart_count($cart_id)
{
global $g4, $default;
$sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where uq_id = '$uq_id' ";
$sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where od_id = '$cart_id' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and ct_time > '$ctime' ";
@ -1059,11 +1059,11 @@ function get_item_supply($it_id, $subject)
return $str;
}
function print_item_options($it_id, $uq_id)
function print_item_options($it_id, $cart_id)
{
global $g4;
$sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and uq_id = '$uq_id' order by io_type asc, ct_num asc, ct_id asc ";
$sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and od_id = '$cart_id' order by io_type asc, ct_num asc, ct_id asc ";
$result = sql_query($sql);
$str = '';
@ -1140,12 +1140,12 @@ function get_yn($val, $case='')
}
// 상품명과 건수를 반환
function get_goods($uq_id)
function get_goods($cart_id)
{
global $g4;
// 상품명만들기
$row = sql_fetch(" select a.it_id, b.it_name from {$g4['shop_cart_table']} a, {$g4['shop_item_table']} b where a.it_id = b.it_id and a.uq_id = '$uq_id' order by ct_id limit 1 ");
$row = sql_fetch(" select a.it_id, b.it_name from {$g4['shop_cart_table']} a, {$g4['shop_item_table']} b where a.it_id = b.it_id and a.od_id = '$cart_id' order by ct_id limit 1 ");
// 상품명에 "(쌍따옴표)가 들어가면 오류 발생함
$goods['it_id'] = $row['it_id'];
$goods['full_name']= $goods['name'] = addslashes($row['it_name']);
@ -1153,7 +1153,7 @@ function get_goods($uq_id)
$goods['full_name'] = preg_replace ("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", "", $goods['full_name']);
// 상품건수
$row = sql_fetch(" select count(*) as cnt from {$g4['shop_cart_table']} where uq_id = '$uq_id' ");
$row = sql_fetch(" select count(*) as cnt from {$g4['shop_cart_table']} where od_id = '$cart_id' ");
$cnt = $row['cnt'] - 1;
if ($cnt)
$goods['full_name'] .= ' 외 '.$cnt.'건';
@ -1266,41 +1266,41 @@ function get_new_od_id()
return $od_id;
}
// uq_id 설정
function set_unique_id($direct)
// cart id 설정
function set_cart_id($direct)
{
global $g4, $default, $member;
if ($direct) {
$tmp_uq_id = get_session('ss_uq_direct');
if(!$tmp_uq_id) {
$tmp_uq_id = get_uniqid();
set_session('ss_uq_direct', $tmp_uq_id);
$tmp_cart_id = get_session('ss_cart_direct');
if(!$tmp_cart_id) {
$tmp_cart_id = get_uniqid();
set_session('ss_cart_direct', $tmp_cart_id);
}
} else {
// 비회원장바구니 uq_id 쿠키설정
// 비회원장바구니 cart id 쿠키설정
if($default['de_guest_cart_use']) {
$tmp_uq_id = get_cookie('ck_guest_cart_uqid');
if($tmp_uq_id) {
set_session('ss_uq_id', $tmp_uq_id);
set_cookie('ck_guest_cart_uqid', $tmp_uq_id, ($default['de_cart_keep_term'] * 86400));
$tmp_cart_id = get_cookie('ck_guest_cart_id');
if($tmp_cart_id) {
set_session('ss_cart_id', $tmp_cart_id);
set_cookie('ck_guest_cart_id', $tmp_cart_id, ($default['de_cart_keep_term'] * 86400));
} else {
$tmp_uq_id = get_uniqid();
set_session('ss_uq_id', $tmp_uq_id);
set_cookie('ck_guest_cart_uqid', $tmp_uq_id, ($default['de_cart_keep_term'] * 86400));
$tmp_cart_id = get_uniqid();
set_session('ss_cart_id', $tmp_cart_id);
set_cookie('ck_guest_cart_id', $tmp_cart_id, ($default['de_cart_keep_term'] * 86400));
}
} else {
$tmp_uq_id = get_session('ss_uq_id');
if(!$tmp_uq_id) {
$tmp_uq_id = get_uniqid();
set_session('ss_uq_id', $tmp_uq_id);
$tmp_cart_id = get_session('ss_cart_id');
if(!$tmp_cart_id) {
$tmp_cart_id = get_uniqid();
set_session('ss_cart_id', $tmp_cart_id);
}
}
// 보관된 회원장바구니 자료 uq_id 변경
if($member['mb_id'] && $tmp_uq_id) {
// 보관된 회원장바구니 자료 cart id 변경
if($member['mb_id'] && $tmp_cart_id) {
$sql = " update {$g4['shop_cart_table']}
set uq_id = '$tmp_uq_id'
set od_id = '$tmp_cart_id'
where mb_id = '{$member['mb_id']}'
and ct_status = '쇼핑' ";
if($default['de_cart_keep_term']) {

View File

@ -27,7 +27,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$tot_point = 0;
$tot_sell_amount = 0;
// $s_uq_id 로 현재 장바구니 자료 쿼리
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
@ -38,7 +38,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
a.ct_send_cost,
b.ca_id
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
where a.od_id = '$s_cart_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
@ -57,7 +57,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
and od_id = '$s_cart_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
@ -69,7 +69,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$image = get_it_image($row['it_id'], 70, 70);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$mod_options = '<div class="sod_option_btn"><button type="button" class="mod_options">선택사항수정</button></div>';
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';

View File

@ -19,7 +19,6 @@ if ( $req_tx == "pay" )
// 카드내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$g_conf_site_cd',
cd_amount = '$good_mny',
cd_app_no = '$app_no',
@ -40,7 +39,6 @@ if ( $req_tx == "pay" )
// 계좌이체내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$g_conf_site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',
@ -63,7 +61,6 @@ if ( $req_tx == "pay" )
// 가상계좌내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$g_conf_site_cd',
cd_amount = '0',
cd_app_no = '$tno',
@ -88,7 +85,6 @@ if ( $req_tx == "pay" )
// 휴대폰결제내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$tmp_uq_id',
cd_mall_id = '$g_conf_site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',

View File

@ -4,13 +4,13 @@ include_once('./_common.php');
set_session("ss_direct", $sw_direct);
// 장바구니가 비어있는가?
if ($sw_direct) {
$tmp_uq_id = get_session("ss_uq_direct");
$tmp_cart_id = get_session("ss_cart_direct");
}
else {
$tmp_uq_id = get_session("ss_uq_id");
$tmp_cart_id = get_session("ss_cart_id");
}
if (get_cart_count($tmp_uq_id) == 0)
if (get_cart_count($tmp_cart_id) == 0)
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
$g4['title'] = '주문서 작성';
@ -19,9 +19,9 @@ include_once(G4_MSHOP_PATH.'/_head.php');
// 새로운 주문번호 생성
$od_id = get_uniqid();
set_session('ss_order_uniqid', $od_id);
set_session('ss_order_id', $od_id);
$s_uq_id = $tmp_uq_id;
$s_cart_id = $tmp_cart_id;
$order_action_url = G4_HTTPS_MSHOP_URL.'/orderformupdate.php';
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) {
include './settle_'.$default['de_card_pg'].'.inc.php';
@ -57,7 +57,7 @@ ob_start();
$goods = $goods_it_id = "";
$goods_count = -1;
// $s_uq_id 로 현재 장바구니 자료 쿼리
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
@ -71,7 +71,7 @@ ob_start();
b.ca_id3,
b.it_notax
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
where a.od_id = '$s_cart_id'
and a.ct_select = '1'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
@ -97,7 +97,7 @@ ob_start();
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
and od_id = '$s_cart_id' ";
$sum = sql_fetch($sql);
if (!$goods)
@ -125,7 +125,7 @@ ob_start();
$image = get_it_image($row['it_id'], 50, 50);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}

View File

@ -20,12 +20,12 @@ if($od_settle_case != '무통장') {
}
// 장바구니가 비어있는가?
if (get_session("ss_direct"))
$tmp_uq_id = get_session('ss_uq_direct');
if (get_session('ss_direct'))
$tmp_cart_id = get_session('ss_cart_direct');
else
$tmp_uq_id = get_session('ss_uq_id');
$tmp_cart_id = get_session('ss_cart_id');
if (get_cart_count($tmp_uq_id) == 0)// 장바구니에 담기
if (get_cart_count($tmp_cart_id) == 0)// 장바구니에 담기
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G4_SHOP_URL.'/cart.php');
$error = "";
@ -37,7 +37,7 @@ $sql = " select it_id,
io_type,
ct_option
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
@ -70,7 +70,7 @@ $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_amount
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_select = '1' ";
from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and ct_select = '1' ";
$row = sql_fetch($sql);
$tot_ct_amount = $row['od_amount'];
@ -116,7 +116,7 @@ if($is_member) {
// 상품금액
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and it_id = '$it_id'
and ct_select = '1' ";
$ct = sql_fetch($sql);
@ -203,7 +203,7 @@ if ($default['de_send_cost_case'] == '없음') {
$send_cost = 0;
$sql = " select it_id
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1'
and ct_num = '0'
and ct_send_cost = '0' ";
@ -214,7 +214,7 @@ if ($default['de_send_cost_case'] == '없음') {
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$sc['it_id']}'
and uq_id = '$tmp_uq_id' ";
and od_id = '$tmp_cart_id' ";
$sum = sql_fetch($sql);
$send_cost += get_item_sendcost($sc['it_id'], $sum['price'], $sum['qty']);
@ -388,10 +388,7 @@ else
$od_pwd = sql_password($_POST['od_pwd']);
// 주문번호를 얻는다.
$od_id = get_session('ss_order_uniqid');
// 주문상품의 uq_id 변경을 위한 uq_id를 얻는다.
$uq_id = get_uniqid();
$od_id = get_session('ss_order_id');
$od_escrow = 0;
if($escw_yn == 'Y')
@ -410,7 +407,6 @@ if($default['de_tax_flag_use']) {
// 주문서에 입력
$sql = " insert {$g4['shop_order_table']}
set od_id = '$od_id',
uq_id = '$uq_id',
mb_id = '{$member['mb_id']}',
od_pwd = '$od_pwd',
od_name = '$od_name',
@ -472,10 +468,10 @@ if ($od_receipt_amount > 0 && !$default['de_card_point']) {
$sql_card_point = " , ct_point = '0' ";
}
$sql = "update {$g4['shop_cart_table']}
set uq_id = '$uq_id',
set od_id = '$od_id',
ct_status = '주문'
$sql_card_point
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql, false);
@ -489,7 +485,7 @@ if(!$result) {
echo "<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['PHP_SELF']}";
// 주문삭제
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' ");
exit;
}
@ -521,7 +517,7 @@ if($is_member) {
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
$sql = " update {$g4['shop_cart_table']}
set cp_amount = '$cp_amt'
where uq_id = '$uq_id'
where od_id = '$od_id'
and it_id = '$cp_it_id'
and ct_select = '1'
and ct_num = '0' ";
@ -600,11 +596,11 @@ $uid = md5($od_id.G4_TIME_YMDHIS.$REMOTE_ADDR);
set_session('ss_orderview_uid', $uid);
// 주문번호제거
set_session('ss_order_uniqid', '');
set_session('ss_order_id', '');
// 기존자료 세션에서 제거
if (get_session('ss_direct'))
set_session('ss_uq_direct', '');
set_session('ss_cart_direct', '');
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
?>

View File

@ -43,7 +43,7 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
// 비회원 주문확인의 경우 바로 주문서 상세조회로 이동
if (!$is_member)
{
$sql = " select od_id, uq_id from {$g4['shop_order_table']} where od_id = '$od_id' and od_pwd = '$od_pwd' ";
$sql = " select od_id, od_time, od_ip from {$g4['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']);

View File

@ -21,7 +21,7 @@ if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
left join {$g4['shop_cart_table']} b on (b.od_id=a.od_id)
where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc

View File

@ -26,8 +26,6 @@ if($rq['cnt'])
// 결제방법
$settle_case = $od['od_settle_case'];
set_session('ss_temp_uq_id', $uq_id);
$g4['title'] = '주문상세내역';
include_once(G4_MSHOP_PATH.'/_head.php');
?>
@ -55,7 +53,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$sql = " select it_id, it_name, cp_amount
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and ct_num = '0'
order by ct_id ";
$result = sql_query($sql);
@ -86,7 +84,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
$sql = " select ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and it_id = '{$row['it_id']}'
order by ct_num ";
$res = sql_query($sql);
@ -510,7 +508,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>&amp;uq_id=<?php echo $od['uq_id']; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
@ -693,7 +691,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<div id="sod_fin_cancelfrm">
<form method="post" action="<?php echo G4_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="uq_id" value="<?php echo $od['uq_id']; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<label for="cancel_memo">취소사유</label>

View File

@ -9,7 +9,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<ul>
<?php
$hsql = " select a.it_id, a.it_name, a.ct_qty from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id ) ";
$hsql .= " where a.uq_id = '".get_session('ss_uq_id')."' and a.ct_num = '0' order by a.ct_id ";
$hsql .= " where a.od_id = '".get_session('ss_cart_id')."' and a.ct_num = '0' order by a.ct_id ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{

View File

@ -1,30 +1,12 @@
<?php
include_once('./_common.php');
// uq_id 설정
set_unique_id($sw_direct);
// cart id 설정
set_cart_id($sw_direct);
// 회원일 경우 자신의 장바구니 상품 uq_id 값을 변경
if($is_member && $sw_direct != 1) {
$tmp_uq_id = get_session('ss_uq_id');
if(!$tmp_uq_id) {
$tmp_uq_id = get_uniqid();
set_session('ss_uq_id', $tmp_uq_id);
}
$ctime = date('Y-m-d H:i:s', (G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400)));
$sql = " update {$g4['shop_cart_table']}
set uq_id = '$tmp_uq_id'
where mb_id = '{$member['mb_id']}'
and ct_status = '쇼핑'
and ct_direct = '0'
and ct_time > '$ctime' ";
sql_query($sql);
}
$s_uq_id = get_session('ss_uq_id');
$s_cart_id = get_session('ss_cart_id');
// 선택필드 초기화
$sql = " update {$g4['shop_cart_table']} set ct_select = '0' where uq_id = '$s_uq_id' ";
$sql = " update {$g4['shop_cart_table']} set ct_select = '0' where od_id = '$s_cart_id' ";
sql_query($sql);
$cart_action_url = G4_SHOP_URL.'/cartupdate.php';
@ -65,7 +47,7 @@ include_once('./_head.php');
$tot_sell_amount = 0;
$tot_cancel_amount = 0;
// $s_uq_id 로 현재 장바구니 자료 쿼리
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
@ -78,7 +60,7 @@ include_once('./_head.php');
b.ca_id2,
b.ca_id3
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
where a.od_id = '$s_cart_id'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
@ -97,7 +79,7 @@ include_once('./_head.php');
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
and od_id = '$s_cart_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
@ -109,7 +91,7 @@ include_once('./_head.php');
$image = get_it_image($row['it_id'], 70, 70);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_uq_id);
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$mod_options = '<div class="sod_option_btn"><button type="button" class="mod_options">선택사항수정</button></div>';
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';

View File

@ -11,12 +11,12 @@ if(!$it['it_id'])
die('no-item');
// 장바구니 자료
$uq_id = get_session('ss_uq_id');
$sql = " select * from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' order by io_type asc, ct_num asc, ct_id asc ";
$cart_id = get_session('ss_cart_id');
$sql = " select * from {$g4['shop_cart_table']} where od_id = '$cart_id' and it_id = '$it_id' order by io_type asc, ct_num asc, ct_id asc ";
$result = sql_query($sql);
// 판매가격
$sql2 = " select ct_price, it_name, ct_send_cost from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$sql2 = " select ct_price, it_name, ct_send_cost from {$g4['shop_cart_table']} where od_id = '$cart_id' and it_id = '$it_id' and ct_num = '0' ";
$row2 = sql_fetch($sql2);
if(!mysql_num_rows($result))

View File

@ -3,16 +3,16 @@ include_once('./_common.php');
// print_r2($_POST); exit;
// uq_id 설정
set_unique_id($sw_direct);
// cart id 설정
set_cart_id($sw_direct);
if($sw_direct)
$tmp_uq_id = get_session('ss_uq_direct');
$tmp_cart_id = get_session('ss_cart_direct');
else
$tmp_uq_id = get_session('ss_uq_id');
$tmp_cart_id = get_session('ss_cart_id');
// 브라우저에서 쿠키를 허용하지 않은 경우라고 볼 수 있음.
if (!$tmp_uq_id)
if (!$tmp_cart_id)
{
alert('더 이상 작업을 진행할 수 없습니다.\\n\\n브라우저의 쿠키 허용을 사용하지 않음으로 설정한것 같습니다.\\n\\n브라우저의 인터넷 옵션에서 쿠키 허용을 사용으로 설정해 주십시오.\\n\\n그래도 진행이 되지 않는다면 쇼핑몰 운영자에게 문의 바랍니다.');
}
@ -36,7 +36,7 @@ if($act == "buy")
$it_id = $_POST['it_id'][$i];
$sql = " update {$g4['shop_cart_table']}
set ct_select = '1'
where it_id = '$it_id' and uq_id = '$tmp_uq_id' ";
where it_id = '$it_id' and od_id = '$tmp_cart_id' ";
sql_query($sql);
}
}
@ -49,7 +49,7 @@ if($act == "buy")
else if ($act == "alldelete") // 모두 삭제이면
{
$sql = " delete from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id' ";
where od_id = '$tmp_cart_id' ";
sql_query($sql);
}
else if ($act == "seldelete") // 선택삭제
@ -62,7 +62,7 @@ else if ($act == "seldelete") // 선택삭제
$ct_chk = $_POST['ct_chk'][$i];
if($ct_chk) {
$it_id = $_POST['it_id'][$i];
$sql = " delete from {$g4['shop_cart_table']} where it_id = '$it_id' and uq_id = '$tmp_uq_id' ";
$sql = " delete from {$g4['shop_cart_table']} where it_id = '$it_id' and od_id = '$tmp_cart_id' ";
sql_query($sql);
}
}
@ -124,7 +124,7 @@ else // 장바구니에 담기
$sql = " select SUM(ct_qty) as cnt from {$g4['shop_cart_table']}
where it_id = '$it_id'
and uq_id = '$tmp_uq_id'
and od_id = '$tmp_cart_id'
and io_id = '$io_id' ";
$row = sql_fetch($sql);
$sum_qty = $row['cnt'];
@ -145,24 +145,13 @@ else // 장바구니에 담기
// 바로구매에 있던 장바구니 자료를 지운다.
if($i == 0)
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_direct = 1 ", false);
sql_query(" delete from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and ct_direct = 1 ", false);
// 옵션수정일 때 기존 장바구니 자료를 먼저 삭제
if($act == 'optionmod')
sql_query(" delete from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and it_id = '$it_id' ");
sql_query(" delete from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and it_id = '$it_id' ");
// 장바구니에 Insert
$sql = " select ct_num
from {$g4['shop_cart_table']}
where it_id = '$it_id'
and uq_id = '$tmp_uq_id'
order by ct_num desc ";
$row = sql_fetch($sql);
if($row['ct_num'] != '')
$ct_num = (int)$row['ct_num'] + 1;
else
$ct_num = 0;
// 바로구매일 경우 장바구니가 체크된것으로 강제 설정
if($sw_direct)
$ct_select = 1;
@ -172,7 +161,7 @@ else // 장바구니에 담기
$ct_count = 0;
$comma = '';
$sql = " INSERT INTO {$g4['shop_cart_table']}
( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
( od_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, ct_notax, io_id, io_type, io_price, ct_time, ct_ip, ct_send_cost, ct_direct, ct_select )
VALUES ";
for($k=0; $k<$opt_count; $k++) {
@ -194,7 +183,7 @@ else // 장바구니에 담기
// 동일옵션의 상품이 있으면 수량 더함
$sql2 = " select ct_id
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and it_id = '$it_id'
and io_id = '$io_id'
and ct_status = '쇼핑' ";
@ -207,9 +196,8 @@ else // 장바구니에 담기
continue;
}
$sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$it['it_id']}', '{$it['it_name']}', '쇼핑', '{$it['it_price']}', '$point', '0', '0', '$io_value', '$ct_qty', '$ct_num', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
$sql .= $comma."( '$tmp_cart_id', '{$member['mb_id']}', '{$it['it_id']}', '{$it['it_name']}', '쇼핑', '{$it['it_price']}', '$point', '0', '0', '$io_value', '$ct_qty', '$k', '{$it['it_notax']}', '$io_id', '$io_type', '$io_price', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$ct_send_cost', '$sw_direct', '$ct_select' )";
$comma = ' , ';
$ct_num++;
$ct_count++;
}

View File

@ -30,7 +30,6 @@ if ( $req_tx == "pay" )
// 카드내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$app_no',
@ -51,7 +50,6 @@ if ( $req_tx == "pay" )
// 계좌이체내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',
@ -75,7 +73,6 @@ if ( $req_tx == "pay" )
// 가상계좌내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$uq_id',
cd_mall_id = '$site_cd',
cd_amount = '0',
cd_app_no = '$tno',
@ -101,7 +98,6 @@ if ( $req_tx == "pay" )
// 휴대폰결제내역 INSERT
$sql = "insert {$g4['shop_card_history_table']}
set od_id = '$ordr_idxx',
uq_id = '$uq_id',
cd_mall_id = '$site_cd',
cd_amount = '$good_mny',
cd_app_no = '$tno',

View File

@ -1,14 +1,14 @@
<!--
/* ============================================================================== */
/* = PAGE : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>â <20><><EFBFBD><EFBFBD> PAGE = */
/* = PAGE : 진행창 예제 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Inc. All Rights Reserverd. = */
/* ============================================================================== */
//-->
<html>
<head>
<title> ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> </title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title> 처리중 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="ImageToolbar" content="No">
</head>
<body leftmargin="0" topmargin="0" onBlur="window.document.pro.focus();">

View File

@ -12,13 +12,13 @@ if (G4_IS_MOBILE) {
set_session("ss_direct", $sw_direct);
// 장바구니가 비어있는가?
if ($sw_direct) {
$tmp_uq_id = get_session("ss_uq_direct");
$tmp_cart_id = get_session('ss_cart_direct');
}
else {
$tmp_uq_id = get_session("ss_uq_id");
$tmp_cart_id = get_session('ss_cart_id');
}
if (get_cart_count($tmp_uq_id) == 0)
if (get_cart_count($tmp_cart_id) == 0)
alert('장바구니가 비어 있습니다.', G4_SHOP_URL.'/cart.php');
$g4['title'] = '주문서 작성';
@ -27,8 +27,8 @@ include_once('./_head.php');
// 새로운 주문번호 생성
$od_id = get_uniqid();
set_session('ss_order_uniqid', $od_id);
$s_uq_id = $tmp_uq_id;
set_session('ss_order_id', $od_id);
$s_cart_id = $tmp_cart_id;
$order_action_url = G4_HTTPS_SHOP_URL.'/orderformupdate.php';
if (file_exists('./settle_'.$default['de_card_pg'].'.inc.php')) {
include './settle_'.$default['de_card_pg'].'.inc.php';
@ -147,7 +147,7 @@ function get_intall_file()
$goods = $goods_it_id = "";
$goods_count = -1;
// $s_uq_id 로 현재 장바구니 자료 쿼리
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
@ -161,7 +161,7 @@ function get_intall_file()
b.ca_id3,
b.it_notax
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$s_uq_id'
where a.od_id = '$s_cart_id'
and a.ct_select = '1'
and a.ct_num = '0' ";
if($default['de_cart_keep_term']) {
@ -187,7 +187,7 @@ function get_intall_file()
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$s_uq_id' ";
and od_id = '$s_cart_id' ";
$sum = sql_fetch($sql);
if (!$goods)
@ -213,7 +213,7 @@ function get_intall_file()
$image = get_it_image($row['it_id'], 50, 50);
$it_name = '<b>' . stripslashes($row['it_name']) . '</b>';
$it_options = print_item_options($row['it_id'], $s_uq_id);
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$it_name .= '<div class="sod_bsk_itopt">'.$it_options.'</div>';
}
@ -1550,7 +1550,7 @@ function gumae2baesong(f)
<?php if ($default['de_hope_date_use']) { ?>
$(function(){
$("#od_hope_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", minDate: "+<?php echo (int)$default['de_hope_date_after']; ?>d;", maxDate: "+<?php echo (int)$default['de_hope_date_after'] + 6; ?>d;" });
$("#od_hope_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", minDate: "+<?php echo (int)$default['de_hope_date_after']; ?>d;", maxDate: "+<?php echo (int)$default['de_hope_date_after'] + 6; ?>d;" });
});
<?php } ?>
</script>

View File

@ -15,11 +15,11 @@ $_POST = array_add_callback("mysql_real_escape_string", $_POST);
// 장바구니가 비어있는가?
if (get_session("ss_direct"))
$tmp_uq_id = get_session('ss_uq_direct');
$tmp_cart_id = get_session('ss_cart_direct');
else
$tmp_uq_id = get_session('ss_uq_id');
$tmp_cart_id = get_session('ss_cart_id');
if (get_cart_count($tmp_uq_id) == 0)// 장바구니에 담기
if (get_cart_count($tmp_cart_id) == 0)// 장바구니에 담기
alert('장바구니가 비어 있습니다.\\n\\n이미 주문하셨거나 장바구니에 담긴 상품이 없는 경우입니다.', G4_SHOP_URL.'/cart.php');
$error = "";
@ -31,7 +31,7 @@ $sql = " select it_id,
io_type,
ct_option
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
@ -64,7 +64,7 @@ $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_amount
from {$g4['shop_cart_table']} where uq_id = '$tmp_uq_id' and ct_select = '1' ";
from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and ct_select = '1' ";
$row = sql_fetch($sql);
$tot_ct_amount = $row['od_amount'];
@ -110,7 +110,7 @@ if($is_member) {
// 상품금액
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and it_id = '$it_id'
and ct_select = '1' ";
$ct = sql_fetch($sql);
@ -197,7 +197,7 @@ if ($default['de_send_cost_case'] == '없음') {
$send_cost = 0;
$sql = " select it_id
from {$g4['shop_cart_table']}
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1'
and ct_num = '0'
and ct_send_cost = '0' ";
@ -208,7 +208,7 @@ if ($default['de_send_cost_case'] == '없음') {
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$sc['it_id']}'
and uq_id = '$tmp_uq_id' ";
and od_id = '$tmp_cart_id' ";
$sum = sql_fetch($sql);
$send_cost += get_item_sendcost($sc['it_id'], $sum['price'], $sum['qty']);
@ -382,10 +382,7 @@ else
$od_pwd = sql_password($_POST['od_pwd']);
// 주문번호를 얻는다.
$od_id = get_session('ss_order_uniqid');
// 주문상품의 uq_id 변경을 위한 uq_id를 얻는다.
$uq_id = get_uniqid();
$od_id = get_session('ss_order_id');
$od_escrow = 0;
if($escw_yn == 'Y')
@ -404,7 +401,6 @@ if($default['de_tax_flag_use']) {
// 주문서에 입력
$sql = " insert {$g4['shop_order_table']}
set od_id = '$od_id',
uq_id = '$uq_id',
mb_id = '{$member['mb_id']}',
od_pwd = '$od_pwd',
od_name = '$od_name',
@ -465,10 +461,10 @@ if ($od_receipt_amount > 0 && !$default['de_card_point']) {
$sql_card_point = " , ct_point = '0' ";
}
$sql = "update {$g4['shop_cart_table']}
set uq_id = '$uq_id',
set od_id = '$od_id',
ct_status = '주문'
$sql_card_point
where uq_id = '$tmp_uq_id'
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql, false);
@ -482,7 +478,7 @@ if(!$result) {
echo "<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['PHP_SELF']}";
// 주문삭제
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
sql_query(" delete from {$g4['shop_order_table']} where od_id = '$od_id' ");
exit;
}
@ -515,7 +511,7 @@ if($is_member) {
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
$sql = " update {$g4['shop_cart_table']}
set cp_amount = '$cp_amt'
where uq_id = '$uq_id'
where od_id = '$od_id'
and it_id = '$cp_it_id'
and ct_select = '1'
and ct_num = '0' ";
@ -594,11 +590,11 @@ $uid = md5($od_id.G4_TIME_YMDHIS.$REMOTE_ADDR);
set_session('ss_orderview_uid', $uid);
// 주문번호제거
set_session('ss_order_uniqid', '');
set_session('ss_order_id', '');
// 기존자료 세션에서 제거
if (get_session('ss_direct'))
set_session('ss_uq_direct', '');
set_session('ss_cart_direct', '');
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.$uid);
?>

View File

@ -24,7 +24,7 @@ if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc

View File

@ -9,7 +9,7 @@ if ($token && get_session("ss_token") == $token) {
alert_close("토큰 에러");
}
$od = sql_fetch(" select * from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' and mb_id = '{$member['mb_id']}' ");
$od = sql_fetch(" select * from {$g4['shop_order_table']} where od_id = '$od_id' and mb_id = '{$member['mb_id']}' ");
if (!$od['od_id']) {
alert("존재하는 주문이 아닙니다.");
@ -19,11 +19,14 @@ if (!$od['od_id']) {
$sql = " select SUM(IF(ct_status = '주문', 1, 0)) as od_count2,
COUNT(*) as od_count1
from {$g4['shop_cart_table']}
where uq_id = '$uq_id' ";
where od_id = '$od_id' ";
$ct = sql_fetch($sql);
if($ct['od_count1'] != $ct['od_count2'] || ($od['od_settle_case'] == '가상계좌' && $od['od_receipt_amount'] > 0))
alert("취소할 수 있는 주문이 아닙니다.", G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uq_id=$uq_id");
$uid = md5($od['od_id'].$od['od_time'].$od['od_ip']);
if($ct['od_count1'] != $ct['od_count2'] || ($od['od_settle_case'] == '가상계좌' && $od['od_receipt_amount'] > 0)) {
alert("취소할 수 있는 주문이 아닙니다.", G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
}
// PG 결제 취소
if($od['od_tno']) {
@ -57,16 +60,16 @@ if($od['od_tno']) {
}
// 장바구니 자료 취소
sql_query(" update {$g4['shop_cart_table']} set ct_status = '취소' where uq_id = '$uq_id' ");
sql_query(" update {$g4['shop_cart_table']} set ct_status = '취소' where od_id = '$od_id' ");
// 주문 취소
$cancel_memo = addslashes($cancel_memo);
//sql_query(" update $g4[shop_order_table] set od_temp_point = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - {$g4['time_ymdhis']} (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
sql_query(" update {$g4['shop_order_table']} set od_send_cost = '0', od_send_cost2 = '0', od_temp_point = '0', od_receipt_amount = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - ".G4_TIME_YMDHIS." (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
sql_query(" update {$g4['shop_order_table']} set od_send_cost = '0', od_send_cost2 = '0', od_temp_point = '0', od_receipt_amount = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - ".G4_TIME_YMDHIS." (취소이유 : {$cancel_memo})\") where od_id = '$od_id' ");
// 주문취소 회원의 포인트를 되돌려 줌
if ($od['od_receipt_point'] > 0)
insert_point($member['mb_id'], $od['od_receipt_point'], "주문번호 $od_id 본인 취소");
goto_url(G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uq_id=$uq_id");
$
goto_url(G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uid=$uid");
?>

View File

@ -50,7 +50,6 @@ if(openwin != null) {
<section id="sod_fin_list">
<form name="forderrequest" method="post" action="./orderrequestupdate.php" onsubmit="return frequest_check(this);">
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
<input type="hidden" name="rq_type" value="">
<h2>주문하신 상품</h2>
<span class="sound_only">상품 상태 설명</span>
@ -70,7 +69,7 @@ if(openwin != null) {
$sql = " select it_id, it_name, cp_amount
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and ct_num = '0'
order by ct_id ";
$result = sql_query($sql);
@ -101,7 +100,7 @@ if(openwin != null) {
<?php
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and it_id = '{$row['it_id']}'
order by ct_num ";
$res = sql_query($sql);
@ -529,7 +528,7 @@ if(openwin != null) {
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>&amp;uq_id=<?php echo $od['uq_id']; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');" class="btn_frmline">현금영수증을 발급하시려면 클릭하십시오.</a>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');" class="btn_frmline">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
@ -712,7 +711,6 @@ if(openwin != null) {
<div id="sod_fin_cancelfrm">
<form method="post" action="./orderinquirycancel.php" onsubmit="return fcancel_check(this);">
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<label for="cancel_memo">취소사유</label>

View File

@ -12,13 +12,13 @@ $it = sql_fetch($sql);
// 상품 총 금액
if($sw_direct)
$uq_id = get_session('ss_uq_direct');
$cart_id = get_session('ss_cart_direct');
else
$uq_id = get_session('ss_uq_id');
$cart_id = get_session('ss_cart_id');
$sql = " select SUM( IF(io_type = '1', io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_price
from {$g4['shop_cart_table']}
where uq_id = '$uq_id'
where od_id = '$od_id'
and it_id = '$it_id' ";
$ct = sql_fetch($sql);
$item_price = $ct['sum_price'];

View File

@ -18,7 +18,7 @@ $sql = " select a.it_id,
b.it_sell_email,
b.it_origin
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$uq_id'
where a.od_id = '$od_id'
and a.ct_select = '1'
and a.ct_num = '0' ";
$result = sql_query($sql);
@ -30,14 +30,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$uq_id'
and od_id = '$od_id'
and ct_select = '1' ";
$sum = sql_fetch($sql);
// 옵션정보
$sql2 = " select ct_option, ct_qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}' and uq_id = '$uq_id' and ct_select = '1'
where it_id = '{$row['it_id']}' and od_id = '$od_id' and ct_select = '1'
order by io_type asc, ct_num asc, ct_id asc ";
$result2 = sql_query($sql2);

View File

@ -39,7 +39,7 @@ $sql = " select b.it_sell_email,
a.it_id,
a.it_name
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '$uq_id'
where a.od_id = '$od_id'
and a.ct_select = '1'
and a.ct_num = '0'
and b.it_sell_email <> '' ";
@ -52,14 +52,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
SUM(ct_qty) as qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}'
and uq_id = '$uq_id'
and od_id = '$od_id'
and ct_select = '1' ";
$sum = sql_fetch($sql);
// 옵션정보
$sql2 = " select ct_option, ct_qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}' and uq_id = '$uq_id' and ct_select = '1'
where it_id = '{$row['it_id']}' and od_id = '$od_id' and ct_select = '1'
order by io_type asc, ct_num asc, ct_id asc ";
$result2 = sql_query($sql2);

View File

@ -2,7 +2,6 @@
include_once('./_common.php');
$od_id = $_POST['od_id'];
$uq_id = $_POST['uq_id'];
$rq_type = $_POST['rq_type'];
$rq_content = $_POST['rq_content'];
@ -21,7 +20,7 @@ switch($rq_type) {
if(!count($_POST['chk_ct_id']))
alert($req_act.'하실 상품을 하나이상 선택해 주십시오.');
$od = sql_fetch(" select od_id from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' and mb_id = '{$member['mb_id']}' ");
$od = sql_fetch(" select od_id, od_time, od_ip from {$g4['shop_order_table']} where od_id = '$od_id' and mb_id = '{$member['mb_id']}' ");
if (!$od['od_id']) {
alert("존재하는 주문이 아닙니다.");
@ -50,5 +49,5 @@ $sql = " insert into {$g4['shop_request_table']}
( '$rq_type', '$od_id', '$ct_id', '{$member['mb_id']}', '$rq_content', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR' ) ";
sql_query($sql);
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uq_id='.$uq_id);
goto_url(G4_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&amp;uid='.md5($od['od_id'].$od['od_time'].$od['od_ip']));
?>

View File

@ -4,11 +4,11 @@ include_once('./_common.php');
$g4['title'] = '주문번호 '.$od_id.' 현금영수증 발행';
include_once(G4_PATH.'/head.sub.php');
$od = sql_fetch(" select * from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ");
$od = sql_fetch(" select * from {$g4['shop_order_table']} where od_id = '$od_id' ");
if (!$od)
die('<p id="scash_empty">주문서가 존재하지 않습니다.</p>');
$goods = get_goods($od['uq_id']);
$goods = get_goods($od['od_id']);
$goods_name = $goods['full_name'];
//if ($goods[count] > 1) $goods_name .= ' 외 '.$goods[count].'건';