Files
2026-06-11 18:47:38 +09:00

117 lines
3.8 KiB
PHP

<?php
$sub_menu = '400900';
include_once('./_common.php');
auth_check_menu($auth, $sub_menu, "r");
$od_id = $_GET['od_id'] ?? '';
$qstr = 'sfl='.$_GET['sfl'].'&stx='.$_GET['stx'].'&sod='.$_GET['sod'].'&spt='.$_GET['spt'].'&page='.$_GET['page'];
$sql = " SELECT * FROM {$g5['g5_shop_order_table']} WHERE od_id = '{$od_id}' ";
$order = sql_fetch($sql);
if (!$order['od_id']) {
alert('존재하지 않는 주문입니다.');
}
$g5['title'] = '결제 상세 정보';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>결제 상세 정보</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $order['od_id']; ?></td>
</tr>
<tr>
<th scope="row">주문자</th>
<td><?php echo $order['od_name']; ?> (<?php echo $order['mb_id'] ? $order['mb_id'] : '비회원'; ?>)</td>
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo number_format($order['od_receipt_price']); ?>원</td>
</tr>
<tr>
<th scope="row">결제수단</th>
<td><?php echo $order['od_settle_case']; ?></td>
</tr>
<tr>
<th scope="row">결제상태</th>
<td><?php echo $order['od_status']; ?></td>
</tr>
<tr>
<th scope="row">주문일시</th>
<td><?php echo $order['od_time']; ?></td>
</tr>
<?php if ($order['od_pg'] && $order['od_tno']): ?>
<tr>
<th scope="row">PG사</th>
<td><?php echo $order['od_pg']; ?></td>
</tr>
<tr>
<th scope="row">거래번호 (TID)</th>
<td><?php echo $order['od_tno']; ?></td>
</tr>
<tr>
<th scope="row">결제 취소</th>
<td>
<form name="fcancel" action="./pg_cancel.php" method="post" onsubmit="return fcancel_check(this);">
<input type="hidden" name="od_id" value="<?php echo $order['od_id']; ?>">
<input type="hidden" name="token" value="<?php echo get_token(); ?>">
<label for="cancel_memo">취소 사유:</label>
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input" size="30" value="관리자 취소">
<label for="cancel_amount" class="ml-3">취소 금액:</label>
<input type="number" name="cancel_amount" id="cancel_amount" class="frm_input" size="10" placeholder="전체취소는 0 또는 미입력">
<input type="submit" value="결제 취소 실행" class="btn_submit btn">
</form>
<div class="local_desc02 local_desc">
<p>
PG사를 통해 결제된 건에 한해 취소가 가능합니다.<br>
<strong>취소 금액</strong>을 입력하지 않거나 0으로 입력하면 <strong>전체 취소</strong>됩니다.<br>
실행 즉시 PG사에 취소 요청이 전송되므로 신중하게操作하십시오.
</p>
</div>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<div class="btn_fixed_top">
<a href="./payment_list.php?<?php echo $qstr; ?>" class="btn btn_02">목록</a>
</div>
<script>
function fcancel_check(f) {
var amount = parseInt(f.cancel_amount.value.replace(/[^0-9]/g, ""));
var max_amount = parseInt("<?php echo $order['od_receipt_price']; ?>");
if (amount > 0 && amount > max_amount) {
alert("취소 금액은 결제 금액보다 클 수 없습니다.");
return false;
}
var msg = "이 결제를 정말로 취소하시겠습니까?";
if (amount > 0) {
msg = "이 결제 건에 대해 " + amount + "원을 부분 취소하시겠습니까?";
}
return confirm(msg);
}
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>