diff --git a/admin/agents.php b/admin/agents.php index 34495cf..ef19cce 100644 --- a/admin/agents.php +++ b/admin/agents.php @@ -1,6 +1,6 @@ query("SELECT COUNT(*) FROM fiat_orders WHERE status IN 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
diff --git a/admin/auth.php b/admin/auth.php new file mode 100644 index 0000000..234be40 --- /dev/null +++ b/admin/auth.php @@ -0,0 +1,9 @@ +query(" 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
diff --git a/admin/chat_iframe.php b/admin/chat_iframe.php index 0168e29..0a6a3ca 100644 --- a/admin/chat_iframe.php +++ b/admin/chat_iframe.php @@ -1,7 +1,7 @@ query("SELECT COUNT(*) FROM fiat_orders WHERE status IN 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
返回 diff --git a/admin/index.php b/admin/index.php index 3d49f15..63be0e9 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,6 +1,6 @@ query("SELECT COUNT(*) FROM users")->fetchColumn(); @@ -45,7 +45,9 @@ $unread_msgs = $db->query("SELECT COUNT(*) FROM messages WHERE sender = 'user' A 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录 前端首页
diff --git a/admin/kyc.php b/admin/kyc.php index 042aa4b..0a937e9 100644 --- a/admin/kyc.php +++ b/admin/kyc.php @@ -1,6 +1,6 @@ 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); ?> KYC 审核 - NovaEx 管理后台 - - +
-
- 返回 -

待审核 KYC

- - -

暂无待审核申请。

- - -
-
-
-

-

身份证号:

-

用户名: (UID: )

+
+

实名认证管理 (KYC)

+ +
+
待审核 ()
+
已通过 ()
+
+ +
+ +
+ +

目前没有待处理的认证申请

-
-
- - - -
-
- - - -
+ + + +
+
+
+
+ + 待审核 +
+

证件号码:

+

关联账号: (UID: )

+
+
+
+ + + +
+
+ + + +
+
+
+
+
+ +
正面照
+
+
+ +
反面照
+
+
+ +
手持照
+
-
- - - + +
+ + -
+ + - \ No newline at end of file + diff --git a/admin/login.php b/admin/login.php new file mode 100644 index 0000000..68d1ab2 --- /dev/null +++ b/admin/login.php @@ -0,0 +1,68 @@ +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 = "用户名或密码错误。"; + } +} +?> + + + + + + 管理员登录 - NovaEx + + + + + + + \ No newline at end of file diff --git a/admin/logout.php b/admin/logout.php new file mode 100644 index 0000000..ed81214 --- /dev/null +++ b/admin/logout.php @@ -0,0 +1,7 @@ +query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->f 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
diff --git a/admin/orders.php b/admin/orders.php index 1c28f46..9f3ac75 100644 --- a/admin/orders.php +++ b/admin/orders.php @@ -1,17 +1,16 @@ 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
返回 @@ -99,7 +100,7 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat - + @@ -107,13 +108,12 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat - - + + + diff --git a/admin/settings.php b/admin/settings.php index b53dc6e..7e03b6d 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -1,13 +1,9 @@ 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 ( 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
@@ -105,6 +124,28 @@ $pending_orders = $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status IN (
+
+

修改登录密码

+
+ +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+

站点配置 (LOGO / 图标)

diff --git a/admin/spot_orders.php b/admin/spot_orders.php index 58e355b..a0acc69 100644 --- a/admin/spot_orders.php +++ b/admin/spot_orders.php @@ -1,6 +1,6 @@ query("SELECT COUNT(*) FROM fiat_orders WHERE status IN 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
返回 diff --git a/admin/users.php b/admin/users.php index a2e4ed5..1b0d2a5 100644 --- a/admin/users.php +++ b/admin/users.php @@ -1,6 +1,6 @@ query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->f 现货交易 合约交易 充值记录 + 提现记录 系统设置 + 退出登录
diff --git a/admin/withdrawals.php b/admin/withdrawals.php new file mode 100644 index 0000000..b2e3766 --- /dev/null +++ b/admin/withdrawals.php @@ -0,0 +1,175 @@ +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(); + +?> + + + + + 提现管理 - NovaEx 管理员 + + + + +
ID用户类型金额凭证状态操作ID用户币种充值金额换算 USDT凭证状态操作
# (UID: ) - - 查看凭证 + + 查看凭证 未上传 @@ -123,17 +123,15 @@ $pending_orders_count = $pdo->query("SELECT COUNT(*) FROM fiat_orders WHERE stat
- - - + +
- - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ID用户 (UID)金额币种提现详情状态申请时间操作
#
UID:
+ +
+ + + + + +
+ + + + +
+
+ + 已处理 + +
+
+
+ + diff --git a/api/place_option_order.php b/api/place_option_order.php index adb550f..006b1cc 100644 --- a/api/place_option_order.php +++ b/api/place_option_order.php @@ -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], ]; diff --git a/assets/pasted-20260212-134041-d2208c3f.png b/assets/pasted-20260212-134041-d2208c3f.png new file mode 100644 index 0000000..76eae31 Binary files /dev/null and b/assets/pasted-20260212-134041-d2208c3f.png differ diff --git a/assets/pasted-20260212-135551-21d68807.png b/assets/pasted-20260212-135551-21d68807.png new file mode 100644 index 0000000..d70acf8 Binary files /dev/null and b/assets/pasted-20260212-135551-21d68807.png differ diff --git a/db/install.sql b/db/install.sql index 4b93ac6..cebb033 100644 --- a/db/install.sql +++ b/db/install.sql @@ -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 diff --git a/futures.php b/futures.php index 65f3723..963d0d8 100644 --- a/futures.php +++ b/futures.php @@ -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; } } @@ -184,9 +180,9 @@ if ($user_id) {
Price / Amount
-
+
--
-
+
@@ -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); - \ No newline at end of file + diff --git a/options.php b/options.php index 2378f70..a95f892 100644 --- a/options.php +++ b/options.php @@ -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; } } @@ -170,9 +166,9 @@ if ($user_id) { 90S 12%
-
+
120S - 20% + 15%
180S @@ -252,11 +248,11 @@ if ($user_id) { Price(USDT) Amount(BTC)
-
+
--
-
+
diff --git a/register.php b/register.php index ad72fbd..a129d69 100644 --- a/register.php +++ b/register.php @@ -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') {
- \ No newline at end of file + diff --git a/spot.php b/spot.php index 9afec15..3db7821 100644 --- a/spot.php +++ b/spot.php @@ -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; } } @@ -101,6 +96,7 @@ if ($user_id) {
+ BTC/USDT
@@ -233,11 +229,11 @@ if ($user_id) { Price(USDT) Amount(BTC)
-
+
--
-
+
@@ -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); - \ No newline at end of file + diff --git a/uploads/kyc/1770904212_back_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png b/uploads/kyc/1770904212_back_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png new file mode 100644 index 0000000..8d86da8 Binary files /dev/null and b/uploads/kyc/1770904212_back_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png differ diff --git a/uploads/kyc/1770904212_front_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png b/uploads/kyc/1770904212_front_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png new file mode 100644 index 0000000..8d86da8 Binary files /dev/null and b/uploads/kyc/1770904212_front_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png differ diff --git a/uploads/kyc/1770904212_handheld_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png b/uploads/kyc/1770904212_handheld_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png new file mode 100644 index 0000000..8d86da8 Binary files /dev/null and b/uploads/kyc/1770904212_handheld_7a8fdb2c-fb1b-4742-92c4-b7af8e3de227.png differ diff --git a/withdraw.php b/withdraw.php index 39b56fe..3eb9258 100644 --- a/withdraw.php +++ b/withdraw.php @@ -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 / 系统错误,请稍后再试"; } } } ?>
-
+
-

-

+

+

- -
- -
- -
-
-
-
+
+
+
+
+ +
+
+

+

+
+
+
+ +
+
+
+ +
+
+

+

Blockchain Transfer

+
+
+
+
+ +
+ + + + + +
- -
-
- - + +
- -
- -
- - -
-
- : USDT -
-
- -
- - -
- - - -
- -
-
-

-
    -
  • -
  • -
  • -
  • -
-
-

-
- +
+ +
+ + MAX +
+
+ Available: USDT
-
+ +
+ + +
+ + +
- \ No newline at end of file + + +