주문 취소 요청 기능 제거
This commit is contained in:
@ -7,7 +7,6 @@ $menu['menu400'] = array (
|
|||||||
array('400400', '주문내역', G4_ADMIN_URL.'/shop_admin/orderlist.php', 'scf_order', 1),
|
array('400400', '주문내역', G4_ADMIN_URL.'/shop_admin/orderlist.php', 'scf_order', 1),
|
||||||
array('400410', '주문개별내역', G4_ADMIN_URL.'/shop_admin/orderstatuslist.php', 'scf_order_by', 1),
|
array('400410', '주문개별내역', G4_ADMIN_URL.'/shop_admin/orderstatuslist.php', 'scf_order_by', 1),
|
||||||
array('400420', '주문통합내역', G4_ADMIN_URL.'/shop_admin/orderlist2.php', 'scf_order_all', 1),
|
array('400420', '주문통합내역', G4_ADMIN_URL.'/shop_admin/orderlist2.php', 'scf_order_all', 1),
|
||||||
array('400430', '취소교환반품내역', G4_ADMIN_URL.'/shop_admin/orderrequestlist.php', 'scf_request', 1),
|
|
||||||
array('400440', '개인결제관리', G4_ADMIN_URL.'/shop_admin/personalpaylist.php', 'scf_personalpay', 1),
|
array('400440', '개인결제관리', G4_ADMIN_URL.'/shop_admin/personalpaylist.php', 'scf_personalpay', 1),
|
||||||
array('400200', '분류관리', G4_ADMIN_URL.'/shop_admin/categorylist.php', 'scf_cate'),
|
array('400200', '분류관리', G4_ADMIN_URL.'/shop_admin/categorylist.php', 'scf_cate'),
|
||||||
array('400300', '상품관리', G4_ADMIN_URL.'/shop_admin/itemlist.php', 'scf_item'),
|
array('400300', '상품관리', G4_ADMIN_URL.'/shop_admin/itemlist.php', 'scf_item'),
|
||||||
|
|||||||
@ -73,12 +73,6 @@ if ($od['mb_id'] == "") {
|
|||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
// 요청정보
|
|
||||||
$sql = " select rq_id, ct_id, rq_type, rq_time, rq_status
|
|
||||||
from {$g4['shop_request_table']} where od_id = '{$od['od_id']}' and rq_parent = '0' order by rq_id desc ";
|
|
||||||
$rq_result = sql_query($sql);
|
|
||||||
$rq_count = mysql_num_rows($rq_result);
|
|
||||||
|
|
||||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
||||||
|
|
||||||
// PG사를 KCP 사용하면서 테스트 상점아이디라면
|
// PG사를 KCP 사용하면서 테스트 상점아이디라면
|
||||||
@ -102,10 +96,8 @@ $result = sql_query($sql);
|
|||||||
|
|
||||||
$pg_anchor = '<ul class="anchor">
|
$pg_anchor = '<ul class="anchor">
|
||||||
<li><a href="#anc_sodr_list">주문상품 목록</a></li>
|
<li><a href="#anc_sodr_list">주문상품 목록</a></li>
|
||||||
<li><a href="#anc_sodr_pay">주문결제 내역</a></li>';
|
<li><a href="#anc_sodr_pay">주문결제 내역</a></li>
|
||||||
if($rq_count)
|
<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
|
||||||
$pg_anchor .= '<li><a href="#anc_sodr_request">고객요청 내역</a></li>';
|
|
||||||
$pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
|
|
||||||
<li><a href="#anc_sodr_paymo">결제상세정보 수정</a></li>
|
<li><a href="#anc_sodr_paymo">결제상세정보 수정</a></li>
|
||||||
<li><a href="#anc_sodr_memo">상점메모</a></li>
|
<li><a href="#anc_sodr_memo">상점메모</a></li>
|
||||||
<li><a href="#anc_sodr_payer">주문하신 분</a></li>
|
<li><a href="#anc_sodr_payer">주문하신 분</a></li>
|
||||||
@ -296,78 +288,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<?php if($rq_count) { ?>
|
|
||||||
<section id="anc_sodr_request" class="cbox">
|
|
||||||
<h2>고객요청내역</h2>
|
|
||||||
<?php echo $pg_anchor; ?>
|
|
||||||
<h3>요청리스트</h3>
|
|
||||||
<div id="sodr_request_list">
|
|
||||||
<?php
|
|
||||||
for($j=0; $rq_row=sql_fetch_array($rq_result); $j++) {
|
|
||||||
$rq_item = explode(',', $rq_row['ct_id']);
|
|
||||||
$rq_item_count = count($rq_item);
|
|
||||||
$rq_ct_id = $rq_item[0];
|
|
||||||
|
|
||||||
switch($rq_row['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$type ='';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$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)
|
|
||||||
$rq_subject .= '외 '.($rq_item_count - 1).'건';
|
|
||||||
$rq_subject .= ' '.$type.'요청';
|
|
||||||
|
|
||||||
if($rq_row['rq_id'] != $rq_id) {
|
|
||||||
$order_href = './orderform.php?od_id='.$od['od_id'].'&rq_id='.$rq_row['rq_id'].'&'.$qstr.'#anc_sodr_request';
|
|
||||||
$rq_subject = '<a href="'.$order_href.'">'.$rq_subject.'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($rq_row['rq_status']) {
|
|
||||||
case 1:
|
|
||||||
$rq_status = ' [처리완료]';
|
|
||||||
break;
|
|
||||||
case 99:
|
|
||||||
$rq_status = ' [고객취소]';
|
|
||||||
break;
|
|
||||||
case 100:
|
|
||||||
$rq_status = ' [처리불가]';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$rq_status = ' [요청접수]';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<?php echo $rq_subject.$rq_status; ?>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<?php if($rq_id) { ?>
|
|
||||||
<div id="sodr_request_frm">
|
|
||||||
<?php
|
|
||||||
// 요청 처리폼 include
|
|
||||||
include_once('./orderrequest.inc.php');
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
</section>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<section class="cbox compare_wrap">
|
<section class="cbox compare_wrap">
|
||||||
<h2>결제상세정보</h2>
|
<h2>결제상세정보</h2>
|
||||||
<?php echo $pg_anchor; ?>
|
<?php echo $pg_anchor; ?>
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|
||||||
|
|
||||||
// 요청정보
|
|
||||||
$sql = " select * from {$g4['shop_request_table']} where rq_id = '$rq_id' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
$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 od_id = '{$od['od_id']}'
|
|
||||||
order by ct_id ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section id="sodr_request_item">
|
|
||||||
<h3><?php echo $type; ?>요청 상품</h3>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">상품명</th>
|
|
||||||
<th scope="col">옵션항목</th>
|
|
||||||
<th scope="col">판매가</th>
|
|
||||||
<th scope="col">수량</th>
|
|
||||||
<th scope="col">소계</th>
|
|
||||||
<th scope="col">상태</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$excp = 0;
|
|
||||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
|
||||||
if(!in_array($row['ct_id'], $item)) {
|
|
||||||
$excp++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$image = get_it_image($row['it_id'], 50, 50);
|
|
||||||
|
|
||||||
if($row['io_type']) {
|
|
||||||
$price = $row['io_price'];
|
|
||||||
$tot_price = $row['io_price'] * $row['ct_qty'];
|
|
||||||
} else {
|
|
||||||
$price = $row['ct_price'] + $row['io_price'];
|
|
||||||
$tot_price = ($row['ct_price'] + $row['io_price']) * $row['ct_qty'];
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo stripslashes($row['it_name']); ?></a>
|
|
||||||
<?php if($od['od_tax_flag'] && $row['ct_notax']) echo '[비과세상품]'; ?>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $row['ct_option']; ?></td>
|
|
||||||
<td><?php echo number_format($price); ?></td>
|
|
||||||
<td><?php echo number_format($row['ct_qty']); ?></td>
|
|
||||||
<td><?php echo number_format($tot_price); ?></td>
|
|
||||||
<td><?php echo $row['ct_status']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div id="order_request">
|
|
||||||
<?php
|
|
||||||
// 요청 처리폼 include
|
|
||||||
include_once('./orderrequestform.php');
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
$sub_menu = '400430';
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], "d");
|
|
||||||
|
|
||||||
if($w == 'd') {
|
|
||||||
$sql = " select rq_id from {$g4['shop_request_table']} where rq_id = '$rq_id' ";
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
if(!$row['rq_id'])
|
|
||||||
alert('자료가 존재하지 않습니다.');
|
|
||||||
|
|
||||||
$sql = " delete from {$g4['shop_request_table']} where rq_id = '$rq_id' or rq_parent = '$rq_id' ";
|
|
||||||
sql_query($sql);
|
|
||||||
} else {
|
|
||||||
$count = count($_POST['chk']);
|
|
||||||
if(!$count)
|
|
||||||
alert('삭제하시려는 항목을 하나이상 선택해 주십시오.');
|
|
||||||
|
|
||||||
for($i=0; $i<$count; $i++) {
|
|
||||||
$k = $_POST['chk'][$i];
|
|
||||||
|
|
||||||
$sql = " delete from {$g4['shop_request_table']} where rq_id = '{$_POST['rq_id'][$k]}' or rq_parent = '{$_POST['rq_id'][$k]}' ";
|
|
||||||
sql_query($sql);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$qstr .= '&rq_type='.$rq_type;
|
|
||||||
|
|
||||||
goto_url('./orderrequestlist.php?'.$qstr);
|
|
||||||
?>
|
|
||||||
@ -1,315 +0,0 @@
|
|||||||
<?php
|
|
||||||
$sub_menu = '400430';
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], "w");
|
|
||||||
|
|
||||||
// 요청정보
|
|
||||||
if(empty($rq)) {
|
|
||||||
$sql = " select * from {$g4['shop_request_table']} where rq_id = '$rq_id' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$rq['rq_id']) {
|
|
||||||
if(!isset($_POST['rq_id']))
|
|
||||||
alert('등록된 자료가 없습니다.');
|
|
||||||
else
|
|
||||||
die('등록된 자료가 없습니다.');
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($rq['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$type = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = explode(',', $rq['ct_id']);
|
|
||||||
if(!count($item)) {
|
|
||||||
if(!isset($_POST['rq_id']))
|
|
||||||
alert($type.'요청된 상품이 없습니다.');
|
|
||||||
else
|
|
||||||
die($type.'요청된 상품이 없습니다.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 주문정보
|
|
||||||
if(empty($od)) {
|
|
||||||
$sql = " select * from {$g4['shop_order_table']} where od_id = '{$rq['od_id']}' ";
|
|
||||||
$od = sql_fetch($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$od['od_id']) {
|
|
||||||
if(!isset($_POST['rq_id']))
|
|
||||||
alert('주문정보가 존재하지 않습니다.');
|
|
||||||
else
|
|
||||||
die('주문정보가 존재하지 않습니다.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 요청내용
|
|
||||||
$cus_content = conv_content($rq['rq_content'], 0);
|
|
||||||
$cus_status = '';
|
|
||||||
|
|
||||||
if(!$rq['rq_parent']) {
|
|
||||||
switch($rq['rq_status']) {
|
|
||||||
case 1:
|
|
||||||
$cus_status = '처리완료';
|
|
||||||
break;
|
|
||||||
case 99:
|
|
||||||
$cus_status = '고객취소';
|
|
||||||
break;
|
|
||||||
case 100:
|
|
||||||
$cus_status = '처리불가';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($rq['rq_parent']) {
|
|
||||||
$sql = " select rq_content from {$g4['shop_request_table']} where rq_id = '{$rq['rq_parent']}' ";
|
|
||||||
$cus = sql_fetch($sql);
|
|
||||||
$cus_content = conv_content($cus['rq_content'], 0);
|
|
||||||
|
|
||||||
switch($cus['rq_status']) {
|
|
||||||
case 1:
|
|
||||||
$cus_status = '처리완료';
|
|
||||||
break;
|
|
||||||
case 99:
|
|
||||||
$cus_status = '고객취소';
|
|
||||||
break;
|
|
||||||
case 100:
|
|
||||||
$cus_status = '처리불가';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 요청상품
|
|
||||||
$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 od_id = '{$od['od_id']}'
|
|
||||||
order by ct_id ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
|
|
||||||
$rq_qstr = "sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&save_stx=$save_stx&page=$page&rq_type=$rq_type";
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section id="sodr_requset_content">
|
|
||||||
<h3><?php echo $type; ?>요청 내용</h3>
|
|
||||||
<p>
|
|
||||||
<?php echo $cus_content; ?>
|
|
||||||
</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="sodr_request_log">
|
|
||||||
<h3><?php echo $type; ?>요청 처리내역</h3>
|
|
||||||
<p>처리내역을 클릭하시면 상세 내용을 확인할 수 있습니다.</p>
|
|
||||||
|
|
||||||
<div id="sodr_request_log_wrap">
|
|
||||||
<?php
|
|
||||||
$c_rq_id = $rq_id;
|
|
||||||
if($rq['rq_parent'])
|
|
||||||
$c_rq_id = $rq['rq_parent'];
|
|
||||||
|
|
||||||
$sql = " select rq_id, rq_content, rq_time from {$g4['shop_request_table']} where rq_parent = '$c_rq_id' order by rq_id desc ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
|
|
||||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
|
||||||
?>
|
|
||||||
<p>
|
|
||||||
<span><b><?php echo $row['rq_time']; ?></b> <?php echo $row['rq_content']; ?></span>
|
|
||||||
<button id="rq_id_<?php echo $row['rq_id']; ?>" class="od_request_list">상세보기</button>
|
|
||||||
</p>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
if($i == 0)
|
|
||||||
echo '<p>처리내역이 없습니다.</p>';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="sodr_request_handle">
|
|
||||||
<h3><?php echo $type; ?>요청 처리</h3>
|
|
||||||
|
|
||||||
<form name="forderrequest" id="forderrequest" method="post" action="./orderrequestformupdate.php">
|
|
||||||
<input type="hidden" name="rq_id" value="<?php echo $rq['rq_parent'] ? $rq['rq_parent'] : $rq['rq_id']; ?>">
|
|
||||||
<input type="hidden" name="disp_list" value="<?php echo $disp_list; ?>">
|
|
||||||
<table class="frm_tbl">
|
|
||||||
<colgroup>
|
|
||||||
<col class="grid_3">
|
|
||||||
<col>
|
|
||||||
</colgroup>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_status">상태</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="rq_status" id="rq_status">
|
|
||||||
<option value="0"<?php echo get_selected($rq['rq_status'], '0'); ?>>선택</option>
|
|
||||||
<option value="1"<?php echo get_selected($rq['rq_status'], '1'); ?>><?php echo $type; ?>요청 처리완료</option>
|
|
||||||
<option value="99"<?php echo get_selected($rq['rq_status'], '99'); ?>>고객취소</option>
|
|
||||||
<option value="100"<?php echo get_selected($rq['rq_status'], '100'); ?>>처리불가</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php if($rq['rq_type'] == 0) { // 취소요청 ?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount1">환불금액</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_account">환불계좌</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_account" id="rq_account" value="<?php echo $rq['rq_account']; ?>" class="frm_input" size="30">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } // 취소요청 끝 ?>
|
|
||||||
<?php if($rq['rq_type'] == 1) { // 교환요청 ?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_item">교환상품</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea name="rq_item" id="rq_item"><?php echo $rq['rq_item']; ?></textarea>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="dl_company">배송회사</label></td>
|
|
||||||
<td>
|
|
||||||
<select name="dl_id" id="dl_id">
|
|
||||||
<option value="">선택</option>
|
|
||||||
<?php
|
|
||||||
$sql = "select * from {$g4['shop_delivery_table']} order by dl_order desc, dl_id desc ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
|
||||||
?>
|
|
||||||
<option value="<?php echo $row['dl_id']; ?>" <?php echo get_selected($rq['dl_company'], $row['dl_id']); ?>><?php echo $row['dl_company']; ?></option>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
mysql_free_result($result);
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_invoice">운송장번호</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_invoice" id="rq_invoice" value="<?php echo $rq['rq_invoice']; ?>" class="frm_input" size="30">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount1">상품차액</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_account">차액입금계좌</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_account" id="rq_account" value="<?php echo $rq['rq_account']; ?>" class="frm_input" size="30">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } // 교환요청 끝 ?>
|
|
||||||
<?php if($rq['rq_type'] == 2) { // 반품요청 ?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount1">환불금액</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_account">환불계좌</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_account" id="rq_account" value="<?php echo $rq['rq_account']; ?>" class="frm_input" size="30">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } // 반품요청 끝 ?>
|
|
||||||
<?php
|
|
||||||
if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') {
|
|
||||||
if($od['od_tax_flag']) {
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount2">과세금액 부분취소</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount2" id="rq_amount2" value="<?php echo $rq['rq_amount2'] ? $rq['rq_amount2'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount3">비과세금액 부분취소</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount3" id="rq_amount3" value="<?php echo $rq['rq_amount3'] ? $rq['rq_amount3'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } else { ?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_amount2">금액 부분취소</label></td>
|
|
||||||
<td>
|
|
||||||
<input type="text" name="rq_amount2" id="rq_amount2" value="<?php echo $rq['rq_amount2'] ? $rq['rq_amount2'] : ''; ?>" class="frm_input" size="15"> 원
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><label for="rq_content">처리내용</label></td>
|
|
||||||
<td>
|
|
||||||
<textarea name="rq_content" id="rq_content"><?php echo $rq['rq_parent'] ? $rq['rq_content'] : ''; ?></textarea>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="btn_confirm">
|
|
||||||
<button type="submit" id="request_submit" class="btn_submit">확인</button>
|
|
||||||
<a href="./orderrequestlist.php?<?php echo $rq_qstr; ?>">요청목록</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$("form[name=forderrequest]").submit(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
<?php if($cus_status) { ?>
|
|
||||||
if(!confirm("<?php echo $cus_status; ?> 상태의 요청내역입니다.\n추가로 처리내용을 입력하시겠습니까?"))
|
|
||||||
return false;
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
$.post(
|
|
||||||
"./orderrequestformupdate.php",
|
|
||||||
$(this).serialize(),
|
|
||||||
function(data) {
|
|
||||||
if(data != "")
|
|
||||||
alert(data);
|
|
||||||
else
|
|
||||||
document.location.reload();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".od_request_list").click(function() {
|
|
||||||
var rq_id = $(this).attr("id").replace(/[^0-9]/g, "");
|
|
||||||
$.post(
|
|
||||||
"./orderrequestform.php",
|
|
||||||
{ rq_id: rq_id },
|
|
||||||
function(data) {
|
|
||||||
$("#order_request").html(data);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@ -1,217 +0,0 @@
|
|||||||
<?php
|
|
||||||
$sub_menu = '400430';
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], "w");
|
|
||||||
|
|
||||||
$sql = " select * from {$g4['shop_request_table']} where rq_id = '$rq_id' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
if(!$rq['rq_id'])
|
|
||||||
die('등록된 자료가 없습니다.');
|
|
||||||
|
|
||||||
// 주문정보
|
|
||||||
$sql = " select * from {$g4['shop_order_table']} where od_id = '{$rq['od_id']}' ";
|
|
||||||
$od = sql_fetch($sql);
|
|
||||||
|
|
||||||
if(!$od['od_id'])
|
|
||||||
die('주문정보가 존재하지 않습니다.');
|
|
||||||
|
|
||||||
if(!trim($rq_content))
|
|
||||||
die('처리내용을 입력해 주십시오.');
|
|
||||||
|
|
||||||
|
|
||||||
// 부분취소처리(결제금액이 있을 때만)
|
|
||||||
if(($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') && ($rq_amout2 > 0 || $rq_amount3 > 0) && $rq_status == 1 && $od['od_receipt_amount'] > 0 && $od['od_tno'])
|
|
||||||
{
|
|
||||||
$rq_amount2 = preg_replace('/[^0-9]/', '', $rq_amount2);
|
|
||||||
$rq_amount3 = preg_replace('/[^0-9]/', '', $rq_amount3);
|
|
||||||
|
|
||||||
switch($rq['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$type = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0, 10) >= G4_TIME_YMD)
|
|
||||||
die('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
|
|
||||||
|
|
||||||
// 취소사유의 한글깨짐 방지처리
|
|
||||||
$def_locale = setlocale(LC_CTYPE, 0);
|
|
||||||
$cancel_memo = iconv("utf-8", "euc-kr", '고객 '.$type.'요청으로 인한 부분취소');
|
|
||||||
$locale_change = false;
|
|
||||||
if(preg_match("/utf[\-]?8/i", $def_locale)) {
|
|
||||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
|
||||||
$locale_change = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 부분취소 실행
|
|
||||||
if ($default['de_card_test']) {
|
|
||||||
if ($default['de_escrow_use'] == 1) {
|
|
||||||
// 에스크로결제 테스트
|
|
||||||
$default['de_kcp_mid'] = "T0007";
|
|
||||||
$default['de_kcp_site_key'] = '2.mDT7R4lUIfHlHq4byhYjf__';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 일반결제 테스트
|
|
||||||
$default['de_kcp_mid'] = "T0000";
|
|
||||||
$default['de_kcp_site_key'] = '3grptw1.zW0GSo4PQdaGvsF__';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$g_conf_site_cd = $default['de_kcp_mid'];
|
|
||||||
$g_conf_site_key = $default['de_kcp_site_key'];
|
|
||||||
$g_conf_home_dir = G4_SHOP_PATH.'/kcp';
|
|
||||||
$g_conf_key_dir = '';
|
|
||||||
$g_conf_log_dir = '';
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
|
||||||
{
|
|
||||||
$g_conf_key_dir = G4_SHOP_PATH.'/kcp/bin/pub.key';
|
|
||||||
$g_conf_log_dir = G4_SHOP_PATH.'/kcp/log';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preg_match("/^T000/", $g_conf_site_cd) || $default['de_card_test']) {
|
|
||||||
$g_conf_gw_url = "testpaygw.kcp.co.kr";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$g_conf_gw_url = "paygw.kcp.co.kr";
|
|
||||||
if (!preg_match("/^SR/", $g_conf_site_cd)) {
|
|
||||||
alert("SR 로 시작하지 않는 KCP SITE CODE 는 지원하지 않습니다.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$g_conf_log_level = "3";
|
|
||||||
$g_conf_gw_port = "8090";
|
|
||||||
|
|
||||||
include G4_SHOP_PATH.'/kcp/pp_cli_hub_lib.php';
|
|
||||||
|
|
||||||
$tno = $od['od_tno'];
|
|
||||||
$req_tx = 'mod';
|
|
||||||
$mod_desc = $cancel_memo;
|
|
||||||
$cust_ip = getenv('REMOTE_ADDR');
|
|
||||||
$rem_mny = $od['od_receipt_amount'] - $od['od_cancel_card'];;
|
|
||||||
$mod_mny = $rq_amount2;
|
|
||||||
$tax_mny = $rq_amount2;
|
|
||||||
$mod_free_mny = $rq_amount3;
|
|
||||||
$mod_type = 'RN07';
|
|
||||||
if($od['od_settle_case'] == '계좌이체')
|
|
||||||
$mod_type = 'STPA';
|
|
||||||
|
|
||||||
if($od['od_tax_flag']) {
|
|
||||||
$mod_mny = $tax_mny + $mod_free_mny;
|
|
||||||
}
|
|
||||||
|
|
||||||
$c_PayPlus = new C_PAYPLUS_CLI;
|
|
||||||
$c_PayPlus->mf_clear();
|
|
||||||
|
|
||||||
if ( $req_tx == "mod" )
|
|
||||||
{
|
|
||||||
$tran_cd = "00200000";
|
|
||||||
|
|
||||||
$c_PayPlus->mf_set_modx_data( "tno" , $tno ); // KCP 원거래 거래번호
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_type" , $mod_type ); // 원거래 변경 요청 종류
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_ip" , $cust_ip ); // 변경 요청자 IP
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_desc" , $mod_desc ); // 변경 사유
|
|
||||||
$c_PayPlus->mf_set_modx_data( "rem_mny" , strval($rem_mny) ); // 취소 가능 잔액
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_mny" , strval($mod_mny) ); // 취소 요청 금액
|
|
||||||
|
|
||||||
if($od['od_tax_flag'])
|
|
||||||
{
|
|
||||||
$mod_tax_mny = round((int)$tax_mny / 1.1);
|
|
||||||
$mod_vat_mny = (int)$tax_mny - $mod_tax_mny;
|
|
||||||
|
|
||||||
$c_PayPlus->mf_set_modx_data( "tax_flag" , "TG03" ); // 복합과세 구분
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_tax_mny" , strval($mod_tax_mny) ); // 공급가 부분 취소 요청 금액
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_vat_mny" , strval($mod_vat_mny) ); // 부과세 부분 취소 요청 금액
|
|
||||||
$c_PayPlus->mf_set_modx_data( "mod_free_mny" , $mod_free_mny ); // 비관세 부분 취소 요청 금액
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( $tran_cd != "" )
|
|
||||||
{
|
|
||||||
$c_PayPlus->mf_do_tx( "", $g_conf_home_dir, $g_conf_site_cd,
|
|
||||||
$g_conf_site_key, $tran_cd, "",
|
|
||||||
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
|
|
||||||
$ordr_idxx, $cust_ip, $g_conf_log_level,
|
|
||||||
"", 0 );
|
|
||||||
|
|
||||||
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
|
|
||||||
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
|
|
||||||
/* $res_en_msg = $c_PayPlus->mf_get_res_data( "res_en_msg" ); // 결과 영문 메세지 */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$c_PayPlus->m_res_cd = "9562";
|
|
||||||
$c_PayPlus->m_res_msg = "연동 오류|Payplus Plugin이 설치되지 않았거나 tran_cd값이 설정되지 않았습니다.";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($res_cd != '0000')
|
|
||||||
{
|
|
||||||
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
|
|
||||||
|
|
||||||
die("$res_cd : $res_msg");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
|
||||||
/* = 취소 결과 처리 = */
|
|
||||||
/* = -------------------------------------------------------------------------- = */
|
|
||||||
if ( $req_tx == "mod" )
|
|
||||||
{
|
|
||||||
if ( $res_cd == "0000" )
|
|
||||||
{
|
|
||||||
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
|
|
||||||
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // 원 거래금액
|
|
||||||
$mod_mny = $c_PayPlus->mf_get_res_data( "panc_mod_mny" ); // 취소요청된 금액
|
|
||||||
$rem_mny = $c_PayPlus->mf_get_res_data( "panc_rem_mny" ); // 취소요청후 잔액
|
|
||||||
|
|
||||||
$sql = " update {$g4['shop_order_table']}
|
|
||||||
set od_cancel_card = od_cancel_card + '$mod_mny'
|
|
||||||
where od_id = '{$od['od_id']}' ";
|
|
||||||
sql_query($sql);
|
|
||||||
} // End of [res_cd = "0000"]
|
|
||||||
|
|
||||||
/* = -------------------------------------------------------------------------- = */
|
|
||||||
/* = 취소 실패 결과 처리 = */
|
|
||||||
/* = -------------------------------------------------------------------------- = */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($locale_change)
|
|
||||||
setlocale(LC_CTYPE, $def_locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 환불금액입력(입금 금액이 있을 때만)
|
|
||||||
$rq_amount1 = preg_replace('/[^0-9]/', '', $rq_amount1);
|
|
||||||
if($od['od_receipt_amount'] > 0 && $rq_amount1 > 0) {
|
|
||||||
$sql = " update {$g4['shop_order_table']}
|
|
||||||
set od_refund_amount = '$rq_amount1'
|
|
||||||
where od_id = '{$od['od_id']}' ";
|
|
||||||
sql_query($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 고객요청 자료에 상태반영
|
|
||||||
$sql = " update {$g4['shop_request_table']}
|
|
||||||
set rq_status = '$rq_status'
|
|
||||||
where rq_id = '$rq_id' ";
|
|
||||||
sql_query($sql);
|
|
||||||
|
|
||||||
// 처리내용입력
|
|
||||||
$sql = " insert into `{$g4['shop_request_table']}`
|
|
||||||
( rq_type, rq_parent, od_id, ct_id, mb_id, rq_content, rq_status, rq_item, dl_company, rq_invoice, rq_amount1, rq_amount2, rq_amount3, rq_account, rq_ip, rq_time )
|
|
||||||
values
|
|
||||||
( '{$rq['rq_type']}', '$rq_id', '{$od['od_id']}', '{$rq['ct_id']}', '{$member['mb_id']}', '$rq_content', '$rq_status', '$rq_item', '$dl_company', '$rq_invoice', '$rq_amount1', '$rq_amount2', '$rq_amount3', '$rq_account', '$REMOTE_ADDR', '".G4_TIME_YMDHIS."' ) ";
|
|
||||||
sql_query($sql);
|
|
||||||
?>
|
|
||||||
@ -1,234 +0,0 @@
|
|||||||
<?php
|
|
||||||
$sub_menu = '400430';
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], "r");
|
|
||||||
|
|
||||||
$g4['title'] = '취소교환반품내역';
|
|
||||||
include_once (G4_ADMIN_PATH.'/admin.head.php');
|
|
||||||
|
|
||||||
$sql_common = " from {$g4['shop_request_table']} a
|
|
||||||
left join {$g4['shop_order_table']} b on ( a.od_id = b.od_id ) ";
|
|
||||||
$sql_search = " where rq_parent = '0' ";
|
|
||||||
$rq_type_text = '요청';
|
|
||||||
|
|
||||||
if($rq_type) {
|
|
||||||
$sql_search .= " and rq_type = '$rq_type' ";
|
|
||||||
|
|
||||||
switch($rq_type) {
|
|
||||||
case 1:
|
|
||||||
$rq_type_text = '교환요청';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$rq_type_text = '반품요청';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$rq_type_text = '취소요청';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($stx != '') {
|
|
||||||
if ($sfl != '') {
|
|
||||||
$sql_search .= " and $sfl like '%$stx%' ";
|
|
||||||
}
|
|
||||||
if ($save_stx != $stx)
|
|
||||||
$page = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sfl == '') $sfl = 'a.od_id';
|
|
||||||
if (!$sst) {
|
|
||||||
$sst = 'rq_id';
|
|
||||||
$sod = 'desc';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql_common .= $sql_search;
|
|
||||||
|
|
||||||
// 테이블의 전체 레코드수만 얻음
|
|
||||||
$sql = " select count(*) as cnt " . $sql_common;
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
$total_count = $row['cnt'];
|
|
||||||
|
|
||||||
$rows = $config['cf_page_rows'];
|
|
||||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
|
||||||
if ($page == '') { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
|
||||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
|
||||||
|
|
||||||
$sql = " select a.*, b.od_temp_amount, b.od_name
|
|
||||||
$sql_common
|
|
||||||
order by $sst $sod, a.rq_id desc
|
|
||||||
limit $from_record, $rows ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
|
|
||||||
$qstr = $qstr.'&save_stx='.$stx;
|
|
||||||
|
|
||||||
$listall = '';
|
|
||||||
if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
|
|
||||||
$listall = '<a href="'.$_SERVER['PHP_SELF'].'">전체목록</a>';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<form name="flist">
|
|
||||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
|
||||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
|
||||||
<input type="hidden" name="rq_type" value="<?php echo $rq_type; ?>">
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
<legend>요청내역 검색</legend>
|
|
||||||
|
|
||||||
<span>
|
|
||||||
<?php echo $listall; ?>
|
|
||||||
전체 <?php echo $rq_type_text; ?>내역 <?php echo $total_count; ?>건
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<label for="sfl" class="sound_only">검색대상</label>
|
|
||||||
<select name="sfl" id="sfl">
|
|
||||||
<option value="a.od_id" <?php echo get_selected($sfl, 'a.od_id'); ?>>주문번호</option>
|
|
||||||
<option value="od_name" <?php echo get_selected($sfl, 'od_name'); ?>>주문자명</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
|
||||||
<input type="text" name="stx" value="<?php echo $stx; ?>" required class="frm_input required">
|
|
||||||
<input type="submit" value="검색" class="btn_submit">
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<section class="cbox">
|
|
||||||
<h2><?php echo $rq_type_text; ?>내역 목록</h2>
|
|
||||||
|
|
||||||
<ul class="sort_odr">
|
|
||||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr.'&rq_type=0'; ?>">취소요청</a></li>
|
|
||||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr.'&rq_type=1'; ?>">교환요청</a></li>
|
|
||||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr.'&rq_type=2'; ?>">반품요청</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<form name="frequestlist" method="post" action="./orderrequestdelete.php" onsubmit="return frequestlist_submit(this);" autocomplete="off">
|
|
||||||
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
|
|
||||||
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
|
|
||||||
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
|
|
||||||
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
|
|
||||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
|
||||||
<input type="hidden" name="rq_type" value="<?php echo $rq_type; ?>">
|
|
||||||
|
|
||||||
<table class="frm_basic">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">
|
|
||||||
<label for="chkall" class="sound_only">요청내역 전체</label>
|
|
||||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
|
||||||
</th>
|
|
||||||
<th scope="col">구분</th>
|
|
||||||
<th scope="col">주문번호</th>
|
|
||||||
<th scope="col">주문금액</th>
|
|
||||||
<th scope="col">주문자</th>
|
|
||||||
<th scope="col">상품</th>
|
|
||||||
<th scope="col">접수일</th>
|
|
||||||
<th scope="col">처리일</th>
|
|
||||||
<th scope="col">관리</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
|
||||||
switch($row['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$type = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$cart = explode(',', $row['ct_id']);
|
|
||||||
$cart_count = count($cart);
|
|
||||||
$sql = " select it_name, ct_option from {$g4['shop_cart_table']} where ct_id = '{$cart[0]}' ";
|
|
||||||
$ct = sql_fetch($sql);
|
|
||||||
$it_name = $ct['it_name']. ' '.$ct['ct_option'];
|
|
||||||
if($cart_count > 1)
|
|
||||||
$it_name .= '외 '.($cart_count - 1).'건';
|
|
||||||
|
|
||||||
$reg_date = substr($row['rq_time'], 2, 8);
|
|
||||||
$done_date = ' ';
|
|
||||||
$sql = " select rq_time
|
|
||||||
from {$g4['shop_request_table']}
|
|
||||||
where rq_parent = '{$row['rq_id']}'
|
|
||||||
and rq_status <> '0'
|
|
||||||
order by rq_id desc
|
|
||||||
limit 1 ";
|
|
||||||
$tmp = sql_fetch($sql);
|
|
||||||
if($tmp['rq_time'])
|
|
||||||
$done_date = substr($tmp['rq_time'], 2, 8);
|
|
||||||
|
|
||||||
$order_href = './orderform.php?od_id='.$row['od_id'].'&rq_id='.$row['rq_id'].'&rq_type='.$rq_type.'&'.$qstr;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td class="td_chk">
|
|
||||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $it_name.' '.$type ?> 요청</label>
|
|
||||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
|
||||||
<input type="hidden" name="rq_id[<?php echo $i; ?>]" value="<?php echo $row['rq_id']; ?>">
|
|
||||||
</td>
|
|
||||||
<td class="td_smallstat"><?php echo $type; ?></td>
|
|
||||||
<td class="td_odrnum3"><?php echo $row['od_id']; ?></td>
|
|
||||||
<td class="td_bignum"><?php echo number_format($row['od_temp_amount']); ?></td>
|
|
||||||
<td class="td_name"><?php echo $row['od_name']; ?></td>
|
|
||||||
<td><?php echo $it_name; ?></td>
|
|
||||||
<td class="td_date"><?php echo $reg_date; ?></td>
|
|
||||||
<td class="td_date"><?php echo $done_date; ?></td>
|
|
||||||
<td class="td_smallmng">
|
|
||||||
<a href="<?php echo $order_href; ?>"><span class="sound_only"><?php echo $it_name. ' '.$type.'요청'; ?> </span>보기</a>
|
|
||||||
<a href="./orderrequestdelete.php?w=d&rq_id=<?php echo $row['rq_id']; ?>&<?php echo $qstr; ?>" onclick="return del_confirm();"><span class="sound_only"><?php echo $it_name. ' '.$type.'요청'; ?> </span>삭제</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($i == 0) {
|
|
||||||
echo '<tr><td colspan="9" class="empty_table">자료가 없습니다.</td></tr>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="btn_list">
|
|
||||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php echo get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page="); ?>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function frequestlist_submit(f)
|
|
||||||
{
|
|
||||||
if (!is_checked("chk[]")) {
|
|
||||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(document.pressed == "선택삭제") {
|
|
||||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function del_confirm()
|
|
||||||
{
|
|
||||||
return confirm('해당 요청을 삭제하시겠습니까?');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once (G4_ADMIN_PATH.'/admin.tail.php');
|
|
||||||
?>
|
|
||||||
@ -667,34 +667,6 @@ CREATE TABLE IF NOT EXISTS `shop_personalpay` (
|
|||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `shop_request`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `shop_request`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `shop_request` (
|
|
||||||
`rq_id` INT(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`rq_type` TINYINT(4) NOT NULL DEFAULT '0',
|
|
||||||
`rq_parent` INT(11) NOT NULL DEFAULT '0',
|
|
||||||
`od_id` BIGINT(20) unsigned NOT NULL,
|
|
||||||
`ct_id` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`mb_id` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`rq_content` TEXT NOT NULL,
|
|
||||||
`rq_status` TINYINT(4) NOT NULL DEFAULT '0',
|
|
||||||
`rq_item` TEXT NOT NULL,
|
|
||||||
`dl_company` INT(11) NOT NULL DEFAULT '0',
|
|
||||||
`rq_invoice` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`rq_amount1` INT(11) NOT NULL DEFAULT '0',
|
|
||||||
`rq_amount2` INT(11) NOT NULL DEFAULT '0',
|
|
||||||
`rq_amount3` INT(11) NOT NULL DEFAULT '0',
|
|
||||||
`rq_account` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`rq_ip` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`rq_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
|
|
||||||
PRIMARY KEY (`rq_id`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `shop_sendcost`
|
-- Table structure for table `shop_sendcost`
|
||||||
--
|
--
|
||||||
|
|||||||
@ -16,13 +16,6 @@ if (!$od['od_id'] || (!$is_member && md5($od['od_id'].$od['od_time'].$od['od_ip'
|
|||||||
alert("조회하실 주문서가 없습니다.", G4_SHOP_URL);
|
alert("조회하실 주문서가 없습니다.", G4_SHOP_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 처리 중인 요청이 있는지..
|
|
||||||
$dsp_request = true;
|
|
||||||
$sql = " select count(*) as cnt from {$g4['shop_request_table']} where od_id = '$od_id' and rq_status = '0' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
if($rq['cnt'])
|
|
||||||
$dsp_request = false;
|
|
||||||
|
|
||||||
// 결제방법
|
// 결제방법
|
||||||
$settle_case = $od['od_settle_case'];
|
$settle_case = $od['od_settle_case'];
|
||||||
|
|
||||||
@ -35,9 +28,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
<p>주문번호 <strong><?php echo $od_id; ?></strong></p>
|
<p>주문번호 <strong><?php echo $od_id; ?></strong></p>
|
||||||
|
|
||||||
<section id="sod_fin_list">
|
<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="rq_type" value="">
|
|
||||||
<h2>주문하신 상품</h2>
|
<h2>주문하신 상품</h2>
|
||||||
<span class="sound_only">상품 상태 설명</span>
|
<span class="sound_only">상품 상태 설명</span>
|
||||||
<dl id="sod_fin_legend">
|
<dl id="sod_fin_legend">
|
||||||
@ -51,9 +41,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
<dd>상품 배송이 완료되었습니다.</dd>
|
<dd>상품 배송이 완료되었습니다.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<?php
|
<?php
|
||||||
$od_count1 = $od_count2 = 0;
|
|
||||||
$idx = 0;
|
|
||||||
|
|
||||||
$sql = " select it_id, it_name, cp_amount
|
$sql = " select it_id, it_name, cp_amount
|
||||||
from {$g4['shop_cart_table']}
|
from {$g4['shop_cart_table']}
|
||||||
where od_id = '$od_id'
|
where od_id = '$od_id'
|
||||||
@ -74,7 +61,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
<table class="basic_tbl">
|
<table class="basic_tbl">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">선택</th>
|
|
||||||
<th scope="col">옵션항목</th>
|
<th scope="col">옵션항목</th>
|
||||||
<th scope="col">수량</th>
|
<th scope="col">수량</th>
|
||||||
<th scope="col">판매가</th>
|
<th scope="col">판매가</th>
|
||||||
@ -102,19 +88,10 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
$sell_amount = $opt_price * $opt['ct_qty'];
|
$sell_amount = $opt_price * $opt['ct_qty'];
|
||||||
$point = $opt['ct_point'] * $opt['ct_qty'];
|
$point = $opt['ct_point'] * $opt['ct_qty'];
|
||||||
|
|
||||||
$disabled = '';
|
|
||||||
if($opt['ct_status'] == '취소' || $opt['ct_status'] == '반품' || $opt['ct_status'] == '품절')
|
|
||||||
$disabled = ' disabled="disabled"';
|
|
||||||
|
|
||||||
$ct_list[$opt['ct_id']]['name'] = $opt['it_name'];
|
$ct_list[$opt['ct_id']]['name'] = $opt['it_name'];
|
||||||
$ct_list[$opt['ct_id']]['option'] = $opt['ct_option'];
|
$ct_list[$opt['ct_id']]['option'] = $opt['ct_option'];
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td_chk">
|
|
||||||
<input type="hidden" name="ct_id[<?php echo $idx; ?>]" value="<?php echo $opt['ct_id']; ?>">
|
|
||||||
<label for="chk_ct_id_<?php echo $idx; ?>" class="sound_only"><?php echo $opt['ct_option']; ?></label>
|
|
||||||
<input type="checkbox" name="chk_ct_id[<?php echo $idx; ?>]" value="1" id="chk_ct_id_<?php echo $idx; ?>"<?php echo $disabled; ?>>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $opt['ct_option']; ?></td>
|
<td><?php echo $opt['ct_option']; ?></td>
|
||||||
<td class="td_smallmng"><?php echo number_format($opt['ct_qty']); ?></td>
|
<td class="td_smallmng"><?php echo number_format($opt['ct_qty']); ?></td>
|
||||||
<td class="td_bignum"><?php echo number_format($opt_price); ?></td>
|
<td class="td_bignum"><?php echo number_format($opt_price); ?></td>
|
||||||
@ -124,13 +101,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$tot_point += $point;
|
$tot_point += $point;
|
||||||
|
|
||||||
// 전체 상품의 상태가 주문인지 비교할 때 사용
|
|
||||||
$od_count1++;
|
|
||||||
if($opt['ct_status'] == '주문')
|
|
||||||
$od_count2++;
|
|
||||||
|
|
||||||
$idx++;
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -141,136 +111,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="request_form">
|
|
||||||
<div>
|
|
||||||
<label for="rq_content">요청내용</label>
|
|
||||||
<input type="text" name="rq_content" value="" id="rq_content" required class="required frm_input">
|
|
||||||
<input type="submit" value="확인" class="btn_frmline">
|
|
||||||
<button type="button" id="request_close" class="btn_cancel">닫기</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sod_req_btn">
|
|
||||||
<button type="button" class="req_button btn_frmline">취소요청</button>
|
|
||||||
<button type="button" class="req_button btn_frmline">교환요청</button>
|
|
||||||
<button type="button" class="req_button btn_frmline">반품요청</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// 요청내역
|
|
||||||
$rq_sql = " select * from {$g4['shop_request_table']} where od_id = '$od_id' and rq_parent = '0' order by rq_id ";
|
|
||||||
$rq_res = sql_query($rq_sql);
|
|
||||||
$rq_cnt = mysql_num_rows($rq_res);
|
|
||||||
|
|
||||||
if($rq_cnt)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<section id="sod_req_log">
|
|
||||||
<h3>요청내역</h3>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
for($j=0; $rq_row=sql_fetch_array($rq_res); $j++) {
|
|
||||||
switch($rq_row['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$rq_type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$rq_type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$rq_type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$rq_type = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = explode(',', $rq_row['ct_id']);
|
|
||||||
$item_count = count($item);
|
|
||||||
$rq_ct_id = $item[0];
|
|
||||||
$rq_subject = $ct_list[$rq_ct_id]['name'].' '.$ct_list[$rq_ct_id]['option'];
|
|
||||||
if($item_count > 1)
|
|
||||||
$rq_subject .= '외 '.($item_count - 1).'건';
|
|
||||||
$rq_subject .= ' <span>'.$rq_type.'요청</span>';
|
|
||||||
?>
|
|
||||||
<li class="sod_req_log_view">
|
|
||||||
<table class="basic_tbl">
|
|
||||||
<caption><?php echo $rq_subject; ?></caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>구분</th>
|
|
||||||
<th>상품명</th>
|
|
||||||
<th>옵션항목</th>
|
|
||||||
<th>요청일</th>
|
|
||||||
<th>처리일</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
for($k=0; $k<$item_count; $k++) {
|
|
||||||
$ct_idx = $item[$k];
|
|
||||||
$it_name = $ct_list[$ct_idx]['name'];
|
|
||||||
$ct_option = $ct_list[$ct_idx]['option'];
|
|
||||||
|
|
||||||
$sql = " select rq_time
|
|
||||||
from {$g4['shop_request_table']}
|
|
||||||
where rq_parent = '{$rq_row['rq_id']}' and rq_status <> '0'
|
|
||||||
order by rq_id desc
|
|
||||||
limit 1 ";
|
|
||||||
$tmp = sql_fetch($sql);
|
|
||||||
$done_date = substr($tmp['rq_time'], 2, 8);
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="td_smallstat"><?php echo $rq_type; ?></td>
|
|
||||||
<td><?php echo $it_name; ?></td>
|
|
||||||
<td><?php echo $ct_option; ?></td>
|
|
||||||
<td class="td_date"><?php echo substr($rq_row['rq_time'], 2, 8); ?></td>
|
|
||||||
<td class="td_date"><?php echo $done_date; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p>
|
|
||||||
<?php echo conv_content($rq_row['rq_content'], 0); ?>
|
|
||||||
<?php if($rq_row['rq_status'] == 0) { ?>
|
|
||||||
<button type="button" id="rq_id_<?php echo $rq_row['rq_id']; ?>" class="request_cancel"><?php echo $rq_type; ?>요청취소</button>
|
|
||||||
<?php } ?>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$(".request_cancel").click(function() {
|
|
||||||
if(!confirm("요청을 취소하시겠습니까?"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var rq_id = $(this).attr("id").replace("rq_id_", "");
|
|
||||||
$.post(
|
|
||||||
"./orderrequestcancel.php",
|
|
||||||
{ rq_id: rq_id, od_id: "<?php echo $od['od_id']; ?>" },
|
|
||||||
function(data) {
|
|
||||||
if(data != "")
|
|
||||||
alert(data);
|
|
||||||
else {
|
|
||||||
alert("고객님의 요청이 취소되었습니다.");
|
|
||||||
document.location.reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</section>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
|
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
|
||||||
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
|
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
|
||||||
@ -709,62 +549,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var req_act = "";
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
$(".req_button").click(function() {
|
|
||||||
var $chk_item = $("input[name^=chk_ct_id]:checked");
|
|
||||||
req_act = $(this).text();
|
|
||||||
<?php if(!$dsp_request) { ?>
|
|
||||||
alert("관리자가 처리 중인 요청내용이 있어 추가로 요청하실 수 없습니다.");
|
|
||||||
return false;
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
if($chk_item.size() < 1) {
|
|
||||||
alert(req_act+"할 상품을 하나 이상 선택해 주십시오");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$("input[name=rq_content]").val("");
|
|
||||||
$("#request_form label").text(req_act+"내용");
|
|
||||||
$("#request_form div").css("display", "block");
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#request_close").click(function() {
|
|
||||||
$("#request_form div").css("display", "none");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function frequest_check(f)
|
|
||||||
{
|
|
||||||
var rq_type;
|
|
||||||
var $chk_item = $("input[name^=chk_ct_id]:checked");
|
|
||||||
if($chk_item.size() < 1) {
|
|
||||||
alert(req_act+"할 상품을 하나 이상 선택해 주십시오");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!confirm("선택하신 상품을 "+req_act+"하시겠습니까?"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch(req_act) {
|
|
||||||
case "교환요청":
|
|
||||||
rq_type = 1;
|
|
||||||
break;
|
|
||||||
case "반품요청":
|
|
||||||
rq_type = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rq_type = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
f.rq_type.value = rq_type;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function fcancel_check(f)
|
function fcancel_check(f)
|
||||||
{
|
{
|
||||||
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
||||||
|
|||||||
@ -21,13 +21,6 @@ if (!$od['od_id'] || (!$is_member && md5($od['od_id'].$od['od_time'].$od['od_ip'
|
|||||||
alert("조회하실 주문서가 없습니다.", G4_SHOP_URL);
|
alert("조회하실 주문서가 없습니다.", G4_SHOP_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 처리 중인 요청이 있는지..
|
|
||||||
$dsp_request = true;
|
|
||||||
$sql = " select count(*) as cnt from {$g4['shop_request_table']} where od_id = '$od_id' and rq_status = '0' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
if($rq['cnt'])
|
|
||||||
$dsp_request = false;
|
|
||||||
|
|
||||||
// 결제방법
|
// 결제방법
|
||||||
$settle_case = $od['od_settle_case'];
|
$settle_case = $od['od_settle_case'];
|
||||||
|
|
||||||
@ -48,285 +41,129 @@ if(openwin != null) {
|
|||||||
<p>주문번호 <strong><?php echo $od_id; ?></strong></p>
|
<p>주문번호 <strong><?php echo $od_id; ?></strong></p>
|
||||||
|
|
||||||
<section id="sod_fin_list">
|
<section id="sod_fin_list">
|
||||||
<form name="forderrequest" method="post" action="./orderrequestupdate.php" onsubmit="return frequest_check(this);">
|
<h2>주문하신 상품</h2>
|
||||||
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
|
<span class="sound_only">상품 상태 설명</span>
|
||||||
<input type="hidden" name="rq_type" value="">
|
<dl id="sod_fin_legend">
|
||||||
<h2>주문하신 상품</h2>
|
<dt>주문</dt>
|
||||||
<span class="sound_only">상품 상태 설명</span>
|
<dd>주문이 접수되었습니다.</dd>
|
||||||
<dl id="sod_fin_legend">
|
<dt>준비</dt>
|
||||||
<dt>주문</dt>
|
<dd>상품 준비 중입니다.</dd>
|
||||||
<dd>주문이 접수되었습니다.</dd>
|
<dt>배송</dt>
|
||||||
<dt>준비</dt>
|
<dd>상품 배송 중입니다.</dd>
|
||||||
<dd>상품 준비 중입니다.</dd>
|
<dt>완료</dt>
|
||||||
<dt>배송</dt>
|
<dd>상품 배송이 완료되었습니다.</dd>
|
||||||
<dd>상품 배송 중입니다.</dd>
|
</dl>
|
||||||
<dt>완료</dt>
|
<?php
|
||||||
<dd>상품 배송이 완료되었습니다.</dd>
|
$sql = " select it_id, it_name
|
||||||
</dl>
|
from {$g4['shop_cart_table']}
|
||||||
|
where od_id = '$od_id'
|
||||||
|
group by it_id
|
||||||
|
order by ct_id ";
|
||||||
|
$result = sql_query($sql);
|
||||||
|
?>
|
||||||
|
<ul id="sod_ul">
|
||||||
<?php
|
<?php
|
||||||
$od_count1 = $od_count2 = 0;
|
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||||
$idx = 0;
|
$image = get_it_image($row['it_id'], 70, 70);
|
||||||
|
|
||||||
$sql = " select it_id, it_name
|
|
||||||
from {$g4['shop_cart_table']}
|
|
||||||
where od_id = '$od_id'
|
|
||||||
group by it_id
|
|
||||||
order by ct_id ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
?>
|
?>
|
||||||
<ul id="sod_ul">
|
<li>
|
||||||
|
<p>
|
||||||
|
<a href="./item.php?it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo $row['it_name']; ?></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<table class="basic_tbl">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">옵션항목</th>
|
||||||
|
<th scope="col">수량</th>
|
||||||
|
<th scope="col">판매가</th>
|
||||||
|
<th scope="col">소계</th>
|
||||||
|
<th scope="col">포인트</th>
|
||||||
|
<th scope="col">상태</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, cp_amount, io_type, io_price
|
||||||
$image = get_it_image($row['it_id'], 70, 70);
|
from {$g4['shop_cart_table']}
|
||||||
|
where od_id = '$od_id'
|
||||||
|
and it_id = '{$row['it_id']}'
|
||||||
|
order by io_type asc, ct_id asc ";
|
||||||
|
$res = sql_query($sql);
|
||||||
|
$ct_list = array();
|
||||||
|
|
||||||
|
for($k=0; $opt=sql_fetch_array($res); $k++) {
|
||||||
|
if($opt['io_type'])
|
||||||
|
$opt_price = $opt['io_price'];
|
||||||
|
else
|
||||||
|
$opt_price = $opt['ct_price'] + $opt['io_price'];
|
||||||
|
|
||||||
|
$sell_amount = $opt_price * $opt['ct_qty'];
|
||||||
|
$point = $opt['ct_point'] * $opt['ct_qty'];
|
||||||
|
|
||||||
|
$ct_list[$opt['ct_id']]['name'] = $opt['it_name'];
|
||||||
|
$ct_list[$opt['ct_id']]['option'] = $opt['ct_option'];
|
||||||
?>
|
?>
|
||||||
<li>
|
<tr>
|
||||||
<p>
|
<td><?php echo $opt['ct_option']; ?></td>
|
||||||
<a href="./item.php?it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo $row['it_name']; ?></a>
|
<td class="td_smallmng"><?php echo number_format($opt['ct_qty']); ?></td>
|
||||||
</p>
|
<td class="td_bignum"><?php echo number_format($opt_price); ?></td>
|
||||||
|
<td class="td_num"><?php echo number_format($sell_amount); ?></td>
|
||||||
<table class="basic_tbl">
|
<td class="td_num"><?php echo number_format($point); ?></td>
|
||||||
<thead>
|
<td class="td_smallmng"><?php echo $opt['ct_status']; ?></td>
|
||||||
<tr>
|
</tr>
|
||||||
<th scope="col">선택</th>
|
|
||||||
<th scope="col">옵션항목</th>
|
|
||||||
<th scope="col">수량</th>
|
|
||||||
<th scope="col">판매가</th>
|
|
||||||
<th scope="col">소계</th>
|
|
||||||
<th scope="col">포인트</th>
|
|
||||||
<th scope="col">상태</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, cp_amount, io_type, io_price
|
|
||||||
from {$g4['shop_cart_table']}
|
|
||||||
where od_id = '$od_id'
|
|
||||||
and it_id = '{$row['it_id']}'
|
|
||||||
order by io_type asc, ct_id asc ";
|
|
||||||
$res = sql_query($sql);
|
|
||||||
$ct_list = array();
|
|
||||||
|
|
||||||
for($k=0; $opt=sql_fetch_array($res); $k++) {
|
|
||||||
if($opt['io_type'])
|
|
||||||
$opt_price = $opt['io_price'];
|
|
||||||
else
|
|
||||||
$opt_price = $opt['ct_price'] + $opt['io_price'];
|
|
||||||
|
|
||||||
$sell_amount = $opt_price * $opt['ct_qty'];
|
|
||||||
$point = $opt['ct_point'] * $opt['ct_qty'];
|
|
||||||
|
|
||||||
$disabled = '';
|
|
||||||
if($opt['ct_status'] == '취소' || $opt['ct_status'] == '반품' || $opt['ct_status'] == '품절')
|
|
||||||
$disabled = ' disabled="disabled"';
|
|
||||||
|
|
||||||
$ct_list[$opt['ct_id']]['name'] = $opt['it_name'];
|
|
||||||
$ct_list[$opt['ct_id']]['option'] = $opt['ct_option'];
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="td_chk">
|
|
||||||
<input type="hidden" name="ct_id[<?php echo $idx; ?>]" value="<?php echo $opt['ct_id']; ?>">
|
|
||||||
<label for="chk_ct_id_<?php echo $idx; ?>" class="sound_only"><?php echo $opt['ct_option']; ?></label>
|
|
||||||
<input type="checkbox" name="chk_ct_id[<?php echo $idx; ?>]" value="1" id="chk_ct_id_<?php echo $idx; ?>"<?php echo $disabled; ?>>
|
|
||||||
</td>
|
|
||||||
<td><?php echo $opt['ct_option']; ?></td>
|
|
||||||
<td class="td_smallmng"><?php echo number_format($opt['ct_qty']); ?></td>
|
|
||||||
<td class="td_bignum"><?php echo number_format($opt_price); ?></td>
|
|
||||||
<td class="td_num"><?php echo number_format($sell_amount); ?></td>
|
|
||||||
<td class="td_num"><?php echo number_format($point); ?></td>
|
|
||||||
<td class="td_smallmng"><?php echo $opt['ct_status']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
$tot_point += $point;
|
|
||||||
|
|
||||||
// 전체 상품의 상태가 주문인지 비교할 때 사용
|
|
||||||
$od_count1++;
|
|
||||||
if($opt['ct_status'] == '주문')
|
|
||||||
$od_count2++;
|
|
||||||
|
|
||||||
$idx++;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</li>
|
|
||||||
<?php
|
<?php
|
||||||
|
$tot_point += $point;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</tbody>
|
||||||
|
</table>
|
||||||
<div id="request_form">
|
</li>
|
||||||
<div>
|
|
||||||
<label for="rq_content">요청내용</label>
|
|
||||||
<input type="text" name="rq_content" value="" id="rq_content" required class="required frm_input">
|
|
||||||
<input type="submit" value="확인" class="btn_frmline">
|
|
||||||
<button type="button" id="request_close" class="btn_cancel">닫기</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="sod_req_btn">
|
|
||||||
<button type="button" class="req_button btn_frmline">취소요청</button>
|
|
||||||
<button type="button" class="req_button btn_frmline">교환요청</button>
|
|
||||||
<button type="button" class="req_button btn_frmline">반품요청</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// 요청내역
|
|
||||||
$rq_sql = " select * from {$g4['shop_request_table']} where od_id = '$od_id' and rq_parent = '0' order by rq_id ";
|
|
||||||
$rq_res = sql_query($rq_sql);
|
|
||||||
$rq_cnt = mysql_num_rows($rq_res);
|
|
||||||
|
|
||||||
if($rq_cnt)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<section id="sod_req_log">
|
|
||||||
<h3>요청내역</h3>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
for($j=0; $rq_row=sql_fetch_array($rq_res); $j++) {
|
|
||||||
switch($rq_row['rq_type']) {
|
|
||||||
case 0:
|
|
||||||
$rq_type = '취소';
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$rq_type = '교환';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$rq_type = '반품';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$rq_type = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = explode(',', $rq_row['ct_id']);
|
|
||||||
$item_count = count($item);
|
|
||||||
$rq_ct_id = $item[0];
|
|
||||||
$rq_subject = $ct_list[$rq_ct_id]['name'].' '.$ct_list[$rq_ct_id]['option'];
|
|
||||||
if($item_count > 1)
|
|
||||||
$rq_subject .= '외 '.($item_count - 1).'건';
|
|
||||||
$rq_subject .= ' <span>'.$rq_type.'요청</span>';
|
|
||||||
?>
|
|
||||||
<li class="sod_req_log_view">
|
|
||||||
<table class="basic_tbl">
|
|
||||||
<caption><?php echo $rq_subject; ?></caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>구분</th>
|
|
||||||
<th>상품명</th>
|
|
||||||
<th>옵션항목</th>
|
|
||||||
<th>요청일</th>
|
|
||||||
<th>처리일</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
for($k=0; $k<$item_count; $k++) {
|
|
||||||
$ct_idx = $item[$k];
|
|
||||||
$it_name = $ct_list[$ct_idx]['name'];
|
|
||||||
$ct_option = $ct_list[$ct_idx]['option'];
|
|
||||||
|
|
||||||
$sql = " select rq_time
|
|
||||||
from {$g4['shop_request_table']}
|
|
||||||
where rq_parent = '{$rq_row['rq_id']}' and rq_status <> '0'
|
|
||||||
order by rq_id desc
|
|
||||||
limit 1 ";
|
|
||||||
$tmp = sql_fetch($sql);
|
|
||||||
$done_date = substr($tmp['rq_time'], 2, 8);
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="td_smallstat"><?php echo $rq_type; ?></td>
|
|
||||||
<td class="sod_req_it"><?php echo $it_name; ?></td>
|
|
||||||
<td><?php echo $ct_option; ?></td>
|
|
||||||
<td class="td_date"><?php echo substr($rq_row['rq_time'], 2, 8); ?></td>
|
|
||||||
<td class="td_date"><?php echo $done_date; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<p>
|
|
||||||
<strong>요청내용</strong>
|
|
||||||
<?php echo conv_content($rq_row['rq_content'], 0); ?>
|
|
||||||
<?php if($rq_row['rq_status'] == 0) { ?>
|
|
||||||
<button type="button" id="rq_id_<?php echo $rq_row['rq_id']; ?>" class="request_cancel"><?php echo $rq_type; ?>요청 취소</button>
|
|
||||||
<?php } ?>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$(".request_cancel").click(function() {
|
|
||||||
if(!confirm("요청을 취소하시겠습니까?"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
var rq_id = $(this).attr("id").replace("rq_id_", "");
|
|
||||||
$.post(
|
|
||||||
"./orderrequestcancel.php",
|
|
||||||
{ rq_id: rq_id, od_id: "<?php echo $od['od_id']; ?>" },
|
|
||||||
function(data) {
|
|
||||||
if(data != "")
|
|
||||||
alert(data);
|
|
||||||
else {
|
|
||||||
alert("고객님의 요청이 취소되었습니다.");
|
|
||||||
document.location.reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</section>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
|
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
|
||||||
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
|
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<dl id="sod_bsk_tot">
|
<dl id="sod_bsk_tot">
|
||||||
<dt class="sod_bsk_dvr">주문총액</dt>
|
<dt class="sod_bsk_dvr">주문총액</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_amount']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_amount']); ?> 원</strong></dd>
|
||||||
|
|
||||||
<?php if($od['od_cart_coupon'] > 0) { ?>
|
<?php if($od['od_cart_coupon'] > 0) { ?>
|
||||||
<dt class="sod_bsk_dvr">상품할인</dt>
|
<dt class="sod_bsk_dvr">상품할인</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if($od['od_coupon'] > 0) { ?>
|
<?php if($od['od_coupon'] > 0) { ?>
|
||||||
<dt class="sod_bsk_dvr">결제할인</dt>
|
<dt class="sod_bsk_dvr">결제할인</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($od['od_send_cost'] > 0) { ?>
|
<?php if ($od['od_send_cost'] > 0) { ?>
|
||||||
<dt class="sod_bsk_dvr">배송비</dt>
|
<dt class="sod_bsk_dvr">배송비</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if($od['od_send_coupon'] > 0) { ?>
|
<?php if($od['od_send_coupon'] > 0) { ?>
|
||||||
<dt class="sod_bsk_dvr">배송비할인</dt>
|
<dt class="sod_bsk_dvr">배송비할인</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($od['od_send_cost2'] > 0) { ?>
|
<?php if ($od['od_send_cost2'] > 0) { ?>
|
||||||
<dt class="sod_bsk_dvr">추가배송비</dt>
|
<dt class="sod_bsk_dvr">추가배송비</dt>
|
||||||
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
|
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<dt class="sod_bsk_cnt">총계</dt>
|
<dt class="sod_bsk_cnt">총계</dt>
|
||||||
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원</strong></dd>
|
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원</strong></dd>
|
||||||
|
|
||||||
<dt class="sod_bsk_point">포인트</dt>
|
<dt class="sod_bsk_point">포인트</dt>
|
||||||
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
|
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
</form>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<div id="sod_fin_view">
|
<div id="sod_fin_view">
|
||||||
@ -722,62 +559,6 @@ if(openwin != null) {
|
|||||||
<!-- } 주문상세내역 끝 -->
|
<!-- } 주문상세내역 끝 -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var req_act = "";
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
$(".req_button").click(function() {
|
|
||||||
var $chk_item = $("input[name^=chk_ct_id]:checked");
|
|
||||||
req_act = $(this).text();
|
|
||||||
<?php if(!$dsp_request) { ?>
|
|
||||||
alert("관리자가 처리 중인 요청내용이 있어 추가로 요청하실 수 없습니다.");
|
|
||||||
return false;
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
if($chk_item.size() < 1) {
|
|
||||||
alert(req_act+"할 상품을 하나 이상 선택해 주십시오");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$("input[name=rq_content]").val("");
|
|
||||||
$("#request_form label").text(req_act+"내용");
|
|
||||||
$("#request_form div").css("display", "block");
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#request_close").click(function() {
|
|
||||||
$("#request_form div").css("display", "none");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function frequest_check(f)
|
|
||||||
{
|
|
||||||
var rq_type;
|
|
||||||
var $chk_item = $("input[name^=chk_ct_id]:checked");
|
|
||||||
if($chk_item.size() < 1) {
|
|
||||||
alert(req_act+"할 상품을 하나 이상 선택해 주십시오");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!confirm("선택하신 상품을 "+req_act+"하시겠습니까?"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch(req_act) {
|
|
||||||
case "교환요청":
|
|
||||||
rq_type = 1;
|
|
||||||
break;
|
|
||||||
case "반품요청":
|
|
||||||
rq_type = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rq_type = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
f.rq_type.value = rq_type;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function fcancel_check(f)
|
function fcancel_check(f)
|
||||||
{
|
{
|
||||||
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
if(!confirm("주문을 정말 취소하시겠습니까?"))
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
$rq_id = $_POST['rq_id'];
|
|
||||||
$od_id = $_POST['od_id'];
|
|
||||||
|
|
||||||
$sql = " select * from {$g4['shop_request_table']} where od_id = '$od_id' and rq_id = '$rq_id' and rq_parent = '0' ";
|
|
||||||
$req = sql_fetch($sql);
|
|
||||||
|
|
||||||
if(!$req['rq_id'])
|
|
||||||
die('요청정보가 존재하지 않습니다.');
|
|
||||||
|
|
||||||
// 처리내역이 있는지
|
|
||||||
$sql = " select count(*) as cnt from {$g4['shop_request_table']} where rq_parent = '$rq_id' and od_id = '$od_id' ";
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
if($row['cnt'])
|
|
||||||
die('요청내용을 관리자가 확인 중이므로 취소할 수 없습니다.');
|
|
||||||
|
|
||||||
// 고객요청 자료에 상태반영
|
|
||||||
$sql = " update {$g4['shop_request_table']}
|
|
||||||
set rq_status = '99'
|
|
||||||
where rq_id = '$rq_id' ";
|
|
||||||
sql_query($sql);
|
|
||||||
|
|
||||||
// 처리내용입력
|
|
||||||
$rq_content = '고객이 요청내역 취소';
|
|
||||||
$sql = " insert into `{$g4['shop_request_table']}`
|
|
||||||
( rq_type, rq_parent, od_id, ct_id, mb_id, rq_content, rq_status, rq_item, dl_company, rq_invoice, rq_amount1, rq_amount2, rq_amount3, rq_account, rq_ip, rq_time )
|
|
||||||
values
|
|
||||||
( '{$req['rq_type']}', '$rq_id', '$od_id', '{$req['ct_id']}', '{$member['mb_id']}', '$rq_content', '99', '', '', '', '', '', '', '', '$REMOTE_ADDR', '".G4_TIME_YMDHIS."' ) ";
|
|
||||||
sql_query($sql);
|
|
||||||
?>
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
include_once('./_common.php');
|
|
||||||
|
|
||||||
$od_id = $_POST['od_id'];
|
|
||||||
$rq_type = $_POST['rq_type'];
|
|
||||||
$rq_content = $_POST['rq_content'];
|
|
||||||
|
|
||||||
switch($rq_type) {
|
|
||||||
case 1:
|
|
||||||
$req_act = '교환요청';
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$req_act = '반품요청';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$req_act = '취소요청';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!count($_POST['chk_ct_id']))
|
|
||||||
alert($req_act.'하실 상품을 하나이상 선택해 주십시오.');
|
|
||||||
|
|
||||||
$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("존재하는 주문이 아닙니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = " select count(*) as cnt from {$g4['shop_request_table']} where od_id = '$od_id' and rq_status = '0' ";
|
|
||||||
$rq = sql_fetch($sql);
|
|
||||||
|
|
||||||
if($rq['cnt'])
|
|
||||||
alert('관리자가 확인 중인 '.$req_act.'이 있습니다');
|
|
||||||
|
|
||||||
$count = count($_POST['ct_id']);
|
|
||||||
$ct_id = '';
|
|
||||||
$rsp = '';
|
|
||||||
|
|
||||||
for($i=0; $i<$count; $i++) {
|
|
||||||
if($_POST['chk_ct_id'][$i]) {
|
|
||||||
$ct_id .= $rsp.$_POST['ct_id'][$i];
|
|
||||||
$rsp = ',';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = " insert into {$g4['shop_request_table']}
|
|
||||||
( rq_type, od_id, ct_id, mb_id, rq_content, rq_time, rq_ip )
|
|
||||||
values
|
|
||||||
( '$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.'&uid='.md5($od['od_id'].$od['od_time'].$od['od_ip']));
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user