주문서 관리 수정중

This commit is contained in:
gnuboard
2013-10-30 10:27:56 +09:00
parent 426c23142b
commit 35fb294cfc
3 changed files with 63 additions and 70 deletions

View File

@ -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&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
$url = "./orderform.php?od_id=$od_id&amp;$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'])

View File

@ -110,7 +110,13 @@ $pg_anchor = '<ul class="anchor">
<h2 class="h2_frm">주문상품 목록</h2>
<?php echo $pg_anchor; ?>
<div class="local_desc02 local_desc">
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원</p>
<p>
주문상태 <strong><?php echo $od['od_status'] ?></strong>
|
주문일시 <strong><?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>)</strong>
|
주문총액 <strong><?php echo number_format($od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원
</p>
<?php if ($default['de_hope_date_use']) { ?><p>희망배송일은 <?php echo $od['od_hope_date']; ?> (<?php echo get_yoil($od['od_hope_date']); ?>) 입니다.</p><?php } ?>
<?php if($od['od_mobile']) { ?>
<p>모바일 쇼핑몰의 주문입니다.</p>
@ -218,16 +224,19 @@ $pg_anchor = '<ul class="anchor">
</div>
<div class="btn_list02 btn_list">
<strong>주문상태 변경</strong>
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
<input type="submit" name="act_button" value="주문" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="상품" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="배송" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="완료" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="취소" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="반품" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="품절" onclick="document.pressed=this.value">
<p>취소,반품,품절 상태는 장바구니 상품의 상태만 변경이 되며 주문서의 상태는 변경되지 않습니다.</p>
<p>
<strong>주문상태 변경</strong>
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
<input type="submit" name="ct_status" value="주문" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="입금" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="준비" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="배송" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="완료" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="취소" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="반품" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="품절" onclick="document.pressed=this.value">
</p>
<p>주문, 입금, 준비, 배송, 완료는 장바구니와 주문서 상태를 모두 변경하지만, 취소, 반품, 품절은 장바구니의 상태만 변경하며, 주문서 상태는 변경하지 않습니다.</p>
</div>
</form>
@ -879,7 +888,7 @@ function form_submit(f)
return false;
}
if (confirm("\'" + status + "\'을(를) 선택하셨습니다.\n\n이대로 처리 하시겠습니까?")) {
if (confirm("\'" + status + "\' 상태를 선택하셨습니다.\n\n처리 하시겠습니까?")) {
return true;
} else {
return false;

View File

@ -7,36 +7,33 @@ include_once(G5_LIB_PATH.'/icode.sms.lib.php');
auth_check($auth[$sub_menu], "w");
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
$od = sql_fetch($sql);
$od = sql_fetch($sql);
if(!$od['od_id'])
alert('주문자료가 존재하지 않습니다.');
if ($od_receipt_time)
{
if ($od_receipt_time) {
if (check_datetime($od_receipt_time) == false)
alert('결제일시 오류입니다.');
}
// 결제정보 반영
$sql = " update {$g5['g5_shop_order_table']}
set od_deposit_name = '$od_deposit_name',
od_bank_account = '$od_bank_account',
od_receipt_time = '$od_receipt_time',
od_receipt_price = '$od_receipt_price',
od_receipt_point = '$od_receipt_point',
od_refund_price = '$od_refund_price',
od_deliver_company = '$od_deliver_company',
od_invoice = '$od_invoice',
od_invoice_time = '$od_invoice_time',
od_send_cost = '$od_send_cost',
od_send_cost2 = '$od_send_cost2'
set od_deposit_name = '{$_POST['od_deposit_name']}',
od_bank_account = '{$_POST['od_bank_account']}',
od_receipt_time = '{$_POST['od_receipt_time']}',
od_receipt_price = '{$_POST['od_receipt_price']}',
od_receipt_point = '{$_POST['od_receipt_point']}',
od_refund_price = '{$_POST['od_refund_price']}',
od_delivery_company= '{$_POST['od_delivery_company']}',
od_invoice = '{$_POST['od_invoice']}',
od_invoice_time = '{$_POST['od_invoice_time']}',
od_send_cost = '{$_POST['od_send_cost']}',
od_send_cost2 = '{$_POST['od_send_cost2']}'
where od_id = '$od_id' ";
sql_query($sql);
// 주문정보
$info = get_order_info($od_id);
if(!$info)
alert('주문자료가 존재하지 않습니다.');
@ -62,19 +59,27 @@ include "./ordersms.inc.php";
// 에스크로 배송처리
if($_POST['od_tno'] && $_POST['od_escrow'] == 1) {
$arr_tno = array();
if($_POST['od_tno'] && $_POST['od_escrow'] == 1)
{
$arr_tno = array();
$arr_corp = array();
$arr_numb = array();
/*
// 배송회사정보
$sql = " select dl_company from {$g5['g5_shop_delivery_table']} where dl_id = '$dl_id' ";
$row = sql_fetch($sql);
$arr_tno[0] = $_POST['od_tno'];
$arr_tno[0] = $_POST['od_tno'];
$arr_corp[0] = $row['dl_company'];
$arr_numb[0] = $od_invoice;
$cust_ip = getenv('REMOTE_ADDR');
*/
$arr_tno[0] = $_POST['od_tno'];
$arr_corp[0] = $od_delivery_company;
$arr_numb[0] = $od_invoice;
$cust_ip = getenv('REMOTE_ADDR');
include_once('./orderescrow.inc.php');
}