最新的修复

This commit is contained in:
Flatlogic Bot 2026-02-12 14:26:48 +00:00
parent 116b830b18
commit 75bce5aa09
27 changed files with 892 additions and 328 deletions

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
// Handle Actions
@ -93,7 +93,9 @@ $pending_orders = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN
<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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">

9
admin/auth.php Normal file
View File

@ -0,0 +1,9 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
if (!isset($_SESSION['admin_id'])) {
header("Location: login.php");
exit;
}

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
// Handle deletion of chat
@ -98,7 +98,9 @@ $chat_users = $pdo->query("
<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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="chat-container">

View File

@ -1,7 +1,7 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
require_once '../includes/currency_helper.php';
session_start();
$pdo = db();
$user_id = $_GET['user_id'] ?? null;

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
$faceValue = 10;
@ -87,7 +87,9 @@ $pending_orders = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN
<a href="spot_orders.php" class="menu-item"><i class="fas fa-exchange-alt"></i> 现货交易</a>
<a href="futures_orders.php" class="menu-item active"><i class="fas fa-file-contract"></i> 合约交易</a>
<a href="orders.php" class="menu-item"><i class="fas fa-wallet"></i> 充值记录</a>
<a href="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> 返回</a>

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$db = db();
$total_users = $db->query("SELECT COUNT(*) FROM users")->fetchColumn();
@ -45,7 +45,9 @@ $unread_msgs = $db->query("SELECT COUNT(*) FROM messages WHERE sender = 'user' 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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></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>

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
if (isset($_POST['action']) && isset($_POST['user_id'])) {
@ -9,83 +9,176 @@ if (isset($_POST['action']) && isset($_POST['user_id'])) {
$pdo->prepare("UPDATE users SET kyc_status = ? WHERE id = ?")->execute([$status, $uid]);
}
$kyc_list = $pdo->query("SELECT * FROM users WHERE kyc_status = 1 ORDER BY id DESC")->fetchAll();
$pending_kyc_list = $pdo->query("SELECT * FROM users WHERE kyc_status = 1 ORDER BY id DESC")->fetchAll();
$approved_kyc_list = $pdo->query("SELECT * FROM users WHERE kyc_status = 2 ORDER BY id DESC")->fetchAll();
$unread_msgs = $pdo->query("SELECT COUNT(*) FROM messages WHERE sender = 'user' AND is_read = 0")->fetchColumn();
$pending_orders = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN ('matching', 'submitting')")->fetchColumn();
$pending_kyc_count = count($pending_kyc_list);
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>KYC 审核 - 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>
:root { --primary: #f0b90b; --bg: #ffffff; --text: #1e2329; --border: #eaecef; }
body { background: #f4f6f9; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; }
.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; color: #1E2329; }
.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; }
.kyc-card { background: #F9FAFB; border: 1px solid #EAECEF; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.kyc-img { width: 200px; height: 120px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid #EAECEF; }
.back-btn { color: #707A8A; text-decoration: none; font-size: 0.9rem; margin-bottom: 20px; display: inline-block; }
.btn-primary { padding: 10px 20px; border-radius: 4px; border: none; cursor: pointer; color: white; font-weight: bold; }
.sidebar { width: 250px; background: #ffffff; border-right: 1px solid var(--border); padding: 1.5rem; }
.main-content { flex: 1; padding: 2rem; background: #ffffff; }
.menu-item { padding: 12px 15px; color: #474d57; text-decoration: none; display: flex; align-items: center; gap: 12px; border-radius: 8px; margin-bottom: 8px; transition: 0.2s; }
.menu-item:hover, .menu-item.active { background: #f5f5f5; color: var(--primary); font-weight: bold; }
.badge { background: #f6465d; color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
.kyc-card { background: white; border: 1px solid var(--border); padding: 25px; border-radius: 12px; margin-bottom: 25px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.kyc-img { width: 180px; height: 110px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); transition: 0.2s; }
.kyc-img:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.btn { padding: 10px 20px; border-radius: 6px; border: none; cursor: pointer; color: white; font-weight: bold; font-size: 0.9rem; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.tab { padding: 12px 20px; cursor: pointer; font-weight: 600; color: #707a8a; position: relative; }
.tab.active { color: var(--primary); }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }
</style>
</head>
<body style="background: white;">
<body>
<div class="admin-layout">
<div class="sidebar">
<h3 style="color: #1E2329; margin-bottom: 2rem;">NovaEx 管理员</h3>
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> 仪表盘</a>
<h2 style="color: var(--primary); margin-bottom: 2rem;">NovaEx Admin</h2>
<a href="index.php" class="menu-item"><i class="fas fa-home"></i> 仪表盘</a>
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> 用户管理</a>
<a href="kyc.php" class="menu-item active"><i class="fas fa-id-card"></i> KYC 审核</a>
<a href="chat.php" class="menu-item">
<i class="fas fa-headset"></i> 客服管理
<a href="agents.php" class="menu-item"><i class="fas fa-user-shield"></i> 代理管理</a>
<a href="kyc.php" class="menu-item active"><i class="fas fa-id-card"></i> KYC 审核
<?php if($pending_kyc_count > 0): ?><span class="badge"><?php echo $pending_kyc_count; ?></span><?php endif; ?>
</a>
<a href="chat.php" class="menu-item"><i class="fas fa-comments"></i> 客服管理
<?php if($unread_msgs > 0 || $pending_orders > 0): ?><span class="badge"><?php echo ($unread_msgs + $pending_orders); ?></span><?php endif; ?>
</a>
<a href="options_orders.php" class="menu-item"><i class="fas fa-clock"></i> 秒合约</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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> 返回</a>
<h2 style="color: #1E2329;">待审核 KYC</h2>
<?php if(empty($kyc_list)): ?>
<p style="color: #707A8A; margin-top: 2rem;">暂无待审核申请。</p>
<?php endif; ?>
<?php foreach($kyc_list as $k): ?>
<div class="kyc-card">
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
<div>
<h4 style="margin-bottom: 10px; color: #1E2329;"><?php echo htmlspecialchars($k['kyc_name']); ?></h4>
<p style="color: #707A8A; font-size: 0.9rem;">身份证号: <?php echo htmlspecialchars($k['kyc_id_number']); ?></p>
<p style="color: #707A8A; font-size: 0.8rem; margin-top: 5px;">用户名: <?php echo htmlspecialchars($k['username']); ?> (UID: <?php echo $k['uid']; ?>)</p>
<div class="main-content">
<h1>实名认证管理 (KYC)</h1>
<div class="tabs">
<div class="tab active" onclick="switchTab('pending')">待审核 (<?php echo count($pending_kyc_list); ?>)</div>
<div class="tab" onclick="switchTab('approved')">已通过 (<?php echo count($approved_kyc_list); ?>)</div>
</div>
<div id="pending-section">
<?php if(empty($pending_kyc_list)): ?>
<div style="text-align: center; padding: 100px; color: #707a8a; background: #f9fafb; border-radius: 12px; border: 1px dashed var(--border);">
<i class="fas fa-check-circle" style="font-size: 3rem; margin-bottom: 15px; opacity: 0.3;"></i>
<p>目前没有待处理的认证申请</p>
</div>
<div style="display: flex; gap: 10px;">
<form method="POST">
<input type="hidden" name="user_id" value="<?php echo $k['id']; ?>">
<input type="hidden" name="action" value="approve">
<button type="submit" class="btn-primary" style="background: #00c087;">通过审核</button>
</form>
<form method="POST">
<input type="hidden" name="user_id" value="<?php echo $k['id']; ?>">
<input type="hidden" name="action" value="reject">
<button type="submit" class="btn-primary" style="background: #f6465d;">拒绝申请</button>
</form>
<?php endif; ?>
<?php foreach($pending_kyc_list as $k): ?>
<div class="kyc-card">
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
<div>
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 5px;">
<span style="font-size: 1.2rem; font-weight: 800;"><?php echo htmlspecialchars($k['kyc_name']); ?></span>
<span style="background: #fff9e6; color: #f0b90b; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold;">待审核</span>
</div>
<p style="color: #474d57; font-size: 1rem; margin-bottom: 8px;">证件号码: <span style="font-family: monospace; font-weight: bold;"><?php echo htmlspecialchars($k['kyc_id_number']); ?></span></p>
<p style="color: #707a8a; font-size: 0.85rem;">关联账号: <?php echo htmlspecialchars($k['username']); ?> (UID: <?php echo $k['uid']; ?>)</p>
</div>
<div style="display: flex; gap: 10px;">
<form method="POST">
<input type="hidden" name="user_id" value="<?php echo $k['id']; ?>">
<input type="hidden" name="action" value="approve">
<button type="submit" class="btn" style="background: #00c087;"><i class="fas fa-check"></i> 通过审核</button>
</form>
<form method="POST">
<input type="hidden" name="user_id" value="<?php echo $k['id']; ?>">
<input type="hidden" name="action" value="reject">
<button type="submit" class="btn" style="background: #f6465d;"><i class="fas fa-times"></i> 驳回</button>
</form>
</div>
</div>
<div style="display: flex; gap: 20px; margin-top: 25px; flex-wrap: wrap;">
<div style="text-align: center;">
<img src="../<?php echo $k['kyc_id_front']; ?>" class="kyc-img" onclick="window.open(this.src)">
<div style="font-size: 0.75rem; color: #707a8a; margin-top: 8px;">正面照</div>
</div>
<div style="text-align: center;">
<img src="../<?php echo $k['kyc_id_back']; ?>" class="kyc-img" onclick="window.open(this.src)">
<div style="font-size: 0.75rem; color: #707a8a; margin-top: 8px;">反面照</div>
</div>
<div style="text-align: center;">
<img src="../<?php echo $k['kyc_id_handheld']; ?>" class="kyc-img" onclick="window.open(this.src)">
<div style="font-size: 0.75rem; color: #707a8a; margin-top: 8px;">手持照</div>
</div>
</div>
</div>
<div style="display: flex; gap: 15px; margin-top: 20px;">
<img src="../<?php echo $k['kyc_id_front']; ?>" class="kyc-img" onclick="window.open(this.src)">
<img src="../<?php echo $k['kyc_id_back']; ?>" class="kyc-img" onclick="window.open(this.src)">
<img src="../<?php echo $k['kyc_id_handheld']; ?>" class="kyc-img" onclick="window.open(this.src)">
<?php endforeach; ?>
</div>
<div id="approved-section" style="display: none;">
<?php if(empty($approved_kyc_list)): ?>
<p style="color: #707A8A; text-align: center; padding: 50px;">暂无已通过认证的用户。</p>
<?php endif; ?>
<div style="background: white; border-radius: 12px; border: 1px solid var(--border); overflow: hidden;">
<table style="width: 100%; border-collapse: collapse;">
<thead style="background: #f9fafb;">
<tr>
<th style="padding: 15px; text-align: left; color: #707a8a; font-size: 0.8rem;">姓名</th>
<th style="padding: 15px; text-align: left; color: #707a8a; font-size: 0.8rem;">证件号码</th>
<th style="padding: 15px; text-align: left; color: #707a8a; font-size: 0.8rem;">关联账号</th>
<th style="padding: 15px; text-align: left; color: #707a8a; font-size: 0.8rem;">认证时间</th>
<th style="padding: 15px; text-align: right; color: #707a8a; font-size: 0.8rem;">操作</th>
</tr>
</thead>
<tbody>
<?php foreach($approved_kyc_list as $k): ?>
<tr style="border-top: 1px solid var(--border);">
<td style="padding: 15px; font-weight: bold;"><?php echo htmlspecialchars($k['kyc_name']); ?></td>
<td style="padding: 15px; font-family: monospace;"><?php echo htmlspecialchars($k['kyc_id_number']); ?></td>
<td style="padding: 15px;"><?php echo htmlspecialchars($k['username']); ?> (<?php echo $k['uid']; ?>)</td>
<td style="padding: 15px; font-size: 0.85rem; color: #707a8a;"><?php echo $k['created_at']; ?></td>
<td style="padding: 15px; text-align: right;">
<form method="POST" onsubmit="return confirm('确定要取消该用户的认证状态吗?')">
<input type="hidden" name="user_id" value="<?php echo $k['id']; ?>">
<input type="hidden" name="action" value="reject">
<button type="submit" style="background: none; border: none; color: #f6465d; cursor: pointer; font-size: 0.85rem; font-weight: bold;">撤销认证</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<script>
function switchTab(tab) {
const tabs = document.querySelectorAll('.tab');
const pending = document.getElementById('pending-section');
const approved = document.getElementById('approved-section');
tabs.forEach(t => t.classList.remove('active'));
if (tab === 'pending') {
tabs[0].classList.add('active');
pending.style.display = 'block';
approved.style.display = 'none';
} else {
tabs[1].classList.add('active');
pending.style.display = 'none';
approved.style.display = 'block';
}
}
</script>
</body>
</html>
</html>

68
admin/login.php Normal file
View File

@ -0,0 +1,68 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
require_once '../db/config.php';
require_once '../includes/i18n.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM admins WHERE username = ?");
$stmt->execute([$username]);
$admin = $stmt->fetch();
if ($admin && password_verify($password, $admin['password'])) {
$_SESSION['admin_id'] = $admin['id'];
$_SESSION['admin_username'] = $admin['username'];
$_SESSION['admin_role'] = $admin['role'];
header("Location: index.php");
exit;
} else {
$error = "用户名或密码错误。";
}
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>管理员登录 - NovaEx</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
body { background: #f4f6f9; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; height: 100vh; display: flex; align-items: center; justify-content: center; margin: 0; }
.login-card { background: white; padding: 40px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); width: 100%; max-width: 400px; border: 1px solid #eaecef; }
.logo { color: #f0b90b; font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #474d57; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #eaecef; border-radius: 8px; font-size: 1rem; outline: none; box-sizing: border-box; }
.btn-login { width: 100%; padding: 14px; background: #f0b90b; border: none; border-radius: 8px; color: black; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s; margin-top: 10px; }
.btn-login:hover { background: #d9a60a; }
.error { background: #fff5f5; color: #f6465d; padding: 10px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 20px; text-align: center; border: 1px solid #ffe3e3; }
</style>
</head>
<body>
<div class="login-card">
<div class="logo">NovaEx Admin</div>
<?php if($error): ?>
<div class="error"><?php echo $error; ?></div>
<?php endif; ?>
<form method="POST">
<div class="form-group">
<label>管理员账号</label>
<input type="text" name="username" required placeholder="请输入账号">
</div>
<div class="form-group">
<label>登录密码</label>
<input type="password" name="password" required placeholder="请输入密码">
</div>
<button type="submit" class="btn-login">立即登录</button>
</form>
</div>
</body>
</html>

7
admin/logout.php Normal file
View File

@ -0,0 +1,7 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
session_destroy();
header("Location: login.php");
exit;

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['action'])) {
@ -57,7 +57,9 @@ $pending_kyc = $pdo->query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->f
<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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">

View File

@ -1,17 +1,16 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
// Handle Actions
if (isset($_POST['action'])) {
$id = $_POST['order_id'];
$table = $_POST['order_table'] === 'fiat' ? 'fiat_orders' : 'orders';
$table = 'fiat_orders';
if ($_POST['action'] == 'match') {
$info = $_POST['account_info'];
$column = ($table === 'fiat_orders') ? 'bank_account_info' : 'account_info';
$pdo->prepare("UPDATE $table SET status = 'matched', $column = ? WHERE id = ?")->execute([$info, $id]);
$pdo->prepare("UPDATE $table SET status = 'matched', bank_account_info = ? WHERE id = ?")->execute([$info, $id]);
$orderStmt = $pdo->prepare("SELECT user_id FROM $table WHERE id = ?");
$orderStmt->execute([$id]);
@ -21,14 +20,15 @@ if (isset($_POST['action'])) {
$pdo->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)")->execute([$order['user_id'], $msg]);
}
} elseif ($_POST['action'] == 'complete') {
$orderStmt = $pdo->prepare("SELECT user_id, amount, currency FROM $table WHERE id = ?");
$orderStmt = $pdo->prepare("SELECT user_id, amount, currency, usdt_amount FROM $table WHERE id = ?");
$orderStmt->execute([$id]);
$order = $orderStmt->fetch();
if ($order) {
$pdo->prepare("UPDATE users SET balance = balance + ? WHERE id = ?")->execute([$order['amount'], $order['user_id']]);
$credit_amount = $order['usdt_amount'] > 0 ? $order['usdt_amount'] : $order['amount'];
$pdo->prepare("UPDATE users SET balance = balance + ? WHERE id = ?")->execute([$credit_amount, $order['user_id']]);
$pdo->prepare("UPDATE $table SET status = 'completed' WHERE id = ?")->execute([$id]);
$msg = "您的充值 " . $order['amount'] . " " . ($order['currency'] ?? 'USDT') . " 已确认到账。";
$msg = "您的充值 " . $credit_amount . " USDT 已确认到账。";
$pdo->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)")->execute([$order['user_id'], $msg]);
}
} elseif ($_POST['action'] == 'reject') {
@ -36,9 +36,7 @@ if (isset($_POST['action'])) {
}
}
$fiat_orders = $pdo->query("SELECT o.*, u.username, u.uid, 'fiat' as tbl FROM fiat_orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC")->fetchAll();
$usdt_orders = $pdo->query("SELECT o.*, u.username, u.uid, 'usdt' as tbl FROM orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC")->fetchAll();
$all_deposits = array_merge($fiat_orders, $usdt_orders);
$all_deposits = $pdo->query("SELECT o.*, u.username, u.uid FROM fiat_orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC")->fetchAll();
usort($all_deposits, function($a, $b) {
$priority = ['matching' => 3, 'submitting' => 2, 'pending' => 2, 'matched' => 1, 'completed' => 0];
@ -60,37 +58,40 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat
<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: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
.main-content { flex: 1; padding: 2rem; background: #0B0E11; color: white; overflow-x: auto; }
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
.badge { background: var(--danger-color); color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
.sidebar { width: 250px; background: #ffffff; border-right: 1px solid #eaecef; padding: 1.5rem; }
.main-content { flex: 1; padding: 2rem; background: #ffffff; color: #1e2329; overflow-x: auto; }
.menu-item { padding: 12px 15px; color: #474d57; text-decoration: none; display: flex; align-items: center; gap: 12px; border-radius: 8px; margin-bottom: 8px; transition: 0.2s; }
.menu-item:hover, .menu-item.active { background: #f5f5f5; color: #f0b90b; font-weight: bold; }
.badge { background: #f6465d; color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; margin-bottom: 3rem; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #2B3139; font-size: 0.85rem; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #eaecef; font-size: 0.85rem; }
.status-badge { padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.matching { background: rgba(255, 60, 0, 0.2); color: #ff3c00; border: 1px solid #ff3c00; animation: blink 1s infinite; }
.matching { background: rgba(255, 60, 0, 0.2); color: #ff3c00; border: 1px solid #ff3c00; }
.submitting { background: rgba(0, 192, 135, 0.2); color: #00c087; border: 1px solid #00c087; }
.matched { background: rgba(55, 122, 255, 0.1); color: #377aff; }
.completed { background: rgba(0, 192, 135, 0.1); color: #00c087; opacity: 0.6; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
.back-btn { color: #848E9C; text-decoration: none; font-size: 0.9rem; margin-bottom: 20px; display: inline-block; }
.btn-primary { background: #f0b90b; color: black; border: none; padding: 8px 15px; border-radius: 6px; font-weight: bold; cursor: pointer; }
</style>
</head>
<body>
<div class="admin-layout">
<div class="sidebar">
<h3 style="color: white; margin-bottom: 2rem;">NovaEx 管理员</h3>
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> 仪表盘</a>
<h2 style="color: #f0b90b; margin-bottom: 2rem;">NovaEx Admin</h2>
<a href="index.php" class="menu-item"><i class="fas fa-home"></i> 仪表盘</a>
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> 用户管理</a>
<a href="agents.php" class="menu-item"><i class="fas fa-user-shield"></i> 代理管理</a>
<a href="kyc.php" class="menu-item"><i class="fas fa-id-card"></i> KYC 审核</a>
<a href="chat.php" class="menu-item">
<i class="fas fa-headset"></i> 客服管理
<a href="chat.php" class="menu-item"><i class="fas fa-comments"></i> 客服管理
<?php if($unread_msgs > 0 || $pending_orders_count > 0): ?><span class="badge"><?php echo ($unread_msgs + $pending_orders_count); ?></span><?php endif; ?>
</a>
<a href="options_orders.php" class="menu-item"><i class="fas fa-clock"></i> 秒合约</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 active"><i class="fas fa-wallet"></i> 充值记录</a>
<a href="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> 返回</a>
@ -99,7 +100,7 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat
<table class="table">
<thead>
<tr>
<th>ID</th><th>用户</th><th>类型</th><th>金额</th><th>凭证</th><th>状态</th><th>操作</th>
<th>ID</th><th>用户</th><th>币种</th><th>充值金额</th><th>换算 USDT</th><th>凭证</th><th>状态</th><th>操作</th>
</tr>
</thead>
<tbody>
@ -107,13 +108,12 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat
<tr>
<td>#<?php echo $o['id']; ?></td>
<td><?php echo htmlspecialchars($o['username']); ?> (UID: <?php echo $o['uid']; ?>)</td>
<td><span style="color: <?php echo $o['tbl'] == 'usdt' ? '#26a17b' : '#007bff'; ?>"><?php echo strtoupper($o['tbl']); ?></span></td>
<td><b><?php echo number_format($o['amount'], 2); ?> <?php echo $o['currency']; ?></b></td>
<td><span style="color: #007bff"><?php echo strtoupper($o['currency']); ?></span></td>
<td><b><?php echo number_format($o['amount'], 2); ?></b></td>
<td><b style="color: #00c087"><?php echo number_format($o['usdt_amount'], 2); ?></b></td>
<td>
<?php
$img = ($o['tbl'] == 'fiat' ? ($o['proof_image'] ?? null) : ($o['proof_img'] ?? null));
if($img): ?>
<a href="../<?php echo $img; ?>" target="_blank" style="color: #00c087; font-weight: bold;"><i class="fas fa-image"></i> 查看凭证</a>
<?php if($o['proof_image']): ?>
<a href="../<?php echo $o['proof_image']; ?>" target="_blank" style="color: #00c087; font-weight: bold;"><i class="fas fa-image"></i> 查看凭证</a>
<?php else: ?>
<span style="color: #555;">未上传</span>
<?php endif; ?>
@ -123,17 +123,15 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat
<?php if($o['status'] == 'matching'): ?>
<form method="POST" style="display: flex; gap: 5px;">
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
<input type="hidden" name="order_table" value="<?php echo $o['tbl']; ?>">
<input type="hidden" name="action" value="match">
<input type="text" name="account_info" placeholder="收款账户信息" required style="padding: 8px; background: #1e2329; border: 1px solid #2b3139; color: white; border-radius: 4px;">
<button type="submit" class="btn-primary" style="background: #ff3c00;">分配账户</button>
<input type="text" name="account_info" placeholder="收款账户信息" required style="padding: 8px; background: #f9fafb; border: 1px solid #eaecef; border-radius: 4px;">
<button type="submit" class="btn-primary" style="background: #ff3c00; color: white;">分配账户</button>
</form>
<?php elseif($o['status'] == 'submitting' || $o['status'] == 'matched'): ?>
<form method="POST">
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
<input type="hidden" name="order_table" value="<?php echo $o['tbl']; ?>">
<input type="hidden" name="action" value="complete">
<button type="submit" class="btn-primary" style="background: #00c087;">确认入金</button>
<button type="submit" class="btn-primary" style="background: #00c087; color: white;">确认入金</button>
</form>
<?php endif; ?>
</td>

View File

@ -1,13 +1,9 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$db = db();
// Basic security check (could be improved with a proper login session for admins)
if (!isset($_SESSION['user_id'])) {
// For now, if not logged in at all, redirect to main login
// In a real scenario, we'd have a separate admin login
}
$admin_id = $_SESSION['admin_id'] ?? 1; // Fallback to 1 if not set, but auth.php should ensure it's set
$message = "";
$error = "";
@ -21,6 +17,27 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$message = "系统设置已成功更新。";
}
if (isset($_POST['change_password'])) {
$old_pass = $_POST['old_password'];
$new_pass = $_POST['new_password'];
$confirm_pass = $_POST['confirm_password'];
$stmt = $db->prepare("SELECT password FROM admins WHERE id = ?");
$stmt->execute([$admin_id]);
$admin = $stmt->fetch();
if ($new_pass !== $confirm_pass) {
$error = "两次输入的新密码不一致。";
} elseif (!password_verify($old_pass, $admin['password'])) {
$error = "旧密码错误。";
} else {
$hashed = password_hash($new_pass, PASSWORD_DEFAULT);
$stmt = $db->prepare("UPDATE admins SET password = ? WHERE id = ?");
$stmt->execute([$hashed, $admin_id]);
$message = "管理密码已成功修改。";
}
}
if (isset($_FILES['logo']) && $_FILES['logo']['error'] === UPLOAD_ERR_OK) {
$ext = pathinfo($_FILES['logo']['name'], PATHINFO_EXTENSION);
$filename = 'logo_' . time() . '.' . $ext;
@ -67,7 +84,7 @@ $pending_orders = $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN (
.card { background: white; border-radius: 12px; border: 1px solid var(--border); padding: 25px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #474d57; }
input[type="text"], input[type="number"], select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; outline: none; box-sizing: border-box; }
input[type="text"], input[type="number"], input[type="password"], select, textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; outline: none; box-sizing: border-box; }
input:focus, textarea:focus { border-color: var(--primary); }
.btn { padding: 12px 30px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; transition: 0.2s; }
.btn-primary { background: var(--primary); color: #000; }
@ -92,7 +109,9 @@ $pending_orders = $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN (
<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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item active"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">
@ -105,6 +124,28 @@ $pending_orders = $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN (
<div style="background: #fff5f5; color: #f6465d; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #f6465d;"><i class="fas fa-exclamation-circle"></i> <?php echo $error; ?></div>
<?php endif; ?>
<div class="card">
<h3>修改登录密码</h3>
<form method="POST">
<input type="hidden" name="change_password" value="1">
<div class="form-group">
<label>当前密码</label>
<input type="password" name="old_password" required placeholder="请输入当前管理员密码">
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
<div class="form-group">
<label>新密码</label>
<input type="password" name="new_password" required placeholder="请输入新密码">
</div>
<div class="form-group">
<label>确认新密码</label>
<input type="password" name="confirm_password" required placeholder="请再次输入新密码">
</div>
</div>
<button type="submit" class="btn btn-primary">更新管理密码</button>
</form>
</div>
<div class="card">
<h3>站点配置 (LOGO / 图标)</h3>
<form method="POST" enctype="multipart/form-data">

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
if (isset($_POST['action']) && isset($_POST['order_id'])) {
@ -77,7 +77,9 @@ $pending_orders = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN
<a href="spot_orders.php" class="menu-item active"><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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> 返回</a>

View File

@ -1,6 +1,6 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
session_start();
$pdo = db();
// Handle Actions
@ -112,7 +112,9 @@ $pending_kyc = $pdo->query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->f
<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="withdrawals.php" class="menu-item"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
</div>
<div class="main-content">

175
admin/withdrawals.php Normal file
View File

@ -0,0 +1,175 @@
<?php
require_once "auth.php";
require_once '../db/config.php';
$pdo = db();
$success_msg = "";
$error_msg = "";
// Handle Actions
if (isset($_POST['action'])) {
$id = $_POST['order_id'];
if ($_POST['action'] == 'complete') {
$pdo->prepare("UPDATE orders SET status = 'completed' WHERE id = ?")->execute([$id]);
$orderStmt = $pdo->prepare("SELECT user_id, amount, currency FROM orders WHERE id = ?");
$orderStmt->execute([$id]);
$order = $orderStmt->fetch();
if ($order) {
$msg = "您的提现 " . $order['amount'] . " " . ($order['currency'] ?? 'USDT') . " 已汇出,请查收。";
$pdo->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)")->execute([$order['user_id'], $msg]);
}
$success_msg = "确认成功,提现已处理。";
} elseif ($_POST['action'] == 'reject') {
// If rejected, refund balance
$orderStmt = $pdo->prepare("SELECT user_id, amount FROM orders WHERE id = ?");
$orderStmt->execute([$id]);
$order = $orderStmt->fetch();
if ($order) {
// Return funds to user balance
$pdo->prepare("UPDATE users SET balance = balance + ? WHERE id = ?")->execute([$order['amount'], $order['user_id']]);
// Update order status to rejected
$pdo->prepare("UPDATE orders SET status = 'rejected' WHERE id = ?")->execute([$id]);
$remark = !empty($_POST['remark']) ? $_POST['remark'] : '违反规定';
$msg = "您的提现申请 #$id 已被拒绝,资金已退回您的余额。原因: " . $remark;
$pdo->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)")->execute([$order['user_id'], $msg]);
$success_msg = "拒绝成功";
} else {
$error_msg = "订单不存在。";
}
}
}
$withdrawals = $pdo->query("SELECT o.*, u.username, u.uid FROM orders o JOIN users u ON o.user_id = u.id WHERE o.type = 'usdt' ORDER BY o.id DESC")->fetchAll();
$unread_msgs = $pdo->query("SELECT COUNT(*) FROM messages WHERE sender = 'user' AND is_read = 0")->fetchColumn();
$pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN ('matching', 'submitting')")->fetchColumn();
$pending_kyc = $pdo->query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->fetchColumn();
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>提现管理 - NovaEx 管理员</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root { --primary: #f0b90b; --bg: #ffffff; --text: #1e2329; --border: #eaecef; }
body { background: #f4f6f9; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #ffffff; border-right: 1px solid var(--border); padding: 1.5rem; }
.main-content { flex: 1; padding: 2rem; background: #ffffff; }
.menu-item { padding: 12px 15px; color: #474d57; text-decoration: none; display: flex; align-items: center; gap: 12px; border-radius: 8px; margin-bottom: 8px; transition: 0.2s; }
.menu-item:hover, .menu-item.active { background: #f5f5f5; color: var(--primary); font-weight: bold; }
.badge { background: #f6465d; color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.table th, .table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { background: #fafafa; color: #707a8a; font-weight: 600; }
.status-badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: bold; }
.pending { background: #fff9e6; color: #f0b90b; }
.completed { background: #e6fff1; color: #03ad5d; }
.rejected { background: #fff1f0; color: #f6465d; }
.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; }
.alert-success { background: #e6fff1; color: #03ad5d; border: 1px solid #03ad5d; }
.alert-error { background: #fff1f0; color: #f6465d; border: 1px solid #f6465d; }
.btn { padding: 8px 15px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: 0.2s; }
.btn-success { background: #03ad5d; color: white; }
.btn-danger { background: #f6465d; color: white; }
.btn:hover { opacity: 0.9; }
input[type="text"] { padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; outline: none; width: 150px; }
input[type="text"]:focus { border-color: var(--primary); }
</style>
</head>
<body>
<div class="admin-layout">
<div class="sidebar">
<h2 style="color: var(--primary); margin-bottom: 2rem;">NovaEx Admin</h2>
<a href="index.php" class="menu-item"><i class="fas fa-home"></i> 仪表盘</a>
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> 用户管理</a>
<a href="agents.php" class="menu-item"><i class="fas fa-user-shield"></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-comments"></i> 客服管理
<?php if($unread_msgs > 0 || $pending_orders_count > 0): ?><span class="badge"><?php echo ($unread_msgs + $pending_orders_count); ?></span><?php endif; ?>
</a>
<a href="options_orders.php" class="menu-item"><i class="fas fa-clock"></i> 秒合约</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="withdrawals.php" class="menu-item active"><i class="fas fa-hand-holding-usd"></i> 提现记录</a>
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> 系统设置</a>
<a href="logout.php" class="menu-item"><i class="fas fa-sign-out-alt"></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">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;">
<h1>提现申请管理</h1>
<div style="color: #707a8a; font-size: 0.9rem;"> <?php echo count($withdrawals); ?> 条记录</div>
</div>
<?php if($success_msg): ?>
<div class="alert alert-success"><i class="fas fa-check-circle"></i> <?php echo $success_msg; ?></div>
<?php endif; ?>
<?php if($error_msg): ?>
<div class="alert alert-error"><i class="fas fa-times-circle"></i> <?php echo $error_msg; ?></div>
<?php endif; ?>
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>用户 (UID)</th>
<th>金额</th>
<th>币种</th>
<th>提现详情</th>
<th>状态</th>
<th>申请时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach($withdrawals as $o): ?>
<tr>
<td>#<?php echo $o['id']; ?></td>
<td><b><?php echo htmlspecialchars($o['username']); ?></b><br><small style="color: #707a8a;">UID: <?php echo $o['uid']; ?></small></td>
<td><span style="font-weight: bold; color: #1e2329;"><?php echo number_format($o['amount'], 2); ?></span></td>
<td><span style="color: #f0b90b; font-weight: bold;"><?php echo strtoupper($o['currency'] ?? 'USDT'); ?></span></td>
<td><small style="color: #474d57;"><?php echo htmlspecialchars($o['account_info'] ?? ''); ?></small></td>
<td><span class="status-badge <?php echo $o['status']; ?>"><?php echo strtoupper($o['status']); ?></span></td>
<td><small style="color: #707a8a;"><?php echo $o['created_at']; ?></small></td>
<td>
<?php if($o['status'] == 'pending'): ?>
<div style="display: flex; gap: 10px; align-items: center;">
<form method="POST" style="margin: 0;" onsubmit="return confirm('确认已处理提现汇出?')">
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
<input type="hidden" name="action" value="complete">
<button type="submit" class="btn btn-success">确认汇出</button>
</form>
<form method="POST" style="margin: 0; display: flex; gap: 5px;">
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
<input type="hidden" name="action" value="reject">
<input type="text" name="remark" placeholder="拒绝原因" required>
<button type="submit" class="btn btn-danger">拒绝</button>
</form>
</div>
<?php else: ?>
<span style="color: #aeaeae; font-size: 0.8rem;">已处理</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</body>
</html>

View File

@ -18,11 +18,11 @@ $duration = (int)($data['duration'] ?? 60);
$opening_price = (float)($data['opening_price'] ?? 0);
// Updated Validate duration and profit rates as per user request
// 60s/8%、90s/12%、120s/20%、180s/20%、300s/32%
// 60s/8%、90s/12%、120s/15%、180s/20%、300s/32%
$valid_durations = [
60 => ['profit' => 0.08, 'min' => 10],
90 => ['profit' => 0.12, 'min' => 10],
120 => ['profit' => 0.20, 'min' => 10],
120 => ['profit' => 0.15, 'min' => 10],
180 => ['profit' => 0.20, 'min' => 10],
300 => ['profit' => 0.32, 'min' => 10],
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -1,108 +1,91 @@
-- NovaEx Database Schema
-- Optimized for one-click deployment
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: app_38350
-- ------------------------------------------------------
-- Server version 10.11.14-MariaDB-0+deb12u2
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-- 1. Users Table
CREATE TABLE IF NOT EXISTS `users` (
--
-- Table structure for table `admins`
--
DROP TABLE IF EXISTS `admins`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`trading_password` varchar(255) DEFAULT '123456',
`balance` decimal(30,10) DEFAULT '0.0000000000',
`credit_score` int(11) DEFAULT '80',
`win_loss_control` enum('none','win','loss') DEFAULT 'none',
`status` enum('active','disabled') DEFAULT 'active',
`kyc_name` varchar(100) DEFAULT NULL,
`kyc_id_number` varchar(50) DEFAULT NULL,
`kyc_id_front` varchar(255) DEFAULT NULL,
`kyc_id_back` varchar(255) DEFAULT NULL,
`kyc_id_handheld` varchar(255) DEFAULT NULL,
`kyc_status` tinyint(1) DEFAULT '0',
`last_ip` varchar(45) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 2. Admins Table
CREATE TABLE IF NOT EXISTS `admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`role` enum('super','agent') DEFAULT 'agent',
`permissions` text,
`remark` text,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`role` enum('admin','agent') DEFAULT 'agent',
`permissions` text DEFAULT NULL,
`remark` text DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- Insert default admin (admin / 123456)
INSERT IGNORE INTO `admins` (`id`, `username`, `password`, `role`, `permissions`) VALUES
(1, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'super', 'all');
--
-- Table structure for table `fiat_orders`
--
-- 3. Settings Table
CREATE TABLE IF NOT EXISTS `settings` (
`name` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- Insert default settings
INSERT IGNORE INTO `settings` (`name`, `value`) VALUES
('win_rate', '70'),
('price_control', '0'),
('chat_greeting', '您好!欢迎咨询 NovaEx 官方客服。'),
('site_logo', 'assets/images/logo.png');
-- 4. Fiat Orders Table (Recharge)
CREATE TABLE IF NOT EXISTS `fiat_orders` (
DROP TABLE IF EXISTS `fiat_orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `fiat_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`amount` decimal(18,2) NOT NULL,
`currency` varchar(10) DEFAULT 'CNY',
`exchange_rate` decimal(18,4) DEFAULT NULL,
`usdt_amount` decimal(18,4) DEFAULT NULL,
`status` varchar(20) DEFAULT 'matching',
`proof_image` varchar(255) DEFAULT NULL,
`bank_account_info` text,
`user_id` int(11) DEFAULT NULL,
`amount` decimal(20,8) DEFAULT NULL,
`usdt_amount` decimal(20,8) DEFAULT NULL,
`exchange_rate` decimal(20,8) DEFAULT NULL,
`currency` varchar(10) DEFAULT NULL,
`status` varchar(20) DEFAULT NULL,
`expires_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`proof_image` varchar(255) DEFAULT NULL,
`bank_account_info` text DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- 5. Orders Table (Withdrawal/USDT)
CREATE TABLE IF NOT EXISTS `orders` (
--
-- Table structure for table `messages`
--
DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`type` varchar(20) DEFAULT 'usdt',
`amount` decimal(18,8) NOT NULL,
`currency` varchar(10) DEFAULT 'USDT',
`account_info` text,
`proof_img` varchar(255) DEFAULT NULL,
`status` varchar(20) DEFAULT 'pending',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user_id` int(11) DEFAULT NULL,
`sender` enum('user','admin') DEFAULT NULL,
`type` enum('text','image') DEFAULT 'text',
`message` text DEFAULT NULL,
`is_read` tinyint(4) DEFAULT 0,
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- 6. Messages Table (Chat)
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`sender` enum('user','admin') NOT NULL,
`message` text NOT NULL,
`type` varchar(20) DEFAULT 'text',
`is_read` tinyint(1) DEFAULT '0',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `option_orders`
--
-- 7. Option Orders Table (Seconds Contract)
CREATE TABLE IF NOT EXISTS `option_orders` (
DROP TABLE IF EXISTS `option_orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `option_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`symbol` varchar(20) NOT NULL,
@ -114,27 +97,57 @@ CREATE TABLE IF NOT EXISTS `option_orders` (
`closing_price` decimal(18,8) DEFAULT NULL,
`status` enum('pending','completed') DEFAULT 'pending',
`result` enum('none','win','loss') DEFAULT 'none',
`profit` decimal(18,8) DEFAULT '0.00000000',
`control` enum('none','win','loss') DEFAULT 'none',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`profit` decimal(18,8) DEFAULT 0.00000000,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`settle_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- 8. User Assets Table (Spot Balances)
CREATE TABLE IF NOT EXISTS `user_assets` (
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`symbol` varchar(20) NOT NULL,
`amount` decimal(30,10) DEFAULT '0.0000000000',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `user_symbol` (`user_id`,`symbol`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`type` enum('fiat','usdt') NOT NULL,
`amount` decimal(16,8) NOT NULL,
`currency` varchar(20) DEFAULT 'USDT',
`account_info` text DEFAULT NULL,
`proof_img` varchar(255) DEFAULT NULL,
`status` enum('pending','matched','paid','completed','cancelled','rejected') DEFAULT 'pending',
`created_at` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- 9. Trading Orders Table (Spot & Futures)
CREATE TABLE IF NOT EXISTS `trading_orders` (
--
-- Table structure for table `settings`
--
DROP TABLE IF EXISTS `settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `settings` (
`name` varchar(255) NOT NULL,
`value` text DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `trading_orders`
--
DROP TABLE IF EXISTS `trading_orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `trading_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`symbol` varchar(20) NOT NULL,
@ -144,14 +157,125 @@ CREATE TABLE IF NOT EXISTS `trading_orders` (
`price` decimal(18,8) NOT NULL,
`amount` decimal(18,8) NOT NULL,
`total` decimal(18,8) NOT NULL,
`leverage` int(11) DEFAULT '1',
`leverage` int(11) DEFAULT 1,
`tp_price` decimal(18,8) DEFAULT NULL,
`sl_price` decimal(18,8) DEFAULT NULL,
`status` varchar(20) DEFAULT 'open',
`admin_status` varchar(20) DEFAULT 'pending',
`status` enum('open','closed','cancelled') DEFAULT 'open',
`win_loss` enum('none','win','loss') DEFAULT 'none',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`admin_status` enum('pending','approved','rejected') DEFAULT 'approved',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
SET FOREIGN_KEY_CHECKS = 1;
--
-- Table structure for table `user_assets`
--
DROP TABLE IF EXISTS `user_assets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_assets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`symbol` varchar(20) NOT NULL,
`amount` decimal(30,10) DEFAULT 0.0000000000,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
UNIQUE KEY `user_symbol` (`user_id`,`symbol`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` varchar(6) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT current_timestamp(),
`credit_score` int(11) DEFAULT 80,
`total_assets` decimal(20,8) DEFAULT 0.00000000,
`kyc_status` int(11) DEFAULT 0,
`kyc_name` varchar(255) DEFAULT NULL,
`kyc_id_number` varchar(255) DEFAULT NULL,
`kyc_id_front` varchar(255) DEFAULT NULL,
`kyc_id_back` varchar(255) DEFAULT NULL,
`kyc_id_handheld` varchar(255) DEFAULT NULL,
`trading_password` varchar(255) DEFAULT '123456',
`balance` decimal(20,8) DEFAULT 0.00000000,
`status` enum('active','disabled') DEFAULT 'active',
`win_loss_control` enum('none','win','loss') DEFAULT 'none',
`last_ip` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `uid` (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2026-02-12 14:22:00
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: app_38350
-- ------------------------------------------------------
-- Server version 10.11.14-MariaDB-0+deb12u2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Dumping data for table `admins`
--
LOCK TABLES `admins` WRITE;
/*!40000 ALTER TABLE `admins` DISABLE KEYS */;
INSERT INTO `admins` VALUES
(1,'admin','$2y$10$dltSsFIkB4FbJPgOPUFLGuDehX/bAFM96fxywvSL9jaEsgA/1r4pG','admin',NULL,NULL,'2026-02-12 08:33:20');
/*!40000 ALTER TABLE `admins` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping data for table `settings`
--
LOCK TABLES `settings` WRITE;
/*!40000 ALTER TABLE `settings` DISABLE KEYS */;
INSERT INTO `settings` VALUES
('chat_greeting','您好!欢迎咨询 NovaEx 官方客服,请问有什么可以帮您?如果是充值咨询,请提供您的充值金额和币种。'),
('price_control','0'),
('win_rate','70');
/*!40000 ALTER TABLE `settings` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2026-02-12 14:22:01

View File

@ -27,14 +27,14 @@ if ($user_id) {
--input-bg: #1e2329;
}
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; overflow-y: auto !important; }
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); min-height: calc(100vh - 64px); }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); min-height: 800px; }
.panel { background: var(--panel-bg); display: flex; flex-direction: column; }
/* Market Panel */
.market-panel { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border-color); }
#pairs-list { height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
#pairs-list { height: 800px; overflow-y: auto; scrollbar-width: thin; }
.pair-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.02); transition: 0.2s; }
.pair-item:hover { background: rgba(255,255,255,0.05); }
.pair-item.active { background: rgba(79, 172, 254, 0.08); border-left: 3px solid var(--accent-color); }
@ -43,7 +43,7 @@ if ($user_id) {
/* Center Panel */
.center-panel { flex: 1; background: var(--bg-color); display: flex; flex-direction: column; min-width: 0; }
.info-bar { height: 66px; display: flex; align-items: center; padding: 0 20px; gap: 25px; border-bottom: 1px solid var(--border-color); background: var(--panel-bg); }
.chart-container { height: 550px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.chart-container { height: 500px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.order-form-panel { padding: 25px; background: var(--panel-bg); border-bottom: 1px solid var(--border-color); }
.order-form-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
@ -65,20 +65,16 @@ if ($user_id) {
.tab-btn.active { color: var(--accent-color); }
.tab-btn.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--accent-color); border-radius: 3px 3px 0 0; }
/* Responsive */
@media (max-width: 1400px) {
.market-panel { width: 260px; }
.order-book-panel { width: 280px; }
}
@media (max-width: 1200px) {
.market-panel { display: none; }
}
@media (max-width: 992px) {
.trading-layout { flex-direction: column; }
.trading-layout { flex-direction: column; min-height: auto; }
.order-book-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
.chart-container { height: 400px; }
.order-form-grid { grid-template-columns: 1fr; gap: 20px; }
.info-bar { height: auto; padding: 15px; flex-wrap: wrap; gap: 15px; }
#pairs-list { height: 400px; }
}
</style>
@ -184,9 +180,9 @@ if ($user_id) {
<div class="ob-header">
<span>Price / Amount</span>
</div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden;"></div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden; min-height: 380px;"></div>
<div id="ob-mid-price" style="padding: 15px 0; text-align: center; font-weight: 800; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); font-size: 18px; font-family: 'Roboto Mono', monospace; background: rgba(255,255,255,0.01);">--</div>
<div id="bids-list" style="flex: 1; overflow: hidden;"></div>
<div id="bids-list" style="flex: 1; overflow: hidden; min-height: 380px;"></div>
</div>
</div>
@ -289,7 +285,7 @@ if ($user_id) {
const bids = document.getElementById('bids-list');
let aH = ''; let bH = '';
let maxVol = 0;
const rows = 18;
const rows = 15;
const askData = [];
const bidData = [];
@ -422,4 +418,4 @@ if ($user_id) {
fetchOrders(); setInterval(fetchOrders, 4000);
</script>
<?php include 'footer.php'; ?>
<?php include 'footer.php'; ?>

View File

@ -27,14 +27,14 @@ if ($user_id) {
--input-bg: #1e2329;
}
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; overflow-y: auto !important; }
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); padding: 0; min-height: calc(100vh - 64px); }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); padding: 0; min-height: 800px; }
.panel { background: var(--panel-bg); display: flex; flex-direction: column; }
/* Market Panel */
.market-panel { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border-color); }
#pairs-list { height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
#pairs-list { height: 800px; overflow-y: auto; scrollbar-width: thin; }
.pair-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.02); transition: 0.2s; }
.pair-item:hover { background: rgba(255,255,255,0.05); }
.pair-item.active { background: rgba(240, 185, 11, 0.08); border-left: 3px solid var(--accent-color); }
@ -43,7 +43,7 @@ if ($user_id) {
/* Center Panel */
.center-panel { flex: 1; background: var(--bg-color); display: flex; flex-direction: column; min-width: 0; }
.info-bar { height: 66px; display: flex; align-items: center; padding: 0 20px; gap: 25px; border-bottom: 1px solid var(--border-color); background: var(--panel-bg); }
.chart-container { height: 550px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.chart-container { height: 500px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
/* Option Order Panel */
.option-order-panel { padding: 20px 25px; background: var(--panel-bg); border-bottom: 1px solid var(--border-color); }
@ -107,20 +107,16 @@ if ($user_id) {
.result-pnl { font-size: 32px; font-weight: 900; margin-bottom: 30px; font-family: 'Roboto Mono'; }
.result-close { width: 100%; padding: 14px; border: none; border-radius: 12px; background: var(--accent-color); color: #000; font-weight: 800; cursor: pointer; font-size: 16px; }
/* Responsive */
@media (max-width: 1400px) {
.market-panel { width: 260px; }
.order-book-panel { width: 280px; }
}
@media (max-width: 1200px) {
.market-panel { display: none; }
}
@media (max-width: 992px) {
.trading-layout { flex-direction: column; }
.trading-layout { flex-direction: column; min-height: auto; }
.order-book-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
.chart-container { height: 400px; }
.option-input-grid { grid-template-columns: 1fr; }
.info-bar { height: auto; padding: 15px; flex-wrap: wrap; gap: 15px; }
#pairs-list { height: 400px; }
}
</style>
@ -170,9 +166,9 @@ if ($user_id) {
<span class="time">90S</span>
<span class="profit"><?php echo __('profit'); ?> 12%</span>
</div>
<div class="duration-item" data-seconds="120" data-profit="20">
<div class="duration-item" data-seconds="120" data-profit="15">
<span class="time">120S</span>
<span class="profit"><?php echo __('profit'); ?> 20%</span>
<span class="profit"><?php echo __('profit'); ?> 15%</span>
</div>
<div class="duration-item" data-seconds="180" data-profit="20">
<span class="time">180S</span>
@ -252,11 +248,11 @@ if ($user_id) {
<span>Price(USDT)</span>
<span>Amount(<span class="asset-name">BTC</span>)</span>
</div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden;"></div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden; min-height: 380px;"></div>
<div style="padding: 15px; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; background: rgba(255,255,255,0.01);">
<div id="ob-mid-price" style="font-size: 18px; font-weight: 800; font-family: 'Roboto Mono', monospace;">--</div>
</div>
<div id="bids-list" style="flex: 1; overflow: hidden;"></div>
<div id="bids-list" style="flex: 1; overflow: hidden; min-height: 380px;"></div>
</div>
</div>

View File

@ -25,12 +25,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Generate UID starting from 618120
$stmt = $pdo->query("SELECT COUNT(*) FROM users");
$count = $stmt->fetchColumn();
$uid = 618120 + $count + mt_rand(1, 9); // Add a small random offset to make it look "randomly sorted" but starting from 618120
$uid = 618120 + $count + mt_rand(1, 9);
// Capture IP
$user_ip = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$user_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
// Register and auto-login
// Default trading_password is '123456' as requested
$stmt = $pdo->prepare("INSERT INTO users (uid, username, password, trading_password, balance) VALUES (?, ?, ?, '123456', 0)");
if ($stmt->execute([$uid, $username, password_hash($password, PASSWORD_DEFAULT)])) {
$stmt = $pdo->prepare("INSERT INTO users (uid, username, password, trading_password, balance, last_ip) VALUES (?, ?, ?, '123456', 0, ?)");
if ($stmt->execute([$uid, $username, password_hash($password, PASSWORD_DEFAULT), $user_ip])) {
$user_id = $pdo->lastInsertId();
$_SESSION['user_id'] = $user_id;
$_SESSION['username'] = $username;
@ -92,4 +97,4 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div>
</main>
<?php include 'footer.php'; ?>
<?php include 'footer.php'; ?>

View File

@ -27,14 +27,14 @@ if ($user_id) {
--input-bg: #1e2329;
}
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; overflow-y: auto !important; }
body { background-color: var(--bg-color); color: var(--text-primary); font-family: 'Inter', 'PingFang SC', sans-serif; margin: 0; }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); padding: 0; min-height: calc(100vh - 64px); }
.trading-layout { display: flex; gap: 1px; background: var(--border-color); padding: 0; min-height: 800px; }
.panel { background: var(--panel-bg); display: flex; flex-direction: column; }
/* Market Panel */
.market-panel { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border-color); }
#pairs-list { height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
#pairs-list { height: 800px; overflow-y: auto; scrollbar-width: thin; }
.pair-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.02); transition: 0.2s; }
.pair-item:hover { background: rgba(255,255,255,0.05); }
.pair-item.active { background: rgba(240, 185, 11, 0.08); border-left: 3px solid var(--accent-color); }
@ -43,7 +43,7 @@ if ($user_id) {
/* Center Panel */
.center-panel { flex: 1; background: var(--bg-color); display: flex; flex-direction: column; min-width: 0; }
.info-bar { height: 66px; display: flex; align-items: center; padding: 0 20px; gap: 25px; border-bottom: 1px solid var(--border-color); background: var(--panel-bg); }
.chart-container { height: 550px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.chart-container { height: 500px; background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.order-placement-panel { display: flex; gap: 30px; padding: 25px; border-bottom: 1px solid var(--border-color); background: var(--panel-bg); }
.order-side-column { flex: 1; }
@ -66,22 +66,17 @@ if ($user_id) {
.tab-btn.active { color: var(--accent-color); }
.tab-btn.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--accent-color); border-radius: 3px 3px 0 0; }
/* Responsive Design */
@media (max-width: 1400px) {
.market-panel { width: 260px; }
.order-book-panel { width: 280px; }
}
@media (max-width: 1200px) {
.market-panel { display: none; }
}
@media (max-width: 992px) {
.trading-layout { flex-direction: column; }
.trading-layout { flex-direction: column; min-height: auto; }
.order-book-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
.chart-container { height: 400px; }
.info-bar { height: auto; padding: 15px; flex-wrap: wrap; gap: 15px; }
.order-placement-panel { flex-direction: column; gap: 40px; }
#pairs-list { height: 400px; }
}
</style>
@ -101,6 +96,7 @@ if ($user_id) {
<div class="panel center-panel">
<div class="info-bar">
<div style="display: flex; align-items: center; gap: 12px;">
<i class="fas fa-bars desktop-only" id="toggleMarketBtn" style="cursor: pointer; color: var(--text-secondary); display: none;"></i>
<img id="current-logo" src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/btc.png" width="32" height="32" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
<span id="current-pair-display" style="font-size: 20px; font-weight: 800; letter-spacing: -0.5px;">BTC/USDT</span>
</div>
@ -233,11 +229,11 @@ if ($user_id) {
<span>Price(USDT)</span>
<span>Amount(<span class="asset-name">BTC</span>)</span>
</div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden;"></div>
<div id="asks-list" style="display: flex; flex-direction: column-reverse; flex: 1; overflow: hidden; min-height: 380px;"></div>
<div style="padding: 15px; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); text-align: center; background: rgba(255,255,255,0.01);">
<div id="ob-mid-price" style="font-size: 18px; font-weight: 800; font-family: 'Roboto Mono', monospace;">--</div>
</div>
<div id="bids-list" style="flex: 1; overflow: hidden;"></div>
<div id="bids-list" style="flex: 1; overflow: hidden; min-height: 380px;"></div>
</div>
</div>
@ -352,7 +348,7 @@ if ($user_id) {
const bids = document.getElementById('bids-list');
let asksHtml = ''; let bidsHtml = '';
let maxVol = 0;
const rows = 18;
const rows = 15;
const askData = [];
const bidData = [];
@ -484,4 +480,4 @@ if ($user_id) {
setInterval(fetchOrders, 5000);
</script>
<?php include 'footer.php'; ?>
<?php include 'footer.php'; ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -7,130 +7,172 @@ if (!isset($_SESSION['user_id'])) {
}
require_once 'db/config.php';
require_once 'includes/currency_helper.php';
$db = db();
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();
$message = '';
$fiat_rates = get_fiat_rates();
$fiat_currencies_info = [
'USD' => 'US Dollar', 'EUR' => 'Euro', 'GBP' => 'British Pound', 'CNY' => 'Chinese Yuan', 'HKD' => 'Hong Kong Dollar', 'JPY' => 'Japanese Yen', 'KRW' => 'Korean Won', 'SGD' => 'Singapore Dollar', 'TWD' => 'Taiwan Dollar', 'THB' => 'Thai Baht', 'VND' => 'Vietnamese Dong', 'IDR' => 'Indonesian Rupiah', 'MYR' => 'Malaysian Ringgit',
];
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$amount = $_POST['amount'];
$address = $_POST['address'];
$network = $_POST['network'];
$trading_pass = $_POST['trading_password'];
$type = $_POST['type'] ?? 'usdt';
$amount = (float)($_POST['amount'] ?? 0);
$currency = $_POST['currency'] ?? 'USDT';
$trading_pass = $_POST['trading_password'] ?? '';
$address = $_POST['address'] ?? '';
$network = $_POST['network'] ?? '';
if ($trading_pass !== $user['trading_password']) {
$error = "Incorrect trading password";
$error = "Incorrect trading password / 交易密码错误";
} elseif ($amount > $user['balance']) {
$error = "Insufficient balance";
$error = "Insufficient balance / 余额不足";
} elseif ($amount < 10) {
$error = "Minimum withdrawal amount is 10 USDT";
$error = "Minimum withdrawal amount is 10 USDT / 最低提现金额为 10 USDT";
} else {
// Process withdrawal (simplified)
$db->beginTransaction();
try {
// Deduct balance
$stmt = $db->prepare("UPDATE users SET balance = balance - ? WHERE id = ?");
$stmt->execute([$amount, $_SESSION['user_id']]);
// Log as a special type of order or transaction
$stmt = $db->prepare("INSERT INTO orders (user_id, type, amount, currency, account_info, status) VALUES (?, 'usdt', ?, 'USDT', ?, 'pending')");
$stmt->execute([$_SESSION['user_id'], $amount, "Network: $network, Address: $address"]);
// Log withdrawal order
$info = ($type === 'usdt') ? "USDT Network: $network, Address: $address" : "Fiat Currency: $currency";
$stmt = $db->prepare("INSERT INTO orders (user_id, type, amount, currency, account_info, status) VALUES (?, ?, ?, ?, ?, 'pending')");
$stmt->execute([$_SESSION['user_id'], $type, $amount, $currency, $info]);
$order_id = $db->lastInsertId();
// Insert notification message for chat
$method_info = ($type === 'usdt') ? "USDT ($network)" : "法币 ($currency)";
$msg = "👈 用户申请提现,金额 $amount USDT\n订单号: #$order_id\n方式: $method_info\n详情: $info";
$stmt = $db->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'user', ?)");
$stmt->execute([$_SESSION['user_id'], $msg]);
$db->commit();
$message = "Withdrawal request submitted successfully. Please wait for audit.";
// Refresh user data
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();
header("Location: chat.php");
exit;
} catch (Exception $e) {
$db->rollBack();
$error = "System error, please try again later";
$error = "System error, please try again later / 系统错误,请稍后再试";
}
}
}
?>
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
<div style="max-width: 800px; margin: 0 auto;">
<div style="max-width: 1000px; margin: 0 auto;">
<a href="profile.php" class="back-btn"><i class="fas fa-arrow-left"></i> <?php echo __('nav_profile'); ?></a>
<div style="margin-bottom: 40px;">
<h1 style="font-size: 2.5rem; font-weight: bold; margin-bottom: 10px;"><?php echo __('withdraw_assets'); ?></h1>
<p style="color: var(--text-muted);"><?php echo __('withdraw_tip'); ?></p>
<h1 style="font-size: 2.5rem; font-weight: bold; margin-bottom: 10px;"><?php echo __('withdraw_assets', '提现资产'); ?></h1>
<p style="color: var(--text-muted);"><?php echo __('withdraw_method_tip', '请选择您偏好的提现方式'); ?></p>
</div>
<?php if($message): ?>
<div style="background: rgba(14,203,129,0.1); color: var(--success-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--success-color);">
<i class="fas fa-check-circle"></i> <?php echo $message; ?>
</div>
<?php endif; ?>
<?php if($error): ?>
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--danger-color);">
<i class="fas fa-exclamation-circle"></i> <?php echo $error; ?>
</div>
<?php endif; ?>
<div style="display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px;">
<div style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 1px solid var(--border-color);">
<form method="POST">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 40px;">
<div id="card-fiat" style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 2px solid transparent; cursor: pointer;" onclick="switchMethod('fiat')">
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 25px;">
<div style="width: 60px; height: 60px; background: rgba(0, 82, 255, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 24px;">
<i class="fas fa-university"></i>
</div>
<div>
<h3 style="margin: 0;"><?php echo __('fiat_withdraw', '法币提现'); ?></h3>
<p style="margin: 5px 0 0; color: var(--text-muted); font-size: 14px;"><?php echo __('bank_transfer', '银行转账 / OTC'); ?></p>
</div>
</div>
</div>
<div id="card-usdt" style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 2px solid var(--success-color); cursor: pointer;" onclick="switchMethod('usdt')">
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 25px;">
<div style="width: 60px; height: 60px; background: rgba(14, 203, 129, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--success-color); font-size: 24px;">
<i class="fas fa-coins"></i>
</div>
<div>
<h3 style="margin: 0;"><?php echo __('crypto_withdraw', '数字货币提现'); ?></h3>
<p style="margin: 5px 0 0; color: var(--text-muted); font-size: 14px;">Blockchain Transfer</p>
</div>
</div>
</div>
</div>
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color);">
<form method="POST">
<input type="hidden" name="type" id="withdraw-type" value="usdt">
<div id="fiat-options" style="display: none; margin-bottom: 25px;">
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;"><?php echo __('select_currency', '选择币种'); ?></label>
<select name="currency" style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none;">
<?php foreach ($fiat_rates as $code => $rate): ?>
<option value="<?php echo $code; ?>"><?php echo $code; ?> - <?php echo $fiat_currencies_info[$code] ?? $code; ?></option>
<?php endforeach; ?>
</select>
</div>
<div id="usdt-options" style="margin-bottom: 25px;">
<div style="margin-bottom: 25px;">
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('select_network'); ?></label>
<select name="network" style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">Select Network</label>
<select name="network" style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
<option value="TRC20">USDT - TRC20 (Recommended)</option>
<option value="ERC20">USDT - ERC20</option>
<option value="BEP20">USDT - BEP20 (BSC)</option>
</select>
</div>
<div style="margin-bottom: 25px;">
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('withdraw_address'); ?></label>
<input type="text" name="address" placeholder="Paste your USDT wallet address" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">Withdrawal Address</label>
<input type="text" name="address" placeholder="Paste your USDT wallet address" style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
</div>
<div style="margin-bottom: 25px;">
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('amount'); ?></label>
<div style="position: relative;">
<input type="number" name="amount" id="withdraw-amount" placeholder="Min. 10" step="0.01" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
<span onclick="document.getElementById('withdraw-amount').value = '<?php echo $user['balance']; ?>'" style="position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--primary-color); font-weight: bold; cursor: pointer; font-size: 12px;"><?php echo __('max'); ?></span>
</div>
<div style="margin-top: 8px; font-size: 12px; color: var(--text-muted);">
<?php echo __('available_balance'); ?>: <span style="color: white; font-weight: bold;"><?php echo number_format($user['balance'], 2); ?> USDT</span>
</div>
</div>
<div style="margin-bottom: 30px;">
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('trading_password'); ?></label>
<input type="password" name="trading_password" placeholder="Enter 6-digit trading password" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
</div>
<button type="submit" class="btn-primary" style="width: 100%; padding: 16px; font-size: 1.1rem; border-radius: 12px; background: var(--danger-color);"><?php echo __('submit_withdrawal'); ?></button>
</form>
</div>
<div>
<div style="background: rgba(240,185,11,0.05); padding: 25px; border-radius: 20px; border: 1px solid rgba(240,185,11,0.1); margin-bottom: 20px;">
<h4 style="color: #f0b90b; margin: 0 0 15px; display: flex; align-items: center; gap: 10px;"><i class="fas fa-exclamation-triangle"></i> <?php echo __('withdrawal_tips'); ?></h4>
<ul style="color: var(--text-muted); font-size: 13px; line-height: 1.8; padding-left: 20px; margin: 0;">
<li><?php echo __('withdrawal_tip_1'); ?></li>
<li><?php echo __('withdrawal_tip_2'); ?></li>
<li><?php echo __('withdrawal_tip_3'); ?></li>
<li><?php echo __('withdrawal_tip_4'); ?></li>
</ul>
</div>
<div style="background: var(--card-bg); padding: 25px; border-radius: 20px; border: 1px solid var(--border-color);">
<h4 style="margin: 0 0 15px;"><?php echo __('recent_history'); ?></h4>
<div style="color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0;">
<?php echo __('no_records'); ?>
<div style="margin-bottom: 25px;">
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;"><?php echo __('withdraw_amount', '提现金额 (USDT)'); ?></label>
<div style="position: relative;">
<input type="number" name="amount" id="amount-input" placeholder="Min. 10" step="0.01" required style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1.2rem; font-weight: bold; outline: none;">
<span onclick="document.getElementById('amount-input').value = '<?php echo $user['balance']; ?>'" style="position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--primary-color); font-weight: bold; cursor: pointer; font-size: 14px;">MAX</span>
</div>
<div style="margin-top: 10px; font-size: 13px; color: var(--text-muted);">
Available: <span style="color: white; font-weight: bold;"><?php echo number_format($user['balance'], 2); ?> USDT</span>
</div>
</div>
</div>
<div style="margin-bottom: 35px;">
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;"><?php echo __('trading_password', '交易密码'); ?></label>
<input type="password" name="trading_password" placeholder="Enter 6-digit trading password" required style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
</div>
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 12px; background: var(--danger-color);">Submit Withdrawal / 提交提现</button>
</form>
</div>
</div>
</main>
<?php include 'footer.php'; ?>
<script>
function switchMethod(method) {
if(method === 'fiat') {
document.getElementById('fiat-options').style.display = 'block';
document.getElementById('usdt-options').style.display = 'none';
document.getElementById('card-fiat').style.borderColor = 'var(--primary-color)';
document.getElementById('card-usdt').style.borderColor = 'transparent';
document.getElementById('withdraw-type').value = 'fiat';
} else {
document.getElementById('fiat-options').style.display = 'none';
document.getElementById('usdt-options').style.display = 'block';
document.getElementById('card-fiat').style.borderColor = 'transparent';
document.getElementById('card-usdt').style.borderColor = 'var(--success-color)';
document.getElementById('withdraw-type').value = 'usdt';
}
}
</script>
<?php include 'footer.php'; ?>