Autosave: 20260218-123410
This commit is contained in:
parent
c6e1a23d69
commit
e3736cc048
16
about.php
16
about.php
@ -8,28 +8,26 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<h1 class="mb-4 fw-bold"><?php echo __('about_us'); ?></h1>
|
||||
<div class="card bg-dark border-secondary p-4">
|
||||
<p class="lead mb-4"><?php echo __('about_content'); ?></p>
|
||||
<h3 class="mt-4 mb-3">Our Mission</h3>
|
||||
<h3 class="mt-4 mb-3"><?= __('our_mission') ?></h3>
|
||||
<p class="text-muted">
|
||||
To make digital asset trading accessible, secure, and intuitive for everyone, everywhere.
|
||||
We believe in the power of blockchain to transform the global financial landscape.
|
||||
<?= __('mission_content') ?>
|
||||
</p>
|
||||
<h3 class="mt-4 mb-3">Global Presence</h3>
|
||||
<h3 class="mt-4 mb-3"><?= __('global_presence') ?></h3>
|
||||
<p class="text-muted">
|
||||
With offices in Singapore, London, and Tokyo, Byro serves a diverse global community.
|
||||
We are compliant with international standards and prioritize the security of our users' assets.
|
||||
<?= __('presence_content') ?>
|
||||
</p>
|
||||
<div class="row mt-5 text-center">
|
||||
<div class="col-4">
|
||||
<h2 class="fw-bold text-primary">5M+</h2>
|
||||
<p class="small text-muted">Users</p>
|
||||
<p class="small text-muted"><?= __('users') ?></p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<h2 class="fw-bold text-primary">100+</h2>
|
||||
<p class="small text-muted">Countries</p>
|
||||
<p class="small text-muted"><?= __('countries') ?></p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<h2 class="fw-bold text-primary">$10B+</h2>
|
||||
<p class="small text-muted">Daily Volume</p>
|
||||
<p class="small text-muted"><?= __('daily_volume') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -138,7 +138,7 @@ async function fetchMessages() {
|
||||
filtered.forEach(m => {
|
||||
const div = document.createElement('div');
|
||||
div.className = `msg ${m.sender === 'admin' ? 'msg-admin' : 'msg-user'}`;
|
||||
div.innerText = m.message;
|
||||
div.innerHTML = m.message;
|
||||
area.appendChild(div);
|
||||
});
|
||||
area.scrollTop = area.scrollHeight;
|
||||
@ -162,6 +162,13 @@ document.getElementById('chat-form').addEventListener('submit', async (e) => {
|
||||
fetchMessages();
|
||||
});
|
||||
|
||||
// Clear notifications when on this page
|
||||
function clearNotifications() {
|
||||
fetch('/api/admin_notifications.php?action=clear&type=messages');
|
||||
}
|
||||
setInterval(clearNotifications, 5000);
|
||||
clearNotifications();
|
||||
|
||||
setInterval(refreshUsers, 3000);
|
||||
setInterval(fetchMessages, 1000);
|
||||
refreshUsers();
|
||||
|
||||
@ -296,12 +296,28 @@ function renderAdminPage($content, $title = '后台管理') {
|
||||
}
|
||||
|
||||
function checkNotifications() {
|
||||
const currentPage = window.location.pathname;
|
||||
fetch('/api/admin_notifications.php')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const counts = data.counts;
|
||||
const total = counts.total;
|
||||
|
||||
// Auto-clear current page types
|
||||
if (currentPage.includes('finance.php')) {
|
||||
fetch('/api/admin_notifications.php?action=clear&type=finance');
|
||||
counts.recharge = 0;
|
||||
counts.withdrawal = 0;
|
||||
} else if (currentPage.includes('customer_service.php')) {
|
||||
fetch('/api/admin_notifications.php?action=clear&type=messages');
|
||||
counts.messages = 0;
|
||||
} else if (currentPage.includes('users.php')) {
|
||||
fetch('/api/admin_notifications.php?action=clear&type=users');
|
||||
counts.users = 0;
|
||||
}
|
||||
// ... other pages can be added here
|
||||
|
||||
const total = counts.recharge + counts.withdrawal + counts.kyc + counts.binary + counts.contract + counts.spot + counts.messages + counts.users;
|
||||
const soundTotal = counts.sound_total || 0;
|
||||
|
||||
// Finance badge
|
||||
|
||||
@ -11,12 +11,34 @@ if (!isset($_SESSION['user_id'])) {
|
||||
$message = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$email_verify = isset($_POST['email_verification_enabled']) ? '1' : '0';
|
||||
$stmt = db()->prepare("UPDATE system_settings SET setting_value = ? WHERE setting_key = 'email_verification_enabled'");
|
||||
$stmt->execute([$email_verify]);
|
||||
$message = 'Settings updated successfully';
|
||||
|
||||
$settings_to_update = [
|
||||
'email_verification_enabled' => $email_verify,
|
||||
'smtp_host' => $_POST['smtp_host'] ?? '',
|
||||
'smtp_port' => $_POST['smtp_port'] ?? '587',
|
||||
'smtp_user' => $_POST['smtp_user'] ?? '',
|
||||
'smtp_pass' => $_POST['smtp_pass'] ?? '',
|
||||
'smtp_secure' => $_POST['smtp_secure'] ?? 'tls',
|
||||
'mail_from_email' => $_POST['mail_from_email'] ?? '',
|
||||
'mail_from_name' => $_POST['mail_from_name'] ?? 'Byro Exchange'
|
||||
];
|
||||
|
||||
foreach ($settings_to_update as $key => $value) {
|
||||
$stmt = db()->prepare("INSERT INTO system_settings (setting_key, setting_value) VALUES (?, ?) ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)");
|
||||
$stmt->execute([$key, $value]);
|
||||
}
|
||||
|
||||
$message = '设置已更新';
|
||||
}
|
||||
|
||||
$email_verify_enabled = getSetting('email_verification_enabled', '0') === '1';
|
||||
$smtp_host = getSetting('smtp_host', '');
|
||||
$smtp_port = getSetting('smtp_port', '587');
|
||||
$smtp_user = getSetting('smtp_user', '');
|
||||
$smtp_pass = getSetting('smtp_pass', '');
|
||||
$smtp_secure = getSetting('smtp_secure', 'tls');
|
||||
$mail_from_email = getSetting('mail_from_email', '');
|
||||
$mail_from_name = getSetting('mail_from_name', 'Byro Exchange');
|
||||
|
||||
function getSetting($key, $default = null) {
|
||||
$stmt = db()->prepare("SELECT setting_value FROM system_settings WHERE setting_key = ?");
|
||||
@ -25,32 +47,96 @@ function getSetting($key, $default = null) {
|
||||
return $row ? $row['setting_value'] : $default;
|
||||
}
|
||||
|
||||
include __DIR__ . '/../includes/header.php';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="section">
|
||||
<div class="container">
|
||||
<h1>Admin Settings</h1>
|
||||
<?php if ($message): ?>
|
||||
<div style="background: var(--success); color: #fff; padding: 12px; border-radius: 4px; margin-bottom: 20px;">
|
||||
<?= $message ?>
|
||||
<div class="row">
|
||||
<div class="col-md-8 mx-auto">
|
||||
<div class="card shadow-sm border-0">
|
||||
<div class="card-header bg-white py-3">
|
||||
<h5 class="mb-0 fw-bold"><i class="bi bi-gear-fill me-2 text-primary"></i> 注册与邮件设置</h5>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="card-body p-4">
|
||||
<?php if ($message): ?>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<i class="bi bi-check-circle-fill me-2"></i><?= $message ?>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div class="mb-4">
|
||||
<label class="form-label fw-bold">注册验证</label>
|
||||
<div class="form-check form-switch p-3 bg-light rounded-3 border">
|
||||
<input class="form-check-input ms-0 me-3" type="checkbox" name="email_verification_enabled" id="email_verify" <?= $email_verify_enabled ? 'checked' : '' ?>>
|
||||
<label class="form-check-label" for="email_verify">开启邮箱/手机验证码 (注册时必须填写)</label>
|
||||
</div>
|
||||
<div class="form-text text-muted mt-2 small">开启后,用户在注册页面必须通过验证码验证。测试环境默认验证码:123456</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<h6 class="fw-bold mb-3"><i class="bi bi-envelope-at me-2 text-primary"></i> SMTP 邮件服务设置</h6>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-9">
|
||||
<label class="form-label small text-muted">SMTP 主机</label>
|
||||
<input type="text" name="smtp_host" class="form-control" value="<?= htmlspecialchars($smtp_host) ?>" placeholder="例如: smtp.gmail.com">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-label small text-muted">端口</label>
|
||||
<input type="text" name="smtp_port" class="form-control" value="<?= htmlspecialchars($smtp_port) ?>" placeholder="587">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-muted">账号 / 邮箱</label>
|
||||
<input type="text" name="smtp_user" class="form-control" value="<?= htmlspecialchars($smtp_user) ?>" placeholder="your-email@example.com">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-muted">授权码 / 密码</label>
|
||||
<input type="password" name="smtp_pass" class="form-control" value="<?= htmlspecialchars($smtp_pass) ?>" placeholder="********">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-muted">安全协议</label>
|
||||
<select name="smtp_secure" class="form-select">
|
||||
<option value="tls" <?= $smtp_secure === 'tls' ? 'selected' : '' ?>>TLS (推荐)</option>
|
||||
<option value="ssl" <?= $smtp_secure === 'ssl' ? 'selected' : '' ?>>SSL</option>
|
||||
<option value="none" <?= $smtp_secure === 'none' ? 'selected' : '' ?>>无</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label small text-muted">发件人姓名</label>
|
||||
<input type="text" name="mail_from_name" class="form-control" value="<?= htmlspecialchars($mail_from_name) ?>" placeholder="Byro Exchange">
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label class="form-label small text-muted">发件人邮箱</label>
|
||||
<input type="email" name="mail_from_email" class="form-control" value="<?= htmlspecialchars($mail_from_email) ?>" placeholder="no-reply@yourdomain.com">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-5 text-end">
|
||||
<button type="submit" class="btn btn-primary px-5 py-2 fw-bold rounded-pill shadow-sm">
|
||||
保存所有设置
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--surface); padding: 40px; border-radius: 8px; border: 1px solid var(--border);">
|
||||
<form method="POST">
|
||||
<div style="display: flex; align-items: center; gap: 12px; margin-bottom: 24px;">
|
||||
<input type="checkbox" name="email_verification_enabled" id="email_verify" <?= $email_verify_enabled ? 'checked' : '' ?> style="width: 20px; height: 20px;">
|
||||
<label for="email_verify">Enable Email Verification for Registration</label>
|
||||
</div>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin-bottom: 24px;">
|
||||
If enabled, users will see an "Email Verification Code" field during registration.
|
||||
(Demo code is 123456)
|
||||
</p>
|
||||
<button type="submit" class="btn btn-primary">Save Settings</button>
|
||||
</form>
|
||||
<div class="mt-4 p-4 bg-info bg-opacity-10 border border-info border-opacity-20 rounded-4">
|
||||
<h6 class="fw-bold text-info mb-2"><i class="bi bi-info-circle-fill me-2"></i> 关于短信验证</h6>
|
||||
<p class="small text-muted mb-0">
|
||||
目前系统通过邮件服务发送验证码。手机号注册将同样通过绑定的邮件或系统预设通道发送。如需接入特定短信网关,请联系技术支持对接 API。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include __DIR__ . '/../includes/footer.php'; ?>
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require_once __DIR__ . '/layout.php';
|
||||
renderAdminPage($content, '注册与邮件设置');
|
||||
?>
|
||||
|
||||
30
api.php
30
api.php
@ -8,43 +8,43 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="row">
|
||||
<div class="col-md-3 border-end border-secondary">
|
||||
<nav class="nav flex-column sticky-top" style="top: 100px;">
|
||||
<a class="nav-link text-white fw-bold mb-2" href="#intro">Introduction</a>
|
||||
<a class="nav-link text-muted mb-2" href="#auth">Authentication</a>
|
||||
<a class="nav-link text-muted mb-2" href="#market">Market Data</a>
|
||||
<a class="nav-link text-muted mb-2" href="#trade">Trade Endpoints</a>
|
||||
<a class="nav-link text-muted mb-2" href="#errors">Errors</a>
|
||||
<a class="nav-link text-white fw-bold mb-2" href="#intro"><?= __('api_intro') ?></a>
|
||||
<a class="nav-link text-muted mb-2" href="#auth"><?= __('api_auth') ?></a>
|
||||
<a class="nav-link text-muted mb-2" href="#market"><?= __('api_market_data') ?></a>
|
||||
<a class="nav-link text-muted mb-2" href="#trade"><?= __('api_trade_endpoints') ?></a>
|
||||
<a class="nav-link text-muted mb-2" href="#errors"><?= __('api_errors') ?></a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-md-9 ps-md-4">
|
||||
<section id="intro" class="mb-5">
|
||||
<h2 class="fw-bold">Introduction</h2>
|
||||
<p class="text-muted">Welcome to the Byro API. Our API allows you to access market data, manage your account, and execute trades programmatically. We use a RESTful architecture with JSON responses.</p>
|
||||
<h2 class="fw-bold"><?= __('api_intro') ?></h2>
|
||||
<p class="text-muted"><?= __('api_intro_desc') ?></p>
|
||||
</section>
|
||||
|
||||
<section id="auth" class="mb-5">
|
||||
<h2 class="fw-bold">Authentication</h2>
|
||||
<p class="text-muted">All private endpoints require API Key authentication. You can generate API keys in your account profile settings.</p>
|
||||
<h2 class="fw-bold"><?= __('api_auth') ?></h2>
|
||||
<p class="text-muted"><?= __('api_auth_desc') ?></p>
|
||||
<div class="bg-black p-3 rounded mb-3">
|
||||
<code class="text-success">Authorization: Bearer YOUR_API_KEY</code>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="market" class="mb-5">
|
||||
<h2 class="fw-bold">Market Data</h2>
|
||||
<h5 class="mt-4">Get Ticker</h5>
|
||||
<h2 class="fw-bold"><?= __('api_market_data') ?></h2>
|
||||
<h5 class="mt-4"><?= __('api_get_ticker') ?></h5>
|
||||
<div class="bg-black p-3 rounded mb-2">
|
||||
<code>GET /api/v1/market/ticker?symbol=BTCUSDT</code>
|
||||
</div>
|
||||
<p class="small text-muted">Returns the latest price and 24h volume for the specified symbol.</p>
|
||||
<p class="small text-muted"><?= __('api_get_ticker_desc') ?></p>
|
||||
</section>
|
||||
|
||||
<section id="trade" class="mb-5">
|
||||
<h2 class="fw-bold">Trade</h2>
|
||||
<h5 class="mt-4">Place Order</h5>
|
||||
<h2 class="fw-bold"><?= __('trade') ?></h2>
|
||||
<h5 class="mt-4"><?= __('api_place_order') ?></h5>
|
||||
<div class="bg-black p-3 rounded mb-2">
|
||||
<code class="text-info">POST /api/v1/trade/order</code>
|
||||
</div>
|
||||
<p class="small text-muted">Payload example:</p>
|
||||
<p class="small text-muted"><?= __('api_payload_example') ?></p>
|
||||
<pre class="bg-black p-3 rounded text-warning"><code>{
|
||||
"symbol": "BTCUSDT",
|
||||
"side": "buy",
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
require_once __DIR__ . '/../includes/lang.php';
|
||||
session_start();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
@ -78,18 +79,20 @@ if ($action === 'get_orders') {
|
||||
'id' => $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;
|
||||
|
||||
293
app.php
293
app.php
@ -2,52 +2,269 @@
|
||||
require_once __DIR__ . '/includes/lang.php';
|
||||
require_once __DIR__ . '/includes/header.php';
|
||||
?>
|
||||
<main class="container py-5 text-center">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-6 text-start">
|
||||
<h1 class="display-4 fw-bold mb-4"><?php echo __('app_download'); ?></h1>
|
||||
<p class="lead text-muted mb-5"><?php echo __('app_desc'); ?></p>
|
||||
|
||||
<div class="d-flex flex-wrap gap-3 mb-5">
|
||||
<a href="#" class="btn btn-dark btn-lg border-secondary px-4 py-2 d-flex align-items-center text-start">
|
||||
<i class="bi bi-apple fs-1 me-3"></i>
|
||||
<div>
|
||||
<div class="small text-muted">Download on the</div>
|
||||
<div class="fw-bold">App Store</div>
|
||||
<main class="app-page-wrapper">
|
||||
<!-- Hero Section -->
|
||||
<section class="app-hero py-5">
|
||||
<div class="container py-lg-5">
|
||||
<div class="row align-items-center g-5">
|
||||
<div class="col-lg-6 text-center text-lg-start animate__animated animate__fadeInLeft">
|
||||
<h1 class="display-3 fw-bold text-white mb-4 line-height-1-2">
|
||||
<?= __('support_anywhere') ?>
|
||||
</h1>
|
||||
<p class="lead text-white-50 mb-5 fs-4">
|
||||
<?= __('app_mockup_desc') ?>
|
||||
</p>
|
||||
|
||||
<div class="download-section mb-5">
|
||||
<div class="row g-3 justify-content-center justify-content-lg-start">
|
||||
<div class="col-6 col-md-4">
|
||||
<a href="<?= getSetting('ios_download_url', '#') ?>" class="download-btn-modern ios">
|
||||
<i class="bi bi-apple"></i>
|
||||
<div class="text">
|
||||
<span><?= __('download_on') ?></span>
|
||||
<div class="store"><?= __('app_store') ?></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<a href="<?= getSetting('android_download_url', '#') ?>" class="download-btn-modern android">
|
||||
<i class="bi bi-google-play"></i>
|
||||
<div class="text">
|
||||
<span><?= __('get_it_on') ?></span>
|
||||
<div class="store"><?= __('google_play') ?></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<a href="<?= getSetting('apk_download_url', '#') ?>" class="download-btn-modern apk">
|
||||
<i class="bi bi-android2"></i>
|
||||
<div class="text">
|
||||
<span><?= __('download_on') ?></span>
|
||||
<div class="store"><?= __('android_apk') ?></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="btn btn-dark btn-lg border-secondary px-4 py-2 d-flex align-items-center text-start">
|
||||
<i class="bi bi-google-play fs-1 me-3 text-primary"></i>
|
||||
<div>
|
||||
<div class="small text-muted">GET IT ON</div>
|
||||
<div class="fw-bold">Google Play</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-6">
|
||||
<div class="p-3 border border-secondary rounded-3 text-center">
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://byro.example.com" alt="QR Code" class="img-fluid rounded mb-2">
|
||||
<p class="small text-muted mb-0">Scan to Download</p>
|
||||
<div class="qr-container d-inline-flex align-items-center p-3 rounded-4 bg-white bg-opacity-5 border border-secondary shadow-lg">
|
||||
<div class="qr-code p-2 bg-white rounded-3">
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=120x120&data=<?= urlencode('https://' . $_SERVER['HTTP_HOST'] . '/app.php') ?>" alt="QR" width="120" height="120">
|
||||
</div>
|
||||
<div class="ms-4 text-start">
|
||||
<h5 class="text-white fw-bold mb-1"><?= __('scan_download') ?></h5>
|
||||
<p class="text-white-50 small mb-0"><?= __('scan_qr_to_download') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<ul class="list-unstyled small text-muted text-start mt-2">
|
||||
<li><i class="bi bi-check2 text-primary me-2"></i> Real-time alerts</li>
|
||||
<li><i class="bi bi-check2 text-primary me-2"></i> Full trading features</li>
|
||||
<li><i class="bi bi-check2 text-primary me-2"></i> 2FA security</li>
|
||||
<li><i class="bi bi-check2 text-primary me-2"></i> 24/7 Live chat</li>
|
||||
</ul>
|
||||
|
||||
<div class="col-lg-6 text-center position-relative animate__animated animate__fadeInRight">
|
||||
<div class="mockup-container">
|
||||
<!-- CSS Based Mockup for better performance and reliability -->
|
||||
<div class="iphone-mockup">
|
||||
<div class="screen">
|
||||
<iframe src="/binary.php?symbol=BTC" frameborder="0" style="width: 100%; height: 100%; border: none;"></iframe>
|
||||
</div>
|
||||
<div class="home-bar"></div>
|
||||
<div class="notch"></div>
|
||||
</div>
|
||||
<!-- Floating elements for depth -->
|
||||
<div class="floating-icon icon-1"><i class="bi bi-currency-bitcoin text-warning"></i></div>
|
||||
<div class="floating-icon icon-2"><i class="bi bi-shield-lock-fill text-primary"></i></div>
|
||||
<div class="floating-icon icon-3"><i class="bi bi-lightning-fill text-info"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 d-none d-lg-block">
|
||||
<div class="position-relative">
|
||||
<div class="bg-primary rounded-circle position-absolute blur-30" style="width: 400px; height: 400px; opacity: 0.1; top: 0; right: 0;"></div>
|
||||
<i class="bi bi-phone text-primary" style="font-size: 400px; line-height: 1;"></i>
|
||||
</section>
|
||||
|
||||
<!-- Features -->
|
||||
<section class="py-5 bg-black bg-opacity-30 border-top border-secondary">
|
||||
<div class="container">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-4">
|
||||
<div class="feature-item p-4 text-center">
|
||||
<div class="icon-circle bg-primary bg-opacity-10 text-primary mb-3 mx-auto">
|
||||
<i class="bi bi-graph-up-arrow fs-2"></i>
|
||||
</div>
|
||||
<h4 class="text-white fw-bold"><?= __('real_time_alerts') ?></h4>
|
||||
<p class="text-white-50"><?= __('full_trading_features') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="feature-item p-4 text-center">
|
||||
<div class="icon-circle bg-success bg-opacity-10 text-success mb-3 mx-auto">
|
||||
<i class="bi bi-safe2 fs-2"></i>
|
||||
</div>
|
||||
<h4 class="text-white fw-bold"><?= __('two_fa_security') ?></h4>
|
||||
<p class="text-white-50"><?= __('inst_security_desc') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="feature-item p-4 text-center">
|
||||
<div class="icon-circle bg-info bg-opacity-10 text-info mb-3 mx-auto">
|
||||
<i class="bi bi-chat-dots fs-2"></i>
|
||||
</div>
|
||||
<h4 class="text-white fw-bold"><?= __('live_chat_247') ?></h4>
|
||||
<p class="text-white-50"><?= __('support_247') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const isIos = /iphone|ipad|ipod/.test(ua);
|
||||
const isAndroid = /android/.test(ua);
|
||||
|
||||
if (isIos) {
|
||||
document.querySelector('.download-btn-modern.ios').classList.add('highlight-pulse');
|
||||
} else if (isAndroid) {
|
||||
document.querySelector('.download-btn-modern.android').classList.add('highlight-pulse');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.highlight-pulse {
|
||||
border-color: var(--primary) !important;
|
||||
box-shadow: 0 0 15px rgba(0, 98, 255, 0.4);
|
||||
animation: pulse-border 2s infinite;
|
||||
}
|
||||
@keyframes pulse-border {
|
||||
0% { box-shadow: 0 0 0 0 rgba(0, 98, 255, 0.4); }
|
||||
70% { box-shadow: 0 0 0 10px rgba(0, 98, 255, 0); }
|
||||
100% { box-shadow: 0 0 0 0 rgba(0, 98, 255, 0); }
|
||||
}
|
||||
.app-page-wrapper {
|
||||
background: #0b0e11;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.download-btn-modern {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 15px;
|
||||
background: #1e2329;
|
||||
border: 1px solid #2b3139;
|
||||
border-radius: 12px;
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
height: 100%;
|
||||
}
|
||||
.download-btn-modern:hover {
|
||||
background: #2b3139;
|
||||
border-color: var(--primary);
|
||||
transform: translateY(-3px);
|
||||
}
|
||||
.download-btn-modern i {
|
||||
font-size: 24px;
|
||||
margin-right: 12px;
|
||||
color: #fff;
|
||||
}
|
||||
.download-btn-modern .text {
|
||||
text-align: left;
|
||||
}
|
||||
.download-btn-modern .text span {
|
||||
display: block;
|
||||
font-size: 10px;
|
||||
color: #848e9c;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.download-btn-modern .text .store {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Mockup CSS */
|
||||
.mockup-container {
|
||||
position: relative;
|
||||
padding: 20px;
|
||||
}
|
||||
.iphone-mockup {
|
||||
width: 300px;
|
||||
height: 600px;
|
||||
background: #2b3139;
|
||||
border-radius: 40px;
|
||||
border: 12px solid #1e2329;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 50px 100px rgba(0,0,0,0.5);
|
||||
overflow: hidden;
|
||||
}
|
||||
.iphone-mockup .screen {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #0b0e11;
|
||||
border-radius: 28px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.iphone-mockup .notch {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 150px;
|
||||
height: 25px;
|
||||
background: #1e2329;
|
||||
border-bottom-left-radius: 20px;
|
||||
border-bottom-right-radius: 20px;
|
||||
z-index: 10;
|
||||
}
|
||||
.iphone-mockup .home-bar {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 100px;
|
||||
height: 4px;
|
||||
background: rgba(255,255,255,0.2);
|
||||
border-radius: 2px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.floating-icon {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: #1e2329;
|
||||
border: 1px solid #2b3139;
|
||||
border-radius: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
animation: float 4s ease-in-out infinite;
|
||||
z-index: 5;
|
||||
}
|
||||
.icon-1 { top: 10%; right: 10%; animation-delay: 0s; }
|
||||
.icon-2 { bottom: 20%; left: 10%; animation-delay: 1s; }
|
||||
.icon-3 { top: 40%; left: -5%; animation-delay: 2s; }
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-20px); }
|
||||
}
|
||||
|
||||
.icon-circle {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 991px) {
|
||||
.iphone-mockup {
|
||||
width: 260px;
|
||||
height: 520px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
||||
|
||||
BIN
assets/pasted-20260218-092326-d1106483.png
Normal file
BIN
assets/pasted-20260218-092326-d1106483.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/pasted-20260218-122005-f3b20f13.png
Normal file
BIN
assets/pasted-20260218-122005-f3b20f13.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
assets/pasted-20260218-122939-e40f3181.png
Normal file
BIN
assets/pasted-20260218-122939-e40f3181.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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') ?>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
fees.php
22
fees.php
@ -7,20 +7,20 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="card bg-dark border-secondary p-4 mb-5">
|
||||
<p class="text-muted"><?php echo __('fees_content'); ?></p>
|
||||
|
||||
<h3 class="mt-4 mb-4">Spot Trading Fees</h3>
|
||||
<h3 class="mt-4 mb-4"><?= __('spot_fees') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-hover border-secondary">
|
||||
<thead>
|
||||
<tr class="text-muted">
|
||||
<th>Tier</th>
|
||||
<th>30d Trading Volume</th>
|
||||
<th>Maker Fee</th>
|
||||
<th>Taker Fee</th>
|
||||
<th><?= __('tier') ?></th>
|
||||
<th><?= __('trading_vol_30d') ?></th>
|
||||
<th><?= __('maker_fee') ?></th>
|
||||
<th><?= __('taker_fee') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>VIP 0 (Regular)</td>
|
||||
<td>VIP 0 (<?= __('regular') ?>)</td>
|
||||
<td>< $10,000</td>
|
||||
<td>0.100%</td>
|
||||
<td>0.100%</td>
|
||||
@ -47,19 +47,19 @@ require_once __DIR__ . '/includes/header.php';
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3 class="mt-5 mb-4">Contract Trading Fees</h3>
|
||||
<h3 class="mt-5 mb-4"><?= __('contract_fees') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-hover border-secondary">
|
||||
<thead>
|
||||
<tr class="text-muted">
|
||||
<th>Tier</th>
|
||||
<th>Maker Fee</th>
|
||||
<th>Taker Fee</th>
|
||||
<th><?= __('tier') ?></th>
|
||||
<th><?= __('maker_fee') ?></th>
|
||||
<th><?= __('taker_fee') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Regular</td>
|
||||
<td><?= __('regular') ?></td>
|
||||
<td>0.020%</td>
|
||||
<td>0.050%</td>
|
||||
</tr>
|
||||
|
||||
@ -221,7 +221,7 @@ csFileInput.addEventListener('change', async () => {
|
||||
formData.append('file', file);
|
||||
formData.append('action', 'upload_image');
|
||||
|
||||
appendMessage('user', '<i class="bi bi-image"></i> Uploading image...');
|
||||
appendMessage('user', '<i class="bi bi-image"></i> <?= __("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 = `
|
||||
<div class="p-2 px-3 rounded-4 small ${sender === 'user' ? 'bg-primary text-white' : 'bg-dark text-muted border border-secondary'}" style="max-width: 80%;">
|
||||
<div class="p-2 px-3 rounded-4 small ${sender === 'user' ? 'bg-primary text-white' : 'bg-dark text-white border border-secondary'}" style="max-width: 80%; color: #ffffff !important;">
|
||||
${text}
|
||||
</div>
|
||||
`;
|
||||
@ -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);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@ -355,19 +355,19 @@ if (!function_exists('getSetting')) {
|
||||
<div class="lang-switcher">
|
||||
<?php if ($lang === 'zh'): ?>
|
||||
<img src="https://flagcdn.com/w40/cn.png" class="flag-icon" alt="CN">
|
||||
<span>中文</span>
|
||||
<span><?= __('chinese') ?></span>
|
||||
<?php else: ?>
|
||||
<img src="https://flagcdn.com/w40/us.png" class="flag-icon" alt="US">
|
||||
<span>English</span>
|
||||
<span><?= __('english') ?></span>
|
||||
<?php endif; ?>
|
||||
<div class="lang-dropdown">
|
||||
<a href="?lang=zh">
|
||||
<img src="https://flagcdn.com/w40/cn.png" class="flag-icon" alt="CN">
|
||||
简体中文
|
||||
<?= __('chinese') ?>
|
||||
</a>
|
||||
<a href="?lang=en">
|
||||
<img src="https://flagcdn.com/w40/us.png" class="flag-icon" alt="US">
|
||||
English
|
||||
<?= __('english') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -379,12 +379,12 @@ if (!function_exists('getSetting')) {
|
||||
</a>
|
||||
<div class="user-dropdown">
|
||||
<div class="user-info-header">
|
||||
<div class="uid-tag">UID: <?= $user['uid'] ?? 'N/A' ?></div>
|
||||
<div class="uid-tag"><?= __('uid') ?>: <?= $user['uid'] ?? 'N/A' ?></div>
|
||||
<div class="fw-bold"><?= htmlspecialchars($user['username']) ?></div>
|
||||
</div>
|
||||
<div class="user-stats">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label"><?= __('real_name') ?? 'Real-name' ?></span>
|
||||
<span class="stat-label"><?= __('real_name') ?></span>
|
||||
<span class="stat-value <?= ($user['kyc_status'] ?? 0) == 2 ? 'success' : 'text-warning' ?>">
|
||||
<?php
|
||||
$statusMap = [0 => __('unverified'), 1 => __('pending'), 2 => __('verified'), 3 => __('rejected')];
|
||||
@ -393,7 +393,7 @@ if (!function_exists('getSetting')) {
|
||||
</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label"><?= __('credit_score') ?? 'Credit Score' ?></span>
|
||||
<span class="stat-label"><?= __('credit_score') ?></span>
|
||||
<span class="stat-value text-primary"><?= $user['credit_score'] ?? 80 ?></span>
|
||||
</div>
|
||||
<?php
|
||||
@ -402,15 +402,15 @@ if (!function_exists('getSetting')) {
|
||||
$bal = $stmt->fetch();
|
||||
?>
|
||||
<div class="stat-item">
|
||||
<span class="stat-label"><?= __('assets') ?? 'Assets' ?></span>
|
||||
<span class="stat-label"><?= __('assets') ?></span>
|
||||
<span class="stat-value"><?= number_format($bal['available'] ?? 0, 2) ?> USDT</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-links">
|
||||
<a href="/profile.php"><i class="bi bi-person"></i> <?= __('personal') ?></a>
|
||||
<a href="/recharge.php"><i class="bi bi-wallet2"></i> <?= __('recharge') ?? 'Deposit' ?></a>
|
||||
<a href="/withdraw.php"><i class="bi bi-cash-stack"></i> <?= __('withdraw') ?? 'Withdraw' ?></a>
|
||||
<a href="/orders.php"><i class="bi bi-list-check"></i> <?= __('orders') ?? 'Orders' ?></a>
|
||||
<a href="/recharge.php"><i class="bi bi-wallet2"></i> <?= __('recharge') ?></a>
|
||||
<a href="/withdraw.php"><i class="bi bi-cash-stack"></i> <?= __('withdraw') ?></a>
|
||||
<a href="/orders.php"><i class="bi bi-list-check"></i> <?= __('orders') ?></a>
|
||||
</div>
|
||||
<a href="/auth/logout.php" class="logout-link"><?= __('logout') ?></a>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -13,23 +13,23 @@ function renderTerminal($activeTab = 'spot') {
|
||||
}
|
||||
|
||||
$full_coins = [
|
||||
['symbol' => 'BTC', 'name' => 'Bitcoin', 'price' => '64,234.50', 'change' => '+2.45%'],
|
||||
['symbol' => 'ETH', 'name' => 'Ethereum', 'price' => '3,456.20', 'change' => '+1.12%'],
|
||||
['symbol' => 'USDT', 'name' => 'Tether', 'price' => '1.00', 'change' => '+0.01%'],
|
||||
['symbol' => 'BNB', 'name' => 'BNB', 'price' => '598.40', 'change' => '-0.56%'],
|
||||
['symbol' => 'SOL', 'name' => 'Solana', 'price' => '145.20', 'change' => '+5.67%'],
|
||||
['symbol' => 'XRP', 'name' => 'Ripple', 'price' => '0.62', 'change' => '-1.23%'],
|
||||
['symbol' => 'ADA', 'name' => 'Cardano', 'price' => '0.58', 'change' => '+0.89%'],
|
||||
['symbol' => 'DOGE', 'name' => 'Dogecoin', 'price' => '0.16', 'change' => '+12.4%'],
|
||||
['symbol' => 'DOT', 'name' => 'Polkadot', 'price' => '8.45', 'change' => '-2.11%'],
|
||||
['symbol' => 'MATIC', 'name' => 'Polygon', 'price' => '0.92', 'change' => '+1.56%'],
|
||||
['symbol' => 'LINK', 'name' => 'Chainlink', 'price' => '18.40', 'change' => '+3.22%'],
|
||||
['symbol' => 'AVAX', 'name' => 'Avalanche', 'price' => '45.20', 'change' => '+4.12%'],
|
||||
['symbol' => 'SHIB', 'name' => 'Shiba Inu', 'price' => '0.000027', 'change' => '-3.45%'],
|
||||
['symbol' => 'TRX', 'name' => 'TRON', 'price' => '0.12', 'change' => '+0.56%'],
|
||||
['symbol' => 'BCH', 'name' => 'Bitcoin Cash', 'price' => '456.20', 'change' => '+2.12%'],
|
||||
['symbol' => 'LTC', 'name' => 'Litecoin', 'price' => '84.50', 'change' => '+1.45%'],
|
||||
['symbol' => 'UNI', 'name' => 'Uniswap', 'price' => '7.20', 'change' => '-2.12%'],
|
||||
['symbol' => 'BTC', 'name' => __('bitcoin'), 'price' => '64,234.50', 'change' => '+2.45%'],
|
||||
['symbol' => 'ETH', 'name' => __('ethereum'), 'price' => '3,456.20', 'change' => '+1.12%'],
|
||||
['symbol' => 'USDT', 'name' => __('tether'), 'price' => '1.00', 'change' => '+0.01%'],
|
||||
['symbol' => 'BNB', 'name' => __('binance_coin'), 'price' => '598.40', 'change' => '-0.56%'],
|
||||
['symbol' => 'SOL', 'name' => __('solana'), 'price' => '145.20', 'change' => '+5.67%'],
|
||||
['symbol' => 'XRP', 'name' => __('ripple'), 'price' => '0.62', 'change' => '-1.23%'],
|
||||
['symbol' => 'ADA', 'name' => __('cardano'), 'price' => '0.58', 'change' => '+0.89%'],
|
||||
['symbol' => 'DOGE', 'name' => __('dogecoin'), 'price' => '0.16', 'change' => '+12.4%'],
|
||||
['symbol' => 'DOT', 'name' => __('polkadot'), 'price' => '8.45', 'change' => '-2.11%'],
|
||||
['symbol' => 'MATIC', 'name' => __('polygon'), 'price' => '0.92', 'change' => '+1.56%'],
|
||||
['symbol' => 'LINK', 'name' => __('chainlink'), 'price' => '18.40', 'change' => '+3.22%'],
|
||||
['symbol' => 'AVAX', 'name' => __('avalanche'), 'price' => '45.20', 'change' => '+4.12%'],
|
||||
['symbol' => 'SHIB', 'name' => __('shiba_inu'), 'price' => '0.000027', 'change' => '-3.45%'],
|
||||
['symbol' => 'TRX', 'name' => __('tron'), 'price' => '0.12', 'change' => '+0.56%'],
|
||||
['symbol' => 'BCH', 'name' => __('bitcoin_cash'), 'price' => '456.20', 'change' => '+2.12%'],
|
||||
['symbol' => 'LTC', 'name' => __('litecoin'), 'price' => '84.50', 'change' => '+1.45%'],
|
||||
['symbol' => 'UNI', 'name' => __('uniswap'), 'price' => '7.20', 'change' => '-2.12%'],
|
||||
];
|
||||
?>
|
||||
<link rel="stylesheet" href="/assets/css/terminal.css?v=<?= time() ?>">
|
||||
@ -69,7 +69,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
</div>
|
||||
|
||||
<div class="sidebar-search">
|
||||
<input type="text" id="coin-search" placeholder="<?= __('search_coin') ?? 'Search Coin' ?>">
|
||||
<input type="text" id="coin-search" placeholder="<?= __('search') ?>">
|
||||
</div>
|
||||
|
||||
<div class="coin-list-container">
|
||||
@ -136,7 +136,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
"timezone": "Etc/UTC",
|
||||
"theme": "dark",
|
||||
"style": "1",
|
||||
"locale": "en",
|
||||
"locale": "<?= $lang === 'zh' ? 'zh_CN' : 'en' ?>",
|
||||
"toolbar_bg": "#f1f3f6",
|
||||
"enable_publishing": false,
|
||||
"hide_side_toolbar": false,
|
||||
@ -153,7 +153,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<?php if ($activeTab === 'binary'): ?>
|
||||
<div class="binary-order-panel w-100">
|
||||
<div class="d-flex justify-content-between align-items-end mb-2">
|
||||
<div class="section-title text-white"><?= __('cycle_settlement') ?? 'Cycle / Settlement' ?></div>
|
||||
<div class="section-title text-white"><?= __('cycle_settlement') ?></div>
|
||||
<div class="small text-white"><?= __('available_balance') ?>: <span class="text-white fw-bold balance-highlight" id="user-usdt-balance"><?= number_format($usdt_balance, 2) ?></span> USDT</div>
|
||||
</div>
|
||||
<div class="cycle-grid">
|
||||
@ -179,7 +179,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="section-title text-white mb-2"><?= __('purchase_amount') ?? 'Purchase Amount' ?> (USDT)</div>
|
||||
<div class="section-title text-white mb-2"><?= __('purchase_amount') ?> (USDT)</div>
|
||||
<div class="amount-input-wrapper mb-3">
|
||||
<input type="number" id="binary-amount" class="form-control" placeholder="100-4999" oninput="calculateProfit()">
|
||||
</div>
|
||||
@ -191,7 +191,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between mb-3 small align-items-center bg-black bg-opacity-25 p-2 rounded">
|
||||
<div class="text-white"><?= __('expected_profit') ?? 'Expected Profit' ?></div>
|
||||
<div class="text-white"><?= __('expected_profit') ?></div>
|
||||
<div class="text-success fw-bold fs-6 profit-highlight" id="profit-display">0.00 USDT</div>
|
||||
</div>
|
||||
|
||||
@ -262,7 +262,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
}
|
||||
|
||||
if (amount > balance) {
|
||||
showErrorModal('<?= __("insufficient_balance") ?? "Insufficient balance" ?>');
|
||||
showErrorModal('<?= __("insufficient_balance") ?>');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -288,13 +288,13 @@ function renderTerminal($activeTab = 'spot') {
|
||||
id: data.order_id,
|
||||
time: new Date().toISOString().replace('T', ' ').substr(0, 19),
|
||||
pair: '<?= $currentSymbol ?>/USDT',
|
||||
type: 'Binary',
|
||||
type: '<?= __("trade_binary") ?>',
|
||||
side: direction === 'up' ? '<?= __("buy_up") ?>' : '<?= __("buy_down") ?>',
|
||||
side_type: direction,
|
||||
price: openPrice,
|
||||
amount: amount.toFixed(2),
|
||||
total: '---',
|
||||
status: 'Executing',
|
||||
status: '<?= __("executing") ?>',
|
||||
secondsLeft: currentSeconds,
|
||||
totalSeconds: currentSeconds,
|
||||
profitRate: currentProfitRate
|
||||
@ -319,7 +319,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
showErrorModal(data.error || 'Order failed');
|
||||
showErrorModal(data.error || '<?= __("operation") ?> <?= __("failed") ?>');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -328,7 +328,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
const closePrice = parseFloat(document.querySelector('.price-jump').innerText.replace(/,/g, ''));
|
||||
|
||||
// Immediately update UI to show it's settling
|
||||
order.status = 'Settling...';
|
||||
order.status = '<?= __("settling") ?>';
|
||||
if (showHistoryTab.currentTab === 'open') showHistoryTab('open');
|
||||
|
||||
const formData = new FormData();
|
||||
@ -344,7 +344,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
// Update order object for immediate UI refresh
|
||||
order.status = data.result === 'won' ? 'Profit' : 'Loss';
|
||||
order.status = data.result === 'won' ? '<?= __("won") ?>' : '<?= __("loss") ?>';
|
||||
const amount = parseFloat(order.amount);
|
||||
const profit = amount * order.profitRate / 100;
|
||||
order.pnl = data.pnl;
|
||||
@ -468,7 +468,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
document.getElementById('popup-countdown-content').style.display = 'block';
|
||||
document.getElementById('popup-result-content').style.display = 'none';
|
||||
|
||||
const sideColor = order.side.includes('Up') || order.side.includes('涨') || order.side.includes('<?= __("buy_up") ?>') ? '#26a69a' : '#ef5350';
|
||||
const sideColor = order.side.includes('Up') || order.side.includes('<?= __("buy_up") ?>') ? '#26a69a' : '#ef5350';
|
||||
|
||||
document.getElementById('popup-price').innerText = order.price;
|
||||
document.getElementById('popup-cycle').innerText = order.totalSeconds + '<?= __('unit_seconds') ?>';
|
||||
@ -508,15 +508,15 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<div class="order-form-container w-100">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div class="order-form-tabs m-0 d-flex gap-2">
|
||||
<button class="active btn btn-sm btn-outline-primary py-1 px-3 fw-bold" style="font-size: 12px; border-radius: 6px;"><?= __('limit') ?? 'Limit' ?></button>
|
||||
<button class="btn btn-sm btn-outline-secondary py-1 px-3 fw-bold" style="font-size: 12px; border-radius: 6px;"><?= __('market') ?? 'Market' ?></button>
|
||||
<button class="active btn btn-sm btn-outline-primary py-1 px-3 fw-bold" style="font-size: 12px; border-radius: 6px;"><?= __('limit') ?></button>
|
||||
<button class="btn btn-sm btn-outline-secondary py-1 px-3 fw-bold" style="font-size: 12px; border-radius: 6px;"><?= __('market') ?></button>
|
||||
</div>
|
||||
<div class="small text-muted fw-medium"><?= __('assets') ?>: <span class="text-white fw-bold"><span id="spot-usdt-balance"><?= number_format($usdt_balance, 2) ?></span> USDT</span></div>
|
||||
</div>
|
||||
|
||||
<?php if ($activeTab === 'contract'): ?>
|
||||
<div class="mb-3">
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= __('leverage') ?? 'Leverage' ?></label>
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= __('leverage') ?></label>
|
||||
<select id="contract-leverage" class="form-select form-select-sm bg-dark border-secondary text-white fw-bold">
|
||||
<?php foreach([10, 20, 50, 100, 150, 200] as $lev): ?>
|
||||
<option value="<?= $lev ?>"><?= $lev ?>x</option>
|
||||
@ -528,7 +528,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<div class="row g-3">
|
||||
<div class="col-6">
|
||||
<div class="input-group-custom mb-3">
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= ($activeTab === 'contract' ? (__('buy_long') ?? 'Buy/Long') : (__('buy_price') ?? 'Buy Price')) ?></label>
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= ($activeTab === 'contract' ? (__('buy_long')) : (__('buy_price'))) ?></label>
|
||||
<div class="input-wrapper bg-black p-2 rounded border border-secondary d-flex justify-content-between align-items-center" style="background: #0b0e11 !important; height: 45px;">
|
||||
<input type="number" id="spot-buy-price" value="64234.50" class="bg-transparent border-0 text-white w-75 fw-bold" style="outline: none; font-size: 14px;">
|
||||
<span class="suffix text-muted small fw-bold">USDT</span>
|
||||
@ -546,11 +546,11 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<button class="btn btn-dark btn-sm py-1 flex-fill fw-bold" style="font-size: 10px; background: #2b3139;" onclick="setSpotPercent('buy', <?= intval($p) ?>)"><?= $p ?></button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<button onclick="<?= ($activeTab === 'contract' ? "placeContractOrder('long')" : "placeSpotOrder('buy')") ?>" class="btn btn-success w-100 py-3 fw-bold rounded-3 shadow-sm border-0" style="background: linear-gradient(135deg, #0ecb81, #26a69a);"><?= ($activeTab === 'contract' ? (__('long') ?? 'Long') : (__('buy'))) ?> <?= $currentSymbol ?></button>
|
||||
<button onclick="<?= ($activeTab === 'contract' ? "placeContractOrder('long')" : "placeSpotOrder('buy')") ?>" class="btn btn-success w-100 py-3 fw-bold rounded-3 shadow-sm border-0" style="background: linear-gradient(135deg, #0ecb81, #26a69a);"><?= ($activeTab === 'contract' ? (__('long')) : (__('buy'))) ?> <?= $currentSymbol ?></button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="input-group-custom mb-3">
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= ($activeTab === 'contract' ? (__('sell_short') ?? 'Sell/Short') : (__('sell_price') ?? 'Sell Price')) ?></label>
|
||||
<label class="small text-muted mb-1 d-block fw-bold"><?= ($activeTab === 'contract' ? (__('sell_short')) : (__('sell_price'))) ?></label>
|
||||
<div class="input-wrapper bg-black p-2 rounded border border-secondary d-flex justify-content-between align-items-center" style="background: #0b0e11 !important; height: 45px;">
|
||||
<input type="number" id="spot-sell-price" value="64234.50" class="bg-transparent border-0 text-white w-75 fw-bold" style="outline: none; font-size: 14px;">
|
||||
<span class="suffix text-muted small fw-bold">USDT</span>
|
||||
@ -568,7 +568,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<button class="btn btn-dark btn-sm py-1 flex-fill fw-bold" style="font-size: 10px; background: #2b3139;" onclick="setSpotPercent('sell', <?= intval($p) ?>)"><?= $p ?></button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<button onclick="<?= ($activeTab === 'contract' ? "placeContractOrder('short')" : "placeSpotOrder('sell')") ?>" class="btn btn-danger w-100 py-3 fw-bold rounded-3 shadow-sm border-0" style="background: linear-gradient(135deg, #f6465d, #ef5350);"><?= ($activeTab === 'contract' ? (__('short') ?? 'Short') : (__('sell'))) ?> <?= $currentSymbol ?></button>
|
||||
<button onclick="<?= ($activeTab === 'contract' ? "placeContractOrder('short')" : "placeSpotOrder('sell')") ?>" class="btn btn-danger w-100 py-3 fw-bold rounded-3 shadow-sm border-0" style="background: linear-gradient(135deg, #f6465d, #ef5350);"><?= ($activeTab === 'contract' ? (__('short')) : (__('sell'))) ?> <?= $currentSymbol ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -610,7 +610,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
showMsg('Order placed successfully', 'success');
|
||||
showMsg('<?= __("request_sent") ?>', 'success');
|
||||
setTimeout(() => location.reload(), 1000);
|
||||
} else {
|
||||
showMsg(data.error, 'error');
|
||||
@ -644,7 +644,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
showMsg('Contract order opened', 'success');
|
||||
showMsg('<?= __("request_sent") ?>', 'success');
|
||||
setTimeout(() => location.reload(), 1000);
|
||||
} else {
|
||||
showMsg(data.error, 'error');
|
||||
@ -875,12 +875,12 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<thead>
|
||||
<tr class="text-muted" style="background: rgba(255,255,255,0.02);">
|
||||
<th class="ps-3 py-2"><?= __('time') ?></th>
|
||||
<th class="py-2"><?= __('trading_pair') ?? 'Pair' ?></th>
|
||||
<th class="py-2"><?= __('trading_pair') ?></th>
|
||||
<th class="py-2"><?= __('type') ?></th>
|
||||
<th class="py-2"><?= __('direction') ?></th>
|
||||
<th class="py-2"><?= __('price') ?></th>
|
||||
<th class="py-2"><?= __('quantity') ?></th>
|
||||
<th class="py-2"><?= __('total') ?? 'Total' ?></th>
|
||||
<th class="py-2"><?= __('total') ?></th>
|
||||
<th class="py-2"><?= __('status') ?></th>
|
||||
<th class="pe-3 py-2 text-end"><?= __('operation') ?></th>
|
||||
</tr>
|
||||
@ -972,29 +972,29 @@ function renderTerminal($activeTab = 'spot') {
|
||||
body.innerHTML = '';
|
||||
|
||||
if (!historyData[tab] || historyData[tab].length === 0) {
|
||||
body.innerHTML = '<tr><td colspan="9" class="text-center py-5 text-muted"><?= __("no_records_found") ?? "No records found" ?></td></tr>';
|
||||
body.innerHTML = '<tr><td colspan="9" class="text-center py-5 text-muted"><?= __("no_records_found") ?></td></tr>';
|
||||
return;
|
||||
}
|
||||
|
||||
historyData[tab].forEach(row => {
|
||||
const tr = document.createElement('tr');
|
||||
const isProfit = row.status === 'Profit';
|
||||
const isLoss = row.status === 'Loss';
|
||||
const isExecuting = row.status === 'Executing';
|
||||
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 statusClass = isProfit ? 'text-success' : (isLoss ? 'text-danger' : 'text-info');
|
||||
const statusBg = isProfit ? 'bg-success' : (isLoss ? 'bg-danger' : 'bg-info');
|
||||
|
||||
let displayStatus = row.status;
|
||||
if (isExecuting) {
|
||||
if (row.secondsLeft <= 0) {
|
||||
displayStatus = '<?= __("settling") ?? "Settling..." ?>';
|
||||
} else {
|
||||
if (row.secondsLeft <= 0 && row.type_raw === 'binary') {
|
||||
displayStatus = '<?= __("settling") ?>';
|
||||
} else if (row.secondsLeft > 0) {
|
||||
displayStatus = '<?= __("executing") ?> (' + row.secondsLeft + '<?= __('unit_seconds') ?>)';
|
||||
}
|
||||
}
|
||||
if (isProfit) displayStatus = '<?= __("profit") ?>';
|
||||
if (isLoss) displayStatus = '<?= __("loss") ?? "Loss" ?>';
|
||||
if (isLoss) displayStatus = '<?= __("loss") ?>';
|
||||
|
||||
// Format total/profit for settled orders
|
||||
let totalDisplay = row.total;
|
||||
@ -1006,11 +1006,11 @@ function renderTerminal($activeTab = 'spot') {
|
||||
<div class="small opacity-75 text-muted">${total} USDT</div>`;
|
||||
}
|
||||
|
||||
const isUp = row.side_type === 'up' || row.side.includes('Up') || row.side.includes('涨') || row.side.includes('<?= __("buy_up") ?>') || row.side === 'Buy' || row.side === 'Long';
|
||||
const isUp = row.side_type === 'up' || row.side_type === 'long' || row.side_type === 'buy';
|
||||
|
||||
let operationHtml = `<button class="btn btn-sm btn-dark px-2 py-0" style="font-size: 10px;"><?= __('details') ?></button>`;
|
||||
if (tab === 'open' && row.type === 'Contract') {
|
||||
operationHtml = `<button onclick="closeContractOrder(${row.id})" class="btn btn-sm btn-danger px-2 py-0" style="font-size: 10px;"><?= __('close') ?? 'Close' ?></button>`;
|
||||
let operationHtml = `<button class="btn btn-sm btn-dark px-2 py-0" style="font-size: 10px;"><?= __("details") ?></button>`;
|
||||
if (tab === 'open' && row.type_raw === 'contract') {
|
||||
operationHtml = `<button onclick="closeContractOrder(${row.id})" class="btn btn-sm btn-danger px-2 py-0" style="font-size: 10px;"><?= __("close") ?></button>`;
|
||||
}
|
||||
|
||||
tr.innerHTML = `
|
||||
@ -1031,7 +1031,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
}
|
||||
|
||||
function closeContractOrder(id) {
|
||||
if (!confirm('Confirm close position?')) return;
|
||||
if (!confirm('<?= __("confirm_close_pos") ?>')) return;
|
||||
const closePrice = parseFloat(document.querySelector('.price-jump').innerText.replace(/,/g, ''));
|
||||
const formData = new FormData();
|
||||
formData.append('action', 'close_order');
|
||||
@ -1045,7 +1045,7 @@ function renderTerminal($activeTab = 'spot') {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
showMsg('Position closed', 'success');
|
||||
showMsg('<?= __("pos_closed") ?>', 'success');
|
||||
loadHistory();
|
||||
} else {
|
||||
showMsg(data.error, 'error');
|
||||
|
||||
26
index.php
26
index.php
@ -121,23 +121,23 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<section class="market-section mb-5">
|
||||
<div class="d-flex justify-content-between align-items-end mb-4">
|
||||
<h2 class="fw-bold m-0"><?php echo __('popular_markets'); ?></h2>
|
||||
<a href="market.php" class="text-decoration-none text-primary"><?php echo __('view_more') ?? 'View More'; ?> <i class="bi bi-arrow-right"></i></a>
|
||||
<a href="market.php" class="text-decoration-none text-primary"><?php echo __('view_more'); ?> <i class="bi bi-arrow-right"></i></a>
|
||||
</div>
|
||||
<div class="row g-4" id="market-list">
|
||||
<?php
|
||||
$coins = [
|
||||
['symbol' => 'BTC', 'name' => 'Bitcoin', 'id' => 'bitcoin'],
|
||||
['symbol' => 'ETH', 'name' => 'Ethereum', 'id' => 'ethereum'],
|
||||
['symbol' => 'USDT', 'name' => 'Tether', 'id' => 'tether'],
|
||||
['symbol' => 'BNB', 'name' => 'BNB', 'id' => 'binancecoin'],
|
||||
['symbol' => 'SOL', 'name' => 'Solana', 'id' => 'solana'],
|
||||
['symbol' => 'XRP', 'name' => 'XRP', 'id' => 'ripple'],
|
||||
['symbol' => 'ADA', 'name' => 'Cardano', 'id' => 'cardano'],
|
||||
['symbol' => 'DOGE', 'name' => 'Dogecoin', 'id' => 'dogecoin'],
|
||||
['symbol' => 'DOT', 'name' => 'Polkadot', 'id' => 'polkadot'],
|
||||
['symbol' => 'MATIC', 'name' => 'Polygon', 'id' => 'matic-network'],
|
||||
['symbol' => 'LINK', 'name' => 'Chainlink', 'id' => 'chainlink'],
|
||||
['symbol' => 'SHIB', 'name' => 'Shiba Inu', 'id' => 'shiba-inu']
|
||||
['symbol' => 'BTC', 'name' => __('bitcoin'), 'id' => 'bitcoin'],
|
||||
['symbol' => 'ETH', 'name' => __('ethereum'), 'id' => 'ethereum'],
|
||||
['symbol' => 'USDT', 'name' => __('tether'), 'id' => 'tether'],
|
||||
['symbol' => 'BNB', 'name' => __('binance_coin'), 'id' => 'binancecoin'],
|
||||
['symbol' => 'SOL', 'name' => __('solana'), 'id' => 'solana'],
|
||||
['symbol' => 'XRP', 'name' => __('ripple'), 'id' => 'ripple'],
|
||||
['symbol' => 'ADA', 'name' => __('cardano'), 'id' => 'cardano'],
|
||||
['symbol' => 'DOGE', 'name' => __('dogecoin'), 'id' => 'dogecoin'],
|
||||
['symbol' => 'DOT', 'name' => __('polkadot'), 'id' => 'polkadot'],
|
||||
['symbol' => 'MATIC', 'name' => __('polygon'), 'id' => 'matic-network'],
|
||||
['symbol' => 'LINK', 'name' => __('chainlink'), 'id' => 'chainlink'],
|
||||
['symbol' => 'SHIB', 'name' => __('shiba_inu'), 'id' => 'shiba-inu']
|
||||
];
|
||||
foreach ($coins as $coin):
|
||||
?>
|
||||
|
||||
22
legal.php
22
legal.php
@ -7,26 +7,26 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="col-lg-10">
|
||||
<h1 class="mb-5 fw-bold"><?php echo __('privacy'); ?></h1>
|
||||
<div class="card bg-dark border-secondary p-5">
|
||||
<p class="text-muted mb-4">Last Updated: February 16, 2026</p>
|
||||
<p class="text-muted mb-4"><?= __('last_updated') ?></p>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">Introduction</h3>
|
||||
<p class="text-muted">Byro ("we", "us", or "our") respects your privacy and is committed to protecting your personal data. This privacy policy informs you about how we look after your personal data when you visit our website.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('privacy_1_title') ?></h3>
|
||||
<p class="text-muted"><?= __('privacy_1_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">The Data We Collect</h3>
|
||||
<p class="text-muted">We may collect, use, store and transfer different kinds of personal data about you, including Identity Data, Contact Data, Financial Data, and Technical Data.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('privacy_2_title') ?></h3>
|
||||
<p class="text-muted"><?= __('privacy_2_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">How We Use Your Data</h3>
|
||||
<p class="text-muted">We will only use your personal data when the law allows us to. Most commonly, we will use your personal data to perform the contract we are about to enter into or have entered into with you.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('privacy_3_title') ?></h3>
|
||||
<p class="text-muted"><?= __('privacy_3_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">Data Security</h3>
|
||||
<p class="text-muted">We have put in place appropriate security measures to prevent your personal data from being accidentally lost, used, or accessed in an unauthorized way.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('privacy_4_title') ?></h3>
|
||||
<p class="text-muted"><?= __('privacy_4_content') ?></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3 class="fw-bold mb-3">Your Legal Rights</h3>
|
||||
<p class="text-muted">Under certain circumstances, you have rights under data protection laws in relation to your personal data, including the right to request access, correction, erasure, or restriction of your personal data.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('privacy_5_title') ?></h3>
|
||||
<p class="text-muted"><?= __('privacy_5_content') ?></p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -101,14 +101,27 @@ class MailService
|
||||
}
|
||||
private static function loadConfig(): array
|
||||
{
|
||||
// Load default from file
|
||||
$configPath = __DIR__ . '/config.php';
|
||||
if (!file_exists($configPath)) {
|
||||
throw new \RuntimeException('Mail config not found. Copy mail/config.sample.php to mail/config.php and fill in credentials.');
|
||||
}
|
||||
$cfg = require $configPath;
|
||||
if (!is_array($cfg)) {
|
||||
throw new \RuntimeException('Invalid mail config format: expected array');
|
||||
$cfg = file_exists($configPath) ? require $configPath : [];
|
||||
|
||||
// Override with database settings if available
|
||||
try {
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
$stmt = db()->query("SELECT setting_key, setting_value FROM system_settings WHERE setting_key LIKE 'smtp_%' OR setting_key LIKE 'mail_%'");
|
||||
$db_settings = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
|
||||
|
||||
if (!empty($db_settings['smtp_host'])) $cfg['smtp_host'] = $db_settings['smtp_host'];
|
||||
if (!empty($db_settings['smtp_port'])) $cfg['smtp_port'] = (int)$db_settings['smtp_port'];
|
||||
if (!empty($db_settings['smtp_user'])) $cfg['smtp_user'] = $db_settings['smtp_user'];
|
||||
if (!empty($db_settings['smtp_pass'])) $cfg['smtp_pass'] = $db_settings['smtp_pass'];
|
||||
if (!empty($db_settings['smtp_secure'])) $cfg['smtp_secure'] = $db_settings['smtp_secure'];
|
||||
if (!empty($db_settings['mail_from_email'])) $cfg['from_email'] = $db_settings['mail_from_email'];
|
||||
if (!empty($db_settings['mail_from_name'])) $cfg['from_name'] = $db_settings['mail_from_name'];
|
||||
} catch (\Throwable $e) {
|
||||
// Fallback to environment if DB fails
|
||||
}
|
||||
|
||||
return $cfg;
|
||||
}
|
||||
|
||||
|
||||
35
market.php
35
market.php
@ -18,24 +18,25 @@ require_once __DIR__ . '/includes/header.php';
|
||||
</thead>
|
||||
<tbody class="border-0">
|
||||
<?php
|
||||
$vol_suffix = __('vol_unit');
|
||||
$full_coins = [
|
||||
['name' => __('bitcoin'), 'symbol' => 'BTC', 'price' => '65,432.10', 'change' => '+2.5%', 'vol' => '32.1B'],
|
||||
['name' => __('ethereum'), 'symbol' => 'ETH', 'price' => '3,456.78', 'change' => '+1.8%', 'vol' => '15.4B'],
|
||||
['name' => __('tether'), 'symbol' => 'USDT', 'price' => '1.00', 'change' => '+0.01%', 'vol' => '45.2B'],
|
||||
['name' => __('binance_coin'), 'symbol' => 'BNB', 'price' => '589.20', 'change' => '-0.5%', 'vol' => '1.2B'],
|
||||
['name' => __('solana'), 'symbol' => 'SOL', 'price' => '145.67', 'change' => '+5.2%', 'vol' => '3.8B'],
|
||||
['name' => __('ripple'), 'symbol' => 'XRP', 'price' => '0.62', 'change' => '-1.2%', 'vol' => '800M'],
|
||||
['name' => __('cardano'), 'symbol' => 'ADA', 'price' => '0.45', 'change' => '+0.8%', 'vol' => '400M'],
|
||||
['name' => __('dogecoin'), 'symbol' => 'DOGE', 'price' => '0.16', 'change' => '+3.4%', 'vol' => '1.1B'],
|
||||
['name' => __('polkadot'), 'symbol' => 'DOT', 'price' => '8.90', 'change' => '-2.1%', 'vol' => '200M'],
|
||||
['name' => __('polygon'), 'symbol' => 'MATIC', 'price' => '0.92', 'change' => '+1.5%', 'vol' => '300M'],
|
||||
['name' => __('avalanche'), 'symbol' => 'AVAX', 'price' => '45.20', 'change' => '+4.1%', 'vol' => '800M'],
|
||||
['name' => __('chainlink'), 'symbol' => 'LINK', 'price' => '18.40', 'change' => '+3.2%', 'vol' => '500M'],
|
||||
['name' => __('shiba_inu'), 'symbol' => 'SHIB', 'price' => '0.000027', 'change' => '-3.4%', 'vol' => '200M'],
|
||||
['name' => __('tron'), 'symbol' => 'TRX', 'price' => '0.12', 'change' => '+0.5%', 'vol' => '1.2B'],
|
||||
['name' => __('bitcoin_cash'), 'symbol' => 'BCH', 'price' => '456.20', 'change' => '+2.12%', 'vol' => '450M'],
|
||||
['name' => __('litecoin'), 'symbol' => 'LTC', 'price' => '84.50', 'change' => '+1.45%', 'vol' => '900M'],
|
||||
['name' => __('uniswap'), 'symbol' => 'UNI', 'price' => '7.20', 'change' => '-2.12%', 'vol' => '120M']
|
||||
['name' => __('bitcoin'), 'symbol' => 'BTC', 'price' => '65,432.10', 'change' => '+2.5%', 'vol' => '321' . $vol_suffix],
|
||||
['name' => __('ethereum'), 'symbol' => 'ETH', 'price' => '3,456.78', 'change' => '+1.8%', 'vol' => '154' . $vol_suffix],
|
||||
['name' => __('tether'), 'symbol' => 'USDT', 'price' => '1.00', 'change' => '+0.01%', 'vol' => '452' . $vol_suffix],
|
||||
['name' => __('binance_coin'), 'symbol' => 'BNB', 'price' => '589.20', 'change' => '-0.5%', 'vol' => '12' . $vol_suffix],
|
||||
['name' => __('solana'), 'symbol' => 'SOL', 'price' => '145.67', 'change' => '+5.2%', 'vol' => '38' . $vol_suffix],
|
||||
['name' => __('ripple'), 'symbol' => 'XRP', 'price' => '0.62', 'change' => '-1.23%', 'vol' => '8' . $vol_suffix],
|
||||
['name' => __('cardano'), 'symbol' => 'ADA', 'price' => '0.45', 'change' => '+0.8%', 'vol' => '4' . $vol_suffix],
|
||||
['name' => __('dogecoin'), 'symbol' => 'DOGE', 'price' => '0.16', 'change' => '+3.4%', 'vol' => '11' . $vol_suffix],
|
||||
['name' => __('polkadot'), 'symbol' => 'DOT', 'price' => '8.90', 'change' => '-2.1%', 'vol' => '2' . $vol_suffix],
|
||||
['name' => __('polygon'), 'symbol' => 'MATIC', 'price' => '0.92', 'change' => '+1.5%', 'vol' => '3' . $vol_suffix],
|
||||
['name' => __('avalanche'), 'symbol' => 'AVAX', 'price' => '45.20', 'change' => '+4.1%', 'vol' => '8' . $vol_suffix],
|
||||
['name' => __('chainlink'), 'symbol' => 'LINK', 'price' => '18.40', 'change' => '+3.2%', 'vol' => '5' . $vol_suffix],
|
||||
['name' => __('shiba_inu'), 'symbol' => 'SHIB', 'price' => '0.000027', 'change' => '-3.4%', 'vol' => '2' . $vol_suffix],
|
||||
['name' => __('tron'), 'symbol' => 'TRX', 'price' => '0.12', 'change' => '+0.5%', 'vol' => '12' . $vol_suffix],
|
||||
['name' => __('bitcoin_cash'), 'symbol' => 'BCH', 'price' => '456.20', 'change' => '+2.12%', 'vol' => '4.5' . $vol_suffix],
|
||||
['name' => __('litecoin'), 'symbol' => 'LTC', 'price' => '84.50', 'change' => '+1.45%', 'vol' => '9' . $vol_suffix],
|
||||
['name' => __('uniswap'), 'symbol' => 'UNI', 'price' => '7.20', 'change' => '-2.12%', 'vol' => '1.2' . $vol_suffix]
|
||||
];
|
||||
foreach ($full_coins as $coin):
|
||||
?>
|
||||
|
||||
18
mining.php
18
mining.php
@ -13,12 +13,12 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="row g-4 mb-5">
|
||||
<?php
|
||||
$pools = [
|
||||
['symbol' => 'BTC', 'name' => __('bitcoin') . ' ' . __('mining_pool'), 'apy' => '12.5%', 'min' => '0.01 BTC', 'term' => '30 ' . __('day'), 'hot' => true],
|
||||
['symbol' => 'ETH', 'name' => 'ETH 2.0 Staking', 'apy' => '8.2%', 'min' => '0.1 ETH', 'term' => __('flexible'), 'hot' => false],
|
||||
['symbol' => 'USDT', 'name' => 'USDT Savings', 'apy' => '15.0%', 'min' => '100 USDT', 'term' => '90 ' . __('day'), 'hot' => true],
|
||||
['symbol' => 'BNB', 'name' => 'BNB Smart Chain', 'apy' => '22.0%', 'min' => '1 BNB', 'term' => '180 ' . __('day'), 'hot' => false],
|
||||
['symbol' => 'SOL', 'name' => 'Solana Yield', 'apy' => '14.2%', 'min' => '5 SOL', 'term' => '60 ' . __('day'), 'hot' => false],
|
||||
['symbol' => 'AVAX', 'name' => 'Avalanche Pro', 'apy' => '18.5%', 'min' => '10 AVAX', 'term' => '120 ' . __('day'), 'hot' => false],
|
||||
['symbol' => 'BTC', 'name' => __('bitcoin') . __('mining_pool'), 'apy' => '12.5%', 'min' => '0.01 BTC', 'term' => '30 ' . __('day'), 'hot' => true],
|
||||
['symbol' => 'ETH', 'name' => __('ethereum') . __('mining_pool'), 'apy' => '8.2%', 'min' => '0.1 ETH', 'term' => __('flexible'), 'hot' => false],
|
||||
['symbol' => 'USDT', 'name' => 'USDT ' . __('mining_pool'), 'apy' => '15.0%', 'min' => '100 USDT', 'term' => '90 ' . __('day'), 'hot' => true],
|
||||
['symbol' => 'BNB', 'name' => 'BNB ' . __('mining_pool'), 'apy' => '22.0%', 'min' => '1 BNB', 'term' => '180 ' . __('day'), 'hot' => false],
|
||||
['symbol' => 'SOL', 'name' => 'SOL ' . __('mining_pool'), 'apy' => '14.2%', 'min' => '5 SOL', 'term' => '60 ' . __('day'), 'hot' => false],
|
||||
['symbol' => 'AVAX', 'name' => 'AVAX ' . __('mining_pool'), 'apy' => '18.5%', 'min' => '10 AVAX', 'term' => '120 ' . __('day'), 'hot' => false],
|
||||
];
|
||||
|
||||
foreach ($pools as $pool): ?>
|
||||
@ -99,17 +99,17 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<p class="text-muted mb-4"><?= __('calc_desc') ?></p>
|
||||
<div class="input-group mb-4">
|
||||
<span class="input-group-text bg-black border-secondary text-white">USDT</span>
|
||||
<input type="number" class="form-control bg-black border-secondary text-white p-3" placeholder="<?= __('amount_to_invest') ?>">
|
||||
<input type="number" id="mining-calc-amount" class="form-control bg-black border-secondary text-white p-3" placeholder="<?= __('amount_to_invest') ?>">
|
||||
</div>
|
||||
<div class="bg-black p-4 rounded-4 mb-4">
|
||||
<div class="row">
|
||||
<div class="col-6 border-end border-secondary">
|
||||
<div class="text-muted small mb-1"><?= __('daily_profit') ?></div>
|
||||
<div class="text-success fw-bold fs-4">$4.10</div>
|
||||
<div class="text-success fw-bold fs-4">--</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="text-muted small mb-1"><?= __('monthly_profit') ?></div>
|
||||
<div class="text-success fw-bold fs-4">$123.00</div>
|
||||
<div class="text-success fw-bold fs-4">--</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
14
news.php
14
news.php
@ -10,25 +10,25 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<?php for($i=1; $i<=5; $i++): ?>
|
||||
<div class="card bg-dark border-secondary mb-4 coin-card">
|
||||
<div class="card-body">
|
||||
<span class="badge bg-primary mb-2">Announcement</span>
|
||||
<span class="badge bg-primary mb-2"><?= __('announcement') ?></span>
|
||||
<h4 class="fw-bold">Byro Lists New Trading Pairs: ARB/USDT and OP/USDT</h4>
|
||||
<p class="text-muted small">February 14, 2026 • 5 min read</p>
|
||||
<p>We are excited to announce that Byro will list Arbitrum (ARB) and Optimism (OP) for spot trading. Deposits are now open...</p>
|
||||
<a href="#" class="btn btn-link p-0 text-primary">Read More <i class="bi bi-arrow-right"></i></a>
|
||||
<a href="#" class="btn btn-link p-0 text-primary"><?= __('read_more') ?> <i class="bi bi-arrow-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endfor; ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-dark border-secondary p-4 sticky-top" style="top: 100px;">
|
||||
<h5 class="fw-bold mb-3">Newsletter</h5>
|
||||
<p class="small text-muted">Subscribe to get the latest crypto insights delivered to your inbox.</p>
|
||||
<h5 class="fw-bold mb-3"><?= __('newsletter') ?></h5>
|
||||
<p class="small text-muted"><?= __('newsletter_desc') ?></p>
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" class="form-control bg-dark text-white border-secondary" placeholder="Email address">
|
||||
<button class="btn btn-primary">Join</button>
|
||||
<input type="email" class="form-control bg-dark text-white border-secondary" placeholder="<?= __('email_address') ?>">
|
||||
<button class="btn btn-primary"><?= __('join') ?></button>
|
||||
</div>
|
||||
<hr class="border-secondary">
|
||||
<h5 class="fw-bold mb-3">Popular Topics</h5>
|
||||
<h5 class="fw-bold mb-3"><?= __('popular_topics') ?></h5>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<span class="badge border border-secondary p-2">#Bitcoin</span>
|
||||
<span class="badge border border-secondary p-2">#Web3</span>
|
||||
|
||||
15
orders.php
15
orders.php
@ -98,9 +98,18 @@ $types_map = [
|
||||
</td>
|
||||
<td class="py-4">
|
||||
<div class="fw-bold text-white"><?= number_format($r['amount'], 2) ?></div>
|
||||
<?php if ($r['direction']): ?>
|
||||
<div class="small <?= (strpos($r['direction'], 'up') !== false || strpos($r['direction'], 'long') !== false || strpos($r['direction'], 'buy') !== false) ? 'text-success' : 'text-danger' ?>">
|
||||
<?= strtoupper($r['direction']) ?>
|
||||
<?php if ($r['direction']):
|
||||
$dir = strtolower($r['direction']);
|
||||
$dirText = $dir;
|
||||
if ($dir === 'up') $dirText = __('buy_up');
|
||||
elseif ($dir === 'down') $dirText = __('buy_down');
|
||||
elseif ($dir === 'buy') $dirText = __('buy');
|
||||
elseif ($dir === 'sell') $dirText = __('sell');
|
||||
elseif ($dir === 'long') $dirText = __('long');
|
||||
elseif ($dir === 'short') $dirText = __('short');
|
||||
?>
|
||||
<div class="small <?= (strpos($dir, 'up') !== false || strpos($dir, 'long') !== false || strpos($dir, 'buy') !== false) ? 'text-success' : 'text-danger' ?>">
|
||||
<?= $dirText ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
32
profile.php
32
profile.php
@ -114,7 +114,7 @@ $kycStatusColor = [
|
||||
<!-- Menu List -->
|
||||
<div class="list-group list-group-flush">
|
||||
<div class="list-group-item py-3 d-flex justify-content-between align-items-center">
|
||||
<span class="text-white-50 small"><i class="bi bi-person-badge me-2 text-primary"></i>UID</span>
|
||||
<span class="text-white-50 small"><i class="bi bi-person-badge me-2 text-primary"></i><?= __('uid') ?></span>
|
||||
<span class="text-white fw-bold small"><?= $userData['uid'] ?></span>
|
||||
</div>
|
||||
<div class="list-group-item py-3 d-flex justify-content-between align-items-center">
|
||||
@ -123,8 +123,30 @@ $kycStatusColor = [
|
||||
</div>
|
||||
<div class="list-group-item py-3 d-flex justify-content-between align-items-center">
|
||||
<span class="text-white-50 small"><i class="bi bi-gem me-2 text-warning"></i><?= __('vip_level') ?></span>
|
||||
<span class="badge bg-warning text-dark fw-bold">VIP <?= $vipLevel ?></span>
|
||||
<span class="badge bg-warning text-dark fw-bold"><?= __('level') ?> <?= $vipLevel ?></span>
|
||||
</div>
|
||||
<?php if ($vipLevel < 7):
|
||||
$nextLevel = $vipLevel + 1;
|
||||
$thresholds = [1 => 10001, 2 => 50000, 3 => 100000, 4 => 500000, 5 => 1000000, 6 => 5000000, 7 => 10000000];
|
||||
$needed = $thresholds[$nextLevel] - ($userData['total_recharge'] ?? 0);
|
||||
if ($needed > 0):
|
||||
?>
|
||||
<div class="list-group-item py-2 bg-black bg-opacity-20 border-0">
|
||||
<div class="small text-white-50 mb-1" style="font-size: 10px;">
|
||||
<?= str_replace(['%amount%', '%level%'], [number_format($needed, 2), $nextLevel], __('recharge_to_upgrade')) ?>
|
||||
</div>
|
||||
<div class="progress rounded-pill shadow-sm" style="height: 4px; background: rgba(255,255,255,0.1);">
|
||||
<div class="progress-bar bg-warning progress-bar-striped progress-bar-animated" style="width: <?= min(100, (($userData['total_recharge'] ?? 0) / $thresholds[$nextLevel]) * 100) ?>%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<div class="list-group-item py-2 bg-black bg-opacity-20 border-0">
|
||||
<div class="small text-success" style="font-size: 10px;">
|
||||
<i class="bi bi-check2-circle me-1"></i><?= __('highest_level') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="/kyc.php" class="list-group-item list-group-item-action py-3 d-flex justify-content-between align-items-center">
|
||||
<span class="text-white-50 small"><i class="bi bi-person-vcard me-2 text-success"></i><?= __('kyc') ?></span>
|
||||
@ -264,13 +286,13 @@ $kycStatusColor = [
|
||||
if ($t['type'] === 'binary_win' || $t['type'] === 'deposit' || $t['type'] === 'recharge' || $t['type'] === 'contract_settle') $prefix = '+';
|
||||
if ($t['type'] === 'binary_loss' || $t['type'] === 'withdraw' || $t['type'] === 'withdrawal' || $t['type'] === 'contract_margin') $prefix = '-';
|
||||
|
||||
$statusText = __('pending') ?? '处理中';
|
||||
$statusText = __('pending');
|
||||
$statusClass = 'bg-warning text-warning';
|
||||
if ($t['status'] === 'completed' || $t['status'] === 'approved') {
|
||||
$statusText = __('approved') ?? '通过';
|
||||
$statusText = __('approved');
|
||||
$statusClass = 'bg-success text-success';
|
||||
} elseif ($t['status'] === 'rejected') {
|
||||
$statusText = __('rejected') ?? '拒绝';
|
||||
$statusText = __('rejected');
|
||||
$statusClass = 'bg-danger text-danger';
|
||||
}
|
||||
?>
|
||||
|
||||
61
recharge.php
61
recharge.php
@ -52,18 +52,18 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('select_currency') ?></label>
|
||||
<select class="form-select bg-dark border-secondary text-white py-3" id="fiatCurrency" onchange="updateRate()">
|
||||
<option value="USD" data-rate="1">🇺🇸 USD - US Dollar</option>
|
||||
<option value="EUR" data-rate="0.92">🇪🇺 EUR - Euro</option>
|
||||
<option value="GBP" data-rate="0.79">🇬🇧 GBP - British Pound</option>
|
||||
<option value="CNY" data-rate="7.19">🇨🇳 CNY - Chinese Yuan</option>
|
||||
<option value="JPY" data-rate="150.2">🇯🇵 JPY - Japanese Yen</option>
|
||||
<option value="KRW" data-rate="1330.5">🇰🇷 KRW - Korean Won</option>
|
||||
<option value="HKD" data-rate="7.82">🇭🇰 HKD - Hong Kong Dollar</option>
|
||||
<option value="TWD" data-rate="31.5">🇹🇼 TWD - Taiwan Dollar</option>
|
||||
<option value="SGD" data-rate="1.34">🇸🇬 SGD - Singapore Dollar</option>
|
||||
<option value="MYR" data-rate="4.77">🇲🇾 MYR - Malaysian Ringgit</option>
|
||||
<option value="THB" data-rate="35.8">🇹🇭 THB - Thai Baht</option>
|
||||
<option value="VND" data-rate="24500">🇻🇳 VND - Vietnamese Dong</option>
|
||||
<option value="USD" data-rate="1">🇺🇸 USD - <?= __('usd_name') ?></option>
|
||||
<option value="EUR" data-rate="0.92">🇪🇺 EUR - <?= __('eur_name') ?></option>
|
||||
<option value="GBP" data-rate="0.79">🇬🇧 GBP - <?= __('gbp_name') ?></option>
|
||||
<option value="CNY" data-rate="7.19">🇨🇳 CNY - <?= __('cny_name') ?></option>
|
||||
<option value="JPY" data-rate="150.2">🇯🇵 JPY - <?= __('jpy_name') ?></option>
|
||||
<option value="KRW" data-rate="1330.5">🇰🇷 KRW - <?= __('krw_name') ?></option>
|
||||
<option value="HKD" data-rate="7.82">🇭🇰 HKD - <?= __('hkd_name') ?></option>
|
||||
<option value="TWD" data-rate="31.5">🇹🇼 TWD - <?= __('twd_name') ?></option>
|
||||
<option value="SGD" data-rate="1.34">🇸🇬 SGD - <?= __('sgd_name') ?></option>
|
||||
<option value="MYR" data-rate="4.77">🇲🇾 MYR - <?= __('myr_name') ?></option>
|
||||
<option value="THB" data-rate="35.8">🇹🇭 THB - <?= __('thb_name') ?></option>
|
||||
<option value="VND" data-rate="24500">🇻🇳 VND - <?= __('vnd_name') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -106,7 +106,7 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('recharge_amount') ?? '充值金额' ?> (USDT)</label>
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('recharge_amount') ?> (USDT)</label>
|
||||
<input type="number" class="form-control bg-dark border-secondary text-white py-3" id="cryptoAmount" placeholder="<?= __('enter_amount') ?>">
|
||||
</div>
|
||||
|
||||
@ -133,11 +133,11 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
|
||||
<div class="p-3 bg-warning bg-opacity-10 border border-warning border-opacity-20 rounded-4 small text-warning mb-4">
|
||||
<i class="bi bi-exclamation-triangle me-2"></i>
|
||||
⚠️ <?= __('crypto_recharge_warning') ?? 'Please only send USDT to this address. Sending other assets may result in permanent loss.' ?>
|
||||
⚠️ <?= __('crypto_recharge_warning') ?>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-outline-primary w-100 py-3 rounded-pill fw-bold" onclick="confirmCryptoOrder()">
|
||||
<?= __('i_have_paid') ?? 'I have paid' ?>
|
||||
<?= __('i_have_paid') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -145,11 +145,11 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
</div>
|
||||
|
||||
<!-- Rich Content Sections -->
|
||||
<div class="row g-4 mb-5">
|
||||
<div class="row g-4 mb-5">
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-surface border-secondary rounded-4 h-100">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-journal-text text-primary me-2"></i> <?= __('recharge_steps') ?? 'Recharge Steps' ?></h5>
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-journal-text text-primary me-2"></i> <?= __('recharge_steps') ?></h5>
|
||||
<div class="text-white-50 small lh-lg">
|
||||
<div class="d-flex gap-3 mb-2">
|
||||
<span class="badge bg-primary rounded-circle p-2" style="width:24px; height:24px; display:flex; align-items:center; justify-content:center;">1</span>
|
||||
@ -174,7 +174,7 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-surface border-secondary rounded-4 h-100">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-shield-lock text-success me-2"></i> <?= __('security_tips') ?? 'Security Tips' ?></h5>
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-shield-lock text-success me-2"></i> <?= __('security_tips') ?></h5>
|
||||
<div class="text-white-50 small lh-lg">
|
||||
<ul class="ps-3 mb-0">
|
||||
<li><?= __('recharge_tip1') ?></li>
|
||||
@ -246,21 +246,25 @@ function selectNetwork(net, addr) {
|
||||
document.getElementById('qrCode').src = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${addr}`;
|
||||
}
|
||||
|
||||
const userId = '<?= $user['uid'] ?? $user['id'] ?>';
|
||||
|
||||
function confirmFiatOrder() {
|
||||
const amount = document.getElementById('fiatAmount').value;
|
||||
const amountInput = document.getElementById('fiatAmount');
|
||||
const amount = parseFloat(amountInput.value);
|
||||
const select = document.getElementById('fiatCurrency');
|
||||
const currency = select.value;
|
||||
const rate = parseFloat(select.options[select.selectedIndex].getAttribute('data-rate'));
|
||||
const estUsdt = parseFloat(document.getElementById('estUsdt').innerText.replace(' USDT', '').replace(/,/g, ''));
|
||||
|
||||
if (!amount || amount <= 0) {
|
||||
if (isNaN(amount) || amount <= 0) {
|
||||
alert('<?= __("enter_amount") ?>');
|
||||
return;
|
||||
}
|
||||
|
||||
const estUsdt = amount / rate;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('action', 'recharge');
|
||||
formData.append('amount', estUsdt); // Store USDT amount
|
||||
formData.append('amount', estUsdt); // High precision USDT amount
|
||||
formData.append('symbol', 'USDT');
|
||||
formData.append('fiat_amount', amount);
|
||||
formData.append('fiat_currency', currency);
|
||||
@ -273,7 +277,13 @@ function confirmFiatOrder() {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const message = `[RECHARGE REQUEST]\n------------------\nType: Fiat Recharge\nAmount: ${amount} ${currency}\nRate: 1 USDT = ${rate} ${currency}\nEst. USDT: ${estUsdt.toFixed(2)} USDT\nStatus: Pending Approval\n------------------\nPlease confirm my deposit.`;
|
||||
let message = `<?= __('recharge_msg_fiat') ?>`;
|
||||
const preciseRes = (amount / rate).toFixed(4);
|
||||
message = message.replace('%uid%', userId)
|
||||
.replace('%amount%', amount)
|
||||
.replace('%currency%', currency)
|
||||
.replace('%rate%', rate)
|
||||
.replace('%res%', preciseRes);
|
||||
sendToCS(message);
|
||||
} else {
|
||||
alert(data.error || 'Request failed');
|
||||
@ -303,7 +313,10 @@ function confirmCryptoOrder() {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const message = `[RECHARGE REQUEST]\n------------------\nType: USDT (${currentNetwork})\nNetwork: ${currentNetwork}\nTo Address: ${currentAddress}\nAmount: ${amount} USDT\nStatus: Paid\n------------------\nPlease verify my transaction.`;
|
||||
let message = `<?= __('recharge_msg_crypto') ?>`;
|
||||
message = message.replace('%uid%', userId)
|
||||
.replace('%network%', currentNetwork)
|
||||
.replace('%amount%', amount);
|
||||
sendToCS(message);
|
||||
} else {
|
||||
alert(data.error || 'Request failed');
|
||||
|
||||
27
support.php
27
support.php
@ -9,32 +9,31 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="card bg-dark border-secondary p-4">
|
||||
<form action="#" method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label text-muted small">Your Email Address</label>
|
||||
<label class="form-label text-muted small"><?= __('email_address') ?></label>
|
||||
<input type="email" class="form-control bg-dark text-white border-secondary" placeholder="email@example.com" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label text-muted small">Issue Type</label>
|
||||
<label class="form-label text-muted small"><?= __('issue_type') ?></label>
|
||||
<select class="form-select bg-dark text-white border-secondary">
|
||||
<option>Account Access</option>
|
||||
<option>Deposit/Withdrawal</option>
|
||||
<option>Trading Issue</option>
|
||||
<option>Bug Report</option>
|
||||
<option>Other</option>
|
||||
<option><?= __('account_access') ?></option>
|
||||
<option><?= __('dep_with_issue') ?></option>
|
||||
<option><?= __('trading_issue') ?></option>
|
||||
<option><?= __('bug_report') ?></option>
|
||||
<option><?= __('other') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label text-muted small">Subject</label>
|
||||
<input type="text" class="form-control bg-dark text-white border-secondary" placeholder="Short description of the issue" required>
|
||||
<label class="form-label text-muted small"><?= __('subject') ?></label>
|
||||
<input type="text" class="form-control bg-dark text-white border-secondary" placeholder="<?= __('description') ?>" required>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-muted small">Description</label>
|
||||
<textarea class="form-control bg-dark text-white border-secondary" rows="5" placeholder="Please provide details about your request..." required></textarea>
|
||||
<label class="form-label text-muted small"><?= __('description') ?></label>
|
||||
<textarea class="form-control bg-dark text-white border-secondary" rows="5" placeholder="<?= __('description') ?>" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100 py-3 fw-bold">Submit Ticket</button>
|
||||
<button type="submit" class="btn btn-primary w-100 py-3 fw-bold"><?= __('submit_ticket') ?></button>
|
||||
</form>
|
||||
<div class="mt-4 text-center small text-muted">
|
||||
Our typical response time is under 2 hours.
|
||||
For urgent issues, please use the live chat in the bottom right.
|
||||
<?= __('support_response_time') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
7
swap.php
7
swap.php
@ -78,11 +78,11 @@ if ($user) {
|
||||
<div class="mb-4 small px-3 py-3 rounded-4" style="background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);">
|
||||
<div class="d-flex justify-content-between text-white opacity-50 mb-2">
|
||||
<span class="fw-medium"><?= __('rate') ?></span>
|
||||
<span id="swap-rate" class="text-white fw-bold">1 BTC ≈ 64,234.50 USDT</span>
|
||||
<span id="swap-rate" class="text-white fw-bold">--</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between text-white opacity-50 mb-2">
|
||||
<span class="fw-medium"><?= __('price_impact') ?></span>
|
||||
<span class="text-success fw-bold">< 0.01%</span>
|
||||
<span class="text-success fw-bold">< 0.01%</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between text-white opacity-50">
|
||||
<span class="fw-medium"><?= __('slippage') ?></span>
|
||||
@ -99,6 +99,7 @@ if ($user) {
|
||||
const fromInput = document.querySelector('input[placeholder="0.00"]:not([readonly])');
|
||||
const toInput = document.querySelector('input[readonly]');
|
||||
const rateEl = document.getElementById('swap-rate');
|
||||
const approxLabel = '<?= __('approx') ?>';
|
||||
let rate = 1 / 64234.50;
|
||||
|
||||
function selectCoin(type, symbol, icon) {
|
||||
@ -126,7 +127,7 @@ function updateCalculation() {
|
||||
toInput.value = (val * rate).toFixed(8);
|
||||
const fromSymbol = document.getElementById('from-coin-symbol').innerText;
|
||||
const toSymbol = document.getElementById('to-coin-symbol').innerText;
|
||||
rateEl.innerText = `1 ${toSymbol} ${'<?= $lang ?>' === 'zh' ? '约等于' : '≈'} ${(1/rate).toLocaleString()} ${fromSymbol}`;
|
||||
rateEl.innerText = `1 ${toSymbol} ${approxLabel} ${(1/rate).toLocaleString()} ${fromSymbol}`;
|
||||
}
|
||||
|
||||
fromInput.addEventListener('input', updateCalculation);
|
||||
|
||||
22
tos.php
22
tos.php
@ -7,26 +7,26 @@ require_once __DIR__ . '/includes/header.php';
|
||||
<div class="col-lg-10">
|
||||
<h1 class="mb-5 fw-bold"><?php echo __('terms'); ?></h1>
|
||||
<div class="card bg-dark border-secondary p-5">
|
||||
<p class="text-muted mb-4">Effective Date: February 16, 2026</p>
|
||||
<p class="text-muted mb-4"><?= __('effective_date') ?></p>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">1. Acceptance of Terms</h3>
|
||||
<p class="text-muted">By accessing or using the Byro platform, you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use our services.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('tos_1_title') ?></h3>
|
||||
<p class="text-muted"><?= __('tos_1_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">2. Eligibility</h3>
|
||||
<p class="text-muted">You must be at least 18 years old and have the legal capacity to enter into a binding agreement to use our platform. You are responsible for ensuring that your use of Byro complies with all local laws and regulations.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('tos_2_title') ?></h3>
|
||||
<p class="text-muted"><?= __('tos_2_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">3. Account Security</h3>
|
||||
<p class="text-muted">You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account. You agree to notify Byro immediately of any unauthorized use of your account.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('tos_3_title') ?></h3>
|
||||
<p class="text-muted"><?= __('tos_3_content') ?></p>
|
||||
</section>
|
||||
<section class="mb-5">
|
||||
<h3 class="fw-bold mb-3">4. Trading Risks</h3>
|
||||
<p class="text-muted">Digital asset trading involves significant risk. Prices can be highly volatile, and you may lose your entire investment. Byro does not provide financial advice.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('tos_4_title') ?></h3>
|
||||
<p class="text-muted"><?= __('tos_4_content') ?></p>
|
||||
</section>
|
||||
<section>
|
||||
<h3 class="fw-bold mb-3">5. Termination</h3>
|
||||
<p class="text-muted">Byro reserves the right to suspend or terminate your account at any time for any reason, including violation of these terms.</p>
|
||||
<h3 class="fw-bold mb-3"><?= __('tos_5_title') ?></h3>
|
||||
<p class="text-muted"><?= __('tos_5_content') ?></p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
67
withdraw.php
67
withdraw.php
@ -35,10 +35,10 @@ $available = $bal['available'] ?? 0;
|
||||
<!-- Tabs -->
|
||||
<ul class="nav nav-pills nav-fill mb-4 bg-black p-1 rounded-pill" id="withdrawTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active rounded-pill px-4" id="crypto-withdraw-tab" data-bs-toggle="pill" data-bs-target="#crypto-withdraw" type="button" role="tab"><?= __('crypto_withdraw') ?? 'USDT Withdrawal' ?></button>
|
||||
<button class="nav-link active rounded-pill px-4" id="crypto-withdraw-tab" data-bs-toggle="pill" data-bs-target="#crypto-withdraw" type="button" role="tab"><?= __('crypto_withdraw') ?></button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link rounded-pill px-4" id="fiat-withdraw-tab" data-bs-toggle="pill" data-bs-target="#fiat-withdraw" type="button" role="tab"><?= __('fiat_withdraw') ?? 'Fiat Withdrawal' ?></button>
|
||||
<button class="nav-link rounded-pill px-4" id="fiat-withdraw-tab" data-bs-toggle="pill" data-bs-target="#fiat-withdraw" type="button" role="tab"><?= __('fiat_withdraw') ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -56,7 +56,7 @@ $available = $bal['available'] ?? 0;
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('network') ?></label>
|
||||
<div class="d-flex gap-2" id="withdrawNetworkSelectors">
|
||||
@ -83,17 +83,17 @@ $available = $bal['available'] ?? 0;
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('withdraw_password') ?? '提现密码' ?></label>
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('withdraw_password') ?></label>
|
||||
<input type="password" class="form-control bg-dark border-secondary text-white py-3" id="withdrawPassword" placeholder="<?= __('withdraw_pwd_placeholder') ?>">
|
||||
</div>
|
||||
|
||||
<div class="mb-5 p-4 bg-warning bg-opacity-10 border border-warning border-opacity-20 rounded-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<span class="text-white-50 small"><?= __('withdraw_fee') ?> (Fee)</span>
|
||||
<span class="text-white-50 small"><?= __('withdraw_fee') ?></span>
|
||||
<span class="text-white small">1.00 USDT</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-white-50"><?= __('to_receive') ?? '预计到账' ?></span>
|
||||
<span class="text-white-50"><?= __('to_receive') ?></span>
|
||||
<span class="h4 mb-0 fw-bold text-warning" id="cryptoReceiveAmount">0.00 USDT</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -110,18 +110,18 @@ $available = $bal['available'] ?? 0;
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('select_currency') ?></label>
|
||||
<select class="form-select bg-dark border-secondary text-white py-3" id="fiatWithdrawCurrency" onchange="updateFiatWithdrawRate()">
|
||||
<option value="USD" data-rate="1">🇺🇸 USD - US Dollar</option>
|
||||
<option value="EUR" data-rate="0.92">🇪🇺 EUR - Euro</option>
|
||||
<option value="GBP" data-rate="0.79">🇬🇧 GBP - British Pound</option>
|
||||
<option value="CNY" data-rate="7.19">🇨🇳 CNY - Chinese Yuan</option>
|
||||
<option value="JPY" data-rate="150.2">🇯🇵 JPY - Japanese Yen</option>
|
||||
<option value="KRW" data-rate="1330.5">🇰🇷 KRW - Korean Won</option>
|
||||
<option value="HKD" data-rate="7.82">🇭🇰 HKD - Hong Kong Dollar</option>
|
||||
<option value="TWD" data-rate="31.5">🇹🇼 TWD - Taiwan Dollar</option>
|
||||
<option value="SGD" data-rate="1.34">🇸🇬 SGD - Singapore Dollar</option>
|
||||
<option value="MYR" data-rate="4.77">🇲🇾 MYR - Malaysian Ringgit</option>
|
||||
<option value="THB" data-rate="35.8">🇹🇭 THB - Thai Baht</option>
|
||||
<option value="VND" data-rate="24500">🇻🇳 VND - Vietnamese Dong</option>
|
||||
<option value="USD" data-rate="1">🇺🇸 USD - <?= __('usd_name') ?></option>
|
||||
<option value="EUR" data-rate="0.92">🇪🇺 EUR - <?= __('eur_name') ?></option>
|
||||
<option value="GBP" data-rate="0.79">🇬🇧 GBP - <?= __('gbp_name') ?></option>
|
||||
<option value="CNY" data-rate="7.19">🇨🇳 CNY - <?= __('cny_name') ?></option>
|
||||
<option value="JPY" data-rate="150.2">🇯🇵 JPY - <?= __('jpy_name') ?></option>
|
||||
<option value="KRW" data-rate="1330.5">🇰🇷 KRW - <?= __('krw_name') ?></option>
|
||||
<option value="HKD" data-rate="7.82">🇭🇰 HKD - <?= __('hkd_name') ?></option>
|
||||
<option value="TWD" data-rate="31.5">🇹🇼 TWD - <?= __('twd_name') ?></option>
|
||||
<option value="SGD" data-rate="1.34">🇸🇬 SGD - <?= __('sgd_name') ?></option>
|
||||
<option value="MYR" data-rate="4.77">🇲🇾 MYR - <?= __('myr_name') ?></option>
|
||||
<option value="THB" data-rate="35.8">🇹🇭 THB - <?= __('thb_name') ?></option>
|
||||
<option value="VND" data-rate="24500">🇻🇳 VND - <?= __('vnd_name') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -137,7 +137,7 @@ $available = $bal['available'] ?? 0;
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('withdraw_password') ?? '提现密码' ?></label>
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('withdraw_password') ?></label>
|
||||
<input type="password" class="form-control bg-dark border-secondary text-white py-3" id="fiatWithdrawPassword" placeholder="<?= __('withdraw_pwd_placeholder') ?>">
|
||||
</div>
|
||||
|
||||
@ -147,7 +147,7 @@ $available = $bal['available'] ?? 0;
|
||||
<span class="text-white small" id="fiatWithdrawRateText">1.00 USD</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-white-50"><?= __('est_receive_fiat') ?? '预计收到法币' ?></span>
|
||||
<span class="text-white-50"><?= __('est_receive_fiat') ?></span>
|
||||
<span class="h4 mb-0 fw-bold text-primary" id="fiatReceiveAmount">0.00 USD</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -166,7 +166,7 @@ $available = $bal['available'] ?? 0;
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-surface border-secondary rounded-4 h-100">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-journal-text text-warning me-2"></i> <?= __('withdraw_steps') ?? '提现步骤' ?></h5>
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-journal-text text-warning me-2"></i> <?= __('withdraw_steps') ?></h5>
|
||||
<div class="text-white-50 small lh-lg">
|
||||
<div class="d-flex gap-3 mb-2">
|
||||
<span class="badge bg-warning text-dark rounded-circle p-2" style="width:24px; height:24px; display:flex; align-items:center; justify-content:center;">1</span>
|
||||
@ -191,7 +191,7 @@ $available = $bal['available'] ?? 0;
|
||||
<div class="col-md-6">
|
||||
<div class="card bg-surface border-secondary rounded-4 h-100">
|
||||
<div class="card-body p-4">
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-shield-lock text-danger me-2"></i> <?= __('security_tips') ?? '安全提示' ?></h5>
|
||||
<h5 class="text-white fw-bold mb-3"><i class="bi bi-shield-lock text-danger me-2"></i> <?= __('security_tips') ?></h5>
|
||||
<div class="text-white-50 small lh-lg">
|
||||
<ul class="ps-3 mb-0">
|
||||
<li><?= __('withdraw_tip1') ?></li>
|
||||
@ -268,6 +268,8 @@ function calculateFiatWithdraw() {
|
||||
document.getElementById('fiatReceiveAmount').innerText = est.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + ' ' + select.value;
|
||||
}
|
||||
|
||||
const userId = '<?= $user['uid'] ?? $user['id'] ?>';
|
||||
|
||||
function confirmCryptoWithdraw() {
|
||||
const addr = document.getElementById('withdrawAddress').value.trim();
|
||||
const amount = parseFloat(document.getElementById('withdrawAmount').value);
|
||||
@ -292,7 +294,10 @@ function confirmCryptoWithdraw() {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const message = `[WITHDRAWAL REQUEST]\n------------------\nType: USDT (${currentWithdrawNetwork})\nNetwork: ${currentWithdrawNetwork}\nAddress: ${addr}\nAmount: ${amount} USDT\nFee: 1.00 USDT\nTo Receive: ${(amount - 1).toFixed(2)} USDT\n------------------\nPlease process my withdrawal.`;
|
||||
let message = `<?= __('withdraw_msg_crypto') ?>`;
|
||||
message = message.replace('%uid%', userId)
|
||||
.replace('%network%', currentWithdrawNetwork)
|
||||
.replace('%amount%', amount.toFixed(2));
|
||||
sendWithdrawToCS(message);
|
||||
} else {
|
||||
alert(data.error || 'Request failed');
|
||||
@ -301,17 +306,19 @@ function confirmCryptoWithdraw() {
|
||||
}
|
||||
|
||||
function confirmFiatWithdraw() {
|
||||
const amount = parseFloat(document.getElementById('fiatWithdrawAmount').value);
|
||||
const amountInput = document.getElementById('fiatWithdrawAmount');
|
||||
const amount = parseFloat(amountInput.value);
|
||||
const select = document.getElementById('fiatWithdrawCurrency');
|
||||
const currency = select.value;
|
||||
const rate = parseFloat(select.options[select.selectedIndex].getAttribute('data-rate'));
|
||||
const estFiat = parseFloat(document.getElementById('fiatReceiveAmount').innerText.replace(' ' + currency, '').replace(/,/g, ''));
|
||||
const password = document.getElementById('fiatWithdrawPassword').value;
|
||||
|
||||
if (!amount || amount < 10) { alert('<?= __("min_withdraw_hint") ?>'); return; }
|
||||
if (isNaN(amount) || amount < 10) { alert('<?= __("min_withdraw_hint") ?>'); return; }
|
||||
if (amount > <?= $available ?>) { alert('<?= __("insufficient_balance") ?>'); return; }
|
||||
if (!password) { alert('<?= __("enter_password") ?>'); return; }
|
||||
|
||||
const estFiat = amount * rate;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('action', 'withdraw');
|
||||
formData.append('amount', amount); // USDT amount
|
||||
@ -328,7 +335,13 @@ function confirmFiatWithdraw() {
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const message = `[WITHDRAWAL REQUEST]\n------------------\nType: Fiat Withdrawal\nAmount: ${amount.toFixed(2)} USDT\nRate: 1 USDT = ${rate} ${currency}\nTo Receive: ${estFiat.toFixed(2)} ${currency}\n------------------\nPlease process my fiat withdrawal.`;
|
||||
let message = `<?= __('withdraw_msg_fiat') ?>`;
|
||||
const preciseRes = (amount * rate).toFixed(2);
|
||||
message = message.replace('%uid%', userId)
|
||||
.replace('%amount%', amount.toFixed(2))
|
||||
.replace('%rate%', rate)
|
||||
.replace('%currency%', currency)
|
||||
.replace('%res%', preciseRes);
|
||||
sendWithdrawToCS(message);
|
||||
} else {
|
||||
alert(data.error || 'Request failed');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user