Merge branch 'orderlist'

This commit is contained in:
gnuboard
2013-10-31 16:25:46 +09:00
4 changed files with 147 additions and 104 deletions

View File

@ -8,34 +8,17 @@ $ct_chk_count = count($_POST['ct_chk']);
if(!$ct_chk_count)
alert('처리할 자료를 하나 이상 선택해 주십시오.');
switch($_POST['act_button'])
{
case '주문':
$ct_status = '주문';
break;
case '상품준비중':
$ct_status = '준비';
break;
case '배송중':
$ct_status = '배송';
break;
case '완료':
$ct_status = '완료';
break;
case '취소':
$ct_status = '취소';
break;
case '반품':
$ct_status = '반품';
break;
case '품절':
$ct_status = '품절';
break;
default:
alert('변경할 상태가 올바르지 않습니다.');
break;
$status_normal = array('주문','입금','준비','배송','완료');
$status_cancel = array('취소','반품','품절');
if (in_array($_POST['ct_status'], $status_normal) || in_array($_POST['ct_status'], $status_cancel)) {
; // 통과
} else {
alert('변경할 상태가 올바르지 않습니다.');
}
$mod_history = '';
$cnt = count($_POST['ct_id']);
for ($i=0; $i<$cnt; $i++)
@ -43,9 +26,7 @@ for ($i=0; $i<$cnt; $i++)
$k = $_POST['ct_chk'][$i];
$ct_id = $_POST['ct_id'][$k];
$sql = " select * from {$g5['g5_shop_cart_table']}
where od_id = '$od_id'
and ct_id = '$ct_id' ";
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_id = '$ct_id' ";
$ct = sql_fetch($sql);
if(!$ct['ct_id'])
continue;
@ -174,22 +155,20 @@ $sql = " update {$g5['g5_shop_order_table']}
od_misu = '{$info['od_misu']}',
od_tax_mny = '{$info['od_tax_mny']}',
od_vat_mny = '{$info['od_vat_mny']}',
od_free_mny = '{$info['od_free_mny']}'
where od_id = '$od_id' ";
od_free_mny = '{$info['od_free_mny']}' ";
if ($mod_history) { // 수량변경 히스토리 기록
$sql .= " , od_mod_history = CONCAT(od_mod_history,'$mod_history') ";
}
if (in_array($_POST['ct_status'], $status_normal)) { // 정상인 주문상태만 기록
$sql .= " , od_status = '{$_POST['ct_status']}' ";
}
$sql .= " where od_id = '$od_id' ";
sql_query($sql);
$qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
$url = "./orderform.php?od_id=$od_id&amp;$qstr";
// 수량변경 히스토리 기록
if($mod_history) {
$sql = " update {$g5['g5_shop_order_table']}
set od_mod_history = CONCAT(od_mod_history,'$mod_history')
where od_id = '$od_id' ";
sql_query($sql);
}
// 1.06.06
$od = sql_fetch(" select od_receipt_point from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
if ($od['od_receipt_point'])

View File

@ -73,16 +73,21 @@ if ($od['mb_id'] == "") {
}
//------------------------------------------------------------------------------
$qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
// PG사를 KCP 사용하면서 테스트 상점아이디라면
$pg_url = 'http://admin8.kcp.co.kr';
if ($default['de_card_test']) {
// 로그인 아이디 / 비번
// 일반 : test1234 / test12345
// 에스크로 : escrow / escrow913
$pg_url = 'http://testadmin8.kcp.co.kr';
}
$pg_anchor = '<ul class="anchor">
<li><a href="#anc_sodr_list">주문상품 목록</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>
<li><a href="#anc_sodr_addressee">받으시는 분</a></li>
</ul>';
$html_receipt_chk = '<input type="checkbox" id="od_receipt_chk" value="'.$od['od_misu'].'" onclick="chk_receipt_price()">
<label for="od_receipt_chk">결제금액 수동 설정</label><br>';
$qstr = "sort1=$sort1&amp;sort2=$sort2&amp;sel_field=$sel_field&amp;search=$search&amp;page=$page";
// 상품목록
$sql = " select it_id,
@ -94,23 +99,19 @@ $sql = " select it_id,
group by it_id
order by ct_id ";
$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>
<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>
<li><a href="#anc_sodr_addressee">받으시는 분</a></li>
</ul>';
?>
<section id="anc_sodr_list">
<h2 class="h2_frm">주문상품 목록</h2>
<?php echo $pg_anchor; ?>
<div class="local_desc02 local_desc">
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원</p>
<p>
주문상태 <strong><?php echo $od['od_status'] ?></strong>
|
주문일시 <strong><?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>)</strong>
|
주문총액 <strong><?php echo number_format($od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원
</p>
<?php if ($default['de_hope_date_use']) { ?><p>희망배송일은 <?php echo $od['od_hope_date']; ?> (<?php echo get_yoil($od['od_hope_date']); ?>) 입니다.</p><?php } ?>
<?php if($od['od_mobile']) { ?>
<p>모바일 쇼핑몰의 주문입니다.</p>
@ -218,16 +219,19 @@ $pg_anchor = '<ul class="anchor">
</div>
<div class="btn_list02 btn_list">
<strong>주문상태 변경</strong>
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
<input type="submit" name="act_button" value="주문" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="상품" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="배송" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="완료" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="취소" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="반품" onclick="document.pressed=this.value">
<input type="submit" name="act_button" value="품절" onclick="document.pressed=this.value">
<p>취소,반품,품절 상태는 장바구니 상품의 상태만 변경이 되며 주문서의 상태는 변경되지 않습니다.</p>
<p>
<strong>주문상태 변경</strong>
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
<input type="submit" name="ct_status" value="주문" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="입금" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="준비" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="배송" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="완료" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="취소" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="반품" onclick="document.pressed=this.value">
<input type="submit" name="ct_status" value="품절" onclick="document.pressed=this.value">
</p>
<p>주문, 입금, 준비, 배송, 완료는 장바구니와 주문서 상태를 모두 변경하지만, 취소, 반품, 품절은 장바구니의 상태만 변경하며, 주문서 상태는 변경하지 않습니다.</p>
</div>
</form>
@ -378,7 +382,7 @@ $pg_anchor = '<ul class="anchor">
<?php if ($od['od_settle_case'] == '신용카드') { ?>
<tr>
<th scope="row" class="sodr_sppay">신용카드 금액</th>
<th scope="row" class="sodr_sppay">신용카드 결제금액</th>
<td>
<?php if ($od['od_receipt_time'] == "0000-00-00 00:00:00") {?>0원
<?php } else { ?><?php echo display_price($od['od_receipt_price']); ?>
@ -394,6 +398,37 @@ $pg_anchor = '<ul class="anchor">
</td>
</tr>
<?php } ?>
<?php if ($od['od_settle_case'] != '무통장') { ?>
<tr>
<th scope="row">결제대행사 링크</th>
<td>
<?php
//------------------------------------------------------------------------------
// KCP(PG) 바로가기
//------------------------------------------------------------------------------
if ($od['od_settle_case'] != '무통장') {
// PG사를 KCP 사용하면서 테스트 상점아이디라면
$pg_url = 'http://admin8.kcp.co.kr';
$pg_test = '';
if ($default['de_card_test']) {
// 로그인 아이디 / 비번
// 일반 : test1234 / test12345
// 에스크로 : escrow / escrow913
$pg_url = 'http://testadmin8.kcp.co.kr';
if ($default['de_escrow_use'])
$pg_test = '에스크로 테스트 ';
else
$pg_test = '일반 테스트 ';
}
echo "<a href=\"{$pg_url}\" target=\"_blank\">KCP {$pg_test}바로가기</a><br>";
}
//------------------------------------------------------------------------------
?>
</td>
</tr>
<?php } ?>
<?php if($od['od_tax_flag']) { ?>
<tr>
<th scope="row">과세공급가액</th>
@ -514,11 +549,11 @@ $pg_anchor = '<ul class="anchor">
<td><?php echo $bank_account; ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="od_receipt_price"><?php echo $od['od_settle_case']; ?> 입금액</label></th>
<td>
<input type="text" name="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" id="od_receipt_price" class="frm_input"> 원
<a href="<?php echo $pg_url; ?>" target="_blank">결제대행사</a>
</td>
</tr>
<tr>
@ -550,8 +585,8 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><label for="od_receipt_price"><?php echo $od['od_settle_case']; ?> 결제액</label></th>
<td>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" id="od_receipt_price" class="frm_input"> 원
<a href="<?php echo $pg_url; ?>" target="_blank">결제대행사</a>
</td>
</tr>
<tr>
@ -566,10 +601,10 @@ $pg_anchor = '<ul class="anchor">
<?php if ($od['od_settle_case'] == '신용카드') { ?>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_receipt_price">신용카드 결제액</label></th>
<th scope="row" class="sodr_sppay"><label for="od_receipt_price">신용카드 결제액</label></th>
<td>
<input type="text" name="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" id="od_receipt_price" class="frm_input" size="10"> 원
<a href="<?php echo $pg_url; ?>" target="_blank">결제대행사</a>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" id="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<tr>
@ -606,15 +641,17 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><label for="od_delivery_company">배송회사</label></th>
<td>
<input type="text" name="od_delivery_company" value="<?php echo $od['od_delivery_company']; ?>" id="od_delivery_company" class="frm_input">
<input type="checkbox" id="od_delivery_chk" value="<?php echo $default['de_delivery_company']; ?>" onclick="chk_delivery_company()">
<label for="od_delivery_chk">기본 배송회사로 설정</label><br>
<input type="text" name="od_delivery_company" id="od_delivery_company" value="<?php echo $od['od_delivery_company']; ?>" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="od_invoice_time">배송일시</label></th>
<td>
<input type="checkbox" name="od_invoice_chk" id="od_invoice_chk" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="if (this.checked == true) this.form.od_invoice_time.value=this.form.od_invoice_chk.value; else this.form.od_invoice_time.value = this.form.od_invoice_time.defaultValue;">
<input type="checkbox" id="od_invoice_chk" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="chk_invoice_time()">
<label for="od_invoice_chk">현재 시간으로 설정</label><br>
<input type="text" name="od_invoice_time" value="<?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?>" id="od_invoice_time" class="frm_input" maxlength="19">
<input type="text" name="od_invoice_time" id="od_invoice_time" value="<?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?>" class="frm_input" maxlength="19">
</td>
</tr>
<tr>
@ -879,7 +916,7 @@ function form_submit(f)
return false;
}
if (confirm("\'" + status + "\'을(를) 선택하셨습니다.\n\n이대로 처리 하시겠습니까?")) {
if (confirm("\'" + status + "\' 상태를 선택하셨습니다.\n\n처리 하시겠습니까?")) {
return true;
} else {
return false;
@ -894,6 +931,30 @@ function del_confirm()
return false;
}
}
// 기본 배송회사로 설정
function chk_delivery_company()
{
var chk = document.getElementById("od_delivery_chk");
var company = document.getElementById("od_delivery_company");
company.value = chk.checked ? chk.value : company.defaultValue;
}
// 현재 시간으로 배송일시 설정
function chk_invoice_time()
{
var chk = document.getElementById("od_invoice_chk");
var time = document.getElementById("od_invoice_time");
time.value = chk.checked ? chk.value : time.defaultValue;
}
// 결제금액 수동 설정
function chk_receipt_price()
{
var chk = document.getElementById("od_receipt_chk");
var price = document.getElementById("od_receipt_price");
price.value = chk.checked ? chk.value : price.defaultValue;
}
</script>
<?php

View File

@ -397,7 +397,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<div class="local_cmd01 local_cmd">
<?php if (($od_status == '' || $od_status == '완료') == false) { // 검색된 주문상태가 '전체', '완료' 가 아니라면 ?>
<strong>주문상태 변경</strong>
<label for="od_status" class="cmd_tit">주문상태 변경</label>
<?php
$change_status = "";
if ($od_status == '주문') $change_status = "입금";
@ -405,11 +405,9 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
if ($od_status == '준비') $change_status = "배송";
if ($od_status == '배송') $change_status = "완료";
?>
<?php if ($change_status) { ?>
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> '<?php echo $od_status ?>'상태에서 '<strong><?php echo $change_status ?></strong>'상태로 변경합니다.</label>
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
<?php if ($od_status == '주문') { ?> <span>주문상태에서만 삭제가 가능합니다.</span> <input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
<?php } ?>
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> '<?php echo $od_status ?>'상태에서 '<strong><?php echo $change_status ?></strong>'상태로 변경합니다.</label>
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
<?php if ($od_status == '주문') { ?> <span>주문상태에서만 삭제가 가능합니다.</span> <input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
<?php } ?>
</div>

View File

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