#252 고객 요청 관리 기능 작업

This commit is contained in:
chicpro
2013-07-12 18:43:24 +09:00
parent cdfaad9e24
commit 9fb91be0aa
7 changed files with 838 additions and 19 deletions

View File

@ -0,0 +1,277 @@
<?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']) {
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);
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);
}
$qstr2 = $qstr.'&amp;rq_type='.$rq_type.'&amp;save_stx='.$stx;
?>
<section>
<h2><?php echo $type; ?>요청 내용</h2>
<div>
<?php echo $cus_content; ?>
</div>
</section>
<section>
<h2><?php echo $type; ?>요청 처리내역</h2>
<p>처리내역을 클릭하시면 상세 내용을 확인할 수 있습니다.</p>
<div>
<?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 id="rq_id_<?php echo $row['rq_id']; ?>" class="od_request_list">
<?php echo $row['rq_time'].' '.$row['rq_content']; ?>
</p>
<?php
}
if($i == 0)
echo '<p>처리내역이 없습니다.</p>';
?>
</div>
</section>
<section>
<h2><?php echo $type; ?>요청 처리</h2>
<form name="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>
<?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="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>
<tr>
<td><label for="rq_amount1">환불금액</label></td>
<td>
<input type="text" name="rq_amount1" id="rq_amount1" value="<?php echo $rq['rq_amount1']; ?>">
</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']; ?>">
</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="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>
<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']; ?>">
</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']; ?>">
</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']; ?>">
</td>
</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']; ?>">
</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']; ?>">
</td>
</tr>
<?php } // 반품요청 끝 ?>
<?php
if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') {
if($default['de_tax_flag_use']) {
?>
<tr>
<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>
<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>
<input type="text" name="rq_amount2" id="rq_amount2" value="<?php echo $rq['rq_amount2']; ?>">
</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>
<button type="button" id="request_submit">확인</button>
<?php if($disp_list) { ?>
<a href="./orderrequestlist.php?<?php echo $qstr2; ?>">목록</a>
<?php } ?>
</div>
</form>
</section>
<script>
$(function() {
$("#request_submit").click(function() {
var $form = $("form[name=forderrequest]");
$.post(
"./orderrequestformupdate.php",
$form.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, disp_list: <?php echo $disp_list; ?> },
function(data) {
$("#order_request").html(data);
}
);
});
});
</script>

View File

@ -0,0 +1,227 @@
<?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('처리내용을 입력해 주십시오.');
// 상품의 상태변경
$ct_status = '';
if($rq['rq_type'] == 0)
$ct_status = '취소';
else if($rq['rq_type'] == 2)
$ct_status = '반품';
if(($rq_status == 1 || $rq_status == 2) && $ct_status != '') {
$item = explode(',', $rq['ct_id']);
for($i=0; $i<count($item); $i++) {
$sql = " update {$g4['shop_cart_table']}
set ct_status = '$ct_status'
where uq_id = '{$od['uq_id']}'
and ct_id = '{$item[$i]}' ";
sql_query($sql);
}
}
// 환불금액입력
$rq_amount1 = preg_replace('/[^0-9]/', '', $rq_amount1);
if($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 = " 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 )
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."' ) ";
sql_query($sql);
// 부분취소처리
if(($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') && ($rq_status == 1 || $rq_status == 2))
{
$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(0, 10, $od['od_time']) >= G4_TIME_YMD)
die('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
// 취소사유의 한글깨짐 방지처리
$def_locale = setlocale(LC_CTYPE, 0);
$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 = '고객 '.$type.'요청으로 인한 부분취소';
$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($default['de_tax_flag_use']) {
$mod_mny = strval($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" , $rem_mny ); // 취소 가능 잔액
$c_PayPlus->mf_set_modx_data( "mod_mny" , $mod_mny ); // 취소 요청 금액
if($default['de_tax_flag_use'])
{
$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);
}
?>

View File

@ -0,0 +1,228 @@
<?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.'&amp;rq_type='.$rq_type.'&amp;save_stx='.$stx;
$qstr1 = $qstr.'&amp;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'].'?'.$qstr1.'&amp;rq_type=0'; ?>">취소요청</a></li>
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr1.'&amp;rq_type=1'; ?>">교환요청</a></li>
<li><a href="<?php echo $_SERVER['PHP_SELF'].'?'.$qstr1.'&amp;rq_type=2'; ?>">반품요청</a></li>
</ul>
<form name="frequestlist" method="post" action="./orderrequrestupdate.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 = '&nbsp;';
$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);
?>
<tr>
<td>
<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><?php echo $type; ?></td>
<td><?php echo $row['od_id']; ?></td>
<td><?php echo number_format($row['od_temp_amount']); ?></td>
<td><?php echo $row['od_name']; ?></td>
<td><?php echo $it_name; ?></td>
<td><?php echo $reg_date; ?></td>
<td><?php echo $done_date; ?></td>
<td>
<a href="./orderrequestview.php?rq_id=<?php echo $row['rq_id']; ?>&amp;<?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']; ?>&amp;<?php echo $qstr; ?>"><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&amp;page="); ?>
<script>
function frequestlist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -0,0 +1,94 @@
<?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'])
alert('등록된 자료가 없습니다.');
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))
alert($type.'요청된 상품이 없습니다.');
$g4['title'] = $type.'요청 상세내용';
include_once (G4_ADMIN_PATH.'/admin.head.php');
// 요청상품
$sql = " select * from {$g4['shop_order_table']} where od_id = '{$rq['od_id']}' ";
$od = sql_fetch($sql);
$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 uq_id = '{$od['uq_id']}'
order by ct_id ";
$result = sql_query($sql);
?>
<section>
<h2><?php echo $type; ?>요청 상품</h2>
<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);
?>
<tr>
<td><a href="./itemform.php?w=u&amp;it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo stripslashes($row['it_name']); ?></a></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
$disp_list = 1;
include_once('./orderrequestform.php');
?>
</div>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -364,29 +364,23 @@ if(!sql_query(" select rq_id from {$g4['shop_request_table']} limit 1 ", false))
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['shop_request_table']}` (
`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(20) NOT NULL DEFAULT '',
`rq_content` TEXT NOT NULL,
`rq_reg_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`rq_ip` VARCHAR(255) NOT NULL DEFAULT '',
`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 '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_account` VARCHAR(255) NOT NULL DEFAULT '0',
`rq_process` TEXT NOT NULL,
`rq_is_admin` TINYINT(4) 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`)
) ", false);
}
if(!sql_query(" select rq_parent from {$g4['shop_request_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g4['shop_request_table']}`
ADD `rq_parent` INT(11) NOT NULL DEFAULT '0' AFTER `rq_ip` ", true);
}
?>

View File

@ -665,22 +665,21 @@ 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(20) NOT NULL DEFAULT '',
`rq_content` TEXT NOT NULL,
`rq_reg_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`rq_ip` VARCHAR(255) NOT NULL DEFAULT '',
`rq_parent` INT(11) NOT NULL DEFAULT '0',
`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 '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_account` VARCHAR(255) NOT NULL DEFAULT '0',
`rq_process` TEXT NOT NULL,
`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;

View File

@ -45,7 +45,7 @@ for($i=0; $i<$count; $i++) {
}
$sql = " insert into {$g4['shop_request_table']}
( rq_type, od_id, ct_id, mb_id, rq_content, rq_reg_time, rq_ip )
( 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);