From 35fb294cfc1e96a1869a666cf77ad7f21ff9a813 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Wed, 30 Oct 2013 10:27:56 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EC=84=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/ordercartupdate.php | 57 +++++++++------------------ adm/shop_admin/orderform.php | 33 ++++++++++------ adm/shop_admin/orderreceiptupdate.php | 43 +++++++++++--------- 3 files changed, 63 insertions(+), 70 deletions(-) diff --git a/adm/shop_admin/ordercartupdate.php b/adm/shop_admin/ordercartupdate.php index 93c091282..5ad606345 100644 --- a/adm/shop_admin/ordercartupdate.php +++ b/adm/shop_admin/ordercartupdate.php @@ -8,34 +8,17 @@ $ct_chk_count = count($_POST['ct_chk']); if(!$ct_chk_count) alert('처리할 자료를 하나 이상 선택해 주십시오.'); -switch($_POST['act_button']) -{ - case '주문': - $ct_status = '주문'; - break; - case '상품준비중': - $ct_status = '준비'; - break; - case '배송중': - $ct_status = '배송'; - break; - case '완료': - $ct_status = '완료'; - break; - case '취소': - $ct_status = '취소'; - break; - case '반품': - $ct_status = '반품'; - break; - case '품절': - $ct_status = '품절'; - break; - default: - alert('변경할 상태가 올바르지 않습니다.'); - break; + +$status_normal = array('주문','입금','준비','배송','완료'); +$status_cancel = array('취소','반품','품절'); + +if (in_array($_POST['ct_status'], $status_normal) || in_array($_POST['ct_status'], $status_cancel)) { + ; // 통과 +} else { + alert('변경할 상태가 올바르지 않습니다.'); } + $mod_history = ''; $cnt = count($_POST['ct_id']); for ($i=0; $i<$cnt; $i++) @@ -43,9 +26,7 @@ for ($i=0; $i<$cnt; $i++) $k = $_POST['ct_chk'][$i]; $ct_id = $_POST['ct_id'][$k]; - $sql = " select * from {$g5['g5_shop_cart_table']} - where od_id = '$od_id' - and ct_id = '$ct_id' "; + $sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_id = '$ct_id' "; $ct = sql_fetch($sql); if(!$ct['ct_id']) continue; @@ -174,22 +155,20 @@ $sql = " update {$g5['g5_shop_order_table']} od_misu = '{$info['od_misu']}', od_tax_mny = '{$info['od_tax_mny']}', od_vat_mny = '{$info['od_vat_mny']}', - od_free_mny = '{$info['od_free_mny']}' - where od_id = '$od_id' "; + od_free_mny = '{$info['od_free_mny']}' "; +if ($mod_history) { // 수량변경 히스토리 기록 + $sql .= " , od_mod_history = CONCAT(od_mod_history,'$mod_history') "; +} +if (in_array($_POST['ct_status'], $status_normal)) { // 정상인 주문상태만 기록 + $sql .= " , od_status = '{$_POST['ct_status']}' "; +} +$sql .= " where od_id = '$od_id' "; sql_query($sql); $qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page"; $url = "./orderform.php?od_id=$od_id&$qstr"; -// 수량변경 히스토리 기록 -if($mod_history) { - $sql = " update {$g5['g5_shop_order_table']} - set od_mod_history = CONCAT(od_mod_history,'$mod_history') - where od_id = '$od_id' "; - sql_query($sql); -} - // 1.06.06 $od = sql_fetch(" select od_receipt_point from {$g5['g5_shop_order_table']} where od_id = '$od_id' "); if ($od['od_receipt_point']) diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php index 4f6637bb8..722668683 100644 --- a/adm/shop_admin/orderform.php +++ b/adm/shop_admin/orderform.php @@ -110,7 +110,13 @@ $pg_anchor = '