Merge branch 'master' of github.com:gnuboard/yc5

This commit is contained in:
chicpro
2013-11-01 16:47:20 +09:00
5 changed files with 208 additions and 166 deletions

View File

@ -1,27 +0,0 @@
<?php
$sub_menu = '400400';
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], "d");
if ($od_id)
{
// 장바구니 삭제
sql_query(" delete from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ");
// 주문서 삭제
sql_query(" delete from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
}
if ($return_url)
{
goto_url("$return_url");
}
else
{
$qstr = "sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search&amp;sort1=$sort1&amp;sort2=$sort2&amp;page=$page";
goto_url("./orderlist{$list}.php?$qstr");
}
?>

View File

@ -2,19 +2,12 @@
$sub_menu = '400400';
include_once('./_common.php');
// 메세지
$html_title = '주문 내역 수정';
$alt_msg1 = '주문번호 오류입니다.';
$mb_guest = '비회원';
$cart_title1 = '쇼핑';
$cart_title2 = '완료';
$cart_title3 = '주문번호';
$cart_title4 = '배송완료';
auth_check($auth[$sub_menu], "w");
$g5['title'] = $html_title;
$g5['title'] = "주문 내역 수정";
include_once(G5_ADMIN_PATH.'/admin.head.php');
//------------------------------------------------------------------------------
@ -23,20 +16,45 @@ include_once(G5_ADMIN_PATH.'/admin.head.php');
$keep_term = $default['de_cart_keep_term'];
if (!$keep_term) $keep_term = 15; // 기본값 15일
$beforetime = date('Y-m-d H:i:s', ( G5_SERVER_TIME - (86400 * $keep_term) ) );
$sql = " delete from {$g5['g5_shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforetime' ";
$sql = " delete from {$g5['g5_shop_cart_table']} where ct_status = '쇼핑' and ct_time <= '$beforetime' ";
sql_query($sql);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// 주문포인트를 적립한다.
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
// 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다.
//------------------------------------------------------------------------------
function save_order_point($ct_status="완료")
{
global $default;
$beforedays = date("Y-m-d H:i:s", ( time() - (86400 * (int)$default['de_point_days']) ) ); // 86400초는 하루
$sql = " select * from {$g5['g5_shop_cart_table']} where ct_status = '$ct_status' and ct_point_use = '0' and ct_time <= '$beforedays' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 회원 ID 를 얻는다.
$od_row = sql_fetch("select od_id, mb_id from {$g5['g5_shop_order_table']} where od_id = '{$row['od_id']}' ");
if ($od_row['mb_id'] && $row['ct_point'] > 0) { // 회원이면서 포인트가 0보다 크다면
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "주문번호 {$od_row['od_id']} ({$row['ct_id']}) 배송완료";
insert_point($od_row['mb_id'], $po_point, $po_content, "@delivery", $od_row['mb_id'], "{$od_row['od_id']},{$row['ct_id']}");
}
sql_query("update {$g5['g5_shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");
}
}
//------------------------------------------------------------------------------
// 주문완료 포인트
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
// 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다.
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
// 설정일이 0 이면 주문서 완료 설정 시점에서 포인트를 바로 부여합니다.
//------------------------------------------------------------------------------
if (!isset($order_not_point)) {
$beforedays = date("Y-m-d H:i:s", ( time() - (60 * 60 * 24 * (int)$default['de_point_days']) ) );
$sql = " select * from {$g5['g5_shop_cart_table']}
where ct_status = '$cart_title2'
where ct_status = '완료'
and ct_point_use = '0'
and ct_time <= '$beforedays' ";
$result = sql_query($sql);
@ -65,24 +83,27 @@ if (!isset($order_not_point)) {
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
$od = sql_fetch($sql);
if (!$od['od_id']) {
alert($alt_msg1);
alert("해당 주문번호로 주문서가 존재하지 않습니다.");
}
if ($od['mb_id'] == "") {
$od['mb_id'] = $mb_guest;
}
$od['mb_id'] = $od['mb_id'] ? $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,30 +115,26 @@ $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>
<?php } ?>
</div>
<form name="frmorderform" method="post" action="./ordercartupdate.php" onsubmit="return form_submit(this);">
<form name="frmorderform" method="post" action="./orderformcartupdate.php" onsubmit="return form_submit(this);">
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
<input type="hidden" name="mb_id" value="<?php echo $od['mb_id']; ?>">
<input type="hidden" name="od_email" value="<?php echo $od['od_email']; ?>">
@ -172,8 +189,9 @@ $pg_anchor = '<ul class="anchor">
else
$opt_price = $opt['ct_price'] + $opt['io_price'];
$ct_price['소계'] = $opt_price * $opt['ct_qty'];
$ct_point['소계'] = $opt['ct_point'] * $opt['ct_qty'];
// 소계
$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
$ct_point['stotal'] = $opt['ct_point'] * $opt['ct_qty'];
?>
<tr>
<?php if($k == 0) { ?>
@ -198,9 +216,9 @@ $pg_anchor = '<ul class="anchor">
<input type="text" name="ct_qty[<?php echo $chk_cnt; ?>]" id="ct_qty_<?php echo $chk_cnt; ?>" value="<?php echo $opt['ct_qty']; ?>" required class="frm_input required" size="5">
</td>
<td class="td_numsmall"><?php echo number_format($opt_price); ?></td>
<td class="td_num"><?php echo number_format($ct_price['소계']); ?></td>
<td class="td_num"><?php echo number_format($ct_price['stotal']); ?></td>
<td class="td_num"><?php echo number_format($opt['cp_price']); ?></td>
<td class="td_num"><?php echo number_format($ct_point['소계']); ?></td>
<td class="td_num"><?php echo number_format($ct_point['stotal']); ?></td>
<td class="td_sendcost_by"><?php echo $opt['ct_send_cost'] ? '착불' : '선불'; ?></td>
<td class="td_mngsmall"><?php echo get_yn($opt['ct_point_use']); ?></td>
<td class="td_mngsmall"><?php echo get_yn($opt['ct_stock_use']); ?></td>
@ -218,16 +236,20 @@ $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>
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
<strong>주문 및 장바구니 상태 변경</strong>
<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>
<p>개별적인(이곳에서의) 상태 변경은 모든 작업을 수동으로 처리합니다. 예를 들어 주문에서 입금으로 상태 변경시 입금액(결제금액)을 포함한 모든 정보는 수동 입력으로 처리하셔야 합니다.</p>
</div>
</form>
@ -307,7 +329,7 @@ $pg_anchor = '<ul class="anchor">
<h2 class="h2_frm">결제상세정보</h2>
<?php echo $pg_anchor; ?>
<form name="frmorderreceiptform" action="./orderreceiptupdate.php" method="post" autocomplete="off">
<form name="frmorderreceiptform" action="./orderformreceiptupdate.php" method="post" autocomplete="off">
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
@ -378,7 +400,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 +416,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,17 +567,18 @@ $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>
<?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>
<th scope="row"><label for="od_deposit_name">입금자명</label></th>
<td>
<?php if ($default['de_sms_use3']) { ?>
<?php if ($default['de_sms_use'] && $default['de_sms_use3']) { ?>
<input type="checkbox" name="od_sms_ipgum_check" id="od_sms_ipgum_check">
<label for="od_sms_ipgum_check">SMS 입금 문자전송</label>
<br>
@ -550,8 +604,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 +620,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>
@ -595,7 +649,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<th scope="row"><label for="od_invoice">운송장번호</label></th>
<td>
<?php if ($default['de_sms_use4']) { ?>
<?php if ($default['de_sms_use'] && $default['de_sms_use4']) { ?>
<input type="checkbox" name="od_sms_baesong_check" id="od_sms_baesong_check">
<label for="od_sms_baesong_check">SMS 배송 문자전송</label>
<br>
@ -606,17 +660,21 @@ $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>
<?php if ($config['cf_email_use']) { ?>
<tr>
<th scope="row"><label for="od_send_mail">메일발송</label></th>
<td>
@ -624,6 +682,8 @@ $pg_anchor = '<ul class="anchor">
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail"> 메일발송
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
@ -633,12 +693,7 @@ $pg_anchor = '<ul class="anchor">
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="결제/배송내역 수정" class="btn_submit">
<?php if($od['od_misu'] > 0) { ?>
<a href="./personalpayform.php?popup=yes&amp;od_id=<?php echo $od_id; ?>" id="personalpay_add">개인결제추가</a>
<?php } ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && $od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel"><?php echo $od['od_settle_case']; ?> 부분취소</a>
<?php } ?>
<a href="./orderlist.php?<?php echo $qstr; ?>">목록</a>
</div>
</form>
</section>
@ -816,14 +871,19 @@ $pg_anchor = '<ul class="anchor">
<div class="btn_confirm01 btn_confirm">
<input type="submit" value="주문자/배송지 정보 수정" class="btn_submit">
<a href="./orderlist.php?<?php echo $qstr; ?>">목록</a>
</div>
</form>
</section>
<div class="btn_list03 btn_list">
<a href="./orderdelete.php?od_id=<?php echo $od['od_id']; ?>&amo;mb_id=<?php echo $od['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return del_confirm();">주문서 삭제</a>
<a href="./orderlist.php?<?php echo $qstr; ?>">목록</a>
<?php if($od['od_misu'] > 0) { ?>
<a href="./personalpayform.php?popup=yes&amp;od_id=<?php echo $od_id; ?>" id="personalpay_add">개인결제추가</a>
<?php } ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && $od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체') { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel"><?php echo $od['od_settle_case']; ?> 부분취소</a>
<?php } ?>
</div>
<script>
@ -879,7 +939,7 @@ function form_submit(f)
return false;
}
if (confirm("\'" + status + "\'을(를) 선택하셨습니다.\n\n이대로 처리 하시겠습니까?")) {
if (confirm("\'" + status + "\' 상태를 선택하셨습니다.\n\n처리 하시겠습니까?")) {
return true;
} else {
return false;
@ -894,6 +954,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

@ -8,34 +8,16 @@ $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 +25,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 +154,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

@ -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');
}

View File

@ -198,7 +198,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
</div>
</form>
<form name="forderlist" id="forderlist" action="./orderlistupdate.php" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
<div class="tbl_head02 tbl_wrap">
@ -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>
@ -461,6 +459,8 @@ function set_date(today)
<script>
function forderlist_submit(f)
{
var change_status = f.od_status.value;
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
@ -492,6 +492,7 @@ function forderlist_submit(f)
}
var chk = document.getElementsByName("chk[]");
for (var i=0; i<chk.length; i++)
{
if (chk[i].checked)
@ -499,7 +500,6 @@ function forderlist_submit(f)
var k = chk[i].value;
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
var current_status = f.elements['current_status['+k+']'].value;
var change_status = f.od_status.value;
switch (change_status)
{
@ -550,8 +550,10 @@ function forderlist_submit(f)
}
}
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
return false;
f.action = "./orderlistupdate.php";
return true;
}
</script>