jiaoyisuo

This commit is contained in:
Flatlogic Bot 2026-02-18 15:50:40 +00:00
parent 1ae0350b18
commit 4e9ea68a5d
7 changed files with 138 additions and 61 deletions

View File

@ -3,6 +3,9 @@ require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/../includes/lang.php';
if (session_status() === PHP_SESSION_NONE) session_start();
// Force admin to be Chinese
$lang = 'zh';
// Admin check
$admin = null;
if (isset($_SESSION['admin_id'])) {
@ -150,8 +153,12 @@ function renderAdminPage($content, $title = '后台管理') {
<?= $admin['is_agent'] ? __('agent_panel') : __('admin_panel') ?>
</div>
<div class="admin-nav">
<a href="/admin/index.php" class="nav-link <?= $current_page == 'index.php' ? 'active' : '' ?>"><i class="bi bi-house-door"></i> <?= __('home') ?></a>
<!-- 1. 平台首页 -->
<a href="/admin/index.php" class="nav-link <?= $current_page == 'index.php' ? 'active' : '' ?>">
<i class="bi bi-speedometer2"></i> <?= __('platform_home') ?>
</a>
<!-- 2. 用户管理 -->
<?php if (hasPermission('manage_users')): ?>
<a href="/admin/users.php" class="nav-link <?= $current_page == 'users.php' ? 'active' : '' ?>">
<i class="bi bi-people"></i> <?= __('users') ?>
@ -159,35 +166,14 @@ function renderAdminPage($content, $title = '后台管理') {
</a>
<?php endif; ?>
<!-- 3. 代理管理 -->
<?php if (!$admin['is_agent']): ?>
<a href="/admin/agents.php" class="nav-link <?= $current_page == 'agents.php' ? 'active' : '' ?>"><i class="bi bi-person-badge"></i> <?= __('agents') ?></a>
<?php endif; ?>
<?php if (hasPermission('audit_finance')): ?>
<a href="/admin/finance.php" class="nav-link <?= $current_page == 'finance.php' ? 'active' : '' ?>">
<i class="bi bi-wallet2"></i> <?= __('finance_management') ?>
<span class="badge bg-danger rounded-pill ms-auto d-none" id="finance-badge">0</span>
</a>
<?php endif; ?>
<?php if (hasPermission('view_orders')): ?>
<a href="/admin/transactions.php" class="nav-link <?= $current_page == 'transactions.php' ? 'active' : '' ?>">
<i class="bi bi-list-ul"></i> <?= __('finance_details') ?>
</a>
<a href="/admin/binary.php" class="nav-link <?= $current_page == 'binary.php' ? 'active' : '' ?>">
<i class="bi bi-clock"></i> <?= __('sec_contract_management') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="binary-badge">0</span>
</a>
<a href="/admin/contract.php" class="nav-link <?= $current_page == 'contract.php' ? 'active' : '' ?>">
<i class="bi bi-layers"></i> <?= __('contract_trading') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="contract-badge">0</span>
</a>
<a href="/admin/spot.php" class="nav-link <?= $current_page == 'spot.php' ? 'active' : '' ?>">
<i class="bi bi-currency-exchange"></i> <?= __('spot_trading') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="spot-badge">0</span>
<a href="/admin/agents.php" class="nav-link <?= $current_page == 'agents.php' ? 'active' : '' ?>">
<i class="bi bi-person-badge"></i> <?= __('agents') ?>
</a>
<?php endif; ?>
<!-- 4. 实名认证 -->
<?php if (hasPermission('manage_kyc')): ?>
<a href="/admin/kyc.php" class="nav-link <?= $current_page == 'kyc.php' ? 'active' : '' ?>">
<i class="bi bi-person-vcard"></i> <?= __('real_name') ?>
@ -195,18 +181,71 @@ function renderAdminPage($content, $title = '后台管理') {
</a>
<?php endif; ?>
<!-- 5. 充提管理 -->
<?php if (hasPermission('audit_finance')): ?>
<a href="/admin/finance.php" class="nav-link <?= $current_page == 'finance.php' ? 'active' : '' ?>">
<i class="bi bi-wallet2"></i> <?= __('finance_management') ?>
<span class="badge bg-danger rounded-pill ms-auto d-none" id="finance-badge">0</span>
</a>
<?php endif; ?>
<!-- 6. 财务明细 -->
<?php if (hasPermission('view_orders')): ?>
<a href="/admin/transactions.php" class="nav-link <?= $current_page == 'transactions.php' ? 'active' : '' ?>">
<i class="bi bi-list-ul"></i> <?= __('finance_details') ?>
</a>
<!-- 7. 秒合约管理 -->
<a href="/admin/binary.php" class="nav-link <?= $current_page == 'binary.php' ? 'active' : '' ?>">
<i class="bi bi-clock"></i> <?= __('sec_contract_management') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="binary-badge">0</span>
</a>
<!-- 8. 现货管理 -->
<a href="/admin/spot.php" class="nav-link <?= $current_page == 'spot.php' ? 'active' : '' ?>">
<i class="bi bi-currency-exchange"></i> <?= __('spot_trading') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="spot-badge">0</span>
</a>
<!-- 9. 合约管理 -->
<a href="/admin/contract.php" class="nav-link <?= $current_page == 'contract.php' ? 'active' : '' ?>">
<i class="bi bi-layers"></i> <?= __('contract_trading') ?>
<span class="badge bg-info rounded-pill ms-auto d-none" id="contract-badge">0</span>
</a>
<?php endif; ?>
<!-- 10. 兑换管理 -->
<?php if (!$admin['is_agent']): ?>
<a href="/admin/exchange.php" class="nav-link"><i class="bi bi-arrow-left-right"></i> <?= __('exchange_management') ?></a>
<a href="/admin/mining.php" class="nav-link"><i class="bi bi-cpu"></i> <?= __('mining_management') ?></a>
<a href="/admin/ai_control.php" class="nav-link"><i class="bi bi-robot"></i> <?= __('ai_control') ?></a>
<a href="/admin/exchange.php" class="nav-link <?= $current_page == 'exchange.php' ? 'active' : '' ?>">
<i class="bi bi-arrow-left-right"></i> <?= __('exchange_management') ?>
</a>
<!-- 11. 挖矿管理 -->
<a href="/admin/mining.php" class="nav-link <?= $current_page == 'mining.php' ? 'active' : '' ?>">
<i class="bi bi-cpu"></i> <?= __('mining_management') ?>
</a>
<!-- 12. AI控盘 -->
<a href="/admin/ai_control.php" class="nav-link <?= $current_page == 'ai_control.php' ? 'active' : '' ?>">
<i class="bi bi-robot"></i> <?= __('ai_control') ?>
</a>
<!-- 13. 在线客服 -->
<a href="/admin/customer_service.php" class="nav-link <?= $current_page == 'customer_service.php' ? 'active' : '' ?>">
<i class="bi bi-headset"></i> <?= __('online_support') ?>
<span class="badge bg-warning rounded-pill ms-auto d-none" id="messages-badge">0</span>
</a>
<a href="/admin/backend_settings.php" class="nav-link"><i class="bi bi-gear"></i> <?= __('backend_settings') ?></a>
<!-- 14. 后台设置 -->
<a href="/admin/backend_settings.php" class="nav-link <?= $current_page == 'backend_settings.php' ? 'active' : '' ?>">
<i class="bi bi-gear"></i> <?= __('backend_settings') ?>
</a>
<?php endif; ?>
<a href="/admin/profile.php" class="nav-link <?= $current_page == 'profile.php' ? 'active' : '' ?>"><i class="bi bi-person-gear"></i> <?= __('personal_settings') ?></a>
<!-- 15. 个人设置 -->
<a href="/admin/profile.php" class="nav-link <?= $current_page == 'profile.php' ? 'active' : '' ?>">
<i class="bi bi-person-gear"></i> <?= __('personal_settings') ?>
</a>
</div>
</div>
@ -215,19 +254,6 @@ function renderAdminPage($content, $title = '后台管理') {
<h5 class="mb-0"><?= $title ?></h5>
</div>
<div class="d-flex align-items-center gap-3">
<div class="dropdown">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle d-flex align-items-center gap-2" type="button" data-bs-toggle="dropdown">
<?php if ($lang === 'zh'): ?>
<img src="https://flagcdn.com/w40/cn.png" width="20" alt="CN"> 中文
<?php else: ?>
<img src="https://flagcdn.com/w40/us.png" width="20" alt="US"> EN
<?php endif; ?>
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item d-flex align-items-center gap-2" href="?lang=zh"><img src="https://flagcdn.com/w40/cn.png" width="20"> 中文</a></li>
<li><a class="dropdown-item d-flex align-items-center gap-2" href="?lang=en"><img src="https://flagcdn.com/w40/us.png" width="20"> English</a></li>
</ul>
</div>
<div class="text-muted small">欢迎您, <?= htmlspecialchars($admin['username']) ?></div>
<div class="position-relative me-2">
<i class="bi bi-bell fs-5"></i>

View File

@ -91,9 +91,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) {
$win_loss = (int)$_POST['win_loss_control'];
$remark = $_POST['remark'];
$email = $_POST['email'];
$vip_level = (int)$_POST['vip_level'];
$sql = "UPDATE users SET credit_score = ?, status = ?, win_loss_control = ?, remark = ?, email = ?";
$params = [$credit_score, $status, $win_loss, $remark, $email];
$sql = "UPDATE users SET credit_score = ?, status = ?, win_loss_control = ?, remark = ?, email = ?, vip_level = ?";
$params = [$credit_score, $status, $win_loss, $remark, $email, $vip_level];
if (!$admin['is_agent'] && isset($_POST['agent_id'])) {
$sql .= ", agent_id = ?";
@ -178,7 +179,7 @@ ob_start();
<thead>
<tr class="text-muted small">
<th>UID</th>
<th>用户名</th>
<th>用户名 / VIP</th>
<?php if (!$admin['is_agent']): ?><th>所属代理</th><?php endif; ?>
<th>注册IP</th>
<th>身份证信息</th>
@ -209,7 +210,7 @@ ob_start();
<tr>
<td><code><?= $u['uid'] ?></code></td>
<td>
<div class="fw-bold"><?= htmlspecialchars($u['username']) ?></div>
<div class="fw-bold"><?= htmlspecialchars($u['username']) ?> <span class="badge bg-warning text-dark" style="font-size: 10px;">VIP <?= $u['vip_level'] ?></span></div>
<div class="text-muted" style="font-size: 11px;"><?= $u['created_at'] ?></div>
</td>
<?php if (!$admin['is_agent']): ?>
@ -380,6 +381,20 @@ ob_start();
<option value="2">控亏 (必亏)</option>
</select>
</div>
<div class="col-md-6">
<label class="form-label">VIP等级</label>
<select name="vip_level" id="edit_vip_level" class="form-control">
<option value="0">VIP 0</option>
<option value="1">VIP 1</option>
<option value="2">VIP 2</option>
<option value="3">VIP 3</option>
<option value="4">VIP 4</option>
<option value="5">VIP 5</option>
<option value="6">VIP 6</option>
<option value="7">VIP 7</option>
<option value="8">VIP 8</option>
</select>
</div>
<?php if (!$admin['is_agent']): ?>
<div class="col-md-6">
<label class="form-label">所属代理</label>
@ -427,6 +442,7 @@ function editUser(user) {
document.getElementById('edit_credit_score').value = user.credit_score;
document.getElementById('edit_status').value = user.status;
document.getElementById('edit_win_loss').value = user.win_loss_control;
document.getElementById('edit_vip_level').value = user.vip_level || 0;
document.getElementById('edit_remark').value = user.remark || '';
if (document.getElementById('edit_agent_id_select')) {
document.getElementById('edit_agent_id_select').value = user.agent_id || '';

View File

@ -137,13 +137,25 @@
</style>
<!-- Customer Service Widget -->
<?php
$service_link = getSetting('service_link');
?>
<div id="cs-widget" style="position: fixed; bottom: 30px; right: 30px; z-index: 9999;">
<button class="btn btn-primary rounded-circle shadow-lg p-0 d-flex align-items-center justify-content-center transition-all" id="cs-toggle" style="width: 70px; height: 70px; border: none; background: linear-gradient(135deg, #00c6ff, #0072ff); box-shadow: 0 10px 20px rgba(0, 114, 255, 0.4);">
<div class="position-relative d-flex align-items-center justify-content-center">
<i class="bi bi-person-fill text-white position-absolute" style="font-size: 1.2rem; margin-top: 4px;"></i>
<i class="bi bi-headset text-white" style="font-size: 2.4rem;"></i>
</div>
</button>
<?php if ($service_link): ?>
<a href="<?= htmlspecialchars($service_link) ?>" target="_blank" class="btn btn-primary rounded-circle shadow-lg p-0 d-flex align-items-center justify-content-center transition-all" style="width: 70px; height: 70px; border: none; background: linear-gradient(135deg, #00c6ff, #0072ff); box-shadow: 0 10px 20px rgba(0, 114, 255, 0.4);">
<div class="position-relative d-flex align-items-center justify-content-center">
<i class="bi bi-person-fill text-white position-absolute" style="font-size: 1.2rem; margin-top: 4px;"></i>
<i class="bi bi-headset text-white" style="font-size: 2.4rem;"></i>
</div>
</a>
<?php else: ?>
<button class="btn btn-primary rounded-circle shadow-lg p-0 d-flex align-items-center justify-content-center transition-all" id="cs-toggle" style="width: 70px; height: 70px; border: none; background: linear-gradient(135deg, #00c6ff, #0072ff); box-shadow: 0 10px 20px rgba(0, 114, 255, 0.4);">
<div class="position-relative d-flex align-items-center justify-content-center">
<i class="bi bi-person-fill text-white position-absolute" style="font-size: 1.2rem; margin-top: 4px;"></i>
<i class="bi bi-headset text-white" style="font-size: 2.4rem;"></i>
</div>
</button>
<?php endif; ?>
<div class="pulse-ring"></div>
</div>
@ -164,7 +176,7 @@
0% { transform: scale(1); opacity: 0.5; }
100% { transform: scale(1.5); opacity: 0; }
}
#cs-toggle:hover {
#cs-toggle:hover, #cs-widget a:hover {
transform: scale(1.1) rotate(5deg);
box-shadow: 0 10px 25px rgba(0, 98, 255, 0.4) !important;
}

View File

@ -24,8 +24,8 @@ if (!function_exists('getSetting')) {
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
$site_logo = '/assets/images/logo.png';
$site_name = 'BYRO';
$site_logo = getSetting('site_logo', '/assets/images/logo.png');
$site_name = getSetting('site_name', 'BYRO');
?>
<title><?= $site_name ?> | <?= __('site_title') ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">

View File

@ -281,7 +281,7 @@ $translations = [
'mission_content' => '让数字资产交易对每个人、每个地方都变得触手可及、安全且直观。我们相信区块链的力量能够改变全球金融格局。',
'global_presence' => '全球业务',
'presence_content' => 'BYRO在新加坡、伦敦和东京设有办事处服务于多元化的全球社区。我们符合国际标准并优先考虑用户资产的安全。',
'users' => '用户',
'users' => '用户管理',
'countries' => '国家',
'daily_volume' => '每日交易量',
'about_content' => 'BYRO是成立于 2023 年的全球领先数字货币交易所。',
@ -491,6 +491,20 @@ $translations = [
'mxn_name' => '墨西哥比索',
'php_name' => '菲律宾比索',
'idr_name' => '印尼盾',
'platform_home' => '平台首页',
'admin_panel' => '超级管理后台',
'agent_panel' => '代理管理后台',
'finance_management' => '充提管理',
'finance_details' => '财务明细',
'sec_contract_management' => '秒合约管理',
'contract_trading' => '合约交易',
'spot_trading' => '现货交易',
'exchange_management' => '兑换管理',
'mining_management' => '挖矿管理',
'ai_control' => 'AI控盘',
'backend_settings' => '后台设置',
'personal_settings' => '个人设置',
'agents' => '代理管理',
],
'en' => [
'home' => 'Home',

View File

@ -507,6 +507,7 @@ CREATE TABLE `users` (
`credit_score` int(11) DEFAULT 80,
`real_name_status` int(11) DEFAULT 0,
`role` varchar(20) DEFAULT 'user',
`vip_level` int(11) DEFAULT 0,
`total_recharge` decimal(16,4) DEFAULT 0.0000,
`transaction_password` varchar(255) DEFAULT NULL,
`kyc_name` varchar(100) DEFAULT NULL,
@ -535,7 +536,7 @@ CREATE TABLE `users` (
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES
(2,'ahao8988998','ahao8988@gmail.com','$2y$10$tdT4vIgddq1kh2isoBRIPe4goiZ3X1cbf2l6vtButmyZx71xP527q','2026-02-18 02:56:51','05617613',80,0,'user',0.0000,NULL,'张世豪','123456789','uploads/kyc/2_front_1771391536.jpg','uploads/kyc/2_back_1771391536.jpg','uploads/kyc/2_handheld_1771391536.jpg',2,NULL,'normal',1,'',NULL,NULL);
(2,'ahao8988998','ahao8988@gmail.com','$2y$10$tdT4vIgddq1kh2isoBRIPe4goiZ3X1cbf2l6vtButmyZx71xP527q','2026-02-18 02:56:51','05617613',80,0,'user',0,0.0000,NULL,'张世豪','123456789','uploads/kyc/2_front_1771391536.jpg','uploads/kyc/2_back_1771391536.jpg','uploads/kyc/2_handheld_1771391536.jpg',2,NULL,'normal',1,'',NULL,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

View File

@ -60,7 +60,10 @@ function getCoinPrice($symbol) {
return $prices[strtoupper($symbol)] ?? 1.00;
}
function getVipLevel($totalRecharge) {
// Use the VIP level from the database column as the source of truth
$vipLevel = $userData['vip_level'] ?? 0;
function getAutoVipLevel($totalRecharge) {
if ($totalRecharge >= 10000000) return 7;
if ($totalRecharge >= 5000000) return 6;
if ($totalRecharge >= 1000000) return 5;
@ -71,7 +74,12 @@ function getVipLevel($totalRecharge) {
return 0;
}
$vipLevel = getVipLevel($userData['total_recharge'] ?? 0);
// If the database VIP level is 0, we can optionally fall back to calculation,
// but since the admin can now set it to any level, we should respect the database.
// However, to keep it "automatic" for new users, we can do:
if ($vipLevel == 0) {
$vipLevel = getAutoVipLevel($userData['total_recharge'] ?? 0);
}
// Fetch transactions
$stmt = db()->prepare("SELECT * FROM transactions WHERE user_id = ? ORDER BY created_at DESC LIMIT 50");