97 lines
6.1 KiB
PHP
97 lines
6.1 KiB
PHP
<?php
|
|
require_once '../db/config.php';
|
|
session_start();
|
|
|
|
$db = db();
|
|
$total_users = $db->query("SELECT COUNT(*) FROM users")->fetchColumn();
|
|
$pending_kyc = $db->query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->fetchColumn();
|
|
$pending_orders = $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN ('matching', 'submitting')")->fetchColumn();
|
|
$unread_msgs = $db->query("SELECT COUNT(*) FROM messages WHERE sender = 'user' AND is_read = 0")->fetchColumn();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>管理后台 - NovaEx</title>
|
|
<link rel="stylesheet" href="../assets/css/custom.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
|
<style>
|
|
.admin-layout { display: flex; min-height: 100vh; }
|
|
.sidebar { width: 250px; background: #FFFFFF; border-right: 1px solid #EAECEF; padding: 1rem; }
|
|
.main-content { flex: 1; padding: 2rem; background: #FFFFFF; }
|
|
.menu-item { padding: 12px; color: #474D57; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
|
.menu-item:hover, .menu-item.active { background: #F5F5F5; color: #F0B90B; }
|
|
.badge { background: #F6465D; color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
|
|
.stat-card { background: #F9FAFB; padding: 20px; border-radius: 8px; border: 1px solid #EAECEF; }
|
|
</style>
|
|
</head>
|
|
<body style="background-color: #FFFFFF; color: #1E2329;">
|
|
<div class="admin-layout">
|
|
<div class="sidebar">
|
|
<h3 style="color: #1E2329; margin-bottom: 2rem;">NovaEx 管理员</h3>
|
|
<a href="index.php" class="menu-item active"><i class="fas fa-chart-pie"></i> 仪表盘</a>
|
|
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> 用户管理</a>
|
|
<a href="kyc.php" class="menu-item">
|
|
<i class="fas fa-id-card"></i> KYC 审核
|
|
<?php if($pending_kyc > 0): ?><span class="badge"><?php echo $pending_kyc; ?></span><?php endif; ?>
|
|
</a>
|
|
<a href="chat.php" class="menu-item">
|
|
<i class="fas fa-headset"></i> 客服管理
|
|
<?php if($unread_msgs > 0 || $pending_orders > 0): ?><span class="badge"><?php echo ($unread_msgs + $pending_orders); ?></span><?php endif; ?>
|
|
</a>
|
|
<a href="spot_orders.php" class="menu-item"><i class="fas fa-exchange-alt"></i> 现货交易</a>
|
|
<a href="futures_orders.php" class="menu-item"><i class="fas fa-file-contract"></i> 合约交易</a>
|
|
<a href="orders.php" class="menu-item">
|
|
<i class="fas fa-wallet"></i> 充值记录
|
|
</a>
|
|
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
|
|
<a href="../index.php" class="menu-item" style="margin-top: 2rem; color: #F0B90B;"><i class="fas fa-external-link-alt"></i> 查看前端</a>
|
|
</div>
|
|
<div class="main-content">
|
|
<h2 style="color: #1E2329; margin-bottom: 2rem;">系统概览</h2>
|
|
<div style="grid-template-columns: repeat(4, 1fr); display: grid; gap: 1.5rem;">
|
|
<div class="stat-card">
|
|
<div style="color: #707A8A; font-size: 0.9rem;">总注册人数</div>
|
|
<div style="font-size: 2rem; color: #1E2329; margin-top: 10px;"><?php echo $total_users; ?></div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div style="color: #707A8A; font-size: 0.9rem;">待处理 KYC</div>
|
|
<div style="font-size: 2rem; color: #F0B90B; margin-top: 10px;"><?php echo $pending_kyc; ?></div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div style="color: #707A8A; font-size: 0.9rem;">待匹配/审核充值</div>
|
|
<div style="font-size: 2rem; color: #F0B90B; margin-top: 10px;"><?php echo $pending_orders; ?></div>
|
|
</div>
|
|
<div class="stat-card">
|
|
<div style="color: #707A8A; font-size: 0.9rem;">未读消息</div>
|
|
<div style="font-size: 2rem; color: #00C087; margin-top: 10px;"><?php echo $unread_msgs; ?></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top: 3rem; background: #F9FAFB; padding: 25px; border-radius: 8px; border: 1px solid #EAECEF;">
|
|
<h3 style="color: #1E2329; margin-bottom: 20px;">控制中心</h3>
|
|
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;">
|
|
<div style="border: 1px solid #EAECEF; padding: 20px; border-radius: 6px; background: white;">
|
|
<h4 style="color: #474D57;">客服与充值管理</h4>
|
|
<p style="color: #707A8A; font-size: 0.8rem;">与用户对话并处理实时的充值匹配请求。</p>
|
|
<a href="chat.php" class="btn-primary" style="display: inline-block; margin-top: 15px; font-size: 0.8rem; padding: 8px 15px;">进入工作台</a>
|
|
</div>
|
|
<div style="border: 1px solid #EAECEF; padding: 20px; border-radius: 6px; background: white;">
|
|
<h4 style="color: #474D57;">交易管理</h4>
|
|
<p style="color: #707A8A; font-size: 0.8rem;">审核并处理现货及合约交易订单。</p>
|
|
<div style="display:flex; gap: 10px; margin-top: 15px;">
|
|
<a href="spot_orders.php" class="btn-primary" style="font-size: 0.75rem; padding: 5px 10px; background: #377aff;">现货</a>
|
|
<a href="futures_orders.php" class="btn-primary" style="font-size: 0.75rem; padding: 5px 10px; background: #f0b90b; color: white;">合约</a>
|
|
</div>
|
|
</div>
|
|
<div style="border: 1px solid #EAECEF; padding: 20px; border-radius: 6px; background: white;">
|
|
<h4 style="color: #474D57;">价格控制</h4>
|
|
<p style="color: #707A8A; font-size: 0.8rem;">手动覆盖特定交易对的实时价格及插针控制。</p>
|
|
<a href="settings.php" class="btn-primary" style="display: inline-block; margin-top: 15px; font-size: 0.8rem; padding: 8px 15px;">立即配置</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|