<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
add_stylesheet('<link rel="stylesheet" href="'.$view_skin_url.'/style.css">', 0);
// 방향값에 따른 컬러 설정 (기존 규칙 유지)
$dir = strtoupper($view['x2_direction']);
$is_in = (stripos($dir, '입금') !== false || $dir == 'IN' || $dir == 'DEPOSIT');
$box_class = $is_in ? 'bg-in' : 'bg-out';
$point_color = $is_in ? '#10b981' : '#ef4444';
?>
<style>
/* 1. 페이지 폭 및 여백 설정 (좌우 50px) */
#bo_v { background-color: #020617 !important; color: #f1f5f9; font-family: 'Pretendard', sans-serif; padding: 40px 0; min-height: 100vh; }
.view-container { margin: 0 50px; max-width: none; }
/* 2. 스크롤바 UI 구성 (페이지 색상 맞춤) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: #232e42; border-radius: 6px; border: 2px solid #020617; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }
/* 리포트 상단 헤더 */
.report-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #232e42; padding-bottom: 20px; margin-bottom: 30px; }
.report-title h1 { font-size: 32px; font-weight: 900; color: #3b82f6; margin: 0; letter-spacing: -1px; }
.report-title p { font-size: 14px; color: #64748b; margin: 5px 0 0; font-weight: 700; text-transform: uppercase; }
.report-date { text-align: right; color: #94a3b8; font-size: 14px; font-family: monospace; }
/* 문서 스타일 카드 (라운딩 6px) */
.report-card { background: #1a2436; border: 1px solid #232e42; border-radius: 6px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.3); margin-bottom: 30px; }
/* 요약 섹션 */
.summary-section { display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(0,0,0,0.2); border-bottom: 1px solid #232e42; }
.summary-item { padding: 30px; text-align: center; border-right: 1px solid #232e42; }
.summary-item:last-child { border-right: none; }
.summary-label { display: block; color: #94a3b8; font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.summary-value { font-size: 26px; font-weight: 900; }
/* 방향 박스 */
.dir-box { display: inline-block; padding: 5px 15px; border-radius: 4px; font-size: 15px; color: #fff; font-weight: 900; }
.bg-in { background: #10b981; }
.bg-out { background: #ef4444; }
/* 명세 그리드 */
.detail-grid { padding: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
.detail-item { border-bottom: 1px solid #232e42; padding-bottom: 18px; }
.detail-label { display: block; color: #64748b; font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.detail-value { font-size: 17px; color: #e2e8f0; font-weight: 600; word-break: break-all; }
.detail-value.highlight { color: #3b82f6; }
/* 상태 컬러 */
.st-done { color: #10b981; }
.st-wait { color: #f59e0b; }
.st-fail { color: #ef4444; }
/* 3. 이전/다음글 좌우 배치형 구성 */
.post-nav { display: flex; gap: 20px; margin-bottom: 40px; }
.nav-item { flex: 1; background: #161e2d; border: 1px solid #232e42; padding: 20px 25px; border-radius: 6px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; transition: 0.2s; }
.nav-item:hover { background: #1e293b; border-color: #3b82f6; }
.nav-label { color: #3b82f6; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }
.nav-subject { color: #e2e8f0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-empty { flex: 1; } /* 링크가 없을 때 공간 유지용 */
/* 버튼 바 및 마우스 오버 효과 */
.view-btn-box { display: flex; justify-content: center; gap: 10px; padding-top: 20px; border-top: 1px solid #232e42; }
.btn-v {
display: inline-flex; align-items: center; justify-content: center;
height: 48px; padding: 0 30px; border-radius: 6px;
font-size: 15px; font-weight: 700; text-decoration: none;
transition: 0.2s; border: 1px solid transparent;
}
/* 버튼별 호버 테두리 색상 효과 */
.btn-list { background: #334155; color: #f1f5f9; }
.btn-list:hover { border-color: #f1f5f9; background: #475569; }
.btn-edit { background: #161e2d; color: #94a3b8; border: 1px solid #232e42; }
.btn-edit:hover { border-color: #3b82f6; color: #fff; }
.btn-delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.1); }
.btn-delete:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.2); }
.btn-write { background: #3b82f6; color: #fff; }
.btn-write:hover { border-color: #fff; background: #2563eb; }
@media (max-width: 1024px) {
.view-container { margin: 0 20px; }
.detail-grid { grid-template-columns: 1fr; }
.post-nav { flex-direction: column; }
}
</style>
<article id="bo_v">
<div class="view-container">
<!-- 리포트 헤더 -->
<header class="report-header">
<div class="report-title">
<p>Transaction Verification Report</p>
<h1><?php echo get_text($view['wr_subject']); ?></h1>
</div>
<div class="report-date">
TIMESTAMP: <?php echo $view['x2_time']; ?>
</div>
</header>
<!-- 리포트 카드 (Content 영역 삭제됨) -->
<div class="report-card">
<!-- 요약 섹션 -->
<div class="summary-section">
<div class="summary-item">
<span class="summary-label">DIRECTION</span>
<span class="dir-box <?php echo $box_class; ?>"><?php echo $dir; ?></span>
</div>
<div class="summary-item">
<span class="summary-label">TOTAL AMOUNT</span>
<span class="summary-value" style="color:<?php echo $point_color; ?>"><?php echo number_format($view['x2_amount'], 4); ?> <small style="font-size:16px;"><?php echo $view['x2_type']; ?></small></span>
</div>
<div class="summary-item">
<span class="summary-label">STATUS</span>
<span class="summary-value <?php
$st = strtoupper($view['x2_state']);
echo ($st == 'DONE' || $st == '완료') ? 'st-done' : (($st == 'CANCELLED' || $st == '취소') ? 'st-fail' : 'st-wait');
?>"><?php echo $st; ?></span>
</div>
</div>
<!-- 세부 명세 그리드 -->
<div class="detail-grid">
<div class="detail-item">
<span class="detail-label">Asset Type</span>
<span class="detail-value highlight"><?php echo $view['x2_type']; ?></span>
</div>
<div class="detail-item">
<span class="detail-label">Transaction Type</span>
<span class="detail-value"><?php echo $view['x2_transaction_type']; ?></span>
</div>
<div class="detail-item">
<span class="detail-label">Processing Fee</span>
<span class="detail-value" style="color:#ef4444; font-family: monospace;"><?php echo $view['x2_fee']; ?></span>
</div>
<div class="detail-item">
<span class="detail-label">Recorded Time</span>
<span class="detail-value"><?php echo $view['x2_time']; ?></span>
</div>
<div class="detail-item" style="grid-column: span 2;">
<span class="detail-label">Destination / Wallet Address</span>
<span class="detail-value" style="font-family: monospace; font-size:15px; color:#3b82f6;"><?php echo $view['x2_address']; ?></span>
</div>
<div class="detail-item" style="grid-column: span 2; border-bottom: none;">
<span class="detail-label">Transaction ID (UUID)</span>
<span class="detail-value" style="font-family: monospace; font-size:14px; color:#64748b;"><?php echo $view['x2_uuid']; ?></span>
</div>
</div>
</div>
<!-- 이전/다음글 좌우 배치형 내비게이션 -->
<nav class="post-nav">
<?php if ($prev_href) { ?>
<a href="<?php echo $prev_href ?>" class="nav-item">
<span class="nav-label">← PREVIOUS TRANSACTION</span>
<span class="nav-subject"><?php echo $prev_wr_subject; ?></span>
</a>
<?php } else { ?>
<div class="nav-empty"></div>
<?php } ?>
<?php if ($next_href) { ?>
<a href="<?php echo $next_href ?>" class="nav-item" style="text-align: right;">
<span class="nav-label">NEXT TRANSACTION →</span>
<span class="nav-subject"><?php echo $next_wr_subject; ?></span>
</a>
<?php } else { ?>
<div class="nav-empty"></div>
<?php } ?>
</nav>
<!-- 하단 관리 버튼 바 -->
<div class="view-btn-box">
<a href="<?php echo $list_href ?>" class="btn-v btn-list">BACK TO LIST</a>
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="btn-v btn-edit">EDIT REPORT</a><?php } ?>
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" class="btn-v btn-delete" onclick="del(this.href); return false;">DELETE</a><?php } ?>
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="btn-v btn-write">EDIT ENTRY</a><?php } ?>
</div>
</div>
</article>
<script>
function del(href) {
if(confirm("이 거래 리포트를 삭제하시겠습니까? 삭제 후에는 복구할 수 없습니다.")) {
location.href = href;
}
}
</script>