주문 취소 요청 기능 제거
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('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('400430', '취소교환반품내역', G4_ADMIN_URL.'/shop_admin/orderrequestlist.php', 'scf_request', 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('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";
|
||||
|
||||
// PG사를 KCP 사용하면서 테스트 상점아이디라면
|
||||
@ -102,10 +96,8 @@ $result = sql_query($sql);
|
||||
|
||||
$pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_sodr_list">주문상품 목록</a></li>
|
||||
<li><a href="#anc_sodr_pay">주문결제 내역</a></li>';
|
||||
if($rq_count)
|
||||
$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_pay">주문결제 내역</a></li>
|
||||
<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
|
||||
<li><a href="#anc_sodr_paymo">결제상세정보 수정</a></li>
|
||||
<li><a href="#anc_sodr_memo">상점메모</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>
|
||||
</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">
|
||||
<h2>결제상세정보</h2>
|
||||
<?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');
|
||||
?>
|
||||
Reference in New Issue
Block a user