- Trade
- Place Order
+ = __('trade') ?>
+ = __('api_place_order') ?>
POST /api/v1/trade/order
- Payload example:
+ = __('api_payload_example') ?>
{
"symbol": "BTCUSDT",
"side": "buy",
diff --git a/api/chat.php b/api/chat.php
index 275522e..3772e53 100644
--- a/api/chat.php
+++ b/api/chat.php
@@ -72,7 +72,8 @@ if ($action === 'send_message') {
$stmt = db()->prepare("INSERT INTO messages (user_id, sender, message, ip_address) VALUES (?, ?, ?, ?)");
$stmt->execute([$user_id, 'user', $message, $ip]);
- echo json_encode(['success' => true]);
+ $newId = db()->lastInsertId();
+ echo json_encode(['success' => true, 'id' => $newId]);
exit;
}
@@ -88,7 +89,8 @@ if ($action === 'admin_send') {
$stmt = db()->prepare("INSERT INTO messages (user_id, admin_id, sender, message, ip_address) VALUES (?, ?, ?, ?, ?)");
$stmt->execute([$user_id, $admin_id, $sender, $message, $target_ip]);
- echo json_encode(['success' => true]);
+ $newId = db()->lastInsertId();
+ echo json_encode(['success' => true, 'id' => $newId]);
exit;
}
diff --git a/api/finance.php b/api/finance.php
index ad834c7..14024ef 100644
--- a/api/finance.php
+++ b/api/finance.php
@@ -1,5 +1,6 @@
$o['id'],
'time' => $o['created_at'],
'pair' => $o['symbol'] . '/USDT',
- 'type' => 'Binary',
- 'side' => ($o['direction'] === 'up' || $o['direction'] === 'buy') ? 'Buy Up' : 'Buy Down',
+ 'type' => __('trade_binary'),
+ 'type_raw' => 'binary',
+ 'side' => ($o['direction'] === 'up' || $o['direction'] === 'buy') ? __('buy_up') : __('buy_down'),
'side_type' => ($o['direction'] === 'up' || $o['direction'] === 'buy') ? 'up' : 'down',
'price' => $o['entry_price'],
'amount' => $o['amount'],
'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' ? 'Profit' : ($o['status'] === 'lost' ? 'Loss' : 'Executing')),
+ 'status' => ($o['status'] === 'won' ? __('won') : ($o['status'] === 'lost' ? __('loss') : __('executing'))),
+ 'status_type' => $o['status'] === 'pending' ? 'executing' : $o['status'],
'profitRate' => $o['profit_rate']
];
if ($o['status'] === 'pending') {
- $row['status'] = 'Executing';
+ $row['status'] = __('executing');
$row['totalSeconds'] = $o['duration'];
$elapsed = time() - strtotime($o['created_at']);
$row['secondsLeft'] = max(0, $o['duration'] - $elapsed);
@@ -108,13 +111,15 @@ if ($action === 'get_orders') {
'id' => $o['id'],
'time' => $o['created_at'],
'pair' => $o['symbol'] . '/USDT',
- 'type' => 'Spot',
- 'side' => ucfirst($o['side']),
+ 'type' => __('trade_spot'),
+ 'type_raw' => 'spot',
+ 'side' => $o['side'] === 'buy' ? __('buy') : __('sell'),
'side_type' => $o['side'],
'price' => $o['price'],
'amount' => $o['amount'],
'total' => ($o['price'] * $o['amount']),
- 'status' => ucfirst($o['status'])
+ 'status' => $o['status'] === 'filled' ? __('approved') : __('pending'),
+ 'status_type' => $o['status']
];
if ($o['status'] === 'pending') $open[] = $row;
else $settlement[] = $row;
@@ -128,14 +133,16 @@ if ($action === 'get_orders') {
'id' => $o['id'],
'time' => $o['created_at'],
'pair' => $o['symbol'] . '/USDT',
- 'type' => 'Contract',
- 'side' => ucfirst($o['direction']),
+ 'type' => __('trade_contract'),
+ 'type_raw' => 'contract',
+ 'side' => $o['direction'] === 'long' ? __('long') : __('short'),
'side_type' => $o['direction'] === 'long' ? 'up' : 'down',
'price' => $o['entry_price'],
'amount' => $o['amount'],
'pnl' => $o['profit'],
'total' => ($o['amount'] / $o['leverage']) + $o['profit'],
- 'status' => ucfirst($o['status'])
+ 'status' => $o['status'] === 'open' ? __('executing') : ($o['profit'] >= 0 ? __('won') : __('loss')),
+ 'status_type' => $o['status'] === 'open' ? 'executing' : ($o['profit'] >= 0 ? 'won' : 'loss')
];
if ($o['status'] === 'open') $open[] = $row;
else $settlement[] = $row;
diff --git a/app.php b/app.php
index c743481..8a5fc13 100644
--- a/app.php
+++ b/app.php
@@ -2,52 +2,269 @@
require_once __DIR__ . '/includes/lang.php';
require_once __DIR__ . '/includes/header.php';
?>
-
-
-
-
-
-
-
-
-
-
-
Download on the
-
App Store
+
+
+
+
+
+
+
+ = __('support_anywhere') ?>
+
+
+ = __('app_mockup_desc') ?>
+
+
+
-
-
-
-
-
GET IT ON
-
Google Play
-
-
-
-
-
-
-

-
Scan to Download
+
+
+
 ?>)
+
+
+
= __('scan_download') ?>
+
= __('scan_qr_to_download') ?>
+
-
-
- - Real-time alerts
- - Full trading features
- - 2FA security
- - 24/7 Live chat
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
= __('real_time_alerts') ?>
+
= __('full_trading_features') ?>
+
+
+
+
+
+
+
+
= __('two_fa_security') ?>
+
= __('inst_security_desc') ?>
+
+
+
+
+
+
+
+
= __('live_chat_247') ?>
+
= __('support_247') ?>
+
+
-
+
+
+
+
+
+
diff --git a/assets/pasted-20260218-092326-d1106483.png b/assets/pasted-20260218-092326-d1106483.png
new file mode 100644
index 0000000..61234a1
Binary files /dev/null and b/assets/pasted-20260218-092326-d1106483.png differ
diff --git a/assets/pasted-20260218-122005-f3b20f13.png b/assets/pasted-20260218-122005-f3b20f13.png
new file mode 100644
index 0000000..5ee36b2
Binary files /dev/null and b/assets/pasted-20260218-122005-f3b20f13.png differ
diff --git a/assets/pasted-20260218-122939-e40f3181.png b/assets/pasted-20260218-122939-e40f3181.png
new file mode 100644
index 0000000..c7da84b
Binary files /dev/null and b/assets/pasted-20260218-122939-e40f3181.png differ
diff --git a/auth/login.php b/auth/login.php
index 5bead9a..13a4d28 100644
--- a/auth/login.php
+++ b/auth/login.php
@@ -9,7 +9,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$password = $_POST['password'] ?? '';
if (empty($account) || empty($password)) {
- $error = 'Please fill in all fields';
+ $error = __('fill_full_info');
} else {
$stmt = db()->prepare("SELECT * FROM users WHERE username = ? OR email = ?");
$stmt->execute([$account, $account]);
@@ -28,7 +28,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
exit;
}
} else {
- $error = 'Invalid account or password';
+ $error = __('invalid_account_pwd');
}
}
}
diff --git a/auth/register.php b/auth/register.php
index 95dc517..b52595f 100644
--- a/auth/register.php
+++ b/auth/register.php
@@ -26,15 +26,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$error = __('fill_full_info');
} elseif ($password !== $confirm_password) {
$error = __('pwd_mismatch');
- } elseif ($email_verify_enabled && $reg_type === 'email' && empty($verify_code)) {
- $error = __('enter_verify_code') ?? 'Please enter verification code';
+ } elseif ($email_verify_enabled && empty($verify_code)) {
+ $error = __('enter_verify_code');
} elseif (!$agree_all) {
- $error = __('agree_terms_error') ?? 'Please agree to terms';
+ $error = __('agree_terms_error');
} else {
- if ($email_verify_enabled && $reg_type === 'email' && $verify_code !== '123456') {
+ if ($email_verify_enabled && $verify_code !== '123456') {
// Check session for actual code if not demo
if (!isset($_SESSION['email_code']) || $verify_code !== $_SESSION['email_code']) {
- $error = __('verify_code_error') ?? 'Invalid verification code';
+ $error = __('verify_code_error');
}
}
@@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
header('Location: /');
exit;
} catch (PDOException $e) {
- $error = '账号已存在或数据库错误';
+ $error = __('account_exists');
}
}
}
@@ -260,7 +260,7 @@ function setRegType(type) {
label.innerText = '= __('mobile_number') ?>';
input.placeholder = '= __('mobile_number') ?>';
input.type = 'text';
- if (verifyLabel) verifyLabel.innerText = '= __('mobile_verify') ?? __('verification_code') ?>';
+ if (verifyLabel) verifyLabel.innerText = '= __('mobile_verify') ?>';
}
}
diff --git a/fees.php b/fees.php
index 40a5fb7..aaef625 100644
--- a/fees.php
+++ b/fees.php
@@ -7,20 +7,20 @@ require_once __DIR__ . '/includes/header.php';
-
Spot Trading Fees
+
= __('spot_fees') ?>
- | Tier |
- 30d Trading Volume |
- Maker Fee |
- Taker Fee |
+ = __('tier') ?> |
+ = __('trading_vol_30d') ?> |
+ = __('maker_fee') ?> |
+ = __('taker_fee') ?> |
- | VIP 0 (Regular) |
+ VIP 0 (= __('regular') ?>) |
< $10,000 |
0.100% |
0.100% |
@@ -47,19 +47,19 @@ require_once __DIR__ . '/includes/header.php';
-
Contract Trading Fees
+
= __('contract_fees') ?>
- | Tier |
- Maker Fee |
- Taker Fee |
+ = __('tier') ?> |
+ = __('maker_fee') ?> |
+ = __('taker_fee') ?> |
- | Regular |
+ = __('regular') ?> |
0.020% |
0.050% |
diff --git a/includes/footer.php b/includes/footer.php
index 874883d..eb9e4c9 100644
--- a/includes/footer.php
+++ b/includes/footer.php
@@ -221,7 +221,7 @@ csFileInput.addEventListener('change', async () => {
formData.append('file', file);
formData.append('action', 'upload_image');
- appendMessage('user', ' Uploading image...');
+ appendMessage('user', ' = __("uploading") ?>');
try {
const resp = await fetch('/api/chat.php', {
@@ -256,15 +256,18 @@ csForm.addEventListener('submit', async (e) => {
const msg = csInput.value.trim();
if (!msg) return;
- appendMessage('user', msg);
csInput.value = '';
try {
- await fetch('/api/chat.php?action=send_message', {
+ const resp = await fetch('/api/chat.php?action=send_message', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `message=${encodeURIComponent(msg)}`
});
+ const data = await resp.json();
+ if (data.success) {
+ pollMessages();
+ }
} catch (err) {
console.error('Failed to send message:', err);
}
@@ -274,7 +277,7 @@ function appendMessage(sender, text) {
const div = document.createElement('div');
div.className = `mb-2 d-flex ${sender === 'user' ? 'justify-content-end' : 'justify-content-start'}`;
div.innerHTML = `
-
+
${text}
`;
@@ -283,20 +286,23 @@ function appendMessage(sender, text) {
}
// Polling for new messages
-let lastCount = 0;
-setInterval(async () => {
+let lastMsgId = 0;
+async function pollMessages() {
if (csBox.classList.contains('d-none')) return;
try {
const resp = await fetch('/api/chat.php?action=get_messages');
const data = await resp.json();
- if (data && data.length > lastCount) {
- // Find only new messages
- const newMessages = data.slice(lastCount);
- newMessages.forEach(m => appendMessage(m.sender, m.message));
- lastCount = data.length;
+ if (data && data.length > 0) {
+ data.forEach(m => {
+ if (parseInt(m.id) > lastMsgId) {
+ appendMessage(m.sender, m.message);
+ lastMsgId = parseInt(m.id);
+ }
+ });
}
} catch (err) {}
-}, 1000);
+}
+setInterval(pollMessages, 1000);