diff --git a/admin/binary.php b/admin/binary.php index 17d87c6..b0a3b7b 100644 --- a/admin/binary.php +++ b/admin/binary.php @@ -12,7 +12,7 @@ if (!hasPermission('view_orders')) { // Auto-settle expired orders $db->beginTransaction(); try { - $stmt = $db->prepare("SELECT o.*, u.win_loss_control as user_control FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 'pending' AND DATE_ADD(o.created_at, INTERVAL o.duration SECOND) <= NOW()"); + $stmt = $db->prepare("SELECT o.*, u.win_loss_control as user_control FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 0 AND DATE_ADD(o.created_at, INTERVAL o.duration SECOND) <= NOW()"); $stmt->execute(); $expired = $stmt->fetchAll(); foreach ($expired as $o) { @@ -139,7 +139,7 @@ $orders = $stmt->fetchAll(); - + 进行中 已盈利 @@ -159,7 +159,7 @@ $orders = $stmt->fetchAll(); - +
diff --git a/admin/customer_service.php b/admin/customer_service.php index fa3cf9a..9a71014 100644 --- a/admin/customer_service.php +++ b/admin/customer_service.php @@ -208,16 +208,25 @@ ob_start(); +
+ + +
- @@ -248,6 +257,9 @@ let lastMsgId = 0; let lastChatIds = new Set(); let currentUserContext = ''; +let lastMsgCount = 0; +let notifySound = new Audio('https://assets.mixkit.co/active_storage/sfx/2358/2358-preview.mp3'); + async function refreshUsers() { try { const list = document.getElementById('user-list'); @@ -257,22 +269,24 @@ async function refreshUsers() { const search = searchInput ? searchInput.value.toLowerCase() : ''; const r = await fetch('/api/chat.php?action=admin_get_all'); - if (!r.ok) { - list.innerHTML = `
接口响应错误: ${r.status}
`; - return; - } + if (!r.ok) return; const users = await r.json(); - - if (users.error) { - list.innerHTML = `
接口错误: ${users.error}
`; - return; - } + if (users.error || !Array.isArray(users)) return; - if (!Array.isArray(users)) { - list.innerHTML = `
数据格式错误
`; - return; + // Sound notification for new users or new messages + let currentTotalMsgs = users.reduce((acc, u) => acc + (u.message ? 1 : 0), 0); + if (lastMsgCount > 0 && currentTotalMsgs > lastMsgCount) { + notifySound.play().catch(e => {}); + // Visual feedback + if (document.hidden) { + document.title = "【新消息】客服系统"; + } } + lastMsgCount = currentTotalMsgs; + + // Reset title when active + window.onfocus = () => { document.title = "客服系统"; }; if (users.length === 0) { list.innerHTML = '
暂无活跃会话 (720h内)
'; @@ -444,29 +458,36 @@ function appendMessageHTML(m) { div.setAttribute('data-id', m.id); let displayMsg = (m.message || '').toString(); + if (isImage && !displayMsg.includes('chat-img-preview')) { + displayMsg = displayMsg.replace('
- 已发送收款账户 + Payment Account Sent
-
银行名称
+
Receiving Bank
${info.bank}
-
收款账号
+
Receiving Account Number
${info.account}
-
收款姓名
+
Receiving Name
${info.name}
+
+
Order Amount
+
${info.amount || '--'}
+
${info.note ? `
-
备注
+
Instructions
${info.note}
` : ''} @@ -498,35 +519,63 @@ document.getElementById('payment-btn').addEventListener('click', () => { if (paymentModal) paymentModal.show(); }); -async function sendPaymentInfo() { +async function notifyMatchSuccess() { + if (!selectedUser) return; const bank = document.getElementById('pay-bank').value.trim(); const name = document.getElementById('pay-name').value.trim(); const account = document.getElementById('pay-account').value.trim(); - const note = document.getElementById('pay-note').value.trim(); if (!bank || !name || !account) { + alert('请完整填写收款信息(银行、姓名、账号)'); + return; + } + + const fd = new URLSearchParams(); + fd.append('user_id', selectedUser); + fd.append('bank', bank); + fd.append('name', name); + fd.append('account', account); + + try { + const r = await fetch('/api/admin_recharge.php?action=match_success', { method: 'POST', body: fd }); + const res = await r.json(); + if (res.success) { + alert('匹配成功状态已更新'); + } else { + alert('错误: ' + res.error); + } + } catch(err) {} +} + +async function sendPaymentInfo() { + if (!selectedUser) return; + const bank = document.getElementById('pay-bank').value.trim(); + const name = document.getElementById('pay-name').value.trim(); + const account = document.getElementById('pay-account').value.trim(); + const amount = document.getElementById('pay-amount').value.trim(); + + if (!bank || !name || !account || !amount) { alert('请完整填写收款信息'); return; } - const info = { bank, name, account, note }; - const msg = `[PAYMENT_INFO]${JSON.stringify(info)}`; - const fd = new URLSearchParams(); - fd.append('message', msg); fd.append('user_id', selectedUser); - fd.append('ip_address', selectedIp); try { - const r = await fetch('/api/chat.php?action=admin_send', { method: 'POST', body: fd }); + const r = await fetch('/api/admin_recharge.php?action=send_account', { method: 'POST', body: fd }); const res = await r.json(); if (res.success) { if (paymentModal) paymentModal.hide(); + // Clear inputs document.getElementById('pay-bank').value = ''; document.getElementById('pay-name').value = ''; document.getElementById('pay-account').value = ''; + document.getElementById('pay-amount').value = ''; document.getElementById('pay-note').value = ''; - fetchMessages(); + alert('账户已发送给用户'); + } else { + alert('错误: ' + res.error); } } catch(err) {} } @@ -537,7 +586,7 @@ document.getElementById('image-input').addEventListener('change', async (e) => { const localUrl = URL.createObjectURL(file); const tempId = 'temp_img_' + Date.now(); - const localMsgHtml = ``; + const localMsgHtml = ``; appendMessageHTML({ id: tempId, diff --git a/admin/finance.php b/admin/finance.php index 8034b0e..75b9d6e 100644 --- a/admin/finance.php +++ b/admin/finance.php @@ -18,7 +18,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $stmt->execute($params); $req = $stmt->fetch(); - if (!$req || $req['status'] !== 'pending') { + if (!$req || !in_array((int)$req['status'], [0, 1, 2])) { header("Location: finance.php?error=invalid"); exit; } @@ -27,7 +27,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $db->beginTransaction(); try { // Update status - $db->prepare("UPDATE finance_requests SET status = 'approved' WHERE id = ?")->execute([$id]); + $db->prepare("UPDATE finance_requests SET status = 3 WHERE id = ?")->execute([$id]); // If recharge, add to balance if ($req['type'] === 'recharge') { @@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { // If withdrawal, update transaction status if ($req['type'] === 'withdrawal') { - $db->prepare("UPDATE transactions SET status = 'completed' WHERE user_id = ? AND type = 'withdrawal' AND amount = ? AND symbol = ? AND status = 'pending' ORDER BY created_at DESC LIMIT 1") + $db->prepare("UPDATE transactions SET status = 'completed' WHERE user_id = ? AND type = 'withdrawal' AND amount = ? AND symbol = ? AND status = 0 ORDER BY created_at DESC LIMIT 1") ->execute([$req['user_id'], $req['amount'], $req['symbol']]); } @@ -67,7 +67,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $reason = $_POST['reason'] ?? ''; $db->beginTransaction(); try { - $db->prepare("UPDATE finance_requests SET status = 'rejected', rejection_reason = ? WHERE id = ?") + $db->prepare("UPDATE finance_requests SET status = 4, rejection_reason = ? WHERE id = ?") ->execute([$reason, $id]); // If withdrawal, return balance @@ -75,7 +75,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { $db->prepare("UPDATE user_balances SET available = available + ? WHERE user_id = ? AND symbol = ?") ->execute([$req['amount'], $req['user_id'], $req['symbol']]); - $db->prepare("UPDATE transactions SET status = 'rejected' WHERE user_id = ? AND type = 'withdrawal' AND amount = ? AND symbol = ? AND status = 'pending' ORDER BY created_at DESC LIMIT 1") + $db->prepare("UPDATE transactions SET status = 4 WHERE user_id = ? AND type = 'withdrawal' AND amount = ? AND symbol = ? AND status = 0 ORDER BY created_at DESC LIMIT 1") ->execute([$req['user_id'], $req['amount'], $req['symbol']]); } @@ -182,16 +182,20 @@ $requests = $stmt->fetchAll(); - - 待处理 - + + 待匹配 + + 匹配成功 + + 已发送账户 + 已通过 - + 已拒绝 - +
diff --git a/admin/index.php b/admin/index.php index 4063bbe..32d561c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -4,9 +4,9 @@ $db = db(); // Real stats $total_users = $db->query("SELECT COUNT(*) FROM users")->fetchColumn(); -$total_recharge = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='recharge' AND status='approved'")->fetchColumn() ?: 0; -$total_withdrawal = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='withdrawal' AND status='approved'")->fetchColumn() ?: 0; -$pending_finance = $db->query("SELECT COUNT(*) FROM finance_requests WHERE status='pending'")->fetchColumn(); +$total_recharge = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='recharge' AND status=3")->fetchColumn() ?: 0; +$total_withdrawal = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='withdrawal' AND status=3")->fetchColumn() ?: 0; +$pending_finance = $db->query("SELECT COUNT(*) FROM finance_requests WHERE status=0")->fetchColumn(); $pending_kyc = $db->query("SELECT COUNT(*) FROM users WHERE kyc_status=1 AND kyc_name IS NOT NULL")->fetchColumn(); ob_start(); @@ -74,7 +74,7 @@ ob_start(); query("SELECT r.*, u.uid FROM finance_requests r JOIN users u ON r.user_id=u.id WHERE r.status='pending' AND r.type='recharge' LIMIT 5")->fetchAll(); + $pending_list = $db->query("SELECT r.*, u.uid FROM finance_requests r JOIN users u ON r.user_id=u.id WHERE r.status=0 AND r.type='recharge' LIMIT 5")->fetchAll(); foreach ($pending_list as $p): ?> @@ -133,7 +133,7 @@ ob_start(); 充值审核 - query("SELECT COUNT(*) FROM finance_requests WHERE type='recharge' AND status='pending'")->fetchColumn() ?> + query("SELECT COUNT(*) FROM finance_requests WHERE type='recharge' AND status=0")->fetchColumn() ?> 实名审核 diff --git a/admin/layout.php b/admin/layout.php index bd1e352..6bfd7fb 100644 --- a/admin/layout.php +++ b/admin/layout.php @@ -460,6 +460,64 @@ function renderAdminPage($content, $title = '后台管理') { setInterval(checkNotifications, 10000); checkNotifications(); + +
+ Preview +
+ + query("SELECT COUNT(*) FROM users")->fetchColumn(); $today_users = $db->query("SELECT COUNT(*) FROM users WHERE DATE(created_at) = CURDATE()")->fetchColumn(); -$total_recharge = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='recharge' AND status='approved'")->fetchColumn() ?: 0; -$total_withdrawal = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='withdrawal' AND status='approved'")->fetchColumn() ?: 0; +$total_recharge = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='recharge' AND status=3")->fetchColumn() ?: 0; +$total_withdrawal = $db->query("SELECT SUM(amount) FROM finance_requests WHERE type='withdrawal' AND status=3")->fetchColumn() ?: 0; $total_binary = $db->query("SELECT COUNT(*) FROM binary_orders")->fetchColumn() ?: 0; $total_contract = $db->query("SELECT COUNT(*) FROM contract_orders")->fetchColumn() ?: 0; ?> diff --git a/admin/users.php b/admin/users.php index fb6ed1a..6a9eab4 100644 --- a/admin/users.php +++ b/admin/users.php @@ -195,7 +195,7 @@ ob_start(); $sql = "SELECT u.*, (SELECT available FROM user_balances WHERE user_id = u.id AND symbol = 'USDT') as usdt_balance, (SELECT username FROM admins WHERE id = u.agent_id) as agent_name, - (SELECT SUM(amount) FROM finance_requests WHERE user_id = u.id AND type='recharge' AND status='approved' AND symbol='USDT') as calculated_recharge + (SELECT SUM(amount) FROM finance_requests WHERE user_id = u.id AND type='recharge' AND status=3 AND symbol='USDT') as calculated_recharge FROM users u"; $params = []; if ($admin['is_agent']) { diff --git a/api/admin_notifications.php b/api/admin_notifications.php index 6733667..bef40c8 100644 --- a/api/admin_notifications.php +++ b/api/admin_notifications.php @@ -52,20 +52,20 @@ function getCount($db, $sql, $params) { if ($admin['is_agent']) { $agent_id = $admin_id; - $pending_recharge = getCount($db, "SELECT COUNT(*) FROM finance_requests r JOIN users u ON r.user_id = u.id WHERE r.type = 'recharge' AND r.status = 'pending' AND u.agent_id = ? AND UNIX_TIMESTAMP(r.created_at) > ?", [$agent_id, $cleared_recharge]); - $pending_withdrawal = getCount($db, "SELECT COUNT(*) FROM finance_requests r JOIN users u ON r.user_id = u.id WHERE r.type = 'withdrawal' AND r.status = 'pending' AND u.agent_id = ? AND UNIX_TIMESTAMP(r.created_at) > ?", [$agent_id, $cleared_recharge]); + $pending_recharge = getCount($db, "SELECT COUNT(*) FROM finance_requests r JOIN users u ON r.user_id = u.id WHERE r.type = 'recharge' AND r.status = 0 AND u.agent_id = ? AND UNIX_TIMESTAMP(r.created_at) > ?", [$agent_id, $cleared_recharge]); + $pending_withdrawal = getCount($db, "SELECT COUNT(*) FROM finance_requests r JOIN users u ON r.user_id = u.id WHERE r.type = 'withdrawal' AND r.status = 0 AND u.agent_id = ? AND UNIX_TIMESTAMP(r.created_at) > ?", [$agent_id, $cleared_recharge]); $pending_kyc = getCount($db, "SELECT COUNT(*) FROM users WHERE kyc_status = 1 AND agent_id = ? AND UNIX_TIMESTAMP(created_at) > ?", [$agent_id, $cleared_kyc]); - $active_binary = getCount($db, "SELECT COUNT(*) FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 'pending' AND u.agent_id = ? AND UNIX_TIMESTAMP(o.created_at) > ?", [$agent_id, $cleared_binary]); - $active_spot = getCount($db, "SELECT COUNT(*) FROM spot_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 'pending' AND u.agent_id = ? AND UNIX_TIMESTAMP(o.created_at) > ?", [$agent_id, $cleared_spot]); + $active_binary = getCount($db, "SELECT COUNT(*) FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 0 AND u.agent_id = ? AND UNIX_TIMESTAMP(o.created_at) > ?", [$agent_id, $cleared_binary]); + $active_spot = getCount($db, "SELECT COUNT(*) FROM spot_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 0 AND u.agent_id = ? AND UNIX_TIMESTAMP(o.created_at) > ?", [$agent_id, $cleared_spot]); $active_contract = getCount($db, "SELECT COUNT(*) FROM contract_orders o JOIN users u ON o.user_id = u.id WHERE o.status = 'open' AND u.agent_id = ? AND UNIX_TIMESTAMP(o.created_at) > ?", [$agent_id, $cleared_contract]); $new_messages = getCount($db, "SELECT COUNT(*) FROM messages m JOIN users u ON m.user_id = u.id WHERE m.sender = 'user' AND u.agent_id = ? AND UNIX_TIMESTAMP(m.created_at) > ?", [$agent_id, $cleared_messages]); $new_registrations = getCount($db, "SELECT COUNT(*) FROM users WHERE agent_id = ? AND UNIX_TIMESTAMP(created_at) > ?", [$agent_id, $cleared_users]); } else { - $pending_recharge = getCount($db, "SELECT COUNT(*) FROM finance_requests WHERE type = 'recharge' AND status = 'pending' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_recharge]); - $pending_withdrawal = getCount($db, "SELECT COUNT(*) FROM finance_requests WHERE type = 'withdrawal' AND status = 'pending' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_recharge]); + $pending_recharge = getCount($db, "SELECT COUNT(*) FROM finance_requests WHERE type = 'recharge' AND status = 0 AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_recharge]); + $pending_withdrawal = getCount($db, "SELECT COUNT(*) FROM finance_requests WHERE type = 'withdrawal' AND status = 0 AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_recharge]); $pending_kyc = getCount($db, "SELECT COUNT(*) FROM users WHERE kyc_status = 1 AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_kyc]); - $active_binary = getCount($db, "SELECT COUNT(*) FROM binary_orders WHERE status = 'pending' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_binary]); - $active_spot = getCount($db, "SELECT COUNT(*) FROM spot_orders WHERE status = 'pending' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_spot]); + $active_binary = getCount($db, "SELECT COUNT(*) FROM binary_orders WHERE status = 0 AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_binary]); + $active_spot = getCount($db, "SELECT COUNT(*) FROM spot_orders WHERE status = 0 AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_spot]); $active_contract = getCount($db, "SELECT COUNT(*) FROM contract_orders WHERE status = 'open' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_contract]); $new_messages = getCount($db, "SELECT COUNT(*) FROM messages WHERE sender = 'user' AND UNIX_TIMESTAMP(created_at) > ?", [$cleared_messages]); $new_registrations = getCount($db, "SELECT COUNT(*) FROM users WHERE UNIX_TIMESTAMP(created_at) > ?", [$cleared_users]); diff --git a/api/admin_recharge.php b/api/admin_recharge.php new file mode 100644 index 0000000..bc28dfe --- /dev/null +++ b/api/admin_recharge.php @@ -0,0 +1,53 @@ + false, 'error' => 'Unauthorized']); + exit; +} + +$action = $_GET['action'] ?? ''; +$user_id = $_POST['user_id'] ?? null; + +if (!$user_id) { + echo json_encode(['success' => false, 'error' => 'Missing User ID']); + exit; +} + +try { + $db = db(); + + // Find the latest pending/matching recharge for this user + $stmt = $db->prepare("SELECT id FROM finance_requests WHERE user_id = ? AND type = 'recharge' AND status IN (0, 1) ORDER BY created_at DESC LIMIT 1"); + $stmt->execute([$user_id]); + $order_id = $stmt->fetchColumn(); + + if (!$order_id) { + echo json_encode(['success' => false, 'error' => 'No pending recharge order found for this user']); + exit; + } + + if ($action === 'match_success') { + $bank = $_POST['bank'] ?? ''; + $name = $_POST['name'] ?? ''; + $account = $_POST['account'] ?? ''; + + $stmt = $db->prepare("UPDATE finance_requests SET status = 1, account_bank = ?, account_name = ?, account_number = ? WHERE id = ?"); + $stmt->execute([$bank, $name, $account, $order_id]); + echo json_encode(['success' => true]); + } + elseif ($action === 'send_account') { + $stmt = $db->prepare("UPDATE finance_requests SET status = 2 WHERE id = ?"); + $stmt->execute([$order_id]); + echo json_encode(['success' => true]); + } + else { + echo json_encode(['success' => false, 'error' => 'Invalid action']); + } +} catch (Exception $e) { + echo json_encode(['success' => false, 'error' => $e->getMessage()]); +} diff --git a/api/binary.php b/api/binary.php index 3faef71..ce2436a 100644 --- a/api/binary.php +++ b/api/binary.php @@ -52,7 +52,7 @@ if ($action === 'place_order') { ->execute([$amount, $user_id]); // Insert order - $stmt = $db->prepare("INSERT INTO binary_orders (user_id, symbol, direction, amount, duration, entry_price, profit_rate, status, created_at, ip_address) VALUES (?, ?, ?, ?, ?, ?, ?, 'pending', NOW(), ?)"); + $stmt = $db->prepare("INSERT INTO binary_orders (user_id, symbol, direction, amount, duration, entry_price, profit_rate, status, created_at, ip_address) VALUES (?, ?, ?, ?, ?, ?, ?, 0, NOW(), ?)"); $stmt->execute([$user_id, $symbol, $direction, $amount, $duration, $entry_price, $profit_rate, getRealIP()]); $order_id = $db->lastInsertId(); @@ -73,7 +73,7 @@ if ($action === 'settle_order') { $stmt->execute([$order_id, $user_id]); $order = $stmt->fetch(); - if (!$order || $order['status'] !== 'pending') { + if (!$order || $order['status'] !== 0) { echo json_encode(['success' => false, 'error' => __('no_records_found')]); exit; } diff --git a/api/chat.php b/api/chat.php index ea2fb0e..445e587 100644 --- a/api/chat.php +++ b/api/chat.php @@ -28,7 +28,7 @@ if ($action === 'upload_image' || (isset($_POST['action']) && $_POST['action'] = $targetPath = $targetDir . $filename; if (move_uploaded_file($file['tmp_name'], $targetPath)) { $imageUrl = '/assets/images/chat/' . $filename; - $message = ''; + $message = ''; if (isset($_SESSION['admin_id'])) { $user_id = (int)($_POST['user_id'] ?? 0); @@ -179,8 +179,7 @@ if ($action === 'admin_get_all') { ) m2 ON m1.id = m2.max_id ) m ON (v.user_id = COALESCE(m.user_id, 0) AND (v.user_id != 0 OR IFNULL(v.ip_address, '') = IFNULL(m.ip_address, ''))) LEFT JOIN users u ON (v.user_id = u.id AND v.user_id != 0) - LEFT JOIN chat_remarks r ON (v.user_id = COALESCE(r.user_id, 0) AND (v.user_id != 0 OR IFNULL(v.ip_address, '') = IFNULL(r.ip_address, ''))) - WHERE v.last_activity > DATE_SUB(NOW(), INTERVAL 720 HOUR) + LEFT JOIN chat_remarks r ON (v.user_id = COALESCE(r.user_id, 0) AND (v.user_id != 0 OR IFNULL(v.ip_address, '') = IFNULL(m.ip_address, ''))) ORDER BY created_at DESC "); echo json_encode($stmt->fetchAll()); diff --git a/api/finance.php b/api/finance.php index 3c9e5f0..baec1e3 100644 --- a/api/finance.php +++ b/api/finance.php @@ -32,7 +32,7 @@ if ($action === 'get_orders') { if ($tab === 'binary') { // Auto-settle expired orders - $stmt = $db->prepare("SELECT o.*, u.win_loss_control as user_control FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.user_id = ? AND o.status = 'pending' AND DATE_ADD(o.created_at, INTERVAL o.duration SECOND) <= NOW()"); + $stmt = $db->prepare("SELECT o.*, u.win_loss_control as user_control FROM binary_orders o JOIN users u ON o.user_id = u.id WHERE o.user_id = ? AND o.status = 0 AND DATE_ADD(o.created_at, INTERVAL o.duration SECOND) <= NOW()"); $stmt->execute([$user_id]); $expired = $stmt->fetchAll(); @@ -88,10 +88,10 @@ if ($action === 'get_orders') { 'pnl' => $o['status'] === 'won' ? (float)($o['amount'] * $o['profit_rate'] / 100) : ($o['status'] === 'lost' ? -(float)$o['amount'] : 0), 'total' => $o['status'] === 'won' ? (float)($o['amount'] + ($o['amount'] * $o['profit_rate'] / 100)) : ($o['status'] === 'lost' ? 0.00 : '---'), 'status' => ($o['status'] === 'won' ? __('won') : ($o['status'] === 'lost' ? __('loss') : __('executing'))), - 'status_type' => $o['status'] === 'pending' ? 'executing' : $o['status'], + 'status_type' => $o['status'] === 0 ? 'executing' : $o['status'], 'profitRate' => $o['profit_rate'] ]; - if ($o['status'] === 'pending') { + if ($o['status'] === 0) { $row['status'] = __('executing'); $row['totalSeconds'] = $o['duration']; $elapsed = time() - strtotime($o['created_at']); @@ -118,10 +118,10 @@ if ($action === 'get_orders') { 'price' => $o['price'], 'amount' => $o['amount'], 'total' => ($o['price'] * $o['amount']), - 'status' => $o['status'] === 'filled' ? __('approved') : __('pending'), + 'status' => $o['status'] === 'filled' ? __(3) : __(0), 'status_type' => $o['status'] ]; - if ($o['status'] === 'pending') $open[] = $row; + if ($o['status'] === 0) $open[] = $row; else $settlement[] = $row; } } elseif ($tab === 'contract') { @@ -166,10 +166,10 @@ if ($action === 'recharge') { exit; } - $stmt = $db->prepare("INSERT INTO finance_requests (user_id, type, amount, symbol, payment_method, tx_hash, fiat_amount, fiat_currency, status, ip_address) VALUES (?, 'recharge', ?, ?, ?, ?, ?, ?, 'pending', ?)"); + $stmt = $db->prepare("INSERT INTO finance_requests (user_id, type, amount, symbol, payment_method, tx_hash, fiat_amount, fiat_currency, status, ip_address) VALUES (?, 'recharge', ?, ?, ?, ?, ?, ?, 0, ?)"); $stmt->execute([$user_id, $amount, $symbol, $method, $tx_hash, $fiat_amount, $fiat_currency, getRealIP()]); - echo json_encode(['success' => true]); + echo json_encode(['success' => true, 'id' => $db->lastInsertId()]); exit; } @@ -201,11 +201,11 @@ if ($action === 'withdraw') { ->execute([$amount, $user_id, $symbol]); // Record request - $stmt = $db->prepare("INSERT INTO finance_requests (user_id, type, amount, symbol, payment_details, fiat_amount, fiat_currency, status, ip_address) VALUES (?, 'withdrawal', ?, ?, ?, ?, ?, 'pending', ?)"); + $stmt = $db->prepare("INSERT INTO finance_requests (user_id, type, amount, symbol, payment_details, fiat_amount, fiat_currency, status, ip_address) VALUES (?, 'withdrawal', ?, ?, ?, ?, ?, 0, ?)"); $stmt->execute([$user_id, $amount, $symbol, $address, $fiat_amount, $fiat_currency, getRealIP()]); // Add to transactions as pending - $db->prepare("INSERT INTO transactions (user_id, type, amount, symbol, status, ip_address) VALUES (?, 'withdrawal', ?, ?, 'pending', ?)") + $db->prepare("INSERT INTO transactions (user_id, type, amount, symbol, status, ip_address) VALUES (?, 'withdrawal', ?, ?, 0, ?)") ->execute([$user_id, $amount, $symbol, getRealIP()]); $db->commit(); diff --git a/api/recharge_status.php b/api/recharge_status.php new file mode 100644 index 0000000..14c9dda --- /dev/null +++ b/api/recharge_status.php @@ -0,0 +1,38 @@ + 'Unauthorized']); + exit; +} + +$order_id = $_GET['id'] ?? null; +if (!$order_id) { + echo json_encode(['error' => 'Missing order ID']); + exit; +} + +try { + $stmt = db()->prepare("SELECT status, account_bank, account_number, account_name, amount FROM finance_requests WHERE id = ? AND user_id = ?"); + $stmt->execute([$order_id, $_SESSION['user_id']]); + $order = $stmt->fetch(); + + if (!$order) { + echo json_encode(['error' => 'Order not found']); + exit; + } + + echo json_encode([ + 'success' => true, + 'status' => (int)$order['status'], + 'account_bank' => $order['account_bank'], + 'account_number' => $order['account_number'], + 'account_name' => $order['account_name'], + 'amount' => $order['amount'] + ]); +} catch (Exception $e) { + echo json_encode(['error' => $e->getMessage()]); +} diff --git a/assets/images/chat/1771655065_69994f99f2344.png b/assets/images/chat/1771655065_69994f99f2344.png new file mode 100644 index 0000000..8a6f72d Binary files /dev/null and b/assets/images/chat/1771655065_69994f99f2344.png differ diff --git a/assets/images/chat/1771655134_69994fdee33f1.png b/assets/images/chat/1771655134_69994fdee33f1.png new file mode 100644 index 0000000..8a6f72d Binary files /dev/null and b/assets/images/chat/1771655134_69994fdee33f1.png differ diff --git a/assets/images/chat/1771655951_6999530f00e14.jpeg b/assets/images/chat/1771655951_6999530f00e14.jpeg new file mode 100644 index 0000000..a5ac901 Binary files /dev/null and b/assets/images/chat/1771655951_6999530f00e14.jpeg differ diff --git a/assets/images/chat/1771656002_699953428960b.png b/assets/images/chat/1771656002_699953428960b.png new file mode 100644 index 0000000..8a6f72d Binary files /dev/null and b/assets/images/chat/1771656002_699953428960b.png differ diff --git a/assets/pasted-20260221-045550-81bebed8.png b/assets/pasted-20260221-045550-81bebed8.png new file mode 100644 index 0000000..b42ca43 Binary files /dev/null and b/assets/pasted-20260221-045550-81bebed8.png differ diff --git a/assets/pasted-20260221-051628-34da2f6f.png b/assets/pasted-20260221-051628-34da2f6f.png new file mode 100644 index 0000000..e27fe23 Binary files /dev/null and b/assets/pasted-20260221-051628-34da2f6f.png differ diff --git a/assets/pasted-20260221-053332-cce002eb.png b/assets/pasted-20260221-053332-cce002eb.png new file mode 100644 index 0000000..856a5f7 Binary files /dev/null and b/assets/pasted-20260221-053332-cce002eb.png differ diff --git a/assets/pasted-20260221-054028-dd60f54d.png b/assets/pasted-20260221-054028-dd60f54d.png new file mode 100644 index 0000000..4451ff4 Binary files /dev/null and b/assets/pasted-20260221-054028-dd60f54d.png differ diff --git a/db/config.php b/db/config.php index 5b28728..bdb38ff 100644 --- a/db/config.php +++ b/db/config.php @@ -28,7 +28,7 @@ function getRealIP() { } function getUserTotalRecharge($userId) { - $stmt = db()->prepare("SELECT SUM(amount) FROM finance_requests WHERE user_id = ? AND type='recharge' AND status='approved' AND symbol='USDT'"); + $stmt = db()->prepare("SELECT SUM(amount) FROM finance_requests WHERE user_id = ? AND type='recharge' AND status=3 AND symbol='USDT'"); $stmt->execute([$userId]); return (float)$stmt->fetchColumn() ?: 0; } diff --git a/db/database.sql b/db/database.sql index 6d02812..ea6dcee 100644 --- a/db/database.sql +++ b/db/database.sql @@ -70,7 +70,7 @@ CREATE TABLE `binary_orders` ( `profit_rate` decimal(5,2) NOT NULL, `entry_price` decimal(20,8) NOT NULL, `close_price` decimal(20,8) DEFAULT NULL, - `status` enum('pending','won','lost','cancelled') DEFAULT 'pending', + `status` enum(0,'won','lost','cancelled') DEFAULT 0, `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', `created_at` timestamp NULL DEFAULT current_timestamp(), `ip_address` varchar(45) DEFAULT NULL, @@ -248,7 +248,7 @@ CREATE TABLE `finance_requests` ( `type` enum('recharge','withdrawal') NOT NULL, `amount` decimal(20,8) NOT NULL, `symbol` varchar(10) DEFAULT 'USDT', - `status` enum('pending','approved','rejected') DEFAULT 'pending', + `status` enum(0,3,4) DEFAULT 0, `payment_method` varchar(50) DEFAULT NULL, `payment_details` text DEFAULT NULL, `rejection_reason` text DEFAULT NULL, @@ -269,30 +269,30 @@ CREATE TABLE `finance_requests` ( LOCK TABLES `finance_requests` WRITE; /*!40000 ALTER TABLE `finance_requests` DISABLE KEYS */; INSERT INTO `finance_requests` VALUES -(1,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 04:45:54',NULL,'2026-02-18 04:46:29',NULL,NULL), -(2,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:15:15',NULL,'2026-02-18 06:16:15',NULL,NULL), -(3,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:33:05',NULL,'2026-02-18 06:33:17',NULL,NULL), -(4,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR: 50000)',NULL,NULL,'','2026-02-18 06:37:57',NULL,'2026-02-18 06:38:22',NULL,NULL), -(5,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:54:02',NULL,'2026-02-18 06:54:16',1000.00,'MYR'), -(6,2,'withdrawal',9249.28000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 06:54:44',NULL,'2026-02-18 06:54:58',44119.07,'MYR'), -(7,2,'recharge',10000.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 06:56:22',NULL,'2026-02-18 06:56:45',10000.00,'USD'), -(8,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 07:09:10',NULL,'2026-02-18 07:10:11',100.00,'USD'), -(9,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 08:13:47',NULL,'2026-02-18 08:14:10',1000.00,'USD'), -(10,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 09:05:05',NULL,'2026-02-18 09:05:52',100.00,'USD'), -(11,2,'withdrawal',100.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:06:13',NULL,'2026-02-18 09:06:48',100.00,'USD'), -(12,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 09:26:51',NULL,'2026-02-18 09:27:12',1000.00,'MYR'), -(13,2,'withdrawal',700.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:27:38',NULL,'2026-02-18 09:27:52',700.00,'USD'), -(14,2,'recharge',746.27000000,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:17:06',NULL,'2026-02-18 11:18:57',1000.00,'SGD'), -(15,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 11:18:24',NULL,'2026-02-18 11:19:04',4770.00,'MYR'), -(16,2,'recharge',1000.00000000,'USDT','approved','TRC20',NULL,NULL,'','2026-02-18 11:21:13',NULL,'2026-02-18 11:21:33',NULL,NULL), -(17,2,'recharge',746.26865672,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:41:32',NULL,'2026-02-18 11:41:46',1000.00,'SGD'), -(18,2,'recharge',12820.51282051,'USDT','approved','法币充值 (MYR)',NULL,NULL,'','2026-02-18 15:19:59',NULL,'2026-02-18 15:20:45',50000.00,'MYR'), -(19,2,'withdrawal',4000.00000000,'USDT','approved',NULL,'法币提现 (USD)',NULL,NULL,'2026-02-19 02:14:37',NULL,'2026-02-19 02:15:22',4000.00,'USD'), -(20,2,'recharge',1447.17800289,'USDT','approved','法币充值 (CNY)',NULL,NULL,'','2026-02-19 02:17:27',NULL,'2026-02-19 02:17:53',10000.00,'CNY'), -(21,2,'withdrawal',857.00000000,'USDT','approved',NULL,'法币提现 (JPY)',NULL,NULL,'2026-02-19 02:22:07',NULL,'2026-02-19 02:45:31',132337.94,'JPY'), -(22,2,'recharge',3177.62948840,'USDT','approved','法币充值 (TWD)',NULL,NULL,'','2026-02-19 02:22:40',NULL,'2026-02-19 02:42:46',100000.00,'TWD'), -(23,2,'withdrawal',21000.00000000,'USDT','approved',NULL,'法币提现 (USD)',NULL,NULL,'2026-02-19 02:42:12',NULL,'2026-02-19 02:45:37',21000.00,'USD'), -(24,2,'recharge',20000.00000000,'USDT','approved','法币充值 (USD)',NULL,NULL,'','2026-02-19 07:07:28',NULL,'2026-02-19 07:07:42',20000.00,'USD'); +(1,2,'recharge',209.64000000,'USDT',3,'Fiat (MYR)',NULL,NULL,'','2026-02-18 04:45:54',NULL,'2026-02-18 04:46:29',NULL,NULL), +(2,2,'recharge',10.00000000,'USDT',3,'Fiat (MYR)',NULL,NULL,'','2026-02-18 06:15:15',NULL,'2026-02-18 06:16:15',NULL,NULL), +(3,2,'recharge',10.00000000,'USDT',3,'Fiat (MYR)',NULL,NULL,'','2026-02-18 06:33:05',NULL,'2026-02-18 06:33:17',NULL,NULL), +(4,2,'recharge',10.00000000,'USDT',3,'Fiat (MYR: 50000)',NULL,NULL,'','2026-02-18 06:37:57',NULL,'2026-02-18 06:38:22',NULL,NULL), +(5,2,'recharge',209.64000000,'USDT',3,'Fiat (MYR)',NULL,NULL,'','2026-02-18 06:54:02',NULL,'2026-02-18 06:54:16',1000.00,'MYR'), +(6,2,'withdrawal',9249.28000000,'USDT',3,NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 06:54:44',NULL,'2026-02-18 06:54:58',44119.07,'MYR'), +(7,2,'recharge',10000.00000000,'USDT',3,'Fiat (USD)',NULL,NULL,'','2026-02-18 06:56:22',NULL,'2026-02-18 06:56:45',10000.00,'USD'), +(8,2,'recharge',100.00000000,'USDT',3,'Fiat (USD)',NULL,NULL,'','2026-02-18 07:09:10',NULL,'2026-02-18 07:10:11',100.00,'USD'), +(9,2,'withdrawal',1000.00000000,'USDT',3,NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 08:13:47',NULL,'2026-02-18 08:14:10',1000.00,'USD'), +(10,2,'recharge',100.00000000,'USDT',3,'Fiat (USD)',NULL,NULL,'','2026-02-18 09:05:05',NULL,'2026-02-18 09:05:52',100.00,'USD'), +(11,2,'withdrawal',100.00000000,'USDT',3,NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:06:13',NULL,'2026-02-18 09:06:48',100.00,'USD'), +(12,2,'recharge',209.64000000,'USDT',3,'Fiat (MYR)',NULL,NULL,'','2026-02-18 09:26:51',NULL,'2026-02-18 09:27:12',1000.00,'MYR'), +(13,2,'withdrawal',700.00000000,'USDT',3,NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:27:38',NULL,'2026-02-18 09:27:52',700.00,'USD'), +(14,2,'recharge',746.27000000,'USDT',3,'Fiat (SGD)',NULL,NULL,'','2026-02-18 11:17:06',NULL,'2026-02-18 11:18:57',1000.00,'SGD'), +(15,2,'withdrawal',1000.00000000,'USDT',3,NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 11:18:24',NULL,'2026-02-18 11:19:04',4770.00,'MYR'), +(16,2,'recharge',1000.00000000,'USDT',3,'TRC20',NULL,NULL,'','2026-02-18 11:21:13',NULL,'2026-02-18 11:21:33',NULL,NULL), +(17,2,'recharge',746.26865672,'USDT',3,'Fiat (SGD)',NULL,NULL,'','2026-02-18 11:41:32',NULL,'2026-02-18 11:41:46',1000.00,'SGD'), +(18,2,'recharge',12820.51282051,'USDT',3,'法币充值 (MYR)',NULL,NULL,'','2026-02-18 15:19:59',NULL,'2026-02-18 15:20:45',50000.00,'MYR'), +(19,2,'withdrawal',4000.00000000,'USDT',3,NULL,'法币提现 (USD)',NULL,NULL,'2026-02-19 02:14:37',NULL,'2026-02-19 02:15:22',4000.00,'USD'), +(20,2,'recharge',1447.17800289,'USDT',3,'法币充值 (CNY)',NULL,NULL,'','2026-02-19 02:17:27',NULL,'2026-02-19 02:17:53',10000.00,'CNY'), +(21,2,'withdrawal',857.00000000,'USDT',3,NULL,'法币提现 (JPY)',NULL,NULL,'2026-02-19 02:22:07',NULL,'2026-02-19 02:45:31',132337.94,'JPY'), +(22,2,'recharge',3177.62948840,'USDT',3,'法币充值 (TWD)',NULL,NULL,'','2026-02-19 02:22:40',NULL,'2026-02-19 02:42:46',100000.00,'TWD'), +(23,2,'withdrawal',21000.00000000,'USDT',3,NULL,'法币提现 (USD)',NULL,NULL,'2026-02-19 02:42:12',NULL,'2026-02-19 02:45:37',21000.00,'USD'), +(24,2,'recharge',20000.00000000,'USDT',3,'法币充值 (USD)',NULL,NULL,'','2026-02-19 07:07:28',NULL,'2026-02-19 07:07:42',20000.00,'USD'); /*!40000 ALTER TABLE `finance_requests` ENABLE KEYS */; UNLOCK TABLES; @@ -419,7 +419,7 @@ CREATE TABLE `spot_orders` ( `price` decimal(20,8) DEFAULT NULL, `amount` decimal(20,8) NOT NULL, `filled` decimal(20,8) DEFAULT 0.00000000, - `status` enum('pending','filled','cancelled') DEFAULT 'pending', + `status` enum(0,'filled','cancelled') DEFAULT 0, `created_at` timestamp NULL DEFAULT current_timestamp(), `ip_address` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) @@ -548,7 +548,7 @@ INSERT INTO `transactions` VALUES (5,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:33:17',NULL), (6,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:38:22',NULL), (7,2,'recharge',209.64000000,'USDT','completed','2026-02-18 06:54:16',NULL), -(8,2,'withdrawal',9249.28000000,'USDT','pending','2026-02-18 06:54:44',NULL), +(8,2,'withdrawal',9249.28000000,'USDT',0,'2026-02-18 06:54:44',NULL), (9,2,'recharge',10000.00000000,'USDT','completed','2026-02-18 06:56:45',NULL), (10,2,'recharge',100.00000000,'USDT','completed','2026-02-18 07:10:11',NULL), (11,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59',NULL), diff --git a/includes/footer.php b/includes/footer.php index e57fb10..312bcca 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -229,7 +229,7 @@ csFileInput.addEventListener('change', async () => { // Create local preview for "0 latency" const localUrl = URL.createObjectURL(file); const tempId = 'temp_img_' + Date.now(); - const localMsgHtml = ``; + const localMsgHtml = ``; appendMessageHTML({ id: tempId, @@ -339,6 +339,9 @@ function appendMessageHTML(m) { const isPaymentInfo = text.startsWith('[PAYMENT_INFO]'); let displayMsg = text; + if (isImage && !displayMsg.includes('chat-img-preview')) { + displayMsg = displayMsg.replace('备注
${info.note}
` : ''} +
+
温馨提示
+
请严格按照页面展示的账户信息进行转账,转账金额需与订单金额保持一致。
+
`; } catch(e) { displayMsg = '[支付信息错误]'; } diff --git a/includes/header.php b/includes/header.php index e17505b..5499114 100644 --- a/includes/header.php +++ b/includes/header.php @@ -460,7 +460,7 @@ if (isset($_SESSION['user_id'])) { __('unverified'), 1 => __('pending'), 2 => __('verified'), 3 => __('rejected')]; + $statusMap = [0 => __('unverified'), 1 => __(0), 2 => __('verified'), 3 => __(4)]; echo $statusMap[$user['kyc_status'] ?? 0] ?? __('unverified'); ?> @@ -496,3 +496,62 @@ if (isset($_SESSION['user_id'])) { + + +
+ Preview +
+ + diff --git a/includes/lang.php b/includes/lang.php index 682de1b..3fd64c4 100644 --- a/includes/lang.php +++ b/includes/lang.php @@ -46,8 +46,8 @@ $translations = [ 'agree_terms_error' => '请同意服务协议', 'mobile_verify' => '手机验证码', 'email_verify' => '邮箱验证码', - 'approved' => '通过', - 'rejected' => '拒绝', + 3 => '通过', + 4 => '拒绝', 'login_admin_error' => '管理员请通过后台页面登录', 'fill_full_info' => '请填写完整信息', 'verification_code' => '验证码', @@ -206,7 +206,7 @@ $translations = [ 'uniswap' => 'UNI', 'site_title' => '全球领先的数字资产交易平台', 'unverified' => '未认证', - 'pending' => '审核中', + 0 => '审核中', 'verified' => '已认证', 'real_name' => '实名认证', 'credit_score' => '信用分', @@ -401,7 +401,7 @@ $translations = [ 'pnl' => '盈亏', 'completed' => '已完成', 'lost' => '亏损', - 'rejected' => '已拒绝', + 4 => '已拒绝', 'cancelled' => '已取消', 'app_store' => '苹果商店', 'google_play' => '谷歌商店', @@ -587,6 +587,23 @@ $translations = [ 'api_doc_desc' => '为开发者提供的完整 API 集成文档。', 'contact_sup_title' => '联系支持', 'contact_sup_desc' => '如果您遇到问题,我们的团队将全天候为您服务。', + 'matched_successfully' => '匹配成功', + 'getting_account_details' => '正在获取账户详情', + 'receiving_bank' => '收款银行', + 'receiving_account' => '收款账号', + 'receiving_name' => '收款姓名', + 'recharge_final_notice' => '匹配成功,请严格按照页面展示的账户信息进行转账,转账金额需与订单金额保持一致,请勿分笔转账或修改金额。转账完成后请点击下方按钮,并将凭证提供给客服。', + 'remaining_time' => '剩余时间', + 'secure_pay' => '安全支付', + 'encrypted_channel' => '加密通道', + 'complete_transfer' => '完成转账', + 'waiting_allocation' => '正在分配中', + 'waiting_countdown' => '等待倒计时', + 'secure_channel' => '安全加密通道', + 'waiting_system_allocation' => '等待系统分配账户', + 'recharge_request_submitted' => '充值申请已提交', + 'recharge_request_submitted_text' => '您的充值申请已成功提交,请耐心等待审核。', + 'matched_desc_short' => '系统已为您分配专属收款账户,请等待详情显示。', 'fees_content' => 'BYRO采用透明的费率结构,旨在为用户提供最具竞争力的交易成本。', ], 'en' => [ @@ -627,8 +644,8 @@ $translations = [ 'agree_terms_error' => 'Please agree to terms', 'mobile_verify' => 'Mobile Code', 'email_verify' => 'Email Code', - 'approved' => 'Approved', - 'rejected' => 'Rejected', + 3 => 'Approved', + 4 => 'Rejected', 'login_admin_error' => 'Admin please login via backend', 'fill_full_info' => 'Please fill in full info', 'verification_code' => 'Verification Code', @@ -794,7 +811,7 @@ $translations = [ 'uniswap' => 'UNI', 'site_title' => 'Leading Digital Asset Platform', 'unverified' => 'Unverified', - 'pending' => 'Pending', + 0 => 'Pending', 'verified' => 'Verified', 'real_name' => 'Real Name', 'credit_score' => 'Credit Score', @@ -982,7 +999,7 @@ $translations = [ 'pnl' => 'PnL', 'completed' => 'Completed', 'lost' => 'Lost', - 'rejected' => 'Rejected', + 4 => 'Rejected', 'cancelled' => 'Cancelled', 'app_store' => 'App Store', 'google_play' => 'Google Play', @@ -1077,6 +1094,23 @@ $translations = [ 'security_step1' => 'For your asset security, please bind your phone and email, and enable Google Verification.', 'security_step2' => 'Please keep your login and trade passwords safe and never disclose them to others.', 'trade_password' => 'Trade Password', + 'matched_successfully' => 'Matched Successfully', + 'getting_account_details' => 'Getting Account Details', + 'receiving_bank' => 'Receiving Bank', + 'receiving_account' => 'Receiving Account', + 'receiving_name' => 'Receiving Name', + 'recharge_final_notice' => 'Matched successfully. Please strictly follow the account information displayed on the page for transfer. The transfer amount must be consistent with the order amount. Do not split transfers or modify amounts. After transfer, click the button below and provide the voucher to support.', + 'remaining_time' => 'Remaining Time', + 'secure_pay' => 'Secure Pay', + 'encrypted_channel' => 'Encrypted Channel', + 'complete_transfer' => 'Complete Transfer', + 'waiting_allocation' => 'Allocating', + 'waiting_countdown' => 'Waiting Countdown', + 'secure_channel' => 'Secure Channel', + 'waiting_system_allocation' => 'Waiting for System Allocation', + 'recharge_request_submitted' => 'Recharge Submitted', + 'recharge_request_submitted_text' => 'Your recharge request has been submitted successfully, please wait for review.', + 'matched_desc_short' => 'The system has allocated an exclusive receiving account for you. Please wait for the details.', 'aud_name' => 'AUD', 'cad_name' => 'CAD', 'chf_name' => 'CHF', diff --git a/includes/terminal_layout.php b/includes/terminal_layout.php index 00900c3..2165a72 100644 --- a/includes/terminal_layout.php +++ b/includes/terminal_layout.php @@ -1073,7 +1073,7 @@ function renderTerminal($activeTab = 'spot') { const tr = document.createElement('tr'); const isProfit = row.status_type === 'won' || row.status_type === 'Profit'; const isLoss = row.status_type === 'lost' || row.status_type === 'loss' || row.status_type === 'Loss'; - const isExecuting = row.status_type === 'executing' || row.status_type === 'pending' || row.status_type === 'open'; + const isExecuting = row.status_type === 'executing' || row.status_type === 0 || row.status_type === 'open'; const statusClass = isProfit ? 'text-success' : (isLoss ? 'text-danger' : 'text-info'); const statusBg = isProfit ? 'bg-success' : (isLoss ? 'bg-danger' : 'bg-info'); diff --git a/kyc.php b/kyc.php index eb8be9a..4045769 100644 --- a/kyc.php +++ b/kyc.php @@ -97,7 +97,7 @@ $kycStatus = $userData['kyc_status'] ?? 0;
-

+

diff --git a/orders.php b/orders.php index c49408d..3a88c5e 100644 --- a/orders.php +++ b/orders.php @@ -129,13 +129,13 @@ $types_map = [ - + - + @@ -158,7 +158,7 @@ $types_map = [ $type = $types_map[$typeKey] ?? ['name' => __($typeKey), 'color' => 'secondary']; $pnl = (float)($r['pnl'] ?? 0); $status = strtolower($r['status']); - $statusClass = ($status === 'completed' || $status === 'won' || $status === 'settled') ? 'text-success' : (($status === 'lost' || $status === 'rejected' || $status === 'cancelled') ? 'text-danger' : 'text-warning'); + $statusClass = ($status === 'completed' || $status === 'won' || $status === 'settled') ? 'text-success' : (($status === 'lost' || $status === 4 || $status === 'cancelled') ? 'text-danger' : 'text-warning'); ?>
diff --git a/profile.php b/profile.php index a62ccc0..b7f0a3f 100644 --- a/profile.php +++ b/profile.php @@ -75,9 +75,9 @@ $transactions = $stmt->fetchAll(); $kycStatusText = [ 0 => __('unverified'), - 1 => __('pending'), + 1 => __(0), 2 => __('verified'), - 3 => __('rejected') + 3 => __(4) ]; $kycStatusColor = [ 0 => 'text-white-50', @@ -289,8 +289,8 @@ $kycStatusColor = [ if (strpos($t['type'], 'win') !== false || $t['type'] === 'deposit' || $t['type'] === 'binary_win' || $t['type'] === 'recharge') $typeColor = 'text-success'; elseif (strpos($t['type'], 'loss') !== false || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'binary_loss') $typeColor = 'text-danger'; $prefix = ($t['type'] === 'binary_win' || $t['type'] === 'deposit' || $t['type'] === 'recharge' || $t['type'] === 'contract_settle') ? '+' : (($t['type'] === 'binary_loss' || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'contract_margin') ? '-' : ''); - $statusText = ($t['status'] === 'completed' || $t['status'] === 'approved') ? __('approved') : ($t['status'] === 'rejected' ? __('rejected') : __('pending')); - $statusClass = ($t['status'] === 'completed' || $t['status'] === 'approved') ? 'text-success' : ($t['status'] === 'rejected' ? 'text-danger' : 'text-warning'); + $statusText = ($t['status'] === 'completed' || $t['status'] === 3) ? __(3) : ($t['status'] === 4 ? __(4) : __(0)); + $statusClass = ($t['status'] === 'completed' || $t['status'] === 3) ? 'text-success' : ($t['status'] === 4 ? 'text-danger' : 'text-warning'); ?> @@ -312,8 +312,8 @@ $kycStatusColor = [
diff --git a/recharge.php b/recharge.php index 536eed0..eb89356 100644 --- a/recharge.php +++ b/recharge.php @@ -204,112 +204,104 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc