38451-vm/profile.php
2026-02-16 02:49:59 +00:00

69 lines
3.5 KiB
PHP

<?php
include __DIR__ . '/includes/header.php';
if (!$user) {
header('Location: /auth/login.php');
exit;
}
// Get balances
$stmt = db()->prepare("SELECT * FROM user_balances WHERE user_id = ?");
$stmt->execute([$user['id']]);
$balances = $stmt->fetchAll();
?>
<div class="section">
<div class="container">
<h1><?= __('personal') ?></h1>
<div style="display: grid; grid-template-columns: 1fr 2fr; gap: 40px; margin-top: 40px;">
<div style="background: var(--surface); padding: 30px; border-radius: 8px; border: 1px solid var(--border);">
<div style="text-align: center; margin-bottom: 30px;">
<i class="fas fa-user-circle" style="font-size: 80px; color: var(--primary);"></i>
<h3 style="margin-top: 15px;"><?= htmlspecialchars($user['username']) ?></h3>
<p style="color: var(--text-muted);"><?= htmlspecialchars($user['email'] ?? 'No email set') ?></p>
</div>
<div style="border-top: 1px solid var(--border); padding-top: 20px;">
<p><strong>UID:</strong> <?= $user['id'] + 10000 ?></p>
<p><strong>Status:</strong> <span style="color: var(--success)">Verified</span></p>
</div>
</div>
<div style="background: var(--surface); padding: 30px; border-radius: 8px; border: 1px solid var(--border);">
<h3>My Assets</h3>
<table style="width: 100%; border-collapse: collapse; margin-top: 20px;">
<thead>
<tr style="text-align: left; color: var(--text-muted); font-size: 14px; border-bottom: 1px solid var(--border);">
<th style="padding: 12px 0;">Asset</th>
<th style="padding: 12px 0;">Available</th>
<th style="padding: 12px 0;">Frozen</th>
<th style="padding: 12px 0; text-align: right;">Action</th>
</tr>
</thead>
<tbody>
<?php foreach($balances as $b): ?>
<tr style="border-bottom: 1px solid var(--border);">
<td style="padding: 16px 0; font-weight: bold;"><?= $b['symbol'] ?></td>
<td style="padding: 16px 0;"><?= number_format((float)$b['available'], 4) ?></td>
<td style="padding: 16px 0;"><?= number_format((float)$b['frozen'], 4) ?></td>
<td style="padding: 16px 0; text-align: right;">
<a href="/trade.php" style="color: var(--primary); font-size: 14px;">Trade</a>
</td>
</tr>
<?php endforeach; ?>
<?php if (empty($balances)): ?>
<tr>
<td colspan="4" style="padding: 40px; text-align: center; color: var(--text-muted);">No assets found.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<div style="margin-top: 30px; display: flex; gap: 16px;">
<button class="btn btn-primary"><?= __('deposit') ?></button>
<button class="btn btn-outline"><?= __('withdraw') ?></button>
</div>
</div>
</div>
</div>
</div>
<?php include __DIR__ . '/includes/footer.php'; ?>