#252 관리자 주문취소 기능 추가
This commit is contained in:
31
adm/shop_admin/orderrequestdelete.php
Normal file
31
adm/shop_admin/orderrequestdelete.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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);
|
||||
?>
|
||||
@ -104,23 +104,22 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<?php if($rq['rq_type'] == 0) { // 취소요청 ?>
|
||||
<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'); ?>>입금전 처리완료</option>
|
||||
<option value="2"<?php echo get_selected($rq['rq_status'], '2'); ?>>입금후 처리완료</option>
|
||||
<option value="1"<?php echo get_selected($rq['rq_status'], '1'); ?>><?php $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']; ?>">
|
||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -137,12 +136,6 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
<textarea name="rq_item" id="rq_item"><?php echo $rq['rq_item']; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rq_recv">상품수령</label></td>
|
||||
<td>
|
||||
<input type="checkbox" name="rq_recv" id="rq_recv"> 교환요청상품 수령함
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="dl_company">배송회사</label></td>
|
||||
<td>
|
||||
@ -170,7 +163,7 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
<tr>
|
||||
<td><label for="rq_amount1">상품차액</label></td>
|
||||
<td>
|
||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1']; ?>">
|
||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -181,16 +174,10 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
</tr>
|
||||
<?php } // 교환요청 끝 ?>
|
||||
<?php if($rq['rq_type'] == 2) { // 반품요청 ?>
|
||||
<tr>
|
||||
<td><label for="rq_recv">상품수령</label></td>
|
||||
<td>
|
||||
<input type="checkbox" name="rq_recv" id="rq_recv"> 반품요청상품 수령함
|
||||
</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']; ?>">
|
||||
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1'] ? $rq['rq_amount1'] : ''; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -205,20 +192,20 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
if($default['de_tax_flag_use']) {
|
||||
?>
|
||||
<tr>
|
||||
<td><label for="rq_amount2">과세부분취소</label></td>
|
||||
<td><label for="rq_amount2">과세금액 부분취소</label></td>
|
||||
<td>
|
||||
<input type="text" name="rq_amount2" id="rq_amount2" value="<?php echo $rq['rq_amount2']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="rq_amount3">비과세부분취소</label></td>
|
||||
<td><label for="rq_amount3">비과세금액 부분취소</label></td>
|
||||
<td>
|
||||
<input type="text" name="rq_amount3" id="rq_amount3" value="<?php echo $rq['rq_amount3']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td><label for="rq_amount2">부분취소</label></td>
|
||||
<td><label for="rq_amount2">금액 부분취소</label></td>
|
||||
<td>
|
||||
<input type="text" name="rq_amount2" id="rq_amount2" value="<?php echo $rq['rq_amount2']; ?>">
|
||||
</td>
|
||||
@ -236,7 +223,7 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<button type="button" id="request_submit">확인</button>
|
||||
<button type="submit" id="request_submit">확인</button>
|
||||
<?php if($disp_list) { ?>
|
||||
<a href="./orderrequestlist.php?<?php echo $qstr2; ?>">목록</a>
|
||||
<?php } ?>
|
||||
@ -246,12 +233,12 @@ $qstr2 = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#request_submit").click(function() {
|
||||
var $form = $("form[name=forderrequest]");
|
||||
$("form[name=forderrequest]").submit(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.post(
|
||||
"./orderrequestformupdate.php",
|
||||
$form.serialize(),
|
||||
$(this).serialize(),
|
||||
function(data) {
|
||||
if(data != "")
|
||||
alert(data);
|
||||
|
||||
@ -48,9 +48,9 @@ if($rq_amount1 > 0) {
|
||||
|
||||
// 처리내용입력
|
||||
$sql = " insert into `{$g4['shop_request_table']}`
|
||||
( rq_type, rq_parent, od_id, ct_id, mb_id, rq_content, rq_status, rq_item, rq_recv, dl_company, rq_invoice, rq_amount1, rq_amount2, rq_amount3, rq_account, rq_ip, rq_time )
|
||||
( 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', '$rq_recv', '$dl_company', '$rq_invoice', '$rq_amount1', '$rq_amount2', '$rq_amount3', '$rq_account', '$REMOTE_ADDR', '".G4_TIME_YMDHIS."' ) ";
|
||||
( '{$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);
|
||||
|
||||
// 부분취소처리
|
||||
|
||||
@ -59,8 +59,7 @@ $sql = " select a.*, b.od_temp_amount, b.od_name
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr = $qstr.'&rq_type='.$rq_type.'&save_stx='.$stx;
|
||||
$qstr1 = $qstr.'&save_stx='.$stx;
|
||||
$qstr = $qstr.'&save_stx='.$stx;
|
||||
|
||||
$listall = '';
|
||||
if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
|
||||
@ -98,12 +97,12 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
|
||||
<h2><?php echo $rq_type_text; ?>내역 목록</h2>
|
||||
|
||||
<ul class="sort_odr">
|
||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr1.'&rq_type=0'; ?>">취소요청</a></li>
|
||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr1.'&rq_type=1'; ?>">교환요청</a></li>
|
||||
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr1.'&rq_type=2'; ?>">반품요청</a></li>
|
||||
<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="./orderrequrestupdate.php" onsubmit="return frequestlist_submit(this);" autocomplete="off">
|
||||
<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; ?>">
|
||||
@ -182,7 +181,7 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
|
||||
<td><?php echo $done_date; ?></td>
|
||||
<td>
|
||||
<a href="./orderrequestview.php?rq_id=<?php echo $row['rq_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo $it_name. ' '.$type.'요청'; ?> </span>보기</a>
|
||||
<a href="./orderrequestdelete.php?rq_id=<?php echo $row['rq_id']; ?>&<?php echo $qstr; ?>"><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>
|
||||
|
||||
@ -221,6 +220,11 @@ function frequestlist_submit(f)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function del_confirm()
|
||||
{
|
||||
return confirm('해당 요청을 삭제하시겠습니까?');
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
@ -65,6 +65,14 @@ $result = sql_query($sql);
|
||||
}
|
||||
|
||||
$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></td>
|
||||
|
||||
@ -371,7 +371,6 @@ if(!sql_query(" select rq_id from {$g4['shop_request_table']} limit 1 ", false))
|
||||
`rq_content` TEXT NOT NULL,
|
||||
`rq_status` TINYINT(4) NOT NULL DEFAULT '0',
|
||||
`rq_item` TEXT NOT NULL,
|
||||
`rq_recv` TINYINT(4) NOT NULL DEFAULT '0',
|
||||
`dl_company` INT(11) NOT NULL DEFAULT '0',
|
||||
`rq_invoice` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`rq_amount1` INT(11) NOT NULL DEFAULT '0',
|
||||
|
||||
@ -672,7 +672,6 @@ CREATE TABLE IF NOT EXISTS `shop_request` (
|
||||
`rq_content` TEXT NOT NULL,
|
||||
`rq_status` TINYINT(4) NOT NULL DEFAULT '0',
|
||||
`rq_item` TEXT NOT NULL,
|
||||
`rq_recv` TINYINT(4) NOT NULL DEFAULT '0',
|
||||
`dl_company` INT(11) NOT NULL DEFAULT '0',
|
||||
`rq_invoice` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`rq_amount1` INT(11) NOT NULL DEFAULT '0',
|
||||
|
||||
Reference in New Issue
Block a user