Files
firstgarden-web-gnu/mobile/shop/orderinquiryview.php
2013-05-16 09:14:05 +09:00

486 lines
17 KiB
PHP

<?php
include_once('./_common.php');
// 불법접속을 할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
if (!$is_member) {
if (get_session("ss_temp_uq_id") != $_GET['uq_id'])
alert("직접 링크로는 주문서 조회가 불가합니다.\\n\\n주문조회 화면을 통하여 조회하시기 바랍니다.");
}
$sql = "select * from {$g4['shop_order_table']} where od_id = '$od_id' and uq_id = '$uq_id' ";
$od = sql_fetch($sql);
if (!$od['od_id']) {
echo "$od_id $uq_id $MxIssueNO";
alert("조회하실 주문서가 없습니다.", G4_SHOP_URL);
}
// 결제방법
$settle_case = $od['od_settle_case'];
set_session('ss_temp_uq_id', $uq_id);
$g4['title'] = '주문상세내역';
include_once(G4_MSHOP_PATH.'/_head.php');
$s_uq_id = $od['uq_id'];
$s_page = 'orderinquiryview.php';
?>
<div id="sod_fin">
<p>주문번호 <strong><?php echo $od_id; ?></strong></p>
<section id="sod_fin_list">
<h2>주문하신 상품</h2>
<span class="sound_only">상품 상태 설명</span>
<dl>
<dt>주문</dt>
<dd>주문이 접수되었습니다.</dd>
<dt>준비</dt>
<dd>상품 준비 중입니다.</dd>
<dt>배송</dt>
<dd>상품 배송 중입니다.</dd>
<dt>완료</dt>
<dd>상품 배송이 완료되었습니다.</dd>
</dl>
<?php include G4_MSHOP_PATH.'/cartsub.inc.php'; ?>
</section>
<div id="sod_fin_view">
<h2>결제/배송 정보</h2>
<?php
$receipt_amount = $od['od_receipt_bank']
+ $od['od_receipt_card']
+ $od['od_receipt_hp']
+ $od['od_receipt_point']
- $od['od_cancel_card']
- $od['od_refund_amount'];
$misu = true;
if ($tot_amount - $tot_cancel_amount == $receipt_amount) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($receipt_amount);
}
// 120615 : 취소된 값을 두번 빼주는 결과가 되어 코드 수정 (군포돼지님)
//$misu_amount = $tot_amount - $tot_cancel_amount - $receipt_amount - $od[od_dc_amount];
$misu_amount = $tot_amount - $receipt_amount - $od['od_dc_amount'];
?>
<section id="sod_fin_pay">
<h3>결제정보</h3>
<table class="basic_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $od_id; ?></td>
</tr>
<tr>
<th scope="row">주문일시</th>
<td><?php echo $od['od_time']; ?></td>
</tr>
<?php
if ($od['od_settle_case'] == '신용카드')
{
$sql = " select * from {$g4['shop_card_history_table']} where od_id = '{$od['od_id']}' order by cd_id desc ";
$result = sql_query($sql);
$cd = mysql_fetch_array($result);
?>
<tr>
<th scope="row">결제방식</th>
<td>신용카드 결제</td>
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo display_price($cd['cd_amount']); ?></td>
</tr>
<tr>
<th scope="row">승인일시</th>
<td><?php echo $cd['cd_trade_ymd'].' '.$cd['cd_trade_hms']; ?></td>
</tr>
<tr>
<th scope="row">승인번호</th>
<td><?php echo $cd['cd_app_no']; ?></td>
</tr>
<tr>
<th scope="row">영수증</th>
<td><a href="javascript:;" onclick="window.open('http://admin.kcp.co.kr/Modules/Sale/Card/ADSA_CARD_BILL_Receipt.jsp?c_trade_no=<?php echo $od['od_escrow1']; ?>', 'winreceipt', 'width=620,height=670')">영수증 출력</a></td>
</tr>
<?php
}
else if ($od['od_settle_case'] == '휴대폰')
{
$sql = " select * from {$g4['shop_card_history_table']} where od_id = '{$od['od_id']}' order by cd_id desc ";
$result = sql_query($sql);
$cd = mysql_fetch_array($result);
?>
<tr>
<th scope="row">결제방식</th>
<td>휴대폰 결제</td>
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo display_price($cd['cd_amount']); ?></td>
</tr>
<tr>
<th scope="row">승인일시</th>
<td><?php echo $cd['cd_trade_ymd'].' '.$cd['cd_trade_hms']; ?></td>
</tr>
<tr>
<th scope="row">휴대폰번호</th>
<td><?php echo $cd['cd_opt02']; ?></td>
</tr>
<?php //echo '<tr><th scope="row">영수증</th><td><a href="javascript:;" onclick="window.open(\'http://admin.kcp.co.kr/Modules/Sale/Card/ADSA_CARD_BILL_Receipt.jsp?c_trade_no='.$od[od_escrow1].'\', \'winreceipt\', \'width=620,height=670\')">영수증 출력</a></td></tr>'; ?>
<tr>
<th scope="row">영수증</th>
<td><a href="javascript:;" onclick="window.open('https://admin.kcp.co.kr/Modules/Bill/ADSA_MCASH_N_Receipt.jsp?a_trade_no=<?php echo $od['od_escrow1']; ?>', 'winreceipt', 'width=500,height=690')">영수증 출력</a></td>
</tr>
<?php
}
else
{
?>
<tr>
<th scope="row">결제방식</th>
<td><?php echo $od['od_settle_case']; ?></td>
</tr>
<?php
if ($od['od_receipt_bank'])
{
?>
<tr>
<th scope="row">입금액</th>
<td><?php echo display_price($od['od_receipt_bank']); ?></td>
</tr>
<tr>
<td scope="row">입금확인일시</th>
<td><?php echo $od['od_bank_time']; ?></td>
</tr>
<?php
}
else
{
?>
<tr>
<th scope="row">입금액</th>
<td>아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.</td>
</tr>
<?php
}
if ($od['od_settle_case'] != '계좌이체') {
?>
<tr>
<th scope="row">계좌번호</th>
<td><?php echo $od['od_bank_account']; ?></td>
</tr>
<?php
}
?>
<tr>
<th scope="row">입금자명</th>
<td><?php echo $od['od_deposit_name']; ?></td>
</tr>
<?php
if ($od['od_escrow1']) {
?>
<tr>
<th scope="row">KCP 거래번호</th>
<td><?php echo $od['od_escrow1']; ?></td>
</tr>
<?
}
}
if ($od['od_receipt_point'] > 0)
{
?>
<tr>
<th scope="row">포인트사용</th>
<td><?php echo display_point($od['od_receipt_point']); ?></td>
</tr>
<?php
}
if ($od['od_cancel_card'] > 0)
{
?>
<tr>
<th scope="row">승인취소 금액</th>
<td><?php echo display_price($od['od_cancel_card']); ?></td>
</tr>
<?php
}
if ($od['od_refund_amount'] > 0)
{
?>
<tr>
<th scope="row">환불 금액</th>
<td><?php echo display_price($od['od_refund_amount']); ?></td>
</tr>
<?php
}
// 현금영수증 발급을 사용하는 경우에만
if ($default['de_taxsave_use']) {
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($misu_amount == 0 && $od['od_receipt_bank']) {
if ($default['de_card_pg'] == 'kcp') {
?>
<tr>
<th scope="row">현금영수증</th>
<td>
<?
if ($od['od_cash'])
{
?>
<a href="javascript:;" onclick="window.open('https://admin.kcp.co.kr/Modules/Service/Cash/Cash_Bill_Common_View.jsp?cash_no=<?php echo $od['od_cash_no']; ?>', 'taxsave_receipt', 'width=360,height=647,scrollbars=0,menus=0');">현금영수증 확인하기</a>
<?php
}
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G4_SHOP_URL; ?>/taxsave_kcp.php?od_id=<?php echo $od_id; ?>&amp;uq_id=<?php echo $od['uq_id']; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
<?php
}
}
}
?>
</tbody>
</table>
</section>
<section id="sod_fin_orderer">
<h3>주문하신 분</h3>
<table class="basic_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo $od['od_name']; ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo $od['od_tel']; ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo $od['od_hp']; ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo sprintf("(%s-%s)&nbsp;%s %s", $od['od_zip1'], $od['od_zip2'], $od['od_addr1'], $od['od_addr2']); ?></td>
</tr>
<tr>
<th scope="row">E-mail</th>
<td><?php echo $od['od_email']; ?></td>
</tr>
</tbody>
</table>
</section>
<section id="sod_fin_receiver">
<h3>받으시는 분</h3>
<table class="basic_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo $od['od_b_name']; ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo $od['od_b_tel']; ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo $od['od_b_hp']; ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo sprintf("(%s-%s)&nbsp;%s %s", $od['od_b_zip1'], $od['od_b_zip2'], $od['od_b_addr1'], $od['od_b_addr2']); ?></td>
</tr>
<?php
// 희망배송일을 사용한다면
if ($default['de_hope_date_use'])
{
?>
<tr>
<th scope="row">희망배송일</td>
<td><?php echo substr($od['od_hope_date'],0,10).' ('.get_yoil($od['od_hope_date']).')' ;?></td>
</tr>
<?php }
if ($od['od_memo'])
{
?>
<tr>
<th scope="row">전하실 말씀</td>
<td><?php echo conv_content($od['od_memo'], 0); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</section>
<section id="sod_fin_dvr">
<h3>배송정보</h3>
<table class="basic_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<?php
// 배송회사 정보
$dl = sql_fetch(" select * from {$g4['shop_delivery_table']} where dl_id = '{$od['dl_id']}' ");
if ($od['od_invoice'] || !$od['misu'])
{
if (is_array($dl))
{
// get 으로 날리는 경우 운송장번호를 넘김
if (strpos($dl['dl_url'], "=")) $invoice = $od['od_invoice'];
?>
<tr>
<th scope="row">배송회사</th>
<td><?php echo $dl['dl_company']; ?> [<a href="<?php echo $dl['dl_url'].$invoice; ?>" target="_blank">배송조회하기</a>]</td>
</tr>
<tr>
<th scope="row">운송장번호</th>
<td><?php echo $od['od_invoice']; ?></td>
</tr>
<tr>
<th scope="row">배송일시</th>
<td><?php echo $od['od_invoice_time']; ?></td>
</tr>
<tr>
<th>고객센터 전화</th>
<td><?php echo $dl['dl_tel']; ?></td>
</tr>
<?php
}
else
{
?>
<tr>
<td class="empty_table">아직 배송하지 않았거나 배송정보를 입력하지 못하였습니다.</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</section>
</div>
<section id="sod_fin_tot">
<h2>결제합계</h2>
<ul>
<li>
총 구매액
<strong><?php echo display_price($tot_amount); ?></strong>
</li>
<?php
if ($od['od_dc_amount'] > 0) {
echo '<li>';
echo '할인액'.PHP_EOL;
echo '<strong>'.display_price($od['od_dc_amount']).'</strong>';
echo '</li>';
}
if ($misu_amount > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_amount).'</strong>';
echo '</li>';
}
?>
<li id="alrdy">
결제액
<strong><?php echo $wanbul; ?></strong>
</li>
</ul>
</section>
<section id="sod_fin_cancel">
<h2>주문취소</h2>
<?php
// 취소한 내역이 없다면
if ($tot_cancel_amount == 0) {
if ($od['od_temp_bank'] > 0 && $od['od_receipt_bank'] == 0) {
?>
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
<div id="sod_fin_cancelfrm">
<form method="post" action="<?php echo G4_SHOP_URL; ?>/orderinquirycancel.php">
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
<input type="hidden" name="uq_id" value="<?php echo $od['uq_id']; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<label for="cancel_memo">취소사유</label>
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input" size="40" maxlength="100">
<input type="submit" value="확인" class="btn_frmline">
</form>
</div>
<?php
}
} else {
$misu_amount = $misu_amount - $send_cost;
?>
<p>주문 취소, 반품, 품절된 내역이 있습니다.</p>
<?php } ?>
</section>
<?php if ($od['od_settle_case'] == '가상계좌' && $default['de_card_test'] && $is_admin) {
preg_match("/(\s[^\s]+\s)/", $od['od_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<fieldset>
<legend>모의입금처리</legend>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<input type="text" name="e_trade_no" value="<?php echo $od['od_escrow1']; ?>" size="80"><br />
<input type="text" name="deposit_no" value="<?php echo $deposit_no; ?>" size="80"><br />
<input type="text" name="req_name" value="<?php echo $od['od_name']; ?>" size="80"><br />
<input type="text" name="noti_url" value="<?php echo G4_SHOP_URL; ?>/settle_kcp_common.php" size="80"><br /><br />
<input type="submit" value="입금통보 테스트">
</form>
</fieldset>
<?php } ?>
</div>
<?php
include_once(G4_MSHOP_PATH.'/_tail.php');
?>