38320-vm/includes/sidebar.php
2026-02-10 07:00:25 +00:00

92 lines
2.9 KiB
PHP

<?php
$current_page = basename($_SERVER['PHP_SELF']);
?>
<style>
.sidebar {
width: 280px;
height: 100vh;
position: fixed;
left: 0;
top: 0;
background-color: #ffffff;
border-right: 2px solid #ffd1dc;
z-index: 1000;
padding: 2rem 1.5rem;
display: flex;
flex-direction: column;
}
.sidebar-brand {
font-size: 1.5rem;
font-weight: 800;
color: #ff4d94;
text-decoration: none;
margin-bottom: 3rem;
display: flex;
align-items: center;
gap: 12px;
}
.sidebar .nav-link {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
color: #8a6d71;
text-decoration: none;
font-weight: 600;
border-radius: 16px;
margin-bottom: 8px;
transition: all 0.2s;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
background-color: #fff8f9;
color: #ff4d94;
}
.sidebar .nav-link i { font-size: 1.2rem; }
@media (max-width: 992px) {
.sidebar { width: 80px; padding: 2rem 0.5rem; align-items: center; }
.sidebar-brand span, .sidebar .nav-link span { display: none; }
.sidebar-brand { margin-bottom: 2rem; justify-content: center; }
.sidebar .nav-link { justify-content: center; padding: 12px; }
}
</style>
<div class="sidebar">
<a href="dashboard.php" class="sidebar-brand">
<i class="fas fa-bolt"></i>
<span>全球接码</span>
</a>
<nav class="flex-grow-1">
<a href="dashboard.php" class="nav-link <?= $current_page === 'dashboard.php' ? 'active' : '' ?>">
<i class="fas fa-th-large"></i>
<span>工作台</span>
</a>
<a href="orders.php" class="nav-link <?= $current_page === 'orders.php' ? 'active' : '' ?>">
<i class="fas fa-history"></i>
<span>接码记录</span>
</a>
<a href="recharge.php" class="nav-link <?= $current_page === 'recharge.php' ? 'active' : '' ?>">
<i class="fas fa-wallet"></i>
<span>充值中心</span>
</a>
<a href="support.php" class="nav-link <?= $current_page === 'support.php' ? 'active' : '' ?>">
<i class="fas fa-headset"></i>
<span>联系客服</span>
</a>
</nav>
<div class="mt-auto">
<?php if (isset($user['username'])): ?>
<div class="p-3 bg-light rounded-4 mb-3 d-none d-lg-block">
<div class="small text-muted fw-bold mb-1">当前用户</div>
<div class="fw-bold text-truncate"><?= htmlspecialchars($user['username']) ?></div>
</div>
<?php endif; ?>
<a href="auth.php?action=logout" class="nav-link text-danger">
<i class="fas fa-sign-out-alt"></i>
<span>退出登录</span>
</a>
</div>
</div>