$sub_menu = "400400"; include_once("./_common.php"); include_once(G4_LIB_PATH.'/thumbnail.lib.php'); // 메세지 $html_title = "주문 내역 수정"; $alt_msg1 = "주문번호 오류입니다."; $mb_guest = "비회원"; $hours = 6; // 설정 시간이 지난 주문서 없는 장바구니 자료 삭제 $cart_title1 = "쇼핑"; $cart_title2 = "완료"; $cart_title3 = "주문번호"; $cart_title4 = "배송완료"; auth_check($auth[$sub_menu], "w"); $g4['title'] = $html_title; include_once(G4_ADMIN_PATH.'/admin.head.php'); //------------------------------------------------------------------------------ // 설정 시간이 지난 주문서 없는 장바구니 자료 삭제 //------------------------------------------------------------------------------ if (!isset($cart_not_delete)) { if (!$hours) $hours = 6; $beforehours = date("Y-m-d H:i:s", ( $g4['server_time'] - (60 * 60 * $hours) ) ); $sql = " delete from {$g4['yc4_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforehours' "; sql_query($sql); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // 주문완료 포인트 // 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여 // 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다. //------------------------------------------------------------------------------ if (!isset($order_not_point)) { $beforedays = date("Y-m-d H:i:s", ( time() - (60 * 60 * 24 * (int)$default['de_point_days']) ) ); $sql = " select * from {$g4['yc4_cart_table']} where ct_status = '$cart_title2' and ct_point_use = '0' and ct_time <= '$beforedays' "; $result = sql_query($sql); 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 od_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['ct_id']}"); } sql_query("update {$g4['yc4_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' "); } } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // 주문서 정보 //------------------------------------------------------------------------------ $sql = " select * from {$g4['yc4_order_table']} where od_id = '$od_id' "; $od = sql_fetch($sql); if (!$od['od_id']) { alert($alt_msg1); } if ($od['mb_id'] == "") { $od['mb_id'] = $mb_guest; } //------------------------------------------------------------------------------ $qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page"; // PG사를 KCP 사용하면서 테스트 상점아이디라면 if ($default['de_card_test']) { // 로그인 아이디 / 비번 // 일반 : test1234 / test12345 // 에스크로 : escrow / escrow913 $g4['yc4_cardpg']['kcp'] = "http://testadmin8.kcp.co.kr"; } $sql_common = " from ( select * from {$g4['yc4_cart_table']} where uq_id = '{$od['od_id']}' order by ct_id asc ) as a left join {$g4['yc4_item_table']} as b on ( a.it_id = b.it_id )"; $sql = " select a.ct_id, a.uq_id, a.it_id, a.it_amount, a.ct_amount, a.ct_qty, a.cp_amount, (SUM((a.ct_amount + a.it_amount) * a.ct_qty) - a.cp_amount) as orderamount, SUM(a.ct_point * a.ct_qty) as pointamount, (SUM(IF(a.ct_status = '취소' OR a.ct_status = '반품' OR a.ct_status = '품절', (a.ct_amount + a.it_amount) * a.ct_qty, 0))) as ordercancel, a.ct_status, a.ct_time, a.ct_point_use, a.ct_stock_use, a.ct_option, a.is_option, a.it_name $sql_common group by a.it_id order by a.ct_id "; $result = sql_query($sql); ?>
| =subtitle("주문상품")?> | if ($default['de_hope_date_use']) { ?> 희망배송일은 =$od['od_hope_date']?> (=get_yoil($od['od_hope_date'])?>) 입니다. } ?> |