361 lines
13 KiB
PHP
361 lines
13 KiB
PHP
<?php
|
|
require_once __DIR__ . '/../db/config.php';
|
|
require_once __DIR__ . '/lang.php';
|
|
|
|
$user = null;
|
|
if (isset($_SESSION['user_id'])) {
|
|
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$user = $stmt->fetch();
|
|
}
|
|
|
|
function getSetting($key, $default = null) {
|
|
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
|
|
$stmt->execute([$key]);
|
|
$row = $stmt->fetch();
|
|
return $row ? $row['setting_value'] : $default;
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="<?= $lang ?>">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Byro | Professional Digital Asset Exchange</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
|
<link rel="stylesheet" href="/assets/css/style.css?v=<?= time() ?>">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--primary: #0062ff;
|
|
--bg: #0b0e11;
|
|
--surface: #1e2329;
|
|
--text: #eaecef;
|
|
--text-muted: #9ba3af;
|
|
--border: #2b3139;
|
|
--success: #26a69a;
|
|
--danger: #ef5350;
|
|
}
|
|
body {
|
|
background-color: var(--bg);
|
|
color: var(--text);
|
|
font-family: 'Noto Sans SC', 'Inter', system-ui, -apple-system, sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
header {
|
|
height: 70px;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 24px;
|
|
border-bottom: 1px solid var(--border);
|
|
position: sticky;
|
|
top: 0;
|
|
background: rgba(0,0,0,0.9);
|
|
backdrop-filter: blur(10px);
|
|
z-index: 1000;
|
|
}
|
|
.logo-container {
|
|
display: flex;
|
|
align-items: center;
|
|
text-decoration: none;
|
|
margin-right: 40px;
|
|
}
|
|
.logo-icon {
|
|
width: 32px;
|
|
height: 32px;
|
|
background: var(--primary);
|
|
border-radius: 6px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-right: 10px;
|
|
}
|
|
.logo-text {
|
|
font-size: 24px;
|
|
font-weight: 800;
|
|
color: #fff;
|
|
letter-spacing: -0.5px;
|
|
}
|
|
nav {
|
|
display: flex;
|
|
gap: 24px;
|
|
flex: 1;
|
|
}
|
|
nav a {
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
font-size: 15px;
|
|
font-weight: 500;
|
|
transition: color 0.2s;
|
|
}
|
|
nav a:hover {
|
|
color: var(--primary);
|
|
}
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 20px;
|
|
}
|
|
.lang-switcher {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
cursor: pointer;
|
|
position: relative;
|
|
padding: 8px 12px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--border);
|
|
background: rgba(255,255,255,0.05);
|
|
transition: all 0.2s;
|
|
}
|
|
.lang-switcher:hover {
|
|
background: rgba(255,255,255,0.1);
|
|
border-color: var(--primary);
|
|
}
|
|
.flag-icon {
|
|
width: 20px;
|
|
height: 15px;
|
|
object-fit: cover;
|
|
border-radius: 2px;
|
|
}
|
|
.lang-dropdown {
|
|
display: none;
|
|
position: absolute;
|
|
top: calc(100% + 10px);
|
|
right: 0;
|
|
background: #121212;
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
padding: 8px;
|
|
min-width: 160px;
|
|
box-shadow: 0 10px 30px rgba(0,0,0,0.8);
|
|
z-index: 1100;
|
|
}
|
|
.lang-switcher:hover .lang-dropdown {
|
|
display: block;
|
|
}
|
|
.lang-dropdown a {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 12px 16px;
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
font-size: 14px;
|
|
border-radius: 8px;
|
|
transition: background 0.2s;
|
|
}
|
|
.lang-dropdown a:hover {
|
|
background: var(--primary);
|
|
color: #fff;
|
|
}
|
|
.auth-btns a {
|
|
font-size: 14px;
|
|
text-decoration: none;
|
|
color: var(--text);
|
|
padding: 10px 20px;
|
|
border-radius: 6px;
|
|
font-weight: 600;
|
|
}
|
|
.btn-login:hover {
|
|
background: #222;
|
|
}
|
|
.btn-register {
|
|
background: var(--primary);
|
|
color: #fff !important;
|
|
}
|
|
.btn-register:hover {
|
|
background: #0056e0;
|
|
}
|
|
|
|
/* User Dropdown */
|
|
.user-center {
|
|
position: relative;
|
|
}
|
|
.profile-trigger {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
padding: 8px 12px;
|
|
border-radius: 8px;
|
|
transition: background 0.2s;
|
|
border: 1px solid transparent;
|
|
}
|
|
.profile-trigger:hover {
|
|
background: rgba(255,255,255,0.05);
|
|
border-color: var(--border);
|
|
color: var(--primary);
|
|
}
|
|
.user-dropdown {
|
|
display: none;
|
|
position: absolute;
|
|
top: calc(100% + 10px);
|
|
right: 0;
|
|
background: #1e2329;
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
width: 260px;
|
|
padding: 16px;
|
|
box-shadow: 0 10px 40px rgba(0,0,0,0.8);
|
|
z-index: 1200;
|
|
}
|
|
.user-center:hover .user-dropdown {
|
|
display: block;
|
|
}
|
|
.user-info-header {
|
|
padding-bottom: 12px;
|
|
border-bottom: 1px solid var(--border);
|
|
margin-bottom: 12px;
|
|
}
|
|
.uid-tag {
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
margin-bottom: 4px;
|
|
}
|
|
.user-stats {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
font-size: 13px;
|
|
}
|
|
.stat-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
.stat-label { color: var(--text-muted); }
|
|
.stat-value { color: var(--text); font-weight: 500; }
|
|
.stat-value.success { color: var(--success); }
|
|
|
|
.dropdown-links {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 8px;
|
|
margin-top: 12px;
|
|
}
|
|
.dropdown-links a {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 6px;
|
|
padding: 10px;
|
|
background: rgba(255,255,255,0.05);
|
|
border-radius: 8px;
|
|
font-size: 13px;
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
transition: all 0.2s;
|
|
}
|
|
.dropdown-links a:hover {
|
|
background: var(--primary);
|
|
color: #fff;
|
|
}
|
|
.logout-link {
|
|
display: block;
|
|
text-align: center;
|
|
margin-top: 16px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid var(--border);
|
|
color: var(--danger);
|
|
text-decoration: none;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<a href="/" class="logo-container">
|
|
<div class="logo-icon">
|
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M12 2L2 7L12 12L22 7L12 2Z" fill="white"/>
|
|
<path d="M12 22L2 17L12 12L22 17L12 22Z" fill="rgba(255,255,255,0.3)"/>
|
|
<path d="M2 12L12 17L22 12" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
</div>
|
|
<span class="logo-text" style="letter-spacing: 1px;">BYRO</span>
|
|
</a>
|
|
<nav>
|
|
<a href="/"><?= __('home') ?></a>
|
|
<a href="/market.php"><?= __('market') ?></a>
|
|
<a href="/binary.php"><?= __('second_contract') ?></a>
|
|
<a href="/trade.php"><?= __('spot') ?></a>
|
|
<a href="/contract.php"><?= __('contract') ?></a>
|
|
<a href="/mining.php"><?= __('mining') ?></a>
|
|
<a href="/swap.php"><?= __('swap') ?></a>
|
|
</nav>
|
|
<div class="header-right">
|
|
<div class="lang-switcher">
|
|
<?php if ($lang === 'zh'): ?>
|
|
<img src="https://flagcdn.com/w40/cn.png" class="flag-icon" alt="CN">
|
|
<span>中文</span>
|
|
<?php else: ?>
|
|
<img src="https://flagcdn.com/w40/us.png" class="flag-icon" alt="US">
|
|
<span>English</span>
|
|
<?php endif; ?>
|
|
<div class="lang-dropdown">
|
|
<a href="?lang=zh">
|
|
<img src="https://flagcdn.com/w40/cn.png" class="flag-icon" alt="CN">
|
|
简体中文
|
|
</a>
|
|
<a href="?lang=en">
|
|
<img src="https://flagcdn.com/w40/us.png" class="flag-icon" alt="US">
|
|
English
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<?php if ($user): ?>
|
|
<div class="user-center">
|
|
<a href="/profile.php" class="profile-trigger">
|
|
<i class="bi bi-person-circle fs-5"></i>
|
|
<span><?= htmlspecialchars($user['username']) ?></span>
|
|
</a>
|
|
<div class="user-dropdown">
|
|
<div class="user-info-header">
|
|
<div class="uid-tag">UID: <?= $user['uid'] ?? 'N/A' ?></div>
|
|
<div class="fw-bold"><?= htmlspecialchars($user['username']) ?></div>
|
|
</div>
|
|
<div class="user-stats">
|
|
<div class="stat-item">
|
|
<span class="stat-label"><?= __('real_name') ?? 'Real-name' ?></span>
|
|
<span class="stat-value <?= ($user['real_name_status'] ?? 0) ? 'success' : 'text-warning' ?>">
|
|
<?= ($user['real_name_status'] ?? 0) ? (__('verified') ?? 'Verified') : (__('unverified') ?? 'Unverified') ?>
|
|
</span>
|
|
</div>
|
|
<div class="stat-item">
|
|
<span class="stat-label"><?= __('credit_score') ?? 'Credit Score' ?></span>
|
|
<span class="stat-value text-primary"><?= $user['credit_score'] ?? 80 ?></span>
|
|
</div>
|
|
<?php
|
|
$stmt = db()->prepare("SELECT available FROM user_balances WHERE user_id = ? AND symbol = 'USDT'");
|
|
$stmt->execute([$user['id']]);
|
|
$bal = $stmt->fetch();
|
|
?>
|
|
<div class="stat-item">
|
|
<span class="stat-label"><?= __('assets') ?? 'Assets' ?></span>
|
|
<span class="stat-value"><?= number_format($bal['available'] ?? 0, 2) ?> USDT</span>
|
|
</div>
|
|
</div>
|
|
<div class="dropdown-links">
|
|
<a href="/profile.php"><i class="bi bi-person"></i> <?= __('personal') ?></a>
|
|
<a href="/recharge.php"><i class="bi bi-wallet2"></i> <?= __('recharge') ?? 'Deposit' ?></a>
|
|
<a href="/withdraw.php"><i class="bi bi-cash-stack"></i> <?= __('withdraw') ?? 'Withdraw' ?></a>
|
|
<a href="/orders.php"><i class="bi bi-list-check"></i> <?= __('orders') ?? 'Orders' ?></a>
|
|
</div>
|
|
<a href="/auth/logout.php" class="logout-link"><?= __('logout') ?></a>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="auth-btns">
|
|
<a href="/auth/login.php" class="btn-login"><?= __('login') ?></a>
|
|
<a href="/auth/register.php" class="btn-register"><?= __('register') ?></a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</header>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|