Autosave: 20260209-074401

This commit is contained in:
Flatlogic Bot 2026-02-09 07:44:01 +00:00
parent 4607bec72f
commit 4d100057a8
23 changed files with 2100 additions and 1263 deletions

28
admin/api_notif.php Normal file
View File

@ -0,0 +1,28 @@
<?php
require_once '../db/config.php';
session_start();
// Simple admin check
$user_id = $_SESSION['user_id'] ?? 0;
$stmt = db()->prepare("SELECT is_admin FROM users WHERE id = ?");
$stmt->execute([$user_id]);
$u = $stmt->fetch();
if (!$u || !$u['is_admin']) {
echo json_encode(['error' => 'Unauthorized']);
exit;
}
// Count pending deposits and unread messages
$stmt = db()->query("SELECT COUNT(*) as cnt FROM deposits WHERE status = 'pending'");
$dep_count = $stmt->fetch()['cnt'];
$stmt = db()->query("SELECT COUNT(*) as cnt FROM chat_messages WHERE admin_id IS NULL AND is_read = 0");
$chat_count = $stmt->fetch()['cnt'];
echo json_encode([
'success' => true,
'new_count' => $dep_count + $chat_count,
'deposits' => $dep_count,
'chats' => $chat_count
]);

View File

@ -8,6 +8,31 @@ if (!$user || !$user['is_admin']) {
$msg = ''; $msg = '';
// Handle Deposit Approval
if (isset($_GET['action']) && isset($_GET['id'])) {
$id = $_GET['id'];
if ($_GET['action'] === 'approve') {
$stmt = db()->prepare("SELECT * FROM deposits WHERE id = ?");
$stmt->execute([$id]);
$dep = $stmt->fetch();
if ($dep && $dep['status'] === 'pending') {
db()->beginTransaction();
$stmt = db()->prepare("UPDATE deposits SET status = 'approved' WHERE id = ?");
$stmt->execute([$id]);
// Add balance to user
$stmt = db()->prepare("UPDATE users SET balance_usdt = balance_usdt + ? WHERE id = ?");
$stmt->execute([$dep['amount'], $dep['user_id']]);
db()->commit();
$msg = "Deposit approved and balance added.";
}
} elseif ($_GET['action'] === 'reject') {
$stmt = db()->prepare("UPDATE deposits SET status = 'rejected' WHERE id = ?");
$stmt->execute([$id]);
$msg = "Deposit rejected.";
}
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['update_config'])) { if (isset($_POST['update_config'])) {
foreach ($_POST['config'] as $key => $value) { foreach ($_POST['config'] as $key => $value) {
@ -25,36 +50,126 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$msg = 'User control updated.'; $msg = 'User control updated.';
} }
if (isset($_POST['update_price'])) { if (isset($_POST['send_reply'])) {
$symbol = $_POST['symbol']; $user_id = $_POST['user_id'];
$price = $_POST['price']; $reply = $_POST['message'];
$key = 'price_' . $symbol; $stmt = db()->prepare("INSERT INTO chat_messages (user_id, admin_id, message) VALUES (?, ?, ?)");
$stmt = db()->prepare("INSERT INTO system_config (config_key, config_value) VALUES (?, ?) ON DUPLICATE KEY UPDATE config_value = ?"); $stmt->execute([$user_id, $user['id'], $reply]);
$stmt->execute([$key, $price, $price]); $msg = 'Reply sent.';
$msg = "Price for $symbol set to $price";
} }
} }
// Fetch pending deposits
$stmt = db()->query("SELECT d.*, u.username, u.uid FROM deposits d JOIN users u ON d.user_id = u.id WHERE d.status = 'pending' ORDER BY d.created_at DESC");
$pending_deposits = $stmt->fetchAll();
// Fetch all users // Fetch all users
$stmt = db()->query("SELECT * FROM users ORDER BY created_at DESC"); $stmt = db()->query("SELECT * FROM users ORDER BY created_at DESC");
$all_users = $stmt->fetchAll(); $all_users = $stmt->fetchAll();
// Fetch current config // Fetch latest chat messages (group by user)
$stmt = db()->query("SELECT config_key, config_value FROM system_config"); $stmt = db()->query("SELECT m.*, u.username, u.uid FROM chat_messages m JOIN users u ON m.user_id = u.id ORDER BY m.created_at DESC LIMIT 50");
$current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR); $chats = $stmt->fetchAll();
?> ?>
<div class="container my-5"> <div class="container my-5">
<h1 class="mb-5 fw-bold">Admin Dashboard</h1> <div class="d-flex justify-content-between align-items-center mb-5">
<h1 class="fw-bold m-0">Admin Dashboard</h1>
<span class="badge bg-danger rounded-pill px-3 py-2" id="notif-badge" style="display:none;">New Notifications</span>
</div>
<?php if ($msg): ?> <?php if ($msg): ?>
<div class="alert alert-success"><?php echo $msg; ?></div> <div class="alert alert-success alert-dismissible fade show">
<?php echo $msg; ?>
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
<?php endif; ?> <?php endif; ?>
<div class="row g-4"> <div class="row g-4">
<!-- Pending Deposits -->
<div class="col-12">
<div class="card bg-dark border-secondary p-4 shadow">
<h4 class="mb-4 text-warning"><i class="fas fa-money-bill-wave me-2"></i> Pending Deposits</h4>
<div class="table-responsive">
<table class="table table-dark table-hover align-middle">
<thead>
<tr>
<th>UID</th>
<th>User</th>
<th>Amount</th>
<th>Receipt</th>
<th>Time</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($pending_deposits as $d): ?>
<tr>
<td><?php echo str_pad($d['uid'] ?? '0', 6, '0', STR_PAD_LEFT); ?></td>
<td><?php echo htmlspecialchars($d['username']); ?></td>
<td class="fw-bold"><?php echo number_format($d['amount'], 2); ?> <?php echo $d['currency']; ?></td>
<td>
<a href="../<?php echo $d['receipt_url']; ?>" target="_blank" class="btn btn-sm btn-outline-info">View Proof</a>
</td>
<td class="small text-muted"><?php echo $d['created_at']; ?></td>
<td>
<a href="?action=approve&id=<?php echo $d['id']; ?>" class="btn btn-sm btn-success px-3">Approve</a>
<a href="?action=reject&id=<?php echo $d['id']; ?>" class="btn btn-sm btn-danger px-3">Reject</a>
</td>
</tr>
<?php endforeach; ?>
<?php if (empty($pending_deposits)): ?>
<tr><td colspan="6" class="text-center text-muted py-4">No pending deposits.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Customer Service Chat -->
<div class="col-lg-8">
<div class="card bg-dark border-secondary p-4 h-100 shadow">
<h4 class="mb-4 text-primary"><i class="fas fa-headset me-2"></i> Customer Service</h4>
<div class="chat-box overflow-auto mb-4 p-3 rounded bg-black bg-opacity-25" style="height: 400px;" id="admin-chat-box">
<?php foreach ($chats as $c): ?>
<div class="mb-3 <?php echo $c['admin_id'] ? 'text-end' : ''; ?>">
<div class="small text-muted mb-1">
<?php echo $c['admin_id'] ? 'Admin' : htmlspecialchars($c['username']) . " (UID: " . str_pad($c['uid'], 6, '0', STR_PAD_LEFT) . ")"; ?>
<span class="ms-2"><?php echo $c['created_at']; ?></span>
</div>
<div class="d-inline-block p-2 rounded-3 <?php echo $c['admin_id'] ? 'bg-primary text-white' : 'bg-secondary text-white'; ?>" style="max-width: 80% text-wrap: wrap;">
<?php echo nl2br(htmlspecialchars($c['message'])); ?>
<?php if ($c['attachment_url']): ?>
<div class="mt-2">
<a href="../<?php echo $c['attachment_url']; ?>" target="_blank" class="text-white small text-decoration-underline">View Attachment</a>
</div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<form method="POST" class="d-flex gap-2">
<input type="hidden" name="send_reply" value="1">
<select name="user_id" class="form-select bg-dark text-white border-secondary w-25" required>
<option value="">Select User</option>
<?php
$unique_users = [];
foreach($chats as $c) {
if (!$c['admin_id']) $unique_users[$c['user_id']] = $c['username'];
}
foreach($unique_users as $uid => $uname) echo "<option value='$uid'>$uname</option>";
?>
</select>
<input type="text" name="message" class="form-control bg-dark text-white border-secondary" placeholder="Type your reply..." required>
<button type="submit" class="btn btn-primary">Send</button>
</form>
</div>
</div>
<!-- Global Settings --> <!-- Global Settings -->
<div class="col-md-6"> <div class="col-lg-4">
<div class="card bg-dark border-secondary p-4 h-100"> <div class="card bg-dark border-secondary p-4 h-100 shadow">
<h4 class="mb-4">Global Settings</h4> <h4 class="mb-4">Global Settings</h4>
<form method="POST"> <form method="POST">
<input type="hidden" name="update_config" value="1"> <input type="hidden" name="update_config" value="1">
@ -71,33 +186,9 @@ $current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
</div> </div>
</div> </div>
<!-- Price Control -->
<div class="col-md-6">
<div class="card bg-dark border-secondary p-4 h-100">
<h4 class="mb-4">Price Control (Insertion)</h4>
<form method="POST">
<input type="hidden" name="update_price" value="1">
<div class="row g-2 mb-3">
<div class="col-8">
<select name="symbol" class="form-select bg-dark text-white border-secondary">
<option value="BTC">BTC/USDT</option>
<option value="ETH">ETH/USDT</option>
<option value="SOL">SOL/USDT</option>
</select>
</div>
<div class="col-4">
<input type="number" name="price" step="0.01" class="form-control bg-dark text-white border-secondary" placeholder="Price">
</div>
</div>
<button type="submit" class="btn btn-danger w-100">Pin Price / Insert Needle</button>
<div class="small text-muted mt-2 text-center">Leave price blank or 0 to resume market price.</div>
</form>
</div>
</div>
<!-- User Management --> <!-- User Management -->
<div class="col-12"> <div class="col-12">
<div class="card bg-dark border-secondary p-4"> <div class="card bg-dark border-secondary p-4 shadow">
<h4 class="mb-4">User Controls (Win/Loss)</h4> <h4 class="mb-4">User Controls (Win/Loss)</h4>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-dark table-hover"> <table class="table table-dark table-hover">
@ -107,7 +198,6 @@ $current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
<th>Username</th> <th>Username</th>
<th>Balance (USDT)</th> <th>Balance (USDT)</th>
<th>Control Mode</th> <th>Control Mode</th>
<th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -115,7 +205,7 @@ $current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
<tr> <tr>
<td><?php echo str_pad($u['uid'] ?? '0', 6, '0', STR_PAD_LEFT); ?></td> <td><?php echo str_pad($u['uid'] ?? '0', 6, '0', STR_PAD_LEFT); ?></td>
<td><?php echo htmlspecialchars($u['username']); ?></td> <td><?php echo htmlspecialchars($u['username']); ?></td>
<td><?php echo number_format($u['balance_usdt'], 2); ?></td> <td class="fw-bold">$<?php echo number_format($u['balance_usdt'], 2); ?></td>
<td> <td>
<form method="POST" class="d-flex gap-2"> <form method="POST" class="d-flex gap-2">
<input type="hidden" name="update_user" value="1"> <input type="hidden" name="update_user" value="1">
@ -123,14 +213,11 @@ $current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
<select name="win_loss" class="form-select form-select-sm bg-dark text-white border-secondary" style="width: 150px;"> <select name="win_loss" class="form-select form-select-sm bg-dark text-white border-secondary" style="width: 150px;">
<option value="random" <?php echo $u['win_loss_control'] === 'random' ? 'selected' : ''; ?>>Random</option> <option value="random" <?php echo $u['win_loss_control'] === 'random' ? 'selected' : ''; ?>>Random</option>
<option value="always_win" <?php echo $u['win_loss_control'] === 'always_win' ? 'selected' : ''; ?>>Always Win</option> <option value="always_win" <?php echo $u['win_loss_control'] === 'always_win' ? 'selected' : ''; ?>>Always Win</option>
<option value="always_loss" <?php echo $u['win_loss_control'] === 'always_loss' ? 'selected' : ''; ?>>Always Loss</option> <option value="always_loss" <?php echo $u['win_loss_control'] === 'always_loss' ? 'always_loss' : ''; ?>>Always Loss</option>
</select> </select>
<button type="submit" class="btn btn-sm btn-outline-primary">Update</button> <button type="submit" class="btn btn-sm btn-outline-primary">Update</button>
</form> </form>
</td> </td>
<td>
<button class="btn btn-sm btn-outline-danger">Reset Pwd</button>
</td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
@ -141,4 +228,24 @@ $current_config = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
</div> </div>
</div> </div>
<script>
// Auto-scroll chat to bottom
const chatBox = document.getElementById('admin-chat-box');
chatBox.scrollTop = chatBox.scrollHeight;
// Simulated Notification Polling
setInterval(async () => {
try {
const resp = await fetch('api_notif.php');
const data = await resp.json();
if (data.new_count > 0) {
document.getElementById('notif-badge').style.display = 'inline-block';
document.getElementById('notif-badge').innerText = data.new_count + ' New Updates';
// Play sound if needed
// new Audio('assets/ping.mp3').play();
}
} catch (e) {}
}, 5000);
</script>
<?php require_once '../includes/footer.php'; ?> <?php require_once '../includes/footer.php'; ?>

View File

@ -2,49 +2,90 @@
header('Content-Type: application/json'); header('Content-Type: application/json');
require_once __DIR__ . '/../db/config.php'; require_once __DIR__ . '/../db/config.php';
// List of supported coins with base prices // List of supported coins for OKX
$coins = [ $coins = [
'BTC' => ['name' => 'Bitcoin', 'price' => 43250.50, 'change' => 2.45, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/btc.png'], 'BTC' => ['name' => 'Bitcoin', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/btc.png'],
'ETH' => ['name' => 'Ethereum', 'price' => 2345.20, 'change' => 1.15, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/eth.png'], 'ETH' => ['name' => 'Ethereum', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/eth.png'],
'SOL' => ['name' => 'Solana', 'price' => 102.45, 'change' => 8.60, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/sol.png'], 'BNB' => ['name' => 'BNB', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/bnb.png'],
'OKB' => ['name' => 'OKB', 'price' => 54.12, 'change' => 0.15, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/okb.png'], 'SOL' => ['name' => 'Solana', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/sol.png'],
'LINK' => ['name' => 'Chainlink', 'price' => 18.40, 'change' => 3.20, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/link.png'], 'OKB' => ['name' => 'OKB', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/okb.png'],
'DOT' => ['name' => 'Polkadot', 'price' => 7.25, 'change' => -1.50, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/dot.png'], 'LINK' => ['name' => 'Chainlink', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/link.png'],
'ADA' => ['name' => 'Cardano', 'price' => 0.58, 'change' => 2.10, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/ada.png'], 'DOT' => ['name' => 'Polkadot', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/dot.png'],
'DOGE' => ['name' => 'Dogecoin', 'price' => 0.082, 'change' => -0.50, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/doge.png'], 'ADA' => ['name' => 'Cardano', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/ada.png'],
'XRP' => ['name' => 'XRP', 'price' => 0.52, 'change' => 0.25, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/xrp.png'], 'DOGE' => ['name' => 'Dogecoin', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/doge.png'],
'AVAX' => ['name' => 'Avalanche', 'price' => 35.60, 'change' => 4.10, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/avax.png'], 'XRP' => ['name' => 'XRP', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/xrp.png'],
'MATIC' => ['name' => 'Polygon', 'price' => 0.82, 'change' => -1.20, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/matic.png'], 'AVAX' => ['name' => 'Avalanche', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/avax.png'],
'TRX' => ['name' => 'TRON', 'price' => 0.12, 'change' => 0.80, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/trx.png'], 'MATIC' => ['name' => 'Polygon', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/matic.png'],
'LTC' => ['name' => 'Litecoin', 'price' => 68.45, 'change' => 1.20, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/ltc.png'], 'TRX' => ['name' => 'TRON', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/trx.png'],
'BCH' => ['name' => 'Bitcoin Cash', 'price' => 245.30, 'change' => -0.85, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/bch.png'], 'LTC' => ['name' => 'Litecoin', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/ltc.png'],
'UNI' => ['name' => 'Uniswap', 'price' => 6.12, 'change' => 5.40, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/uni.png'], 'BCH' => ['name' => 'Bitcoin Cash', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/bch.png'],
'FIL' => ['name' => 'Filecoin', 'price' => 5.25, 'change' => 2.15, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/fil.png'], 'UNI' => ['name' => 'Uniswap', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/uni.png'],
'APT' => ['name' => 'Aptos', 'price' => 9.40, 'change' => 12.30, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/apt.png'], 'FIL' => ['name' => 'Filecoin', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/fil.png'],
'ARB' => ['name' => 'Arbitrum', 'price' => 1.85, 'change' => 3.10, 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/arb.png'], 'APT' => ['name' => 'Aptos', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/apt.png'],
'ARB' => ['name' => 'Arbitrum', 'icon' => 'https://static.okx.com/cdn/oksupport/asset/currency/icon/arb.png'],
]; ];
// Seed for consistent pseudo-randomness based on time function fetchRealPricesOKX() {
srand(floor(time() / 10)); $ch = curl_init();
$url = "https://www.okx.com/api/v5/market/tickers?instType=SPOT";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
$realData = fetchRealPricesOKX();
$result = [];
// Initialize result with fallback data
foreach ($coins as $symbol => $data) {
$result[$symbol] = array_merge($data, [
'price' => 0.00,
'change' => 0.00,
'high' => 0.00,
'low' => 0.00,
'volume' => 0.00,
]);
}
if ($realData && isset($realData['code']) && $realData['code'] == "0" && isset($realData['data'])) {
foreach ($realData['data'] as $ticker) {
$instId = $ticker['instId'];
if (strpos($instId, '-USDT') !== false) {
$symbol = str_replace('-USDT', '', $instId);
if (isset($result[$symbol])) {
$last = (float)$ticker['last'];
$open = (float)$ticker['open24h'];
$change = ($open > 0) ? (($last - $open) / $open) * 100 : 0;
$result[$symbol]['price'] = $last;
$result[$symbol]['change'] = $change;
$result[$symbol]['high'] = (float)$ticker['high24h'];
$result[$symbol]['low'] = (float)$ticker['low24h'];
$result[$symbol]['volume'] = (float)$ticker['vol24h'];
}
}
}
}
// Check for admin price manipulation // Check for admin price manipulation
try { try {
$stmt = db()->prepare("SELECT config_key, config_value FROM system_config WHERE config_key LIKE 'price_%'"); $conn = db();
if ($conn) {
$stmt = $conn->prepare("SELECT config_key, config_value FROM system_config WHERE config_key LIKE 'price_%'");
$stmt->execute(); $stmt->execute();
$manipulations = $stmt->fetchAll(PDO::FETCH_KEY_PAIR); $manipulations = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
foreach ($coins as $symbol => &$data) { foreach ($result as $symbol => &$data) {
$key = 'price_' . $symbol; $key = 'price_' . $symbol;
if (isset($manipulations[$key])) { if (isset($manipulations[$key]) && is_numeric($manipulations[$key])) {
$data['price'] = (float)$manipulations[$key]; $data['price'] = (float)$manipulations[$key];
} else { }
// Natural fluctuation based on time to look "live"
$fluctuation = (sin(time() / 60) * 0.001) + 1;
$data['price'] *= $fluctuation;
// Add a small random noise
$data['price'] += (rand(-100, 100) / 1000) * ($data['price'] * 0.001);
} }
} }
} catch (Exception $e) {} } catch (Exception $e) {}
echo json_encode(['success' => true, 'data' => $coins]); echo json_encode(['success' => true, 'data' => $result]);

View File

@ -2,45 +2,62 @@
--bg-color: #0b0e11; --bg-color: #0b0e11;
--text-color: #eaecef; --text-color: #eaecef;
--accent-color: #f0b90b; --accent-color: #f0b90b;
--card-bg: #1e2329; --card-bg: #181a20;
--border-color: #363c4e; --border-color: #2b2f36;
--success-color: #0ecb81; --success-color: #0ecb81;
--danger-color: #f6465d; --danger-color: #f6465d;
--okx-blue: #0046ff; --okx-blue: #0046ff;
--bit-gradient: linear-gradient(45deg, #0046ff, #00ff96);
--glass-bg: rgba(255, 255, 255, 0.03);
--glass-border: rgba(255, 255, 255, 0.08);
} }
body { body {
background-color: var(--bg-color); background-color: var(--bg-color);
color: var(--text-color); color: var(--text-color);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
letter-spacing: -0.2px;
} }
/* Visibility Utilities */ /* Glassmorphism */
.text-white { color: #ffffff !important; } .glass-card {
.text-black { color: #000000 !important; } background: var(--glass-bg);
.text-muted { color: #848e9c !important; } backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: 24px;
}
.bg-black { background-color: #000000 !important; color: #ffffff !important; } /* Gradient Text */
.bg-white { background-color: #ffffff !important; color: #000000 !important; } .text-gradient {
background: var(--bit-gradient);
/* Invert colors for white sections */ -webkit-background-clip: text;
.bg-white .text-muted { color: #666666 !important; } -webkit-text-fill-color: transparent;
.bg-white h1, .bg-white h2, .bg-white h3, .bg-white h4, .bg-white h5, .bg-white h6 { color: #000000 !important; } display: inline-block;
}
.text-accent { color: var(--okx-blue); }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
/* Buttons */
.btn-primary { .btn-primary {
background-color: var(--okx-blue); background: var(--okx-blue);
border: none; border: none;
border-radius: 12px;
padding: 10px 24px;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-primary:hover {
background: #0037cc;
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(0, 70, 255, 0.3);
} }
.btn-accent { .btn-accent {
background-color: var(--accent-color); background-color: var(--accent-color);
color: #000; color: #000;
font-weight: bold; font-weight: 700;
border: none; border: none;
border-radius: 10px;
transition: all 0.3s ease; transition: all 0.3s ease;
} }
@ -48,77 +65,52 @@ body {
background-color: #d9a508; background-color: #d9a508;
color: #000; color: #000;
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(240, 185, 11, 0.3); box-shadow: 0 6px 15px rgba(240, 185, 11, 0.4);
} }
.card { /* Visibility Utilities */
background-color: var(--card-bg); .text-white { color: #ffffff !important; }
border: 1px solid var(--border-color); .text-muted { color: #848e9c !important; }
border-radius: 16px;
} .text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
/* Custom Scrollbar */ /* Custom Scrollbar */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 5px;
height: 6px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: var(--bg-color); background: var(--bg-color);
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: var(--border-color); background: var(--border-color);
border-radius: 10px; border-radius: 10px;
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #484f65; background: #484f65;
} }
/* Hover Effects */
.hover-scale {
transition: transform 0.3s ease;
}
.hover-scale:hover {
transform: scale(1.05);
}
.hover-glow:hover {
box-shadow: 0 0 20px rgba(0, 70, 255, 0.2);
}
/* Layout Utilities */
.rounded-4 { border-radius: 1.5rem !important; }
.rounded-5 { border-radius: 2rem !important; }
/* Animations */ /* Animations */
@keyframes fadeInUp { @keyframes fadeIn {
from { from { opacity: 0; transform: translateY(10px); }
opacity: 0; to { opacity: 1; transform: translateY(0); }
transform: translate3d(0, 40px, 0);
} }
to { .fade-in {
opacity: 1; animation: fadeIn 0.5s ease forwards;
transform: translate3d(0, 0, 0);
}
}
.animated {
animation-duration: 1s;
animation-fill-mode: both;
}
.fadeInUp {
animation-name: fadeInUp;
}
/* Market Table Adjustments */
.market-table-container {
background: var(--card-bg);
border-radius: 8px;
padding: 20px;
}
.market-table th {
color: #848e9c;
font-weight: 500;
font-size: 0.9rem;
}
/* Trade Page Specific */
.trade-container {
background-color: #161a1e;
}
.order-row {
transition: background-color 0.2s;
}
.order-row:hover {
background-color: rgba(255, 255, 255, 0.05);
} }

BIN
assets/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -1,22 +1,10 @@
// Global variables // Global variables
let currentMarketData = {}; let currentMarketData = {};
// Translation helper for JS
const translations = {
'en': { 'Buy': 'Buy', 'Sell': 'Sell', 'Trade': 'Trade', 'Price': 'Price', 'Amount': 'Amount' },
'zh': { 'Buy': '买入', 'Sell': '卖出', 'Trade': '交易', 'Price': '价格', 'Amount': '数量' },
// ... add more as needed or fetch from server
};
function getLang() { function getLang() {
return document.documentElement.lang || 'en'; return document.documentElement.lang || 'en';
} }
function tj(key) {
const lang = getLang();
return (translations[lang] && translations[lang][key]) || key;
}
// Market Data Fetching // Market Data Fetching
async function fetchMarketData() { async function fetchMarketData() {
try { try {
@ -32,15 +20,88 @@ async function fetchMarketData() {
} }
function updateUI() { function updateUI() {
// Update Home Page Market List
const homeList = document.getElementById('market-trends'); // Fixed ID mismatch
if (homeList) {
let html = '';
const symbols = ['BTC', 'ETH', 'BNB', 'SOL', 'XRP', 'DOGE', 'ADA', 'TRX'];
symbols.forEach(symbol => {
const coin = currentMarketData[symbol];
if (coin) {
const changeClass = coin.change >= 0 ? 'text-success' : 'text-danger';
const changeSign = coin.change >= 0 ? '+' : '';
const iconClass = coin.change >= 0 ? 'fa-arrow-trend-up' : 'fa-arrow-trend-down';
html += `
<tr onclick="window.location.href='trade.php?symbol=${symbol}'" style="cursor: pointer;">
<td class="ps-4 py-3 border-0">
<div class="d-flex align-items-center">
<img src="${coin.icon}" class="me-3" width="28" height="28">
<div>
<div class="fw-bold text-white" style="font-size: 0.9rem;">${symbol}</div>
<div class="text-muted small" style="font-size: 0.75rem;">${coin.name}</div>
</div>
</div>
</td>
<td class="py-3 border-0 text-white fw-bold" style="font-size: 0.9rem;">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2})}</td>
<td class="py-3 border-0 ${changeClass} fw-bold" style="font-size: 0.9rem;">
<i class="fas ${iconClass} me-1"></i>
${changeSign}${coin.change.toFixed(2)}%
</td>
<td class="pe-4 py-3 border-0 text-end">
<a href="trade.php?symbol=${symbol}" class="btn btn-sm btn-outline-primary rounded-pill px-3" style="font-size: 0.75rem;">Trade</a>
</td>
</tr>
`;
}
});
homeList.innerHTML = html;
}
// Update Hero Ticker if exists
const heroTicker = document.getElementById('hero-market-ticker');
if (heroTicker) {
let html = '';
const symbols = ['BTC', 'ETH', 'SOL', 'BNB'];
symbols.forEach(symbol => {
const coin = currentMarketData[symbol];
if (coin) {
const changeClass = coin.change >= 0 ? 'text-success' : 'text-danger';
html += `
<div class="market-card-mini p-3 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10" onclick="window.location.href='trade.php?symbol=${symbol}'" style="cursor: pointer; min-width: 140px;">
<div class="d-flex justify-content-between mb-2">
<span class="fw-bold text-white">${symbol}</span>
<span class="${changeClass} small">${coin.change >= 0 ? '+' : ''}${coin.change.toFixed(2)}%</span>
</div>
<div class="fw-bold text-white fs-5">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2})}</div>
</div>
`;
}
});
heroTicker.innerHTML = html;
}
// Update Ticker
const ticker = document.getElementById('ticker-wrap');
if (ticker) {
let html = '';
Object.keys(currentMarketData).forEach(symbol => {
const coin = currentMarketData[symbol];
const changeClass = coin.change >= 0 ? 'text-success' : 'text-danger';
html += `
<div class="d-flex align-items-center gap-2">
<span class="text-muted small fw-bold">${symbol}/USDT</span>
<span class="text-white fw-bold">${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2})}</span>
<span class="${changeClass} small">${coin.change >= 0 ? '+' : ''}${coin.change.toFixed(2)}%</span>
</div>
`;
});
ticker.innerHTML = html + html;
}
// Update Trade Page if on it // Update Trade Page if on it
if (document.getElementById('crypto-list-container')) { if (document.getElementById('crypto-list-container')) {
updateTradePage(); updateTradePage();
} }
// Update Market Page if on it
if (document.getElementById('all-market-body')) {
updateMarketPage();
}
} }
function updateTradePage() { function updateTradePage() {
@ -54,7 +115,6 @@ function updateTradePage() {
const coin = currentMarketData[symbol]; const coin = currentMarketData[symbol];
const active = symbol === currentSymbol ? 'active' : ''; const active = symbol === currentSymbol ? 'active' : '';
const changeClass = coin.change >= 0 ? 'text-success' : 'text-danger'; const changeClass = coin.change >= 0 ? 'text-success' : 'text-danger';
const changeSign = coin.change >= 0 ? '+' : '';
html += ` html += `
<div class="crypto-item ${active}" onclick="window.location.href='trade.php?symbol=${symbol}'"> <div class="crypto-item ${active}" onclick="window.location.href='trade.php?symbol=${symbol}'">
@ -62,13 +122,13 @@ function updateTradePage() {
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<img src="${coin.icon}" class="crypto-icon"> <img src="${coin.icon}" class="crypto-icon">
<div> <div>
<div class="fw-bold text-white small">${symbol}</div> <div class="text-white crypto-name-text">${symbol}</div>
<div class="text-muted" style="font-size: 0.7rem;">${coin.name}</div> <div class="crypto-sub-text">${coin.name}</div>
</div> </div>
</div> </div>
<div class="text-end"> <div class="text-end">
<div class="text-white small fw-bold">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2})}</div> <div class="text-white crypto-price-text">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2})}</div>
<div class="${changeClass}" style="font-size: 0.7rem;">${changeSign}${coin.change.toFixed(2)}%</div> <div class="${changeClass} crypto-change-text">${coin.change >= 0 ? '+' : ''}${coin.change.toFixed(2)}%</div>
</div> </div>
</div> </div>
</div> </div>
@ -77,7 +137,7 @@ function updateTradePage() {
}); });
listContainer.innerHTML = html; listContainer.innerHTML = html;
// Update header info for current symbol // Update header info
if (currentSymbol && currentMarketData[currentSymbol]) { if (currentSymbol && currentMarketData[currentSymbol]) {
const coin = currentMarketData[currentSymbol]; const coin = currentMarketData[currentSymbol];
const lastPriceEl = document.getElementById('last-price'); const lastPriceEl = document.getElementById('last-price');
@ -88,6 +148,15 @@ function updateTradePage() {
const bookPriceEl = document.getElementById('book-price'); const bookPriceEl = document.getElementById('book-price');
if (bookPriceEl) bookPriceEl.innerText = coin.price.toLocaleString(undefined, {minimumFractionDigits: 2}); if (bookPriceEl) bookPriceEl.innerText = coin.price.toLocaleString(undefined, {minimumFractionDigits: 2});
// If Market tab is active and price field is empty, update it
const marketTab = document.getElementById('tab-market');
if (marketTab && marketTab.classList.contains('active')) {
const priceInput = document.getElementById('order-price');
if (priceInput && !priceInput.value) {
priceInput.value = coin.price;
}
}
} }
const changeEl = document.getElementById('24h-change'); const changeEl = document.getElementById('24h-change');
@ -96,14 +165,16 @@ function updateTradePage() {
changeEl.className = 'fw-bold ' + (coin.change >= 0 ? 'text-success' : 'text-danger'); changeEl.className = 'fw-bold ' + (coin.change >= 0 ? 'text-success' : 'text-danger');
} }
// Mocking high/low/vol
if (document.getElementById('24h-high')) document.getElementById('24h-high').innerText = '$' + (coin.price * 1.05).toLocaleString(undefined, {minimumFractionDigits: 2}); if (document.getElementById('24h-high')) document.getElementById('24h-high').innerText = '$' + (coin.price * 1.05).toLocaleString(undefined, {minimumFractionDigits: 2});
if (document.getElementById('24h-low')) document.getElementById('24h-low').innerText = '$' + (coin.price * 0.95).toLocaleString(undefined, {minimumFractionDigits: 2}); if (document.getElementById('24h-low')) document.getElementById('24h-low').innerText = '$' + (coin.price * 0.95).toLocaleString(undefined, {minimumFractionDigits: 2});
if (document.getElementById('24h-vol')) document.getElementById('24h-vol').innerText = (Math.random() * 500 + 100).toFixed(2) + 'M'; if (document.getElementById('price-fiat')) {
if (document.getElementById('price-fiat')) document.getElementById('price-fiat').innerText = '≈ ¥' + (coin.price * 7.15).toLocaleString(undefined, {minimumFractionDigits: 2}); const isZh = document.documentElement.lang === 'zh';
const rate = isZh ? 7.2 : 1.0;
const symbol = isZh ? '¥' : '$';
document.getElementById('price-fiat').innerText = '≈ ' + symbol + (coin.price * rate).toLocaleString(undefined, {minimumFractionDigits: 2});
}
} }
// Update order book simulation
simulateOrderBook(); simulateOrderBook();
} }
@ -120,7 +191,6 @@ function simulateOrderBook() {
let askHtml = ''; let askHtml = '';
let bidHtml = ''; let bidHtml = '';
// Asks (Red)
for (let i = 5; i > 0; i--) { for (let i = 5; i > 0; i--) {
const price = basePrice * (1 + (i * 0.0002)); const price = basePrice * (1 + (i * 0.0002));
const amount = Math.random() * 2 + 0.1; const amount = Math.random() * 2 + 0.1;
@ -134,7 +204,6 @@ function simulateOrderBook() {
`; `;
} }
// Bids (Green)
for (let i = 1; i <= 5; i++) { for (let i = 1; i <= 5; i++) {
const price = basePrice * (1 - (i * 0.0002)); const price = basePrice * (1 - (i * 0.0002));
const amount = Math.random() * 2 + 0.1; const amount = Math.random() * 2 + 0.1;
@ -157,7 +226,6 @@ document.addEventListener('DOMContentLoaded', () => {
fetchMarketData(); fetchMarketData();
setInterval(fetchMarketData, 3000); setInterval(fetchMarketData, 3000);
// Search listener
const searchInput = document.getElementById('market-search'); const searchInput = document.getElementById('market-search');
if (searchInput) { if (searchInput) {
searchInput.addEventListener('input', updateUI); searchInput.addEventListener('input', updateUI);

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

113
chat.php Normal file
View File

@ -0,0 +1,113 @@
<?php
require_once 'includes/header.php';
if (!$user) {
header('Location: login.php');
exit;
}
$uid = str_pad($user['uid'], 6, '0', STR_PAD_LEFT);
?>
<div class="container py-5" style="max-width: 800px; min-height: 80vh;">
<div class="d-flex align-items-center mb-4">
<button onclick="history.back()" class="btn btn-dark rounded-circle me-3 border-secondary" style="width: 40px; height: 40px;">
<i class="fas fa-arrow-left"></i>
</button>
<h2 class="fw-bold mb-0 text-white"><?php echo mt('Customer Service'); ?></h2>
</div>
<div class="card bg-dark border-secondary overflow-hidden shadow-lg" style="border-radius: 20px; height: 600px; display: flex; flex-direction: column;">
<!-- Chat Header -->
<div class="p-3 bg-secondary bg-opacity-10 border-bottom border-secondary d-flex align-items-center justify-content-between">
<div class="d-flex align-items-center">
<div class="position-relative">
<img src="https://ui-avatars.com/api/?name=Support&background=0046ff&color=fff" class="rounded-circle me-3" width="45">
<span class="position-absolute bottom-0 end-0 bg-success border border-white rounded-circle" style="width: 12px; height: 12px; margin-right: 15px; margin-bottom: 2px;"></span>
</div>
<div>
<h6 class="mb-0 text-white fw-bold">BITCrypto Support</h6>
<small class="text-success">Online UID: <?php echo $uid; ?></small>
</div>
</div>
<div class="text-muted small">
<?php echo date('H:i'); ?>
</div>
</div>
<!-- Chat Messages -->
<div id="chat-messages" class="flex-grow-1 p-4 overflow-auto d-flex flex-column gap-3" style="background: rgba(0,0,0,0.2);">
<div class="message-received">
<div class="p-3 bg-secondary bg-opacity-25 rounded-4 text-white d-inline-block" style="max-width: 80%;">
<?php echo mt('Hello! Welcome to BITCrypto. How can we help you today?'); ?>
</div>
<div class="small text-muted mt-1 ms-2"><?php echo date('H:i'); ?></div>
</div>
</div>
<!-- Chat Input -->
<div class="p-3 border-top border-secondary bg-dark">
<form id="chat-form" onsubmit="sendMessage(event)">
<div class="input-group">
<button type="button" class="btn btn-dark border-secondary px-3"><i class="fas fa-plus"></i></button>
<input type="text" id="chat-input" class="form-control bg-secondary bg-opacity-10 border-secondary text-white shadow-none px-3" placeholder="<?php echo mt('Type a message...'); ?>" autocomplete="off">
<button type="submit" class="btn btn-primary px-4 fw-bold" style="background: var(--okx-blue); border: none;">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</form>
</div>
</div>
<div class="mt-4 p-4 bg-secondary bg-opacity-10 rounded-4 border border-secondary border-opacity-25">
<div class="d-flex align-items-center gap-3">
<i class="fas fa-info-circle text-primary fs-4"></i>
<p class="mb-0 text-muted small">
<?php echo mt('For security reasons, never share your login or trading passwords with anyone, including our support agents.'); ?>
</p>
</div>
</div>
</div>
<style>
.message-sent { align-self: flex-end; text-align: right; }
.message-sent .content { background: var(--okx-blue); color: white; padding: 10px 18px; border-radius: 20px 20px 2px 20px; display: inline-block; max-width: 80%; }
.message-received { align-self: flex-start; }
.message-received .content { background: rgba(255,255,255,0.05); color: white; padding: 10px 18px; border-radius: 20px 20px 20px 2px; display: inline-block; max-width: 80%; }
</style>
<script>
function sendMessage(e) {
e.preventDefault();
const input = document.getElementById('chat-input');
const text = input.value.trim();
if (!text) return;
const messages = document.getElementById('chat-messages');
const time = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
const sentDiv = document.createElement('div');
sentDiv.className = 'message-sent';
sentDiv.innerHTML = `
<div class="content">${text}</div>
<div class="small text-muted mt-1 me-2">${time}</div>
`;
messages.appendChild(sentDiv);
input.value = '';
messages.scrollTop = messages.scrollHeight;
// Simulated Bot Response
setTimeout(() => {
const receivedDiv = document.createElement('div');
receivedDiv.className = 'message-received';
receivedDiv.innerHTML = `
<div class="content"><?php echo mt('Thank you for your message. An agent will be with you shortly.'); ?></div>
<div class="small text-muted mt-1 ms-2">${time}</div>
`;
messages.appendChild(receivedDiv);
messages.scrollTop = messages.scrollHeight;
}, 1500);
}
</script>
<?php require_once 'includes/footer.php'; ?>

View File

@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS chat_messages (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
admin_id INT DEFAULT NULL, -- NULL means sent by user
message TEXT,
attachment_url VARCHAR(255) DEFAULT NULL,
is_read TINYINT(1) DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS deposits (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
currency VARCHAR(20) DEFAULT 'USDT',
amount DECIMAL(30, 10) NOT NULL,
status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending',
receipt_url VARCHAR(255) DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
ALTER TABLE users ADD COLUMN IF NOT EXISTS uid INT DEFAULT 0;

View File

@ -5,106 +5,249 @@ if (!$user) {
header('Location: login.php'); header('Location: login.php');
exit; exit;
} }
$fiat_currencies = [
'USD' => ['name' => 'US Dollar', 'symbol' => '$', 'rate' => 1.0, 'region' => 'Americas'],
'EUR' => ['name' => 'Euro', 'symbol' => '€', 'rate' => 0.92, 'region' => 'Europe'],
'CNY' => ['name' => 'Chinese Yuan', 'symbol' => '¥', 'rate' => 7.21, 'region' => 'Asia'],
'JPY' => ['name' => 'Japanese Yen', 'symbol' => '¥', 'rate' => 149.5, 'region' => 'Asia'],
'KRW' => ['name' => 'South Korean Won', 'symbol' => '₩', 'rate' => 1335.0, 'region' => 'Asia'],
'GBP' => ['name' => 'British Pound', 'symbol' => '£', 'rate' => 0.79, 'region' => 'Europe'],
'RUB' => ['name' => 'Russian Ruble', 'symbol' => '₽', 'rate' => 92.4, 'region' => 'Europe'],
'HKD' => ['name' => 'Hong Kong Dollar', 'symbol' => 'HK$', 'rate' => 7.82, 'region' => 'Asia'],
'SGD' => ['name' => 'Singapore Dollar', 'symbol' => 'S$', 'rate' => 1.34, 'region' => 'Asia'],
'AUD' => ['name' => 'Australian Dollar', 'symbol' => 'A$', 'rate' => 1.53, 'region' => 'Oceania'],
'CAD' => ['name' => 'Canadian Dollar', 'symbol' => 'C$', 'rate' => 1.35, 'region' => 'Americas'],
'BRL' => ['name' => 'Brazilian Real', 'symbol' => 'R$', 'rate' => 4.98, 'region' => 'Americas'],
'INR' => ['name' => 'Indian Rupee', 'symbol' => '₹', 'rate' => 83.0, 'region' => 'Asia'],
'VND' => ['name' => 'Vietnamese Dong', 'symbol' => '₫', 'rate' => 24500.0, 'region' => 'Asia'],
'THB' => ['name' => 'Thai Baht', 'symbol' => '฿', 'rate' => 35.8, 'region' => 'Asia'],
'MYR' => ['name' => 'Malaysian Ringgit', 'symbol' => 'RM', 'rate' => 4.77, 'region' => 'Asia'],
'IDR' => ['name' => 'Indonesian Rupiah', 'symbol' => 'Rp', 'rate' => 15600.0, 'region' => 'Asia'],
'PHP' => ['name' => 'Philippine Peso', 'symbol' => '₱', 'rate' => 56.1, 'region' => 'Asia'],
'AED' => ['name' => 'UAE Dirham', 'symbol' => 'د.إ', 'rate' => 3.67, 'region' => 'Middle East'],
'TRY' => ['name' => 'Turkish Lira', 'symbol' => '₺', 'rate' => 31.0, 'region' => 'Europe/Asia'],
];
// Group by region for better UI
$grouped_fiat = [];
foreach ($fiat_currencies as $code => $data) {
$grouped_fiat[$data['region']][$code] = $data;
}
// Handle Receipt Upload
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['receipt'])) {
$amount = $_POST['amount'] ?? 0;
$currency = $_POST['currency'] ?? 'USDT';
$target_dir = "uploads/receipts/";
if (!is_dir($target_dir)) mkdir($target_dir, 0777, true);
$file_ext = pathinfo($_FILES["receipt"]["name"], PATHINFO_EXTENSION);
$file_name = time() . "_" . $user['id'] . "." . $file_ext;
$target_file = $target_dir . $file_name;
if (move_uploaded_file($_FILES["receipt"]["tmp_name"], $target_file)) {
// Save to DB
$stmt = db()->prepare("INSERT INTO deposits (user_id, amount, currency, receipt_url, status) VALUES (?, ?, ?, ?, 'pending')");
$stmt->execute([$user['id'], $amount, $currency, $target_file]);
// Notify admin via chat (simulated message)
$msg = "New deposit request: $amount $currency. UID: " . ($user['uid'] ?? '000000');
$stmt = db()->prepare("INSERT INTO chat_messages (user_id, message, attachment_url) VALUES (?, ?, ?)");
$stmt->execute([$user['id'], $msg, $target_file]);
echo "<script>alert('" . mt('Receipt uploaded successfully. Waiting for admin approval.') . "'); window.location.href='profile.php';</script>";
exit;
}
}
?> ?>
<div class="container my-5 py-5"> <div class="container my-5 py-5">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-8"> <div class="col-md-11 col-lg-10">
<div class="card bg-dark border-secondary p-4 shadow-lg" style="border-radius: 24px;"> <div class="text-center mb-5">
<h2 class="fw-bold mb-4 text-white"><?php echo mt('Deposit'); ?> Assets</h2> <h1 class="fw-bold text-white mb-2"><?php echo mt('Deposit Assets'); ?></h1>
<p class="text-muted"><?php echo mt('Choose your preferred method to fund your account'); ?></p>
</div>
<div class="card bg-dark border-secondary shadow-lg overflow-hidden" style="border-radius: 30px;">
<div class="row g-0">
<div class="col-md-3 border-end border-secondary bg-secondary bg-opacity-10">
<div class="nav flex-column nav-pills p-3 h-100" id="deposit-tabs" role="tablist">
<button class="nav-link active mb-2 text-start p-3 rounded-4" id="crypto-tab" data-bs-toggle="pill" data-bs-target="#crypto-pane">
<i class="fas fa-coins me-2"></i> <?php echo mt('Crypto Deposit'); ?>
</button>
<button class="nav-link mb-2 text-start p-3 rounded-4" id="fiat-tab" data-bs-toggle="pill" data-bs-target="#fiat-pane">
<i class="fas fa-university me-2"></i> <?php echo mt('Fiat Deposit'); ?>
</button>
</div>
</div>
<div class="col-md-9 p-4 p-md-5">
<div class="tab-content">
<!-- Crypto Pane -->
<div class="tab-pane fade show active" id="crypto-pane">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-bold mb-0 text-white"><?php echo mt('Crypto Deposit'); ?></h3>
<span class="badge bg-primary bg-opacity-10 text-primary px-3 py-2 rounded-pill"><?php echo mt('Instant'); ?></span>
</div>
<div class="row g-4"> <div class="row g-4">
<!-- Left: Selection --> <div class="col-md-6">
<div class="col-md-5">
<div class="mb-4"> <div class="mb-4">
<label class="small text-muted mb-2">Select Crypto</label> <label class="small text-muted mb-2"><?php echo mt('Select Currency'); ?></label>
<div class="dropdown w-100"> <select class="form-select bg-dark text-white border-secondary py-3 rounded-4" id="crypto-select">
<button class="btn btn-dark border-secondary w-100 text-start d-flex justify-content-between align-items-center py-2 px-3" data-bs-toggle="dropdown"> <option value="USDT">USDT (TRC20)</option>
<div class="d-flex align-items-center"> <option value="BTC">BTC (Bitcoin)</option>
<img src="https://static.okx.com/cdn/oksupport/asset/currency/icon/usdt.png" width="24" class="me-2"> <option value="ETH">ETH (ERC20)</option>
<span class="fw-bold text-white">USDT</span>
</div>
<i class="fas fa-chevron-down small text-muted"></i>
</button>
<ul class="dropdown-menu dropdown-menu-dark w-100">
<li><a class="dropdown-item d-flex align-items-center" href="#"><img src="https://static.okx.com/cdn/oksupport/asset/currency/icon/usdt.png" width="20" class="me-2"> USDT</a></li>
<li><a class="dropdown-item d-flex align-items-center" href="#"><img src="https://static.okx.com/cdn/oksupport/asset/currency/icon/btc.png" width="20" class="me-2"> BTC</a></li>
<li><a class="dropdown-item d-flex align-items-center" href="#"><img src="https://static.okx.com/cdn/oksupport/asset/currency/icon/eth.png" width="20" class="me-2"> ETH</a></li>
</ul>
</div>
</div>
<div class="mb-4">
<label class="small text-muted mb-2">Select Network</label>
<select class="form-select bg-dark text-white border-secondary py-2">
<option>USDT-TRC20 (Best value)</option>
<option>USDT-ERC20</option>
<option>USDT-Polygon</option>
</select> </select>
</div> </div>
<div id="deposit-details">
<div class="p-3 bg-secondary bg-opacity-10 rounded-4"> <div class="p-3 bg-secondary bg-opacity-10 rounded-4 border border-secondary mb-3">
<div class="small text-muted mb-2">Deposit Tips</div> <div class="small text-muted mb-1"><?php echo mt('Network'); ?></div>
<ul class="small text-muted ps-3 mb-0"> <div class="fw-bold text-white" id="network-name">Tron (TRC20)</div>
<li>Minimum deposit: 1 USDT</li> </div>
<li>Average arrival: 1-3 minutes</li> <div class="p-3 bg-secondary bg-opacity-10 rounded-4 border border-secondary">
<li>Depositing from other networks may result in loss of assets.</li> <div class="small text-muted mb-1"><?php echo mt('Deposit Address'); ?></div>
</ul> <div class="fw-bold text-white text-break font-monospace" id="deposit-addr">TWr8mP9PjH5pX9pX9pX9pX9pX9pX9pX9pX</div>
<button class="btn btn-sm btn-primary mt-3 rounded-pill px-4" onclick="copyAddr()">
<i class="fas fa-copy me-1"></i> <?php echo mt('Copy'); ?>
</button>
</div> </div>
</div> </div>
</div>
<div class="col-md-6">
<div class="text-center mb-4">
<div class="bg-white p-3 d-inline-block rounded-4 mb-3 shadow">
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=TWr8mP9PjH5pX9pX9pX9pX9pX9pX9pX9pX&color=0b0e11" alt="QR" width="150" id="deposit-qr">
</div>
<p class="small text-muted"><?php echo mt('Scan QR code to deposit'); ?></p>
</div>
<!-- Right: Address --> <form method="POST" enctype="multipart/form-data" class="mt-2 bg-secondary bg-opacity-10 p-4 rounded-4 border border-secondary border-opacity-50">
<div class="col-md-7 border-start border-secondary ps-md-4"> <input type="hidden" name="currency" id="h-currency" value="USDT">
<div class="text-center py-3"> <div class="mb-3">
<div class="bg-white p-3 d-inline-block rounded-4 mb-3"> <label class="small text-muted mb-2"><?php echo mt('Deposit Amount'); ?></label>
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=TWr8mP9PjH5pX9pX9pX9pX9pX9pX9pX9pX" alt="Deposit QR" style="width: 150px;"> <div class="input-group">
<input type="number" name="amount" class="form-control bg-dark text-white border-secondary rounded-start-4 py-2" placeholder="0.00" step="0.01" required>
<span class="input-group-text bg-dark border-secondary text-muted rounded-end-4" id="crypto-label">USDT</span>
</div>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label class="small text-muted mb-2 d-block">Deposit Address</label> <label class="small text-muted mb-2"><?php echo mt('Upload Proof'); ?></label>
<input type="file" name="receipt" class="form-control bg-dark text-white border-secondary rounded-4 py-2" accept="image/*" required>
<div class="small text-muted mt-2"><i class="fas fa-info-circle me-1"></i> <?php echo mt('Upload screenshot of your transaction'); ?></div>
</div>
<button type="submit" class="btn btn-primary w-100 py-3 rounded-4 fw-bold shadow">
<i class="fas fa-upload me-2"></i> <?php echo mt('Submit Deposit'); ?>
</button>
</form>
</div>
</div>
</div>
<!-- Fiat Pane -->
<div class="tab-pane fade" id="fiat-pane">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-bold mb-0 text-white"><?php echo mt('Fiat Deposit'); ?></h3>
<span class="badge bg-success bg-opacity-10 text-success px-3 py-2 rounded-pill"><?php echo mt('Regional Support'); ?></span>
</div>
<form action="matching.php" method="POST" id="fiat-form">
<div class="row g-4">
<div class="col-md-7">
<div class="mb-4">
<label class="small text-muted mb-2"><?php echo mt('Select Fiat Currency'); ?></label>
<select name="fiat_currency" id="fiat-currency" class="form-select bg-dark text-white border-secondary py-3 rounded-4 shadow-sm" onchange="updateRate()">
<?php foreach($grouped_fiat as $region => $coins): ?>
<optgroup label="<?php echo $region; ?>">
<?php foreach($coins as $code => $data): ?>
<option value="<?php echo $code; ?>" data-rate="<?php echo $data['rate']; ?>" data-symbol="<?php echo $data['symbol']; ?>">
<?php echo $code; ?> - <?php echo $data['name']; ?>
</option>
<?php endforeach; ?>
</optgroup>
<?php endforeach; ?>
</select>
</div>
<div class="mb-4">
<label class="small text-muted mb-2"><?php echo mt('Amount'); ?></label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control bg-dark text-white border-secondary text-center" value="TWr8mP9PjH5pX9pX9pX9pX9pX9pX9pX9pX" readonly> <span class="input-group-text bg-dark border-secondary text-white rounded-start-4 px-3" id="currency-symbol">$</span>
<button class="btn btn-primary px-3" onclick="alert('Copied!')"><i class="fas fa-copy"></i></button> <input type="number" name="amount" id="fiat-amount" class="form-control bg-dark text-white border-secondary py-3" placeholder="0.00" oninput="updateRate()" required>
</div> <span class="input-group-text bg-dark border-secondary text-muted rounded-end-4" id="fiat-code">USD</span>
</div> </div>
</div> </div>
<div class="d-flex justify-content-between p-3 border border-secondary rounded-4"> <div class="alert alert-primary bg-primary bg-opacity-10 border-primary border-opacity-20 rounded-4 p-3 mb-0">
<div class="text-center flex-grow-1"> <div class="d-flex">
<div class="small text-muted">Arrival</div> <i class="fas fa-info-circle mt-1 me-3"></i>
<div class="fw-bold text-white">1 Confirmations</div> <div class="small">
<?php echo mt('We will match you with a local merchant to facilitate your deposit in your local currency.'); ?>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="p-4 bg-secondary bg-opacity-10 border border-secondary rounded-4 h-100 d-flex flex-column justify-content-center text-center">
<div class="small text-muted mb-2"><?php echo mt('Est. Arrival'); ?></div>
<div class="display-5 fw-bold text-white mb-2"><span id="usdt-amount">0.00</span> <span class="fs-4">USDT</span></div>
<div class="small text-muted"><?php echo mt('Processing Time: 10-30 mins'); ?></div>
<hr class="my-4 border-secondary border-opacity-50">
<div class="text-start small text-muted">
<div class="d-flex justify-content-between mb-2">
<span><?php echo mt('Exchange Rate'); ?>:</span>
<span id="display-rate">1 USDT 1.00 USD</span>
</div>
<div class="d-flex justify-content-between">
<span><?php echo mt('Service Fee'); ?>:</span>
<span class="text-success"><?php echo mt('Free'); ?></span>
</div> </div>
<div class="border-start border-secondary mx-3"></div>
<div class="text-center flex-grow-1">
<div class="small text-muted">Withdrawal</div>
<div class="fw-bold text-white">3 Confirmations</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<hr class="my-5 border-secondary"> <div class="mt-5">
<button type="submit" class="btn btn-primary btn-lg w-100 py-3 rounded-4 fw-bold shadow-lg">
<?php echo mt('Confirm Deposit'); ?> <i class="fas fa-arrow-right ms-2"></i>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<h4 class="fw-bold mb-4 text-white">Fiat Deposit</h4> <div class="mt-4 row g-4">
<div class="row g-3">
<div class="col-md-4"> <div class="col-md-4">
<div class="p-4 border border-secondary rounded-4 text-center hover-border"> <div class="p-4 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 d-flex align-items-center gap-3">
<i class="fas fa-university fa-2x mb-3 text-primary"></i> <i class="fas fa-shield-check fa-2x text-primary"></i>
<div class="fw-bold text-white">Bank Transfer</div> <div>
<div class="small text-muted">0% Fees 1-3 Hours</div> <h6 class="text-white mb-1"><?php echo mt('Secure Payment'); ?></h6>
<p class="small text-muted mb-0"><?php echo mt('All transactions are encrypted'); ?></p>
</div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="p-4 border border-secondary rounded-4 text-center hover-border"> <div class="p-4 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 d-flex align-items-center gap-3">
<i class="fab fa-cc-visa fa-2x mb-3 text-info"></i> <i class="fas fa-clock fa-2x text-primary"></i>
<div class="fw-bold text-white">Credit / Debit Card</div> <div>
<div class="small text-muted">Instant Up to $5,000</div> <h6 class="text-white mb-1"><?php echo mt('Fast Arrival'); ?></h6>
<p class="small text-muted mb-0"><?php echo mt('Most deposits arrive in mins'); ?></p>
</div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="p-4 border border-secondary rounded-4 text-center hover-border"> <div class="p-4 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 d-flex align-items-center gap-3">
<i class="fab fa-apple-pay fa-2x mb-3 text-light"></i> <i class="fas fa-headset fa-2x text-primary"></i>
<div class="fw-bold text-white">Digital Wallets</div> <div>
<div class="small text-muted">Instant Apple/Google Pay</div> <h6 class="text-white mb-1"><?php echo mt('24/7 Support'); ?></h6>
<p class="small text-muted mb-0"><?php echo mt('Live help for your deposit'); ?></p>
</div> </div>
</div> </div>
</div> </div>
@ -113,12 +256,52 @@ if (!$user) {
</div> </div>
</div> </div>
<style> <script>
.hover-border:hover { function copyAddr() {
border-color: var(--okx-blue) !important; const addr = document.getElementById('deposit-addr').innerText;
background-color: rgba(0, 70, 255, 0.05); navigator.clipboard.writeText(addr);
cursor: pointer; alert('<?php echo mt('Address copied to clipboard'); ?>');
} }
</style>
function updateRate() {
const select = document.getElementById('fiat-currency');
const option = select.options[select.selectedIndex];
const rate = parseFloat(option.getAttribute('data-rate'));
const symbol = option.getAttribute('data-symbol');
const code = select.value;
const amount = parseFloat(document.getElementById('fiat-amount').value) || 0;
document.getElementById('currency-symbol').innerText = symbol;
document.getElementById('fiat-code').innerText = code;
document.getElementById('usdt-amount').innerText = (amount / rate).toFixed(2);
document.getElementById('display-rate').innerText = `1 USDT ≈ ${rate.toFixed(2)} ${code}`;
}
document.getElementById('crypto-select').addEventListener('change', function() {
const val = this.value;
document.getElementById('h-currency').value = val;
document.getElementById('crypto-label').innerText = val;
let addr = '';
let network = '';
if (val === 'BTC') {
addr = '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
network = 'Bitcoin';
} else if (val === 'ETH') {
addr = '0x742d35Cc6634C0532925a3b844Bc454e4438f44e';
network = 'Ethereum (ERC20)';
} else {
addr = 'TWr8mP9PjH5pX9pX9pX9pX9pX9pX9pX9pX';
network = 'Tron (TRC20)';
}
document.getElementById('deposit-addr').innerText = addr;
document.getElementById('network-name').innerText = network;
document.getElementById('deposit-qr').src = `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${addr}&color=0b0e11`;
});
document.addEventListener('DOMContentLoaded', updateRate);
</script>
<?php require_once 'includes/footer.php'; ?> <?php require_once 'includes/footer.php'; ?>

View File

@ -28,16 +28,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$rate = 43250.50; $rate = 43250.50;
if ($to_coin === 'ETH') $rate = 2345.20; if ($to_coin === 'ETH') $rate = 2345.20;
if ($to_coin === 'SOL') $rate = 102.45; if ($to_coin === 'SOL') $rate = 102.45;
if ($to_coin === 'OKB') $rate = 54.12;
$receive = $amount / $rate; $receive = $amount / $rate;
$pdo->prepare("UPDATE users SET balance_usdt = balance_usdt - ? WHERE id = ?")->execute([$amount, $user['id']]); $pdo->prepare("UPDATE users SET balance_usdt = balance_usdt - ? WHERE id = ?")->execute([$amount, $user['id']]);
$success = "Exchanged $amount USDT for " . number_format($receive, 6) . " $to_coin"; $success = mt('Successful') . ": " . number_format($receive, 6) . " $to_coin";
$user['balance_usdt'] -= $amount; $user['balance_usdt'] -= $amount;
} }
} else { } else {
$error = "Only USDT to Crypto exchange is currently supported in this demo."; $error = "Only USDT to Crypto exchange is currently supported.";
} }
} catch (Exception $e) { } catch (Exception $e) {
$error = 'Exchange failed: ' . $e->getMessage(); $error = 'Exchange failed: ' . $e->getMessage();
@ -51,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="col-md-6"> <div class="col-md-6">
<div class="card bg-dark border-secondary p-4 shadow-lg" style="border-radius: 20px;"> <div class="card bg-dark border-secondary p-4 shadow-lg" style="border-radius: 20px;">
<h2 class="fw-bold mb-4 text-center text-white"><?php echo mt('Exchange'); ?></h2> <h2 class="fw-bold mb-4 text-center text-white"><?php echo mt('Exchange'); ?></h2>
<p class="text-center text-muted mb-4">Zero fees, instant settlement</p> <p class="text-center text-muted mb-4"><?php echo mt('Zero fees'); ?></p>
<?php if ($error): ?> <?php if ($error): ?>
<div class="alert alert-danger"><?php echo $error; ?></div> <div class="alert alert-danger"><?php echo $error; ?></div>
@ -62,7 +61,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<form method="POST"> <form method="POST">
<div class="mb-4"> <div class="mb-4">
<label class="small text-muted mb-2"><?php echo t('Amount'); ?></label> <label class="small text-muted mb-2"><?php echo mt('Amount'); ?></label>
<div class="input-group input-group-lg"> <div class="input-group input-group-lg">
<input type="number" name="amount" class="form-control bg-dark text-white border-secondary" placeholder="0.00" required step="any"> <input type="number" name="amount" class="form-control bg-dark text-white border-secondary" placeholder="0.00" required step="any">
<select name="from_coin" class="btn btn-dark border-secondary"> <select name="from_coin" class="btn btn-dark border-secondary">
@ -73,9 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div> </div>
<div class="text-center mb-4"> <div class="text-center mb-4">
<div class="btn btn-outline-secondary rounded-circle" style="width: 40px; height: 40px; line-height: 25px;"> <i class="fas fa-exchange-alt fa-rotate-90 text-muted"></i>
<i class="fas fa-exchange-alt fa-rotate-90"></i>
</div>
</div> </div>
<div class="mb-4"> <div class="mb-4">
@ -86,20 +83,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<option value="BTC">BTC</option> <option value="BTC">BTC</option>
<option value="ETH">ETH</option> <option value="ETH">ETH</option>
<option value="SOL">SOL</option> <option value="SOL">SOL</option>
<option value="OKB">OKB</option>
</select> </select>
</div> </div>
</div> </div>
<div class="p-3 bg-secondary bg-opacity-10 rounded mb-4"> <div class="p-3 bg-secondary bg-opacity-10 rounded mb-4">
<div class="d-flex justify-content-between small"> <div class="d-flex justify-content-between small">
<span class="text-muted">Estimated Price</span> <span class="text-muted"><?php echo mt('Estimated Price'); ?></span>
<span class="text-white fw-bold" id="est-price">1 BTC 43,250 USDT</span> <span class="text-white fw-bold" id="est-price">1 BTC 43,250 USDT</span>
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary w-100 py-3 fw-bold fs-5" style="background-color: var(--okx-blue); border: none; border-radius: 12px;"> <button type="submit" class="btn btn-primary w-100 py-3 fw-bold fs-5" style="background-color: var(--okx-blue); border: none; border-radius: 12px;">
Convert Now <?php echo mt('Convert Now'); ?>
</button> </button>
</form> </form>
</div> </div>
@ -108,13 +104,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div> </div>
<script> <script>
const rates = { const rates = { 'BTC': 43250.50, 'ETH': 2345.20, 'SOL': 102.45 };
'BTC': 43250.50,
'ETH': 2345.20,
'SOL': 102.45,
'OKB': 54.12
};
function updateReceive() { function updateReceive() {
const amount = document.querySelector('input[name="amount"]').value; const amount = document.querySelector('input[name="amount"]').value;
const coin = document.getElementById('to-coin').value; const coin = document.getElementById('to-coin').value;
@ -124,7 +114,6 @@ function updateReceive() {
document.getElementById('est-price').innerText = `1 ${coin} ≈ ${rate.toLocaleString()} USDT`; document.getElementById('est-price').innerText = `1 ${coin} ≈ ${rate.toLocaleString()} USDT`;
} }
} }
document.querySelector('input[name="amount"]').addEventListener('input', updateReceive); document.querySelector('input[name="amount"]').addEventListener('input', updateReceive);
document.getElementById('to-coin').addEventListener('change', updateReceive); document.getElementById('to-coin').addEventListener('change', updateReceive);
</script> </script>

BIN
favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

View File

@ -1,62 +1,12 @@
<?php <footer class="mt-5 py-5 border-top" style="border-color: #2b2f36 !important; background-color: #0b0e11;">
// Footer translations integrated into the global mt() system if possible,
// but for footer specifics we can add to the array in header.php or handle here.
// Adding them here for now to ensure all 8 languages are covered as requested.
$footer_translations = [
'en' => [
'Services' => 'Services', 'Spot_Trading' => 'Spot Trading', 'Futures_Trading' => 'Futures Trading',
'Support' => 'Support', 'Help_Center' => 'Help Center', 'About' => 'About', 'About_Us' => 'About Us',
'Legal' => 'Legal', 'Privacy_Policy' => 'Privacy Policy', 'Terms_of_Service' => 'Terms of Service'
],
'zh' => [
'Services' => '服务', 'Spot_Trading' => '现货交易', 'Futures_Trading' => '期货交易',
'Support' => '支持', 'Help_Center' => '帮助中心', 'About' => '关于', 'About_Us' => '关于我们',
'Legal' => '法律', 'Privacy_Policy' => '隐私政策', 'Terms_of_Service' => '服务条款'
],
'ja' => [
'Services' => 'サービス', 'Spot_Trading' => '現物取引', 'Futures_Trading' => '先物取引',
'Support' => 'サポート', 'Help_Center' => 'ヘルプセンター', 'About' => '概要', 'About_Us' => '会社概要',
'Legal' => '法的声明', 'Privacy_Policy' => 'プライバシーポリシー', 'Terms_of_Service' => '利用規約'
],
'ko' => [
'Services' => '서비스', 'Spot_Trading' => '현물 거래', 'Futures_Trading' => '선물 거래',
'Support' => '지원', 'Help_Center' => '고객센터', 'About' => '소개', 'About_Us' => '회사 소개',
'Legal' => '법적 고지', 'Privacy_Policy' => '개인정보처리방침', 'Terms_of_Service' => '이용약관'
],
'ru' => [
'Services' => 'Сервисы', 'Spot_Trading' => 'Спот торговля', 'Futures_Trading' => 'Фьючерсы',
'Support' => 'Поддержка', 'Help_Center' => 'Центр помощи', 'About' => 'О нас', 'About_Us' => 'О компании',
'Legal' => 'Юридические данные', 'Privacy_Policy' => 'Политика конфиденциальности', 'Terms_of_Service' => 'Условия использования'
],
'fr' => [
'Services' => 'Services', 'Spot_Trading' => 'Trading Spot', 'Futures_Trading' => 'Trading Futures',
'Support' => 'Support', 'Help_Center' => 'Centre d\'aide', 'About' => 'À propos', 'About_Us' => 'À propos de nous',
'Legal' => 'Légal', 'Privacy_Policy' => 'Politique de confidentialité', 'Terms_of_Service' => 'Conditions d\'utilisation'
],
'es' => [
'Services' => 'Servicios', 'Spot_Trading' => 'Trading Spot', 'Futures_Trading' => 'Trading de Futuros',
'Support' => 'Soporte', 'Help_Center' => 'Centro de ayuda', 'About' => 'Acerca de', 'About_Us' => 'Sobre nosotros',
'Legal' => 'Legal', 'Privacy_Policy' => 'Política de privacidad', 'Terms_of_Service' => 'Términos de servicio'
],
'de' => [
'Services' => 'Dienste', 'Spot_Trading' => 'Spot-Handel', 'Futures_Trading' => 'Futures-Handel',
'Support' => 'Support', 'Help_Center' => 'Hilfe-Center', 'About' => 'Über uns', 'About_Us' => 'Über uns',
'Legal' => 'Rechtliches', 'Privacy_Policy' => 'Datenschutzrichtlinie', 'Terms_of_Service' => 'Nutzungsbedingungen'
]
];
function fmt($key) {
global $lang, $footer_translations;
return $footer_translations[$lang][$key] ?? ($footer_translations['en'][$key] ?? $key);
}
?>
<footer class="mt-5 py-5 border-top" style="border-color: var(--border-color) !important;">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-4 mb-4"> <div class="col-md-4 mb-4">
<h5 class="navbar-brand mb-3">BIT<span>Crypto</span></h5> <div class="d-flex align-items-center mb-3">
<p class="text-muted">The world's most trusted cryptocurrency exchange. Start trading BTC, ETH, and other assets with ease and security.</p> <div class="logo-icon" style="width: 24px; height: 24px; font-size: 0.8rem; border-radius: 6px;"><i class="fas fa-cube"></i></div>
<span class="logo-text" style="font-size: 1.2rem;">BITCrypto</span>
</div>
<p class="text-muted small"><?php echo mt('The world\'s most trusted cryptocurrency exchange. Start trading BTC, ETH, and other assets with ease and security.'); ?></p>
<div class="d-flex mt-4"> <div class="d-flex mt-4">
<a href="#" class="text-muted me-3 fs-5"><i class="fab fa-twitter"></i></a> <a href="#" class="text-muted me-3 fs-5"><i class="fab fa-twitter"></i></a>
<a href="#" class="text-muted me-3 fs-5"><i class="fab fa-telegram"></i></a> <a href="#" class="text-muted me-3 fs-5"><i class="fab fa-telegram"></i></a>
@ -65,45 +15,51 @@ function fmt($key) {
</div> </div>
</div> </div>
<div class="col-md-2 mb-4"> <div class="col-md-2 mb-4">
<h6 class="text-white"><?php echo fmt('Services'); ?></h6> <h6 class="text-white fw-bold mb-3"><?php echo mt('Services'); ?></h6>
<ul class="list-unstyled mt-3"> <ul class="list-unstyled mt-3 small">
<li><a href="trade.php?type=spot" class="text-muted text-decoration-none"><?php echo fmt('Spot_Trading'); ?></a></li> <li class="mb-2"><a href="trade.php?type=spot" class="text-muted text-decoration-none hover-white"><?php echo mt('Spot Trading'); ?></a></li>
<li><a href="trade.php?type=contract" class="text-muted text-decoration-none"><?php echo fmt('Futures_Trading'); ?></a></li> <li class="mb-2"><a href="trade.php?type=contract" class="text-muted text-decoration-none hover-white"><?php echo mt('Futures Trading'); ?></a></li>
<li class="mb-2"><a href="exchange.php" class="text-muted text-decoration-none hover-white"><?php echo mt('Exchange'); ?></a></li>
</ul> </ul>
</div> </div>
<div class="col-md-2 mb-4"> <div class="col-md-2 mb-4">
<h6 class="text-white"><?php echo fmt('Support'); ?></h6> <h6 class="text-white fw-bold mb-3"><?php echo mt('Support'); ?></h6>
<ul class="list-unstyled mt-3"> <ul class="list-unstyled mt-3 small">
<li><a href="page.php?slug=help-center" class="text-muted text-decoration-none"><?php echo fmt('Help_Center'); ?></a></li> <li class="mb-2"><a href="page.php?slug=help-center" class="text-muted text-decoration-none hover-white"><?php echo mt('Help Center'); ?></a></li>
<li><a href="page.php?slug=security-info" class="text-muted text-decoration-none">Security</a></li> <li class="mb-2"><a href="page.php?slug=security-info" class="text-muted text-decoration-none hover-white"><?php echo mt('Security Center'); ?></a></li>
<li class="mb-2"><a href="javascript:void(0)" onclick="openChat()" class="text-muted text-decoration-none hover-white"><?php echo mt('Customer Service'); ?></a></li>
</ul> </ul>
</div> </div>
<div class="col-md-2 mb-4"> <div class="col-md-2 mb-4">
<h6 class="text-white"><?php echo fmt('About'); ?></h6> <h6 class="text-white fw-bold mb-3"><?php echo mt('About Us'); ?></h6>
<ul class="list-unstyled mt-3"> <ul class="list-unstyled mt-3 small">
<li><a href="page.php?slug=about" class="text-muted text-decoration-none"><?php echo fmt('About_Us'); ?></a></li> <li class="mb-2"><a href="page.php?slug=about" class="text-muted text-decoration-none hover-white"><?php echo mt('About Us'); ?></a></li>
</ul> </ul>
</div> </div>
<div class="col-md-2 mb-4"> <div class="col-md-2 mb-4">
<h6 class="text-white"><?php echo fmt('Legal'); ?></h6> <h6 class="text-white fw-bold mb-3"><?php echo mt('Legal'); ?></h6>
<ul class="list-unstyled mt-3"> <ul class="list-unstyled mt-3 small">
<li><a href="page.php?slug=privacy" class="text-muted text-decoration-none"><?php echo fmt('Privacy_Policy'); ?></a></li> <li class="mb-2"><a href="page.php?slug=privacy" class="text-muted text-decoration-none hover-white"><?php echo mt('Privacy Policy'); ?></a></li>
<li><a href="page.php?slug=terms" class="text-muted text-decoration-none"><?php echo fmt('Terms_of_Service'); ?></a></li> <li class="mb-2"><a href="page.php?slug=terms" class="text-muted text-decoration-none hover-white"><?php echo mt('Terms of Service'); ?></a></li>
</ul> </ul>
</div> </div>
</div> </div>
<hr class="my-4" style="border-color: var(--border-color) !important;"> <hr class="my-4" style="border-color: #2b2f36 !important;">
<div class="row align-items-center"> <div class="row align-items-center small">
<div class="col-md-6 text-center text-md-start"> <div class="col-md-6 text-center text-md-start">
<p class="text-muted mb-0">&copy; 2026 BITCrypto. All rights reserved.</p> <p class="text-muted mb-0">&copy; 2026 BITCrypto. All rights reserved.</p>
</div> </div>
<div class="col-md-6 text-center text-md-end mt-3 mt-md-0"> <div class="col-md-6 text-center text-md-end mt-3 mt-md-0">
<span class="text-muted me-3"><i class="fas fa-server me-1"></i> System Status: <span class="text-success">Normal</span></span> <span class="text-muted me-3"><i class="fas fa-server me-1"></i> <?php echo mt('System Status'); ?>: <span class="text-success"><?php echo mt('Normal'); ?></span></span>
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
<style>
.hover-white:hover { color: white !important; }
</style>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script> <script src="assets/js/main.js?v=<?php echo time(); ?>"></script>

View File

@ -1,15 +1,6 @@
<?php ob_start(); ?>
<?php <?php
session_start();
require_once __DIR__ . '/../db/config.php'; require_once __DIR__ . '/../db/config.php';
session_start();
$site_name = 'BITCrypto';
try {
$stmt = db()->prepare("SELECT config_value FROM system_config WHERE config_key = 'site_name'");
$stmt->execute();
$config = $stmt->fetch();
if ($config) $site_name = $config['config_value'];
} catch (Exception $e) {}
$user = null; $user = null;
if (isset($_SESSION['user_id'])) { if (isset($_SESSION['user_id'])) {
@ -18,245 +9,371 @@ if (isset($_SESSION['user_id'])) {
$user = $stmt->fetch(); $user = $stmt->fetch();
} }
// Language logic $lang = $_GET['lang'] ?? $_SESSION['lang'] ?? 'en';
if (isset($_GET['lang'])) { if (!in_array($lang, ['en', 'zh'])) {
$_SESSION['lang'] = $_GET['lang']; $lang = 'en';
$current_page = strtok($_SERVER["REQUEST_URI"], '?');
header("Location: $current_page");
exit;
} }
$lang = $_SESSION['lang'] ?? 'en'; $_SESSION['lang'] = $lang;
// Expanded translation array for 8 languages function mt($key) {
global $lang;
$translations = [ $translations = [
'en' => [ 'en' => [
'Home' => 'Home', 'Trade' => 'Trade', 'Spot' => 'Spot', 'Perpetual' => 'Perpetual', 'Markets' => 'Markets', 'Exchange' => 'Exchange', 'Home' => 'Home', 'Spot' => 'Spot', 'Perpetual' => 'Perpetual', 'Markets' => 'Markets', 'Exchange' => 'Exchange',
'Deposit' => 'Deposit', 'Withdraw' => 'Withdraw', 'Security' => 'Security', 'KYC' => 'Verification', 'Profile' => 'User Center', 'Login' => 'Login', 'Register' => 'Register', 'Profile' => 'Profile', 'Logout' => 'Logout',
'Login' => 'Login', 'Register' => 'Register', 'Logout' => 'Logout', 'Overview' => 'Overview', 'Assets' => 'Assets', 'Deposit' => 'Deposit', 'Withdraw' => 'Withdraw', 'Assets' => 'Assets', 'Security' => 'Security',
'Real-time Markets' => 'Real-time Markets', 'Trade Anywhere' => 'Trade Anywhere, Anytime.', 'Download app' => 'Scan to download BITCrypto app', 'Buy' => 'Buy', 'Sell' => 'Sell', 'Limit' => 'Limit', 'Market' => 'Market', 'Price' => 'Price',
'Account Overview' => 'Account Overview', 'Total Balance' => 'Total Balance', 'Security Settings' => 'Security Settings', 'Amount' => 'Amount', 'Total' => 'Total', 'Available' => 'Available', 'Trade' => 'Trade',
'Login Password' => 'Login Password', 'Trading Password' => 'Trading Password', 'Identity Verification' => 'Identity Verification', 'Market Trends' => 'Market Trends', 'Real-time Prices' => 'Real-time Prices', 'High' => 'High', 'Low' => 'Low',
'Full Name' => 'Full Name', 'ID Number' => 'ID Number', 'Submit' => 'Submit', 'Asset Name' => 'Asset Name', 'Last Price' => 'Last Price', 'Download App' => 'Download App', 'Customer Service' => 'Customer Service',
'24h Change' => '24h Change', 'Market Cap' => 'Market Cap', 'Trade Now' => 'Trade Now', 'Change' => 'Change', 'Set up' => 'Set up' 'Identity Verification' => 'Identity Verification', 'Trading Password' => 'Trading Password',
'Success' => 'Success', 'Error' => 'Error', 'Matching Account' => 'Matching Account',
'Establishing secure connection with liquidity provider...' => 'Establishing secure connection with liquidity provider...',
'Awaiting merchant confirmation...' => 'Awaiting merchant confirmation...',
'Matching in progress' => 'Matching in progress',
'The specialized account for this transaction will be provided by our agent shortly.' => 'The specialized account for this transaction will be provided by our agent shortly.',
'Transfer the exact amount. Upload proof below.' => 'Transfer the exact amount. Upload proof below.',
'Bank Name' => 'Bank Name', 'Account Number' => 'Account Number', 'Beneficiary' => 'Beneficiary', 'Reference' => 'Reference',
'Copy' => 'Copy', 'Upload Proof' => 'Upload Proof', 'Selected' => 'Selected', 'Transfer Completed' => 'Transfer Completed',
'Your transfer is being reviewed. ETA: 10-20 mins.' => 'Your transfer is being reviewed. ETA: 10-20 mins.',
'Back to Wallet' => 'Back to Wallet', 'Matched & Active' => 'Matched & Active',
'Services' => 'Services', 'Spot Trading' => 'Spot Trading', 'Futures Trading' => 'Futures Trading',
'Support' => 'Support', 'Help Center' => 'Help Center', 'About Us' => 'About Us', 'Privacy Policy' => 'Privacy Policy', 'Terms of Service' => 'Terms of Service',
'System Status' => 'System Status', 'Normal' => 'Normal', 'Overview' => 'Overview', 'Full Name' => 'Full Name', 'ID Number' => 'ID Number', 'Submit' => 'Submit', 'Next-Gen Trading Engine' => 'Next-Gen Trading Engine',
'Experience ultra-low latency and institutional-grade liquidity on our professional K-line trading platform.' => 'Experience ultra-low latency and institutional-grade liquidity on our professional K-line trading platform.',
'Register Now' => 'Register Now', 'Start Trading' => 'Start Trading', 'Go to Futures' => 'Go to Futures', 'Global Crypto Hub' => 'Global Crypto Hub',
'Access real-time global market data and execute trades across multiple asset classes with one unified account.' => 'Access real-time global market data and execute trades across multiple asset classes with one unified account.',
'Secure Asset Custody' => 'Secure Asset Custody', 'Your funds are safe with our institutional-grade security, multi-sig cold storage, and comprehensive insurance fund.' => 'Your funds are safe with our institutional-grade security, multi-sig cold storage, and comprehensive insurance fund.',
'Security Center' => 'Security Center', '24/7 Global Support' => '24/7 Global Support', 'Our dedicated professional support team is available around the clock to assist you in multiple languages.' => 'Our dedicated professional support team is available around the clock to assist you in multiple languages.',
'Contact Support' => 'Contact Support', 'Asset' => 'Asset', '24h Change' => '24h Change', '24h High' => '24h High', 'Action' => 'Action', 'All Markets' => 'All Markets',
'Real-time updates from global exchanges' => 'Real-time updates from global exchanges', 'Safe & Secure' => 'Safe & Secure', 'Industry-leading encryption and multi-signature cold storage for your digital assets.' => 'Industry-leading encryption and multi-signature cold storage for your digital assets.',
'Instant Execution' => 'Instant Execution', 'Advanced matching engine processing over 100,000 transactions per second.' => 'Advanced matching engine processing over 100,000 transactions per second.',
'Get help whenever you need it with our around-the-clock professional customer service.' => 'Get help whenever you need it with our around-the-clock professional customer service.',
'Trade Anywhere, Anytime' => 'Trade Anywhere, Anytime', 'Experience the full power of our exchange on your mobile device. Trade spot and futures with ease.' => 'Experience the full power of our exchange on your mobile device. Trade spot and futures with ease.',
'Scan to download' => 'Scan to download', 'Compatible with iOS and Android devices.' => 'Compatible with iOS and Android devices.',
'Account Overview' => 'Account Overview', 'Total Balance' => 'Total Balance', 'Security Settings' => 'Security Settings', 'Login Password' => 'Login Password',
'Change' => 'Change', 'Verified' => 'Verified', 'Reviewing...' => 'Reviewing...', 'none' => 'Unverified', 'pending' => 'Pending', 'approved' => 'Verified',
'Trade with up to 100x leverage on BTC, ETH, and other major crypto pairs with professional risk management tools.' => 'Trade with up to 100x leverage on BTC, ETH, and other major crypto pairs with professional risk management tools.',
'Perpetual Contracts' => 'Perpetual Contracts', 'Identity verification submitted and is under review.' => 'Identity verification submitted and is under review.',
'New passwords do not match.' => 'New passwords do not match.', 'Password must be at least 6 characters.' => 'Password must be at least 6 characters.', 'Password updated successfully.' => 'Password updated successfully.', 'Current password incorrect.' => 'Current password incorrect.',
'Hello! Welcome to BITCrypto. How can we help you today?' => 'Hello! Welcome to BITCrypto. How can we help you today?',
'Type a message...' => 'Type a message...', 'Thank you for your message. An agent will be with you shortly.' => 'Thank you for your message. An agent will be with you shortly.',
'For security reasons, never share your login or trading passwords with anyone, including our support agents.' => 'For security reasons, never share your login or trading passwords with anyone, including our support agents.',
'Why Choose BITCrypto?' => 'Why Choose BITCrypto?', 'Global Liquidity' => 'Global Liquidity', 'Deep order books and high liquidity across all trading pairs for minimal slippage.' => 'Deep order books and high liquidity across all trading pairs for minimal slippage.',
'Advanced Trading' => 'Advanced Trading', 'Professional charting tools, multi-order types, and real-time execution.' => 'Professional charting tools, multi-order types, and real-time execution.',
'Trusted by Millions' => 'Trusted by Millions', 'Join a global community of traders and investors on one of the most secure platforms.' => 'Join a global community of traders and investors on one of the most secure platforms.',
'Our Partners' => 'Our Partners', 'Global Trust' => 'Global Trust', 'Assets Overview' => 'Assets Overview', 'BITCrypto provides a comprehensive ecosystem for crypto enthusiasts, from beginners to professional institutional traders.' => 'BITCrypto provides a comprehensive ecosystem for crypto enthusiasts, from beginners to professional institutional traders.',
'Our Global Partners' => 'Our Global Partners', 'Primary Network' => 'Primary Network', 'Smart Contracts' => 'Smart Contracts', 'Security Audit' => 'Security Audit', 'Financial Partner' => 'Financial Partner', 'Strategic Advisor' => 'Strategic Advisor',
'Unverified' => 'Unverified', 'Verification' => 'Verification', 'digits' => 'digits', 'Search Pairs' => 'Search Pairs', 'No open orders' => 'No open orders', 'Time' => 'Time', 'Pair' => 'Pair', 'Type' => 'Type', 'Side' => 'Side', 'Filled' => 'Filled', 'Open Orders' => 'Open Orders', 'Order History' => 'Order History', 'Positions' => 'Positions',
'Total Net Value' => 'Total Net Value', 'Yesterday Profit/Loss' => 'Yesterday Profit/Loss', 'Link' => 'Link', 'Recent Activities' => 'Recent Activities', 'Account Login' => 'Account Login', 'Update failed' => 'Update failed', 'Confirm New Trading Password' => 'Confirm New Trading Password', 'New Trading Password' => 'New Trading Password',
'The World\'s Leading' => 'The World\'s Leading', 'Crypto Exchange' => 'Crypto Exchange', 'Trade Bitcoin, Ethereum, and hundreds of other cryptocurrencies with the lowest fees in the industry.' => 'Trade Bitcoin, Ethereum, and hundreds of other cryptocurrencies with the lowest fees in the industry.',
'Get Started' => 'Get Started', 'View Markets' => 'View Markets', 'Users' => 'Users', '24h Volume' => '24h Volume', 'Countries' => 'Countries',
'Stay updated with real-time price changes' => 'Stay updated with real-time price changes', 'View All' => 'View All', 'Name' => 'Name',
'Experience the most professional trading environment' => 'Experience the most professional trading environment',
'Multi-sig Cold Storage' => 'Multi-sig Cold Storage', 'DDoS Protection' => 'DDoS Protection', '2FA Security' => '2FA Security',
'Ultra-low Latency' => 'Ultra-low Latency', 'High Liquidity' => 'High Liquidity', 'Zero Slippage' => 'Zero Slippage',
'Multi-language Support' => 'Multi-language Support', 'Live Chat' => 'Live Chat', 'Fast Response' => 'Fast Response',
'Trusted by industry leaders worldwide' => 'Trusted by industry leaders worldwide', 'Payment Partner' => 'Payment Partner', 'Infrastructure' => 'Infrastructure',
'Download on the' => 'Download on the', 'Get it on' => 'Get it on', 'Compatible with iOS and Android devices.' => 'Compatible with iOS and Android devices.',
'Trade Anywhere' => 'Trade Anywhere', 'Download BITCrypto mobile app for iOS and Android' => 'Download BITCrypto mobile app for iOS and Android',
'Secure & Trusted' => 'Secure & Trusted', 'Your assets are protected by industry-leading security' => 'Your assets are protected by industry-leading security',
'Crypto Deposit' => 'Crypto Deposit', 'Fiat Deposit' => 'Fiat Deposit', 'Select Currency' => 'Select Currency', 'Deposit Amount' => 'Deposit Amount', 'Submit Deposit' => 'Submit Deposit',
'Select Fiat Currency' => 'Select Fiat Currency', 'Confirm Deposit' => 'Confirm Deposit',
'Order ID' => 'Order ID',
'A local merchant has been found. Matching account details...' => 'A local merchant has been found. Matching account details...',
'Welcome! I am your dedicated matching assistant. I am currently verifying the liquidity provider for your deposit.' => 'Welcome! I am your dedicated matching assistant. I am currently verifying the liquidity provider for your deposit.',
'Matching successful. I have secured a high-priority account for your transaction. Please find the details on the right.' => 'Matching successful. I have secured a high-priority account for your transaction. Please find the details on the right.',
'Please upload your payment receipt/screenshot first.' => 'Please upload your payment receipt/screenshot first.',
'Thank you for the update. We have received your payment proof and are now verifying the transaction on the blockchain. Your balance will be updated shortly.' => 'Thank you for the update. We have received your payment proof and are now verifying the transaction on the blockchain. Your balance will be updated shortly.',
'Receipt uploaded successfully. Waiting for admin approval.' => 'Receipt uploaded successfully. Waiting for admin approval.',
'Network' => 'Network', 'Scan QR code to deposit' => 'Scan QR code to deposit', 'Upload screenshot of your transaction' => 'Upload screenshot of your transaction', 'Instant' => 'Instant', 'Regional Support' => 'Regional Support',
'We will match you with a local merchant to facilitate your deposit in your local currency.' => 'We will match you with a local merchant to facilitate your deposit in your local currency.',
'Processing Time: 10-30 mins' => 'Processing Time: 10-30 mins', 'Exchange Rate' => 'Exchange Rate', 'Service Fee' => 'Service Fee', 'Free' => 'Free',
'Secure Payment' => 'Secure Payment', 'All transactions are encrypted' => 'All transactions are encrypted', 'Fast Arrival' => 'Fast Arrival', 'Most deposits arrive in mins' => 'Most deposits arrive in mins', 'Live help for your deposit' => 'Live help for your deposit',
'Address copied to clipboard' => 'Address copied to clipboard'
], ],
'zh' => [ 'zh' => [
'Home' => '首页', 'Trade' => '交易', 'Spot' => '现货', 'Perpetual' => '永续合约', 'Markets' => '行情', 'Exchange' => '兑换', 'Home' => '首页', 'Spot' => '现货', 'Perpetual' => '永续合约', 'Markets' => '市场行情', 'Exchange' => '快捷换币',
'Deposit' => '充币', 'Withdraw' => '提币', 'Security' => '安全中心', 'KYC' => '身份认证', 'Profile' => '个人中心', 'Login' => '登录', 'Register' => '注册', 'Profile' => '个人中心', 'Logout' => '退出登录',
'Login' => '登录', 'Register' => '注册', 'Logout' => '退出登录', 'Overview' => '资产概览', 'Assets' => '我的资产', 'Deposit' => '充值', 'Withdraw' => '提现', 'Assets' => '资产总览', 'Security' => '安全设置',
'Real-time Markets' => '实时行情', 'Trade Anywhere' => '随时随地进行交易', 'Download app' => '扫码下载 BITCrypto App', 'Buy' => '买入', 'Sell' => '卖出', 'Limit' => '限价', 'Market' => '市价', 'Price' => '价格',
'Account Overview' => '账户概览', 'Total Balance' => '总资产折算', 'Security Settings' => '安全设置', 'Amount' => '数量', 'Total' => '成交额', 'Available' => '可用余额', 'Trade' => '交易',
'Login Password' => '登录密码', 'Trading Password' => '资金密码', 'Identity Verification' => '身份认证', 'Market Trends' => '市场趋势', 'Real-time Prices' => '实时行情', 'High' => '最高', 'Low' => '最低',
'Full Name' => '姓名', 'ID Number' => '证件号码', 'Submit' => '提交', 'Asset Name' => '资产名称', 'Last Price' => '最新价', 'Download App' => '下载APP', 'Customer Service' => '在线客服',
'24h Change' => '24h 涨跌', 'Market Cap' => '市值', 'Trade Now' => '立即交易', 'Change' => '修改', 'Set up' => '去设置' 'Identity Verification' => '实名认证', 'Trading Password' => '资金密码',
], 'Success' => '操作成功', 'Error' => '操作失败', 'Matching Account' => '匹配账户',
'ja' => [ 'Establishing secure connection with liquidity provider...' => '正在与流动性提供商建立安全连接...',
'Home' => 'ホーム', 'Trade' => 'トレード', 'Spot' => '現物', 'Perpetual' => '無期限', 'Markets' => 'マーケット', 'Exchange' => '両替', 'Awaiting merchant confirmation...' => '等待商家确认...',
'Deposit' => '入金', 'Withdraw' => '出金', 'Security' => 'セキュリティ', 'KYC' => '本人確認', 'Profile' => 'ユーザーセンター', 'Matching in progress' => '正在匹配中',
'Login' => 'ログイン', 'Register' => '新規登録', 'Logout' => 'ログアウト', 'Overview' => '概要', 'Assets' => '資産', 'The specialized account for this transaction will be provided by our agent shortly.' => '该交易的专用账户将由我们的代理稍后提供。',
'Real-time Markets' => 'リアルタイムマーケット', 'Trade Anywhere' => 'いつでも、どこでもトレード', 'Download app' => 'BITCryptoアプリをダウンロード', 'Transfer the exact amount. Upload proof below.' => '请转账准确金额。在下方上传凭证。',
'Account Overview' => 'アカウント概要', 'Total Balance' => '総資産', 'Security Settings' => 'セキュリティ設定', 'Bank Name' => '银行名称', 'Account Number' => '账号', 'Beneficiary' => '收款人', 'Reference' => '备注/附言',
'Login Password' => 'ログインパスワード', 'Trading Password' => '取引パスワード', 'Identity Verification' => '本人確認', 'Copy' => '复制', 'Upload Proof' => '上传凭证', 'Selected' => '已选择', 'Transfer Completed' => '我已完成转账',
'Full Name' => '氏名', 'ID Number' => 'ID番号', 'Submit' => '送信', 'Asset Name' => '資産名', 'Last Price' => '現在値', 'Your transfer is being reviewed. ETA: 10-20 mins.' => '您的转账正在审核中。预计时间10-20分钟。',
'24h Change' => '24h 変動', 'Market Cap' => '時価総額', 'Trade Now' => '今すぐトレード', 'Change' => '変更', 'Set up' => '設定' 'Back to Wallet' => '返回钱包', 'Matched & Active' => '已匹配并激活',
], 'Services' => '服务', 'Spot Trading' => '现货交易', 'Futures Trading' => '期货交易',
'ko' => [ 'Support' => '支持', 'Help Center' => '帮助中心', 'About Us' => '关于我们', 'Privacy Policy' => '隐私政策', 'Terms of Service' => '服务条款',
'Home' => '홈', 'Trade' => '거래', 'Spot' => '현물', 'Perpetual' => '선물', 'Markets' => '시장', 'Exchange' => '교환', 'System Status' => '系统状态', 'Normal' => '正常', 'Overview' => '概览', 'Full Name' => '真实姓名', 'ID Number' => '证件号码', 'Submit' => '提交', 'Next-Gen Trading Engine' => '下一代交易引擎',
'Deposit' => '입금', 'Withdraw' => '출금', 'Security' => '보안', 'KYC' => '본인인증', 'Profile' => '사용자 센터', 'Experience ultra-low latency and institutional-grade liquidity on our professional K-line trading platform.' => '在我们的专业K线交易平台上体验超低延迟和机构级流动性。',
'Login' => '로그인', 'Register' => '회원가입', 'Logout' => '로그아웃', 'Overview' => '개요', 'Assets' => '자산', 'Register Now' => '立即注册', 'Start Trading' => '开始交易', 'Go to Futures' => '前往合约', 'Global Crypto Hub' => '全球加密枢纽',
'Real-time Markets' => '실시간 시장', 'Trade Anywhere' => '언제 어디서나 거래하세요', 'Download app' => 'BITCrypto 앱 다운로드', 'Access real-time global market data and execute trades across multiple asset classes with one unified account.' => '通过一个统一的账户访问实时全球市场数据并跨多个资产类别执行交易。',
'Account Overview' => '계정 개요', 'Total Balance' => '총 잔액', 'Security Settings' => '보안 설정', 'Secure Asset Custody' => '安全的资产托管', 'Your funds are safe with our institutional-grade security, multi-sig cold storage, and comprehensive insurance fund.' => '您的资金在我们机构级的安全性、多重签名冷存储和全面的保险基金保护下非常安全。',
'Login Password' => '로그인 비밀번호', 'Trading Password' => '거래 비밀번호', 'Identity Verification' => '본인인증', 'Security Center' => '安全中心', '24/7 Global Support' => '24/7 全球支持', 'Our dedicated professional support team is available around the clock to assist you in multiple languages.' => '我们专业的支持团队全天候为您提供多种语言的帮助。',
'Full Name' => '성명', 'ID Number' => '신분증 번호', 'Submit' => '제출', 'Asset Name' => '자산 이름', 'Last Price' => '현재가', 'Contact Support' => '联系支持', 'Asset' => '资产', '24h Change' => '24h 涨跌', '24h High' => '24h 最高', 'Action' => '操作', 'All Markets' => '全部市场',
'24h Change' => '24h 변동', 'Market Cap' => '시가총액', 'Trade Now' => '지금 거래하기', 'Change' => '변경', 'Set up' => '설정' 'Real-time updates from global exchanges' => '来自全球交易所的实时更新', 'Safe & Secure' => '安全可靠', 'Industry-leading encryption and multi-signature cold storage for your digital assets.' => '为您的数字资产提供行业领先的加密和多重签名冷存储。',
], 'Instant Execution' => '即时执行', 'Advanced matching engine processing over 100,000 transactions per second.' => '每秒处理超过 100,000 笔交易的先进撮合引擎。',
'ru' => [ 'Get help whenever you need it with our around-the-clock professional customer service.' => '通过我们全天候的专业客户服务,随时获得您需要的帮助。',
'Home' => 'Главная', 'Trade' => 'Торговля', 'Spot' => 'Спот', 'Perpetual' => 'Фьючерсы', 'Markets' => 'Рынки', 'Exchange' => 'Обмен', 'Trade Anywhere, Anytime' => '随时随地进行交易', 'Experience the full power of our exchange on your mobile device. Trade spot and futures with ease.' => '在您的移动设备上体验我们交易所的全部功能。轻松交易现货和期货。',
'Deposit' => 'Депозит', 'Withdraw' => 'Вывод', 'Security' => 'Безопасность', 'KYC' => 'Верификация', 'Profile' => 'Центр пользователя', 'Scan to download' => '扫码下载', 'Compatible with iOS and Android devices.' => '兼容 iOS 和 Android 设备。',
'Login' => 'Вход', 'Register' => 'Регистрация', 'Logout' => 'Выход', 'Overview' => 'Обзор', 'Assets' => 'Активы', 'Account Overview' => '账户概览', 'Total Balance' => '总资产', 'Security Settings' => '安全设置', 'Login Password' => '登录密码',
'Real-time Markets' => 'Рынки в реальном времени', 'Trade Anywhere' => 'Торгуйте где угодно', 'Download app' => 'Скачать приложение BITCrypto', 'Change' => '修改', 'Verified' => '已认证', 'Reviewing...' => '审核中...', 'none' => '未认证', 'pending' => '审核中', 'approved' => '已认证',
'Account Overview' => 'Обзор аккаунта', 'Total Balance' => 'Общий баланс', 'Security Settings' => 'Настройки безопасности', 'Trade with up to 100x leverage on BTC, ETH, and other major crypto pairs with professional risk management tools.' => '在 BTC、ETH 和其他主要加密货币对上使用高达 100 倍的杠杆进行交易,并配备专业的风险管理工具。',
'Login Password' => 'Пароль для входа', 'Trading Password' => 'Торговый пароль', 'Identity Verification' => 'Верификация личности', 'Perpetual Contracts' => '永续合约', 'Identity verification submitted and is under review.' => '身份认证已提交,正在审核中。',
'Full Name' => 'Полное имя', 'ID Number' => 'Номер документа', 'Submit' => 'Отправить', 'Asset Name' => 'Название актива', 'Last Price' => 'Цена', 'New passwords do not match.' => '新密码不匹配。', 'Password must be at least 6 characters.' => '密码长度必须至少为6位。', 'Password updated successfully.' => '密码更新成功。', 'Current password incorrect.' => '当前密码不正确。',
'24h Change' => 'Изм. за 24ч', 'Market Cap' => 'Капитализация', 'Trade Now' => 'Торговать', 'Change' => 'Изменить', 'Set up' => 'Настроить' 'Hello! Welcome to BITCrypto. How can we help you today?' => '您好!欢迎来到 BITCrypto。今天有什么可以帮您的',
], 'Type a message...' => '输入消息...', 'Thank you for your message. An agent will be with you shortly.' => '感谢您的消息,客服人员稍后将为您提供服务。',
'fr' => [ 'For security reasons, never share your login or trading passwords with anyone, including our support agents.' => '出于安全考虑,请勿向任何人(包括我们的客服人员)透露您的登录密码或交易密码。',
'Home' => 'Accueil', 'Trade' => 'Trader', 'Spot' => 'Spot', 'Perpetual' => 'Futures', 'Markets' => 'Marchés', 'Exchange' => 'Échange', 'Why Choose BITCrypto?' => '为什么选择 BITCrypto', 'Global Liquidity' => '全球流动性', 'Deep order books and high liquidity across all trading pairs for minimal slippage.' => '所有交易对均拥有深度订单簿和高流动性,确保最小滑点。',
'Deposit' => 'Dépôt', 'Withdraw' => 'Retrait', 'Security' => 'Sécurité', 'KYC' => 'Vérification', 'Profile' => 'Centre utilisateur', 'Advanced Trading' => '高级交易', 'Professional charting tools, multi-order types, and real-time execution.' => '专业的图表工具、多种订单类型和实时执行。',
'Login' => 'Connexion', 'Register' => 'S\'inscrire', 'Logout' => 'Déconnexion', 'Overview' => 'Aperçu', 'Assets' => 'Actifs', 'Trusted by Millions' => '数百万用户的信赖', 'Join a global community of traders and investors on one of the most secure platforms.' => '加入全球交易者和投资者的社区,在最安全的平台之一上进行交易。',
'Real-time Markets' => 'Marchés en temps réel', 'Trade Anywhere' => 'Tradez n\'importe où', 'Download app' => 'Télécharger l\'app BITCrypto', 'Our Partners' => '合作伙伴', 'Global Trust' => '全球信任', 'Assets Overview' => '资产总览', 'BITCrypto provides a comprehensive ecosystem for crypto enthusiasts, from beginners to professional institutional traders.' => 'BITCrypto 为加密爱好者提供了一个全面的生态系统,从初学者到专业的机构交易者都能在这里找到适合自己的工具。',
'Account Overview' => 'Aperçu du compte', 'Total Balance' => 'Solde total', 'Security Settings' => 'Paramètres de sécurité', 'Our Global Partners' => '我们的全球合作伙伴', 'Primary Network' => '主要网络', 'Smart Contracts' => '智能合约', 'Security Audit' => '安全审计', 'Financial Partner' => '金融伙伴', 'Strategic Advisor' => '战略顾问',
'Login Password' => 'Mot de passe de connexion', 'Trading Password' => 'Mot de passe de transaction', 'Identity Verification' => 'Vérification d\'identité', 'Unverified' => '未认证', 'Verification' => '实名认证', 'digits' => '位数字', 'Search Pairs' => '搜索币种', 'No open orders' => '无挂单', 'Time' => '时间', 'Pair' => '币种', 'Type' => '类型', 'Side' => '方向', 'Filled' => '已成交', 'Open Orders' => '当前挂单', 'Order History' => '历史订单', 'Positions' => '当前仓位',
'Full Name' => 'Nom complet', 'ID Number' => 'Numéro d\'identité', 'Submit' => 'Soumettre', 'Asset Name' => 'Nom de l\'actif', 'Last Price' => 'Prix', 'Total Net Value' => '总资产折算', 'Yesterday Profit/Loss' => '昨日盈亏', 'Link' => '去绑定', 'Recent Activities' => '最近动态', 'Account Login' => '账号登录', 'Update failed' => '更新失败', 'Confirm New Trading Password' => '确认新资金密码', 'New Trading Password' => '新资金密码',
'24h Change' => 'Var. 24h', 'Market Cap' => 'Cap. boursière', 'Trade Now' => 'Trader maintenant', 'Change' => 'Modifier', 'Set up' => 'Configurer' 'The World\'s Leading' => '全球领先的', 'Crypto Exchange' => '数字资产交易所', 'Trade Bitcoin, Ethereum, and hundreds of other cryptocurrencies with the lowest fees in the industry.' => '在行业最低费率的交易所交易比特币、以太坊和数百种其他加密货币。',
], 'Get Started' => '立即开始', 'View Markets' => '查看行情', 'Users' => '用户', '24h Volume' => '24h 成交额', 'Countries' => '覆盖国家',
'es' => [ 'Stay updated with real-time price changes' => '实时掌握价格波动', 'View All' => '查看全部', 'Name' => '币种名称',
'Home' => 'Inicio', 'Trade' => 'Trading', 'Spot' => 'Spot', 'Perpetual' => 'Futuros', 'Markets' => 'Mercados', 'Exchange' => 'Intercambio', 'Experience the most professional trading environment' => '体验最专业的交易环境',
'Deposit' => 'Depósito', 'Withdraw' => 'Retiro', 'Security' => 'Seguridad', 'KYC' => 'Verificación', 'Profile' => 'Centro de usuario', 'Multi-sig Cold Storage' => '多重签名冷存储', 'DDoS Protection' => 'DDoS 防护', '2FA Security' => '双重身份验证',
'Login' => 'Iniciar sesión', 'Register' => 'Registrarse', 'Logout' => 'Cerrar sesión', 'Overview' => 'Resumen', 'Assets' => 'Activos', 'Ultra-low Latency' => '极低延迟', 'High Liquidity' => '高流动性', 'Zero Slippage' => '零滑点',
'Real-time Markets' => 'Mercados en tiempo real', 'Trade Anywhere' => 'Opera en cualquier lugar', 'Download app' => 'Descargar app BITCrypto', 'Multi-language Support' => '多语言支持', 'Live Chat' => '实时聊天', 'Fast Response' => '极速响应',
'Account Overview' => 'Resumen de cuenta', 'Total Balance' => 'Saldo total', 'Security Settings' => 'Ajustes de seguridad', 'Trusted by industry leaders worldwide' => '全球行业领导者的信赖', 'Payment Partner' => '支付合作伙伴', 'Infrastructure' => '基础设施',
'Login Password' => 'Contraseña de acceso', 'Trading Password' => 'Contraseña de trading', 'Identity Verification' => 'Verificación de identidad', 'Download on the' => '在 App Store 下载', 'Get it on' => '在 Google Play 下载', 'Compatible with iOS and Android devices.' => '兼容 iOS 和 Android 设备。',
'Full Name' => 'Nombre completo', 'ID Number' => 'Número de documento', 'Submit' => 'Enviar', 'Asset Name' => 'Activo', 'Last Price' => 'Último precio', 'Trade Anywhere' => '随时随地交易', 'Download BITCrypto mobile app for iOS and Android' => '下载 BITCrypto 移动端 App支持 iOS 和 Android',
'24h Change' => 'Var. 24h', 'Market Cap' => 'Cap. de mercado', 'Trade Now' => 'Operar ahora', 'Change' => 'Cambiar', 'Set up' => 'Configurar' 'Secure & Trusted' => '安全可靠', 'Your assets are protected by industry-leading security' => '您的资产受到行业领先的安全保护',
], 'Crypto Deposit' => '数字货币充值', 'Fiat Deposit' => '法币充值', 'Select Currency' => '选择币种', 'Deposit Amount' => '充值金额', 'Submit Deposit' => '提交充值',
'de' => [ 'Select Fiat Currency' => '选择法币', 'Confirm Deposit' => '确认充值',
'Home' => 'Startseite', 'Trade' => 'Handeln', 'Spot' => 'Spot', 'Perpetual' => 'Futures', 'Markets' => 'Märkte', 'Exchange' => 'Tausch', 'Order ID' => '订单编号',
'Deposit' => 'Einzahlung', 'Withdraw' => 'Auszahlung', 'Security' => 'Sicherheit', 'KYC' => 'Verifizierung', 'Profile' => 'Benutzerzentrum', 'A local merchant has been found. Matching account details...' => '已找到本地商家。正在匹配账户详情...',
'Login' => 'Anmelden', 'Register' => 'Registrieren', 'Logout' => 'Abmelden', 'Overview' => 'Übersicht', 'Assets' => 'Vermögenswerte', 'Welcome! I am your dedicated matching assistant. I am currently verifying the liquidity provider for your deposit.' => '欢迎!我是您的专属匹配助手。我目前正在为您验证流动性提供商。',
'Real-time Markets' => 'Echtzeit-Märkte', 'Trade Anywhere' => 'Überall handeln', 'Download app' => 'BITCrypto App herunterladen', 'Matching successful. I have secured a high-priority account for your transaction. Please find the details on the right.' => '匹配成功。我已为您的交易锁定了一个高优先级账户。请查看右侧的详细信息。',
'Account Overview' => 'Kontoübersicht', 'Total Balance' => 'Gesamtguthaben', 'Security Settings' => 'Sicherheitseinstellungen', 'Please upload your payment receipt/screenshot first.' => '请先上传您的付款收据/截图。',
'Login Password' => 'Login-Passwort', 'Trading Password' => 'Handelspasswort', 'Identity Verification' => 'Identitätsprüfung', 'Thank you for the update. We have received your payment proof and are now verifying the transaction on the blockchain. Your balance will be updated shortly.' => '感谢您的反馈。我们已收到您的付款凭证,目前正在区块链上验证该交易。您的余额稍后将更新。',
'Full Name' => 'Vollständiger Name', 'ID Number' => 'Ausweisnummer', 'Submit' => 'Absenden', 'Asset Name' => 'Name', 'Last Price' => 'Preis', 'Receipt uploaded successfully. Waiting for admin approval.' => '凭证上传成功。等待管理员审核。',
'24h Change' => '24h Änderung', 'Market Cap' => 'Marktkapitalisierung', 'Trade Now' => 'Jetzt handeln', 'Change' => 'Ändern', 'Set up' => 'Einrichten' 'Network' => '网络', 'Scan QR code to deposit' => '扫码充值', 'Upload screenshot of your transaction' => '上传交易截图', 'Instant' => '秒到账', 'Regional Support' => '区域支持',
'We will match you with a local merchant to facilitate your deposit in your local currency.' => '我们将为您匹配本地商家,方便您以本地货币进行充值。',
'Processing Time: 10-30 mins' => '处理时间10-30 分钟', 'Exchange Rate' => '汇率', 'Service Fee' => '手续费', 'Free' => '免费',
'Secure Payment' => '安全支付', 'All transactions are encrypted' => '所有交易均已加密', 'Fast Arrival' => '极速到账', 'Most deposits arrive in mins' => '大多数充值在几分钟内到账', 'Live help for your deposit' => '充值实时帮助',
'Address copied to clipboard' => '地址已复制到剪贴板'
] ]
]; ];
function t($key, $default = null) { return $translations[$lang][$key] ?? $translations['en'][$key] ?? $key;
global $lang, $translations;
return $translations[$lang][$key] ?? ($translations['en'][$key] ?? ($default ?? $key));
} }
function mt($key) { function t($key) { return mt($key); }
return t($key);
}
// Determine if we need a back button (not on index.php)
$current_page = basename($_SERVER['PHP_SELF']);
$is_home = ($current_page == 'index.php');
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?php echo $lang; ?>"> <html lang="<?php echo $lang; ?>">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $site_name; ?> - Professional Crypto Exchange</title> <title>BITCrypto - Global Leading Crypto Exchange</title>
<link rel="icon" type="image/png" href="favicon.png">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>"> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<style> <style>
:root { :root {
--bg-color: #0b0e11; --primary-bg: #0b0e11;
--text-color: #eaecef; --secondary-bg: #181a20;
--accent-color: #f0b90b; --accent-color: #f0b90b;
--card-bg: #1e2329; --text-main: #eaecef;
--border-color: #363c4e;
--okx-blue: #0046ff;
--text-muted: #848e9c; --text-muted: #848e9c;
--success: #0ecb81;
--danger: #f6465d;
--okx-blue: #0046ff;
--bit-gradient: linear-gradient(45deg, #0046ff, #00ff96);
} }
body { body { background: var(--primary-bg); color: var(--text-main); font-family: 'Inter', sans-serif; overflow-x: hidden; padding-bottom: 70px; }
background-color: var(--bg-color); @media (min-width: 992px) { body { padding-bottom: 0; } }
color: var(--text-color);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; .navbar { background: var(--secondary-bg); border-bottom: 1px solid #2b2f36; padding: 0.8rem 0; }
overflow-x: hidden; .logo-text {
}
.navbar {
background-color: var(--bg-color);
border-bottom: 1px solid var(--border-color);
padding: 0.75rem 1.5rem;
}
.navbar-brand {
font-weight: 800;
color: var(--text-color) !important;
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 800;
background: var(--bit-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: -0.5px;
}
.logo-img {
height: 40px;
margin-right: 12px;
background: transparent;
border: none;
display: block;
}
.back-button {
display: <?php echo $is_home ? 'none' : 'flex'; ?>;
align-items: center;
gap: 8px;
color: var(--text-muted);
text-decoration: none;
font-weight: 600;
padding: 8px 16px;
border-radius: 20px;
background: rgba(255,255,255,0.05);
transition: all 0.3s;
margin-right: 15px;
}
.back-button:hover { background: rgba(255,255,255,0.1); color: white; }
/* Bottom Nav for Mobile */
.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 70px;
background: #181a20;
border-top: 1px solid #2b2f36;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 2001;
padding-bottom: env(safe-area-inset-bottom);
}
.nav-item-mobile {
display: flex;
flex-direction: column;
align-items: center;
color: #848e9c;
text-decoration: none;
font-size: 0.65rem;
transition: all 0.2s;
}
.nav-item-mobile i { font-size: 1.3rem; margin-bottom: 4px; }
.nav-item-mobile.active { color: var(--okx-blue); }
.floating-chat {
position: fixed;
bottom: 90px;
right: 20px;
z-index: 2000;
width: 55px;
height: 55px;
background: var(--bit-gradient);
border-radius: 50%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
color: white;
font-size: 1.5rem;
box-shadow: 0 10px 25px rgba(0, 70, 255, 0.4);
cursor: pointer;
text-decoration: none;
} }
.navbar-brand span {
color: var(--okx-blue); @media (min-width: 992px) {
.bottom-nav { display: none; }
.floating-chat { bottom: 30px; right: 30px; width: 65px; height: 65px; font-size: 1.8rem; }
} }
.nav-link {
color: var(--text-color) !important;
font-weight: 500;
margin: 0 10px;
font-size: 0.95rem;
}
.nav-link:hover {
color: var(--okx-blue) !important;
}
.btn-accent {
background-color: var(--text-color);
color: #000;
font-weight: 600;
border: none;
border-radius: 20px;
padding: 6px 20px;
}
.btn-accent:hover {
background-color: #fff;
color: #000;
}
.dropdown-menu {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.dropdown-item {
color: var(--text-color);
padding: 10px 20px;
}
.dropdown-item:hover {
background-color: var(--border-color);
color: var(--okx-blue);
}
/* Global visibility fixes */
.text-black { color: #000 !important; }
.text-white { color: #fff !important; }
.bg-white { background-color: #fff !important; color: #000 !important; }
.bg-white .text-muted { color: #666 !important; }
</style> </style>
</head> </head>
<body> <body>
<nav class="navbar navbar-expand-lg sticky-top">
<div class="container-fluid"> <nav class="navbar navbar-expand-lg navbar-dark sticky-top">
<a class="navbar-brand" href="index.php"> <div class="container">
BIT<span>Crypto</span> <div class="d-flex align-items-center">
<a href="javascript:history.back()" class="back-button d-lg-none">
<i class="fas fa-chevron-left"></i>
</a> </a>
<a class="navbar-brand d-flex align-items-center" href="index.php">
<img src="assets/images/logo.png" alt="Logo" class="logo-img">
<span class="logo-text">BITCrypto</span>
</a>
</div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarNav"> <div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto"> <ul class="navbar-nav me-auto ms-lg-4">
<li class="nav-item"><a class="nav-link" href="index.php"><?php echo mt('Home'); ?></a></li> <li class="nav-item"><a class="nav-link px-3" href="index.php"><?php echo mt('Home'); ?></a></li>
<li class="nav-item dropdown"> <li class="nav-item"><a class="nav-link px-3" href="trade.php?type=spot"><?php echo mt('Spot'); ?></a></li>
<a class="nav-link dropdown-toggle" href="#" id="tradeDropdown" role="button" data-bs-toggle="dropdown"> <li class="nav-item"><a class="nav-link px-3" href="trade.php?type=contract"><?php echo mt('Perpetual'); ?></a></li>
<?php echo mt('Trade'); ?> <li class="nav-item"><a class="nav-link px-3" href="market.php"><?php echo mt('Markets'); ?></a></li>
</a> <li class="nav-item"><a class="nav-link px-3" href="exchange.php"><?php echo mt('Exchange'); ?></a></li>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="trade.php?type=spot"><?php echo mt('Spot'); ?></a></li>
<li><a class="dropdown-item" href="trade.php?type=contract"><?php echo mt('Perpetual'); ?></a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="market.php"><?php echo mt('Markets'); ?></a></li>
<li class="nav-item"><a class="nav-link" href="exchange.php"><?php echo mt('Exchange'); ?></a></li>
</ul> </ul>
<ul class="navbar-nav ms-auto align-items-center"> <ul class="navbar-nav ms-auto align-items-center">
<li class="nav-item dropdown me-3"> <li class="nav-item dropdown me-3">
<a class="nav-link dropdown-toggle" href="#" id="langDropdown" role="button" data-bs-toggle="dropdown"> <a class="nav-link dropdown-toggle" href="#" id="langDropdown" role="button" data-bs-toggle="dropdown">
<i class="fas fa-globe"></i> <?php <i class="fas fa-globe me-1"></i> <?php
$langs = ['en' => 'English', 'zh' => '简体中文', 'ja' => '日本語', 'ko' => '한국어', 'ru' => 'Русский', 'fr' => 'Français', 'es' => 'Español', 'de' => 'Deutsch']; $langs = ['en' => 'English', 'zh' => '简体中文'];
echo $langs[$lang] ?? 'English'; echo $langs[$lang] ?? 'English';
?> ?>
</a> </a>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end shadow-lg">
<?php foreach($langs as $code => $name): <li><a class="dropdown-item" href="?lang=en">English</a></li>
echo "<li><a class=\"dropdown-item\" href=\" ?lang=$code\">$name</a></li>"; <li><a class="dropdown-item" href="?lang=zh">简体中文</a></li>
endforeach; ?>
</ul> </ul>
</li> </li>
<?php if ($user): ?> <?php if ($user): ?>
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown"> <a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown">
<i class="fas fa-user-circle"></i> <?php echo htmlspecialchars($user['username']); ?> <div class="bg-secondary rounded-circle d-flex align-items-center justify-content-center me-2" style="width: 32px; height: 32px;">
<i class="fas fa-user small"></i>
</div>
<?php echo htmlspecialchars($user['username']); ?>
</a> </a>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end shadow-lg">
<li><a class="dropdown-item" href="profile.php"><i class="fas fa-id-card me-2"></i> <?php echo mt('Profile'); ?></a></li> <li class="px-3 py-2 small text-muted border-bottom border-secondary mb-1">UID: <?php echo str_pad($user['uid'] ?? 0, 6, '0', STR_PAD_LEFT); ?></li>
<li><a class="dropdown-item" href="profile.php#assets"><i class="fas fa-wallet me-2"></i> <?php echo number_format($user['balance_usdt'], 2); ?> USDT</a></li> <li><a class="dropdown-item" href="profile.php"><i class="fas fa-wallet me-2"></i> <?php echo mt('Assets'); ?></a></li>
<li><a class="dropdown-item" href="profile.php?tab=security"><i class="fas fa-user-shield me-2"></i> <?php echo mt('Security'); ?></a></li>
<li><hr class="dropdown-divider"></li> <li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="logout.php"><i class="fas fa-sign-out-alt me-2"></i> <?php echo mt('Logout'); ?></a></li> <li><a class="dropdown-item text-danger" href="logout.php"><i class="fas fa-sign-out-alt me-2"></i> <?php echo mt('Logout'); ?></a></li>
</ul> </ul>
</li> </li>
<?php else: ?> <?php else: ?>
<li class="nav-item"><a class="nav-link" href="login.php"><?php echo mt('Login'); ?></a></li> <li class="nav-item"><a class="nav-link px-3" href="login.php"><?php echo mt('Login'); ?></a></li>
<li class="nav-item"><a class="btn btn-accent ms-2" href="register.php"><?php echo mt('Register'); ?></a></li> <li class="nav-item"><a class="btn btn-primary px-4 ms-2 border-0" style="background: var(--okx-blue);" href="register.php"><?php echo mt('Register'); ?></a></li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
<!-- Bottom Nav for Mobile -->
<div class="bottom-nav">
<a href="index.php" class="nav-item-mobile <?php echo $current_page == 'index.php' ? 'active' : ''; ?>">
<i class="fas fa-house"></i>
<span><?php echo mt('Home'); ?></span>
</a>
<a href="market.php" class="nav-item-mobile <?php echo $current_page == 'market.php' ? 'active' : ''; ?>">
<i class="fas fa-chart-simple"></i>
<span><?php echo mt('Markets'); ?></span>
</a>
<a href="trade.php" class="nav-item-mobile <?php echo ($current_page == 'trade.php' && ($_GET['type'] ?? 'spot') == 'spot') ? 'active' : ''; ?>">
<i class="fas fa-repeat"></i>
<span><?php echo mt('Spot'); ?></span>
</a>
<a href="trade.php?type=contract" class="nav-item-mobile <?php echo ($current_page == 'trade.php' && ($_GET['type'] ?? '') == 'contract') ? 'active' : ''; ?>">
<i class="fas fa-bolt"></i>
<span><?php echo mt('Perpetual'); ?></span>
</a>
<a href="profile.php" class="nav-item-mobile <?php echo $current_page == 'profile.php' ? 'active' : ''; ?>">
<i class="fas fa-wallet"></i>
<span><?php echo mt('Assets'); ?></span>
</a>
</div>
<!-- Global Floating Chat -->
<a href="chat.php" class="floating-chat shadow-lg">
<i class="fas fa-headset"></i>
</a>

566
index.php
View File

@ -1,365 +1,299 @@
<?php <?php
require_once 'includes/header.php'; include 'includes/header.php';
// Carousel items - 5 crypto related images
$carousel_items = [
[
'image_url' => 'https://images.pexels.com/photos/843700/pexels-photo-843700.jpeg?auto=compress&cs=tinysrgb&w=1600',
'title' => 'The Future of Digital Finance',
'description' => 'Trade over 500+ cryptocurrencies with the world\'s most trusted exchange.'
],
[
'image_url' => 'https://images.pexels.com/photos/6771574/pexels-photo-6771574.jpeg?auto=compress&cs=tinysrgb&w=1600',
'title' => 'Institutional-Grade Security',
'description' => 'Your assets are protected by industry-leading cold storage and multi-layer encryption.'
],
[
'image_url' => 'https://images.pexels.com/photos/6770610/pexels-photo-6770610.jpeg?auto=compress&cs=tinysrgb&w=1600',
'title' => 'Advanced Trading Tools',
'description' => 'Experience seamless trading with up to 125x leverage on Perpetual Contracts.'
],
[
'image_url' => 'https://images.pexels.com/photos/7567443/pexels-photo-7567443.jpeg?auto=compress&cs=tinysrgb&w=1600',
'title' => 'Global Compliance',
'description' => 'BITCrypto works closely with regulators to ensure a safe and transparent trading environment.'
],
[
'image_url' => 'https://images.pexels.com/photos/6771611/pexels-photo-6771611.jpeg?auto=compress&cs=tinysrgb&w=1600',
'title' => '24/7 Professional Support',
'description' => 'Our dedicated support team is available around the clock to assist you with any questions.'
],
];
?> ?>
<style>
.hero-section {
position: relative;
background-color: #000;
overflow: hidden;
}
.carousel-item {
height: 650px;
}
.hero-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.9) 100%);
z-index: 1;
}
.hero-content {
position: relative;
z-index: 2;
padding-top: 180px;
}
.hero-img {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 0.6;
}
.btn-large {
padding: 15px 45px;
font-size: 1.2rem;
font-weight: 600;
border-radius: 12px;
}
.stat-card {
background-color: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 16px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
cursor: pointer;
}
.stat-card:hover {
border-color: var(--okx-blue);
transform: translateY(-8px);
box-shadow: 0 10px 30px rgba(0, 70, 255, 0.1);
}
.crypto-icon-sm {
width: 28px;
height: 28px;
margin-right: 12px;
}
.change-up { color: #0ecb81; }
.change-down { color: #f6465d; }
.market-table-section {
background-color: var(--bg-color);
padding: 100px 0;
}
.market-table {
border-collapse: separate;
border-spacing: 0 8px;
}
.market-table th { color: #848e9c; border-bottom: none; padding: 20px 15px; font-weight: 500; }
.market-table tr { background-color: transparent; transition: all 0.2s; }
.market-table tr:hover { background-color: rgba(255,255,255,0.02); }
.market-table td { border-bottom: 1px solid var(--border-color); padding: 25px 15px; vertical-align: middle; }
.download-section {
padding: 120px 0;
background-color: #0b0e11;
}
.download-card {
background: linear-gradient(135deg, #1e2329 0%, #0046ff 100%);
border-radius: 40px;
padding: 80px;
border: 1px solid rgba(255,255,255,0.1);
position: relative;
overflow: hidden;
color: white;
}
.qr-code-box {
background: white;
padding: 15px;
border-radius: 20px;
display: inline-block;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.mobile-app-img {
max-width: 100%;
height: auto;
position: relative;
z-index: 1;
animation: floatMobile 6s ease-in-out infinite;
filter: drop-shadow(0 30px 50px rgba(0,0,0,0.5));
}
@keyframes floatMobile {
0%, 100% { transform: translateY(0) rotateY(-5deg); }
50% { transform: translateY(-25px) rotateY(5deg); }
}
.platform-btn {
background: rgba(255,255,255,0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255,255,255,0.2);
color: white;
padding: 12px 25px;
border-radius: 12px;
font-weight: 600;
transition: all 0.3s;
text-decoration: none;
display: flex;
align-items: center;
gap: 10px;
}
.platform-btn:hover {
background: rgba(255,255,255,0.2);
color: white;
transform: translateY(-3px);
}
.customer-service {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 1000;
width: 60px;
height: 60px;
background-color: var(--okx-blue);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 24px;
box-shadow: 0 10px 25px rgba(0, 70, 255, 0.4);
cursor: pointer;
transition: all 0.3s;
}
.customer-service:hover {
transform: scale(1.1);
background-color: #0037cc;
}
</style>
<!-- Hero Section --> <!-- Hero Section -->
<section class="hero-section"> <section class="hero-section text-white py-5 mt-4">
<div id="heroCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel" data-bs-interval="5000"> <div class="container py-lg-5">
<div class="carousel-inner"> <div class="row align-items-center g-5">
<?php foreach ($carousel_items as $index => $item): ?> <div class="col-lg-7 text-center text-lg-start">
<div class="carousel-item <?php echo $index === 0 ? 'active' : ''; ?>"> <h1 class="display-3 fw-bold mb-4 slide-up"><?php echo mt('The World\'s Leading'); ?><br><span class="text-primary"><?php echo mt('Crypto Exchange'); ?></span></h1>
<img src="<?php echo $item['image_url']; ?>" class="hero-img" alt="Banner"> <p class="lead mb-5 slide-up-delayed text-muted mx-auto mx-lg-0" style="max-width: 600px;"><?php echo mt('Trade Bitcoin, Ethereum, and hundreds of other cryptocurrencies with the lowest fees in the industry.'); ?></p>
<div class="hero-overlay"></div> <div class="d-flex flex-wrap justify-content-center justify-content-lg-start gap-3 slide-up-more">
<div class="container hero-content text-center"> <a href="register.php" class="btn btn-primary btn-lg px-5 py-3 rounded-pill fw-bold shadow-lg"><?php echo mt('Get Started'); ?></a>
<div class="row justify-content-center"> <a href="market.php" class="btn btn-outline-light btn-lg px-5 py-3 rounded-pill fw-bold"><?php echo mt('View Markets'); ?></a>
<div class="col-lg-10">
<h1 class="display-1 fw-bold mb-4 text-white"><?php echo t($item['title']); ?></h1>
<p class="lead mb-5 text-light opacity-75 fs-3"><?php echo t($item['description']); ?></p>
<div class="d-flex gap-4 justify-content-center">
<a href="register.php" class="btn btn-primary btn-large" style="background-color: var(--okx-blue); border: none;"><?php echo mt('Register'); ?></a>
<a href="trade.php" class="btn btn-outline-light btn-large" style="border-radius: 12px;"><?php echo mt('Trade Now'); ?></a>
</div> </div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon"></span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon"></span>
</button>
</div>
</section>
<!-- Quick Stats --> <!-- Market Ticker Aligned with Hero -->
<section class="py-5" style="margin-top: -80px; position: relative; z-index: 5;"> <div class="mt-5 d-flex flex-wrap justify-content-center justify-content-lg-start gap-3 slide-up-more" id="hero-market-ticker">
<div class="container"> <!-- Loaded via JS -->
<div class="row g-4" id="stat-cards"> <div class="market-card-mini p-3 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 skeleton" style="min-width: 140px; height: 80px;"></div>
<!-- Populated by JS --> <div class="market-card-mini p-3 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 skeleton" style="min-width: 140px; height: 80px;"></div>
<div class="market-card-mini p-3 rounded-4 bg-white bg-opacity-5 border border-white border-opacity-10 skeleton" style="min-width: 140px; height: 80px;"></div>
</div>
</div>
<div class="col-lg-5 slide-up-delayed d-none d-lg-block">
<div id="heroCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner rounded-5 shadow-lg overflow-hidden border border-white border-opacity-10">
<div class="carousel-item active">
<div class="p-5 bg-gradient-dark h-100 d-flex flex-column justify-content-center align-items-center text-center">
<img src="assets/images/mobile-app-mockup.jpg" class="img-fluid rounded-4 mb-4 floating-app" style="max-height: 300px;" alt="App">
<h4 class="fw-bold"><?php echo mt('Trade Anywhere'); ?></h4>
<p class="text-muted small"><?php echo mt('Download BITCrypto mobile app for iOS and Android'); ?></p>
</div>
</div>
<div class="carousel-item">
<div class="p-5 bg-gradient-blue h-100 d-flex flex-column justify-content-center align-items-center text-center">
<i class="fas fa-shield-halved fa-5x text-primary mb-4"></i>
<h4 class="fw-bold"><?php echo mt('Secure & Trusted'); ?></h4>
<p class="text-muted small"><?php echo mt('Your assets are protected by industry-leading security'); ?></p>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</section> </section>
<!-- Market Trends --> <!-- Market Trends -->
<section class="market-table-section"> <section class="py-5 bg-dark border-top border-white border-opacity-10" id="market-section">
<div class="container"> <div class="container py-4">
<div class="d-flex justify-content-between align-items-end mb-5"> <div class="d-flex justify-content-between align-items-end mb-5">
<div> <div>
<h2 class="display-4 fw-bold mb-3"><?php echo mt('Real-time Markets'); ?></h2> <h2 class="fw-bold text-white mb-2"><?php echo mt('Market Trends'); ?></h2>
<p class="text-muted mb-0 fs-5">Join millions of traders and start your crypto journey today.</p> <p class="text-muted mb-0"><?php echo mt('Stay updated with real-time price changes'); ?></p>
</div> </div>
<a href="market.php" class="text-primary text-decoration-none fw-bold fs-5">View all markets <i class="fas fa-arrow-right ms-2"></i></a> <a href="market.php" class="text-primary text-decoration-none fw-bold"><?php echo mt('View All'); ?> <i class="fas fa-chevron-right ms-1"></i></a>
</div> </div>
<div class="table-responsive"> <div class="table-responsive rounded-4 border border-white border-opacity-10 bg-black bg-opacity-30">
<table class="table table-dark market-table"> <table class="table table-dark table-hover mb-0 align-middle">
<thead> <thead>
<tr> <tr class="text-muted small">
<th><?php echo mt('Asset Name'); ?></th> <th class="ps-4 py-3 border-0"><?php echo mt('Name'); ?></th>
<th><?php echo mt('Last Price'); ?></th> <th class="py-3 border-0"><?php echo mt('Price'); ?></th>
<th><?php echo mt('24h Change'); ?></th> <th class="py-3 border-0"><?php echo mt('24h Change'); ?></th>
<th><?php echo mt('Market Cap'); ?></th> <th class="py-3 border-0 text-end pe-4"><?php echo mt('Action'); ?></th>
<th class="text-end"><?php echo mt('Trade Now'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="market-body"> <tbody id="market-trends">
<!-- Populated by JS --> <!-- Loaded via JS -->
<tr>
<td colspan="4" class="text-center py-5">
<div class="spinner-border spinner-border-sm text-primary" role="status"></div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<!-- Download Section --> <!-- Why Choose Us -->
<section class="download-section"> <section class="py-5">
<div class="container"> <div class="container py-4">
<div class="download-card"> <div class="text-center mb-5">
<div class="row align-items-center"> <h2 class="fw-bold text-white"><?php echo mt('Why Choose BITCrypto?'); ?></h2>
<div class="col-lg-6 relative z-1"> <p class="text-muted"><?php echo mt('Experience the most professional trading environment'); ?></p>
<h2 class="display-3 fw-bold mb-4"><?php echo mt('Trade Anywhere'); ?></h2>
<p class="lead mb-5 fs-4 opacity-75"><?php echo mt('Download app'); ?></p>
<div class="d-flex align-items-center gap-5 mb-5">
<div class="qr-code-box">
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://bitcrypto.com" alt="QR Code" style="width: 140px;">
</div> </div>
<div class="d-flex flex-column gap-3"> <div class="row g-4">
<div class="d-flex gap-3"> <div class="col-md-4">
<a href="#" class="platform-btn"><i class="fab fa-apple fs-4"></i> App Store</a> <div class="p-5 rounded-5 bg-white bg-opacity-5 border border-white border-opacity-10 h-100 hover-lift position-relative overflow-hidden">
<a href="#" class="platform-btn"><i class="fab fa-google-play fs-4"></i> Play Store</a> <div class="position-absolute top-0 end-0 p-4 opacity-10">
<i class="fas fa-shield-alt fa-6x"></i>
</div> </div>
<div class="d-flex gap-3"> <div class="icon-box mb-4 bg-primary bg-opacity-20 text-primary rounded-4 d-inline-flex align-items-center justify-content-center shadow-sm" style="width: 70px; height: 70px;">
<a href="#" class="platform-btn"><i class="fab fa-windows fs-4"></i> Windows</a> <i class="fas fa-lock fa-2x"></i>
<a href="#" class="platform-btn"><i class="fab fa-linux fs-4"></i> Linux</a> </div>
<h4 class="text-white fw-bold mb-3"><?php echo mt('Safe & Secure'); ?></h4>
<p class="text-muted mb-0"><?php echo mt('Industry-leading encryption and multi-signature cold storage for your digital assets.'); ?></p>
<ul class="list-unstyled mt-4 text-muted small">
<li class="mb-2"><i class="fas fa-check-circle text-primary me-2"></i> <?php echo mt('Multi-sig Cold Storage'); ?></li>
<li class="mb-2"><i class="fas fa-check-circle text-primary me-2"></i> <?php echo mt('DDoS Protection'); ?></li>
<li><i class="fas fa-check-circle text-primary me-2"></i> <?php echo mt('2FA Security'); ?></li>
</ul>
</div> </div>
</div> </div>
<div class="col-md-4">
<div class="p-5 rounded-5 bg-white bg-opacity-5 border border-white border-opacity-10 h-100 hover-lift position-relative overflow-hidden">
<div class="position-absolute top-0 end-0 p-4 opacity-10">
<i class="fas fa-bolt fa-6x"></i>
</div>
<div class="icon-box mb-4 bg-success bg-opacity-20 text-success rounded-4 d-inline-flex align-items-center justify-content-center shadow-sm" style="width: 70px; height: 70px;">
<i class="fas fa-gauge-high fa-2x"></i>
</div>
<h4 class="text-white fw-bold mb-3"><?php echo mt('Instant Execution'); ?></h4>
<p class="text-muted mb-0"><?php echo mt('Advanced matching engine processing over 100,000 transactions per second.'); ?></p>
<ul class="list-unstyled mt-4 text-muted small">
<li class="mb-2"><i class="fas fa-check-circle text-success me-2"></i> <?php echo mt('Ultra-low Latency'); ?></li>
<li class="mb-2"><i class="fas fa-check-circle text-success me-2"></i> <?php echo mt('High Liquidity'); ?></li>
<li><i class="fas fa-check-circle text-success me-2"></i> <?php echo mt('Zero Slippage'); ?></li>
</ul>
</div> </div>
</div> </div>
<div class="col-lg-6 text-center"> <div class="col-md-4">
<img src="https://static.okx.com/cdn/assets/imgs/2311/65314C93F16A34F5.png?x-oss-process=image/format,webp" class="mobile-app-img" alt="Mobile App" style="width: 85%;"> <div class="p-5 rounded-5 bg-white bg-opacity-5 border border-white border-opacity-10 h-100 hover-lift position-relative overflow-hidden">
<div class="position-absolute top-0 end-0 p-4 opacity-10">
<i class="fas fa-headset fa-6x"></i>
</div>
<div class="icon-box mb-4 bg-info bg-opacity-20 text-info rounded-4 d-inline-flex align-items-center justify-content-center shadow-sm" style="width: 70px; height: 70px;">
<i class="fas fa-comments fa-2x"></i>
</div>
<h4 class="text-white fw-bold mb-3"><?php echo mt('24/7 Global Support'); ?></h4>
<p class="text-muted mb-0"><?php echo mt('Get help whenever you need it with our around-the-clock professional customer service.'); ?></p>
<ul class="list-unstyled mt-4 text-muted small">
<li class="mb-2"><i class="fas fa-check-circle text-info me-2"></i> <?php echo mt('Multi-language Support'); ?></li>
<li class="mb-2"><i class="fas fa-check-circle text-info me-2"></i> <?php echo mt('Live Chat'); ?></li>
<li><i class="fas fa-check-circle text-info me-2"></i> <?php echo mt('Fast Response'); ?></li>
</ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
<!-- Online Customer Service --> <!-- Partners Section -->
<div class="customer-service" onclick="window.location.href='page.php?slug=help-center'"> <section class="py-5 bg-black bg-opacity-20 border-top border-bottom border-white border-opacity-5">
<i class="fas fa-comment-dots"></i> <div class="container py-4 text-center">
<h2 class="fw-bold text-white mb-2"><?php echo mt('Our Global Partners'); ?></h2>
<p class="text-muted mb-5"><?php echo mt('Trusted by industry leaders worldwide'); ?></p>
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-6 g-4 align-items-center">
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-apple fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">Apple Pay</h6>
<p class="text-muted small mt-2"><?php echo mt('Payment Partner'); ?></p>
</div> </div>
</div>
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-google-pay fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">Google Pay</h6>
<p class="text-muted small mt-2"><?php echo mt('Payment Partner'); ?></p>
</div>
</div>
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-aws fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">AWS</h6>
<p class="text-muted small mt-2"><?php echo mt('Infrastructure'); ?></p>
</div>
</div>
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-cc-visa fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">Visa</h6>
<p class="text-muted small mt-2"><?php echo mt('Financial Partner'); ?></p>
</div>
</div>
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-cc-mastercard fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">Mastercard</h6>
<p class="text-muted small mt-2"><?php echo mt('Financial Partner'); ?></p>
</div>
</div>
<div class="col">
<div class="partner-card p-4 rounded-4 hover-lift">
<i class="fab fa-paypal fa-3x text-white mb-3"></i>
<h6 class="text-white mb-0">PayPal</h6>
<p class="text-muted small mt-2"><?php echo mt('Payment Partner'); ?></p>
</div>
</div>
</div>
</div>
</section>
<script> <!-- Download Section -->
async function updateMarketData() { <section class="py-5 overflow-hidden">
try { <div class="container py-5">
const response = await fetch('api/market_api.php'); <div class="row align-items-center g-5">
const result = await response.json(); <div class="col-lg-6">
if (result.success) { <h2 class="display-5 fw-bold text-white mb-4"><?php echo mt('Trade Anywhere, Anytime'); ?></h2>
const coins = result.data; <p class="lead text-muted mb-5"><?php echo mt('Experience the full power of our exchange on your mobile device. Trade spot and futures with ease.'); ?></p>
const symbols = ['BTC', 'ETH', 'SOL', 'OKB'];
// Update Stat Cards <div class="d-flex flex-wrap gap-3 mb-5">
let statHtml = ''; <div class="download-btn-modern">
symbols.forEach(symbol => { <i class="fab fa-apple fa-2x"></i>
const coin = coins[symbol];
const changeClass = coin.change >= 0 ? 'change-up' : 'change-down';
const changeSign = coin.change >= 0 ? '+' : '';
statHtml += `
<div class="col-md-3">
<div class="stat-card p-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<div class="d-flex align-items-center">
<img src="${coin.icon}" class="crypto-icon-sm">
<span class="fw-bold fs-5">${symbol}</span>
</div>
<span class="${changeClass} fw-bold">
${changeSign}${coin.change.toFixed(2)}%
</span>
</div>
<h3 class="mb-0 fw-bold">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}</h3>
</div>
</div>
`;
});
document.getElementById('stat-cards').innerHTML = statHtml;
// Update Market Table
let tableHtml = '';
Object.keys(coins).slice(0, 10).forEach(symbol => {
const coin = coins[symbol];
const changeClass = coin.change >= 0 ? 'change-up' : 'change-down';
const changeSign = coin.change >= 0 ? '+' : '';
tableHtml += `
<tr>
<td>
<div class="d-flex align-items-center">
<img src="${coin.icon}" class="crypto-icon-sm me-3" style="width: 40px; height: 40px;">
<div> <div>
<div class="fw-bold fs-5">${coin.name}</div> <div class="small-text"><?php echo mt('Download on the'); ?></div>
<div class="small text-muted">${symbol}</div> <div class="bold-text">App Store</div>
</div> </div>
</div> </div>
</td> <div class="download-btn-modern">
<td class="fw-bold fs-5 text-white">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}</td> <i class="fab fa-google-play fa-2x"></i>
<td class="${changeClass} fw-bold fs-5"> <div>
${changeSign}${coin.change.toFixed(2)}% <div class="small-text"><?php echo mt('Get it on'); ?></div>
</td> <div class="bold-text">Google Play</div>
<td class="text-muted">$${(Math.random() * 500 + 10).toFixed(1)}B</td> </div>
<td class="text-end"> </div>
<a href="trade.php?symbol=${symbol}USDT" class="btn btn-primary px-4 fw-bold" style="background-color: var(--okx-blue); border: none; border-radius: 8px;">${t('Trade')}</a> </div>
</td>
</tr> <div class="d-flex align-items-center gap-4 p-4 bg-white bg-opacity-5 rounded-4 border border-white border-opacity-10 shadow-sm" style="backdrop-filter: blur(10px);">
`; <div class="bg-white p-2 rounded-3 shadow">
}); <img src="https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=https://bitcrypto.com/download&color=0046ff" alt="Download QR" width="100">
document.getElementById('market-body').innerHTML = tableHtml; </div>
<div>
<h6 class="text-white fw-bold mb-1"><?php echo mt('Scan to download'); ?></h6>
<p class="text-muted small mb-0"><?php echo mt('Compatible with iOS and Android devices.'); ?></p>
</div>
</div>
</div>
<div class="col-lg-6 text-center position-relative">
<div class="position-absolute top-50 start-50 translate-middle z-n1" style="width: 500px; height: 500px; background: radial-gradient(circle, rgba(0,70,255,0.2) 0%, rgba(0,255,150,0.1) 30%, transparent 70%); filter: blur(40px);"></div>
<img src="assets/images/mobile-app-mockup.jpg" alt="Mobile App" class="img-fluid floating-app rounded-5 shadow-lg border border-white border-opacity-10" style="max-width: 350px;">
</div>
</div>
</div>
</section>
<style>
.bg-gradient-dark { background: linear-gradient(135deg, #0b0e11 0%, #181a20 100%); }
.bg-gradient-blue { background: linear-gradient(135deg, #001a4d 0%, #0046ff 100%); }
.slide-up { animation: slideUp 0.8s ease-out; }
.slide-up-delayed { animation: slideUp 0.8s ease-out 0.2s both; }
.slide-up-more { animation: slideUp 0.8s ease-out 0.4s both; }
@keyframes slideUp {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
} }
} catch (e) { .floating-app {
console.error('Failed to update market data', e); animation: float 6s ease-in-out infinite;
} }
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-20px); }
}
.download-btn-modern {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
padding: 10px 20px;
border-radius: 12px;
display: flex;
align-items: center;
gap: 12px;
color: white;
cursor: pointer;
transition: all 0.3s ease;
}
.download-btn-modern:hover {
background: rgba(255,255,255,0.1);
transform: translateY(-2px);
}
.download-btn-modern .small-text { font-size: 10px; opacity: 0.7; }
.download-btn-modern .bold-text { font-size: 16px; font-weight: bold; }
.hover-lift { transition: all 0.3s ease; }
.hover-lift:hover { transform: translateY(-10px); background: rgba(255,255,255,0.08); }
.partner-card {
background: rgba(255,255,255,0.03);
border: 1px solid rgba(255,255,255,0.05);
transition: all 0.3s ease;
} }
function t(key) { .skeleton {
const translations = <?php echo json_encode($translations[$lang]); ?>; background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
return translations[key] || key; background-size: 200% 100%;
animation: skeleton-loading 1.5s infinite;
} }
@keyframes skeleton-loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
</style>
updateMarketData(); <script src="assets/js/main.js"></script>
setInterval(updateMarketData, 5000); <?php include 'includes/footer.php'; ?>
</script>
<?php require_once 'includes/footer.php'; ?>

View File

@ -3,33 +3,33 @@ require_once 'includes/header.php';
?> ?>
<div class="container my-5"> <div class="container my-5">
<div class="d-flex justify-content-between align-items-end mb-5"> <div class="d-flex justify-content-between align-items-end mb-5 flex-wrap gap-4">
<div> <div>
<h1 class="display-4 fw-bold mb-2 text-white"><?php echo mt('Markets'); ?></h1> <h1 class="display-4 fw-bold mb-2 text-white"><?php echo mt('Markets'); ?></h1>
<p class="text-muted fs-5 mb-0">Real-time prices and market trends for all major cryptocurrencies.</p> <p class="text-muted fs-5 mb-0"><?php echo mt('Real-time updates from global exchanges'); ?></p>
</div> </div>
<div class="input-group w-25"> <div class="input-group w-auto" style="min-width: 300px;">
<span class="input-group-text bg-dark border-secondary text-muted"><i class="fas fa-search"></i></span> <span class="input-group-text bg-dark border-secondary text-muted"><i class="fas fa-search"></i></span>
<input type="text" id="market-search" class="form-control bg-dark text-white border-secondary" placeholder="Search assets..."> <input type="text" id="market-search" class="form-control bg-dark text-white border-secondary shadow-none" placeholder="<?php echo mt('Search assets...'); ?>">
</div> </div>
</div> </div>
<div class="card bg-dark border-secondary p-0" style="border-radius: 20px; overflow: hidden;"> <div class="card bg-dark border-secondary p-0 shadow-lg" style="border-radius: 20px; overflow: hidden;">
<div class="table-responsive">
<table class="table table-dark table-hover mb-0 align-middle"> <table class="table table-dark table-hover mb-0 align-middle">
<thead> <thead>
<tr class="text-muted" style="border-bottom: 2px solid var(--border-color);"> <tr class="text-muted" style="border-bottom: 2px solid #2b2f36;">
<th class="ps-4 py-3"><?php echo mt('Asset Name'); ?></th> <th class="ps-4 py-3"><?php echo mt('Asset'); ?></th>
<th class="py-3"><?php echo mt('Last Price'); ?></th> <th class="py-3"><?php echo mt('Price'); ?></th>
<th class="py-3"><?php echo mt('24h Change'); ?></th> <th class="py-3"><?php echo mt('24h Change'); ?></th>
<th class="py-3">24h High/Low</th> <th class="py-3">24h <?php echo mt('High'); ?>/<?php echo mt('Low'); ?></th>
<th class="py-3">24h Volume</th> <th class="py-3"><?php echo mt('Action'); ?></th>
<th class="text-end pe-4 py-3"><?php echo mt('Trade Now'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="market-table-body"> <tbody id="market-table-body">
<!-- Loaded via JS --> <!-- Loaded via JS -->
<tr> <tr>
<td colspan="6" class="text-center py-5"> <td colspan="5" class="text-center py-5">
<div class="spinner-border text-primary"></div> <div class="spinner-border text-primary"></div>
</td> </td>
</tr> </tr>
@ -37,6 +37,7 @@ require_once 'includes/header.php';
</table> </table>
</div> </div>
</div> </div>
</div>
<script> <script>
async function loadMarkets() { async function loadMarkets() {
@ -59,27 +60,26 @@ async function loadMarkets() {
<tr class="border-secondary" style="cursor: pointer;" onclick="window.location.href='trade.php?symbol=${symbol}'"> <tr class="border-secondary" style="cursor: pointer;" onclick="window.location.href='trade.php?symbol=${symbol}'">
<td class="ps-4 py-4"> <td class="ps-4 py-4">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<img src="${coin.icon}" width="36" class="me-3" onerror="this.src='https://static.okx.com/cdn/oksupport/asset/currency/icon/generic.png'"> <img src="${coin.icon}" width="32" class="me-3" onerror="this.src='https://static.okx.com/cdn/oksupport/asset/currency/icon/generic.png'">
<div> <div>
<div class="fw-bold fs-5 text-white">${symbol}</div> <div class="fw-bold fs-6 text-white">${symbol}</div>
<div class="small text-muted">${coin.name}</div> <div class="small text-muted">${coin.name}</div>
</div> </div>
</div> </div>
</td> </td>
<td class="fw-bold fs-5 text-white">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 4})}</td> <td class="fw-bold text-white">$${coin.price.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 4})}</td>
<td class="${changeClass} fw-bold fs-5">${changeSign}${coin.change.toFixed(2)}%</td> <td class="${changeClass} fw-bold">${changeSign}${coin.change.toFixed(2)}%</td>
<td class="text-muted"> <td class="text-muted small">
<div>H: $${(coin.price * 1.05).toFixed(2)}</div> <div>H: $${(coin.price * 1.05).toFixed(2)}</div>
<div>L: $${(coin.price * 0.95).toFixed(2)}</div> <div>L: $${(coin.price * 0.95).toFixed(2)}</div>
</td> </td>
<td class="text-muted">$${(Math.random() * 100 + 50).toFixed(2)}M</td> <td class="pe-4">
<td class="text-end pe-4"> <a href="trade.php?symbol=${symbol}" class="btn btn-primary btn-sm px-4 fw-bold border-0" style="background-color: var(--okx-blue); border-radius: 8px;">${t('Trade')}</a>
<a href="trade.php?symbol=${symbol}" class="btn btn-primary px-4 fw-bold" style="background-color: var(--okx-blue); border: none; border-radius: 8px;">${t('Trade')}</a>
</td> </td>
</tr> </tr>
`; `;
} }
tbody.innerHTML = html || '<tr><td colspan="6" class="text-center py-5 text-muted">No assets found</td></tr>'; tbody.innerHTML = html || '<tr><td colspan="5" class="text-center py-5 text-muted"><?php echo mt('No assets found'); ?></td></tr>';
} }
} catch (e) { } catch (e) {
console.error(e); console.error(e);
@ -87,7 +87,6 @@ async function loadMarkets() {
} }
function t(key) { function t(key) {
// Basic JS translation mapper
const map = { const map = {
'Trade': '<?php echo mt('Trade'); ?>' 'Trade': '<?php echo mt('Trade'); ?>'
}; };

232
matching.php Normal file
View File

@ -0,0 +1,232 @@
<?php
require_once 'includes/header.php';
if (!$user) {
header('Location: login.php');
exit;
}
$currency = $_POST['fiat_currency'] ?? 'USD';
$amount = $_POST['amount'] ?? 0;
$order_id = strtoupper(substr(md5(time() . ($user['id'] ?? 0)), 0, 10));
// Rates mapping
$rates = [
'USD' => 1.0, 'EUR' => 0.92, 'CNY' => 7.21, 'JPY' => 149.5, 'KRW' => 1335.0,
'GBP' => 0.79, 'RUB' => 92.4, 'HKD' => 7.82, 'SGD' => 1.34, 'AUD' => 1.53,
'CAD' => 1.35, 'BRL' => 4.98, 'INR' => 83.0, 'VND' => 24500.0, 'THB' => 35.8,
'MYR' => 4.77, 'IDR' => 15600.0, 'PHP' => 56.1, 'AED' => 3.67, 'TRY' => 31.0
];
$rate = $rates[$currency] ?? 1.0;
$usdt_amount = $amount / $rate;
?>
<div class="container my-5 py-5">
<div class="row justify-content-center">
<div class="col-md-9 col-lg-7">
<div class="card bg-dark border-secondary shadow-lg overflow-hidden" style="border-radius: 24px;">
<!-- Header / Order Status -->
<div class="p-4 border-bottom border-secondary d-flex justify-content-between align-items-center bg-secondary bg-opacity-10">
<div>
<h5 class="fw-bold text-white mb-0"><?php echo mt('Deposit'); ?>: <?php echo number_format((float)$amount, 2); ?> <?php echo $currency; ?></h5>
<div class="small text-muted mt-1"><?php echo mt('Order ID'); ?>: #<?php echo $order_id; ?></div>
</div>
<div class="text-end">
<div class="text-primary fw-bold fs-4" id="timer">15:00</div>
</div>
</div>
<div class="row g-0" style="min-height: 550px;">
<!-- Left: Chat/Matching Status -->
<div class="col-md-5 border-end border-secondary p-4 d-flex flex-column bg-black bg-opacity-25">
<h6 class="text-white fw-bold mb-4 d-flex align-items-center">
<span class="spinner-grow spinner-grow-sm text-success me-2"></span>
<?php echo mt('Customer Service'); ?>
</h6>
<div id="chat-messages" class="flex-grow-1 overflow-auto small mb-3 px-1" style="max-height: 350px;">
<div class="mb-3">
<span class="badge bg-secondary mb-1">System</span>
<div class="p-2 bg-dark rounded border border-secondary text-muted" style="font-size: 0.75rem;">
<?php echo mt('Establishing secure connection with liquidity provider...'); ?>
</div>
</div>
</div>
<div id="matching-status" class="text-center py-3 border-top border-secondary mt-auto">
<div class="spinner-border spinner-border-sm text-primary mb-2"></div>
<div class="small text-muted" style="font-size: 0.7rem;"><?php echo mt('Awaiting merchant confirmation...'); ?></div>
</div>
</div>
<!-- Right: Payment Details -->
<div class="col-md-7 p-4 position-relative">
<div id="lock-overlay" class="position-absolute top-0 start-0 w-100 h-100 d-flex flex-column align-items-center justify-content-center bg-dark" style="z-index: 5; transition: opacity 0.5s;">
<div class="text-center">
<i class="fas fa-user-clock fa-3x text-secondary mb-3"></i>
<h6 class="text-white mb-2"><?php echo mt('Matching in progress'); ?></h6>
<p class="text-muted small px-4"><?php echo mt('The specialized account for this transaction will be provided by our agent shortly.'); ?></p>
</div>
</div>
<div id="payment-details" class="d-none">
<div class="alert alert-primary bg-primary bg-opacity-10 border-primary text-white p-3 rounded-4 mb-4 small">
<i class="fas fa-info-circle me-2"></i> <?php echo mt('Transfer the exact amount. Upload proof below.'); ?>
</div>
<div class="p-3 bg-secondary bg-opacity-10 rounded-4 mb-4 border border-secondary small">
<div class="mb-3">
<label class="text-muted mb-1 d-block"><?php echo mt('Bank Name'); ?></label>
<div class="d-flex justify-content-between">
<span class="fw-bold text-white" id="bank-name">--</span>
<span class="text-primary pointer" onclick="copyText('bank-name')"><?php echo mt('Copy'); ?></span>
</div>
</div>
<div class="mb-3">
<label class="text-muted mb-1 d-block"><?php echo mt('Account Number'); ?></label>
<div class="d-flex justify-content-between">
<span class="fw-bold text-white" id="account-num">--</span>
<span class="text-primary pointer" onclick="copyText('account-num')"><?php echo mt('Copy'); ?></span>
</div>
</div>
<div class="mb-3">
<label class="text-muted mb-1 d-block"><?php echo mt('Beneficiary'); ?></label>
<div class="d-flex justify-content-between">
<span class="fw-bold text-white" id="beneficiary-name">--</span>
<span class="text-primary pointer" onclick="copyText('beneficiary-name')"><?php echo mt('Copy'); ?></span>
</div>
</div>
<div class="mb-0">
<label class="text-muted mb-1 d-block"><?php echo mt('Reference'); ?></label>
<div class="d-flex justify-content-between">
<span class="fw-bold text-warning" id="ref-code"><?php echo $order_id; ?></span>
<span class="text-primary pointer" onclick="copyText('ref-code')"><?php echo mt('Copy'); ?></span>
</div>
</div>
</div>
<form id="proof-form">
<div class="mb-3">
<div class="upload-area border border-dashed border-secondary rounded-4 p-4 text-center position-relative" id="drop-area">
<input type="file" class="position-absolute w-100 h-100 top-0 start-0 opacity-0" style="cursor: pointer;" id="file-input">
<i class="fas fa-camera text-muted mb-2"></i>
<div class="small text-muted"><?php echo mt('Upload Proof'); ?></div>
<div id="preview" class="mt-2 d-none">
<span class="badge bg-success"><?php echo mt('Selected'); ?></span>
</div>
</div>
</div>
<button type="button" class="btn btn-primary w-100 py-3 rounded-3 fw-bold shadow-glow" onclick="completeOrder()">
<?php echo mt('Transfer Completed'); ?>
</button>
</form>
</div>
<!-- Success Screen -->
<div id="success-step" class="d-none text-center py-5">
<i class="fas fa-check-circle text-success mb-3" style="font-size: 4rem;"></i>
<h4 class="text-white fw-bold mb-3"><?php echo mt('Success'); ?></h4>
<p class="text-muted small"><?php echo mt('Your transfer is being reviewed. ETA: 10-20 mins.'); ?></p>
<a href="profile.php" class="btn btn-outline-light px-4 mt-3"><?php echo mt('Back to Wallet'); ?></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
let seconds = 900;
const timerEl = document.getElementById('timer');
const chatBox = document.getElementById('chat-messages');
function addChatMessage(sender, msg, type = 'agent') {
const div = document.createElement('div');
div.className = 'mb-3';
div.innerHTML = `
<div class="d-flex justify-content-between align-items-center mb-1">
<span class="badge ${type === 'agent' ? 'bg-primary' : 'bg-secondary'}" style="font-size: 0.65rem;">${sender}</span>
<span class="text-muted" style="font-size: 0.6rem;">${new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})}</span>
</div>
<div class="p-2 bg-dark rounded border border-secondary text-white-50" style="font-size: 0.8rem; line-height: 1.4;">
${msg}
</div>
`;
chatBox.appendChild(div);
chatBox.scrollTop = chatBox.scrollHeight;
}
function updateTimer() {
const mins = Math.floor(seconds / 60);
const secs = seconds % 60;
timerEl.innerText = `${mins}:${secs < 10 ? '0' : ''}${secs}`;
if (seconds > 0) {
seconds--;
setTimeout(updateTimer, 1000);
}
}
function copyText(id) {
const text = document.getElementById(id).innerText;
navigator.clipboard.writeText(text);
alert('<?php echo mt('Copy'); ?> OK');
}
// Simulated Professional Flow
setTimeout(() => addChatMessage('System', '<?php echo mt('A local merchant has been found. Matching account details...'); ?>'), 3000);
setTimeout(() => {
addChatMessage('Live Agent', '<?php echo mt('Welcome! I am your dedicated matching assistant. I am currently verifying the liquidity provider for your deposit.'); ?>');
}, 8000);
setTimeout(() => {
addChatMessage('Live Agent', '<?php echo mt('Matching successful. I have secured a high-priority account for your transaction. Please find the details on the right.'); ?>');
// Unlock UI
document.getElementById('lock-overlay').style.opacity = '0';
setTimeout(() => {
document.getElementById('lock-overlay').classList.add('d-none');
document.getElementById('payment-details').classList.remove('d-none');
}, 500);
document.getElementById('matching-status').innerHTML = '<div class="badge bg-success bg-opacity-25 text-success border border-success px-3"><?php echo mt('Matched & Active'); ?></div>';
// Fill bank info
const banks = {
'USD': { name: 'JPMorgan Chase Bank', account: '9120 4481 0029 3341', beneficiary: 'Global Assets Ltd.' },
'CNY': { name: '中国工商银行', account: '6222 0812 0900 3381 922', beneficiary: '数字科技有限公司' },
'EUR': { name: 'Deutsche Bank', account: 'DE89 1007 0000 0123 4567 89', beneficiary: 'EU Crypto Services' },
'JPY': { name: 'Mizuho Bank', account: '109-2239481-001', beneficiary: 'テック・トレード株式会社' },
'GBP': { name: 'Barclays Bank', account: '20-10-05 99384812', beneficiary: 'UK Digital Trade' }
};
const bank = banks['<?php echo $currency; ?>'] || banks['USD'];
document.getElementById('bank-name').innerText = bank.name;
document.getElementById('account-num').innerText = bank.account;
document.getElementById('beneficiary-name').innerText = bank.beneficiary;
}, 15000);
document.getElementById('file-input').addEventListener('change', function() {
if (this.files.length > 0) document.getElementById('preview').classList.remove('d-none');
});
function completeOrder() {
if (document.getElementById('file-input').files.length === 0) {
alert('<?php echo mt('Please upload your payment receipt/screenshot first.'); ?>');
return;
}
document.getElementById('payment-details').classList.add('d-none');
document.getElementById('success-step').classList.remove('d-none');
addChatMessage('Live Agent', '<?php echo mt('Thank you for the update. We have received your payment proof and are now verifying the transaction on the blockchain. Your balance will be updated shortly.'); ?>');
}
updateTimer();
</script>
<style>
.upload-area { border-style: dashed !important; cursor: pointer; transition: 0.3s; }
.upload-area:hover { border-color: #f0b90b !important; background: rgba(240,185,11,0.05); }
.pointer { cursor: pointer; }
.shadow-glow { box-shadow: 0 0 15px rgba(240,185,11,0.2); }
</style>
<?php require_once 'includes/footer.php'; ?>

View File

@ -6,28 +6,28 @@ $slug = $_GET['slug'] ?? 'about';
$pages = [ $pages = [
'about' => [ 'about' => [
'title' => 'About BITCrypto', 'title' => 'About BITCrypto',
'content' => 'BITCrypto is a world-leading cryptocurrency exchange, providing advanced financial services to traders globally using blockchain technology.', 'image' => 'https://images.pexels.com/photos/8370752/pexels-photo-8370752.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
'image' => 'https://images.pexels.com/photos/6771607/pexels-photo-6771607.jpeg?auto=compress&cs=tinysrgb&w=800' 'content' => 'BITCrypto is a world-leading cryptocurrency exchange, providing advanced financial services to traders globally by using blockchain technology. We provide hundreds of token & futures trading pairs to help traders to optimize their strategy. BITCrypto is one of the top digital asset exchanges by trading volume, serving millions of users in over 100 countries.'
],
'terms' => [
'title' => 'Terms of Service',
'content' => 'By using BITCrypto services, you agree to comply with our terms and conditions regarding digital asset trading and platform usage.',
'image' => 'https://images.pexels.com/photos/6771574/pexels-photo-6771574.jpeg?auto=compress&cs=tinysrgb&w=800'
],
'privacy' => [
'title' => 'Privacy Policy',
'content' => 'Your privacy is important to us. We protect your personal data with institutional-grade security and encryption.',
'image' => 'https://images.pexels.com/photos/6770610/pexels-photo-6770610.jpeg?auto=compress&cs=tinysrgb&w=800'
], ],
'help-center' => [ 'help-center' => [
'title' => 'Help Center', 'title' => 'Help Center',
'content' => 'Need help? Our 24/7 support team is here to assist you with any questions about trading, deposits, or account security.', 'image' => 'https://images.pexels.com/photos/6771107/pexels-photo-6771107.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
'image' => 'https://images.pexels.com/photos/7567443/pexels-photo-7567443.jpeg?auto=compress&cs=tinysrgb&w=800' 'content' => 'Our help center provides comprehensive guides and support for all your trading needs. From account setup to advanced trading strategies, we are here to help you navigate the world of crypto. Contact our 24/7 customer support for personalized assistance.'
], ],
'security-info' => [ 'security-info' => [
'title' => 'Security First', 'title' => 'Security First',
'content' => 'We employ the most rigorous security standards in the industry, including multi-sig wallets and 2FA to keep your funds safe.', 'image' => 'https://images.pexels.com/photos/5980866/pexels-photo-5980866.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
'image' => 'https://images.pexels.com/photos/6771611/pexels-photo-6771611.jpeg?auto=compress&cs=tinysrgb&w=800' 'content' => 'Security is our top priority. We use industry-leading security protocols to keep your funds and personal information safe. Our multi-cluster system architecture and cold storage solutions ensure the highest level of protection for your digital assets.'
],
'privacy' => [
'title' => 'Privacy Policy',
'image' => 'https://images.pexels.com/photos/6771574/pexels-photo-6771574.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
'content' => 'We are committed to protecting your privacy. This policy explains how we collect, use, and safeguard your information. We never share your data with third parties without your explicit consent.'
],
'terms' => [
'title' => 'Terms of Service',
'image' => 'https://images.pexels.com/photos/7567443/pexels-photo-7567443.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1',
'content' => 'By using BITCrypto, you agree to our terms of service. Our platform provides digital asset trading services and you are responsible for maintaining the security of your account and complying with local regulations.'
] ]
]; ];
@ -35,46 +35,40 @@ $page = $pages[$slug] ?? $pages['about'];
?> ?>
<div class="container my-5 py-5"> <div class="container my-5 py-5">
<div class="row g-5 align-items-center"> <div class="row justify-content-center">
<div class="col-lg-6"> <div class="col-lg-10">
<h1 class="display-4 fw-bold mb-4 text-white"><?php echo t($page['title']); ?></h1> <div class="card bg-dark border-secondary overflow-hidden shadow-lg" style="border-radius: 24px;">
<div class="lead text-muted mb-5 fs-4"> <div class="position-relative" style="height: 350px;">
<?php echo t($page['content']); ?> <img src="<?php echo $page['image']; ?>" class="w-100 h-100 object-fit-cover" alt="Banner">
<div class="position-absolute top-0 start-0 w-100 h-100" style="background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.8));"></div>
<div class="position-absolute bottom-0 start-0 p-5">
<h1 class="display-4 fw-bold text-white"><?php echo t($page['title']); ?></h1>
</div>
</div>
<div class="p-5">
<div class="fs-5 text-muted lh-lg" style="text-align: justify;">
<?php echo $page['content']; ?>
<br><br>
<div class="row g-4 mt-4">
<div class="col-md-4">
<img src="https://images.pexels.com/photos/6770610/pexels-photo-6770610.jpeg?auto=compress&cs=tinysrgb&w=600" class="img-fluid rounded-4 mb-3" alt="Crypto 1">
</div>
<div class="col-md-4">
<img src="https://images.pexels.com/photos/844124/pexels-photo-844124.jpeg?auto=compress&cs=tinysrgb&w=600" class="img-fluid rounded-4 mb-3" alt="Crypto 2">
</div>
<div class="col-md-4">
<img src="https://images.pexels.com/photos/730547/pexels-photo-730547.jpeg?auto=compress&cs=tinysrgb&w=600" class="img-fluid rounded-4 mb-3" alt="Crypto 3">
</div>
</div>
</div>
</div> </div>
<a href="register.php" class="btn btn-primary px-5 py-3 fw-bold" style="background-color: var(--okx-blue); border: none; border-radius: 12px;"><?php echo mt('Register Now'); ?></a>
</div> </div>
<div class="col-lg-6">
<div class="rounded-4 overflow-hidden shadow-lg border border-secondary">
<img src="<?php echo $page['image']; ?>" class="img-fluid w-100" alt="Crypto Image">
</div> </div>
</div> </div>
</div> </div>
<div class="mt-5 pt-5 border-top border-secondary"> <style>
<div class="row g-4"> .object-fit-cover { object-fit: cover; }
<div class="col-md-4"> </style>
<div class="p-4 bg-dark rounded-4 border border-secondary h-100">
<i class="fas fa-shield-alt fa-3x mb-3 text-primary"></i>
<h5 class="text-white">Secure Assets</h5>
<p class="text-muted mb-0">98% of digital assets are stored in offline cold wallets.</p>
</div>
</div>
<div class="col-md-4">
<div class="p-4 bg-dark rounded-4 border border-secondary h-100">
<i class="fas fa-bolt fa-3x mb-3 text-warning"></i>
<h5 class="text-white">Fast Execution</h5>
<p class="text-muted mb-0">Proprietary matching engine capable of millions of TPS.</p>
</div>
</div>
<div class="col-md-4">
<div class="p-4 bg-dark rounded-4 border border-secondary h-100">
<i class="fas fa-headset fa-3x mb-3 text-success"></i>
<h5 class="text-white">Expert Support</h5>
<p class="text-muted mb-0">Professional assistance in multiple languages 24/7/365.</p>
</div>
</div>
</div>
</div>
</div>
<?php require_once 'includes/footer.php'; ?> <?php require_once 'includes/footer.php'; ?>

View File

@ -26,10 +26,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['kyc_submit'])) {
try { try {
$stmt = db()->prepare("UPDATE users SET real_name = ?, id_number = ?, kyc_status = 'pending' WHERE id = ?"); $stmt = db()->prepare("UPDATE users SET real_name = ?, id_number = ?, kyc_status = 'pending' WHERE id = ?");
$stmt->execute([$real_name, $id_number, $user['id']]); $stmt->execute([$real_name, $id_number, $user['id']]);
$msg = t('Identity verification submitted and is under review.'); $msg = mt('Identity verification submitted and is under review.');
$user['kyc_status'] = 'pending'; $user['kyc_status'] = 'pending';
} catch (Exception $e) { } catch (Exception $e) {
$error = 'Error: ' . $e->getMessage(); $error = mt('Error') . ': ' . $e->getMessage();
} }
} }
@ -41,9 +41,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
$confirm_pass = $_POST['confirm_password'] ?? ''; $confirm_pass = $_POST['confirm_password'] ?? '';
if ($new_pass !== $confirm_pass) { if ($new_pass !== $confirm_pass) {
$error = 'New passwords do not match.'; $error = mt('New passwords do not match.');
} elseif (strlen($new_pass) < 6) { } elseif (strlen($new_pass) < 6) {
$error = 'Password must be at least 6 characters.'; $error = mt('Password must be at least 6 characters.');
} else { } else {
$current_hash = ($type === 'login') ? $user['password_hash'] : $user['security_password']; $current_hash = ($type === 'login') ? $user['password_hash'] : $user['security_password'];
if (password_verify($old_pass, $current_hash)) { if (password_verify($old_pass, $current_hash)) {
@ -51,12 +51,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
$column = ($type === 'login') ? 'password_hash' : 'security_password'; $column = ($type === 'login') ? 'password_hash' : 'security_password';
try { try {
db()->prepare("UPDATE users SET $column = ? WHERE id = ?")->execute([$new_hash, $user['id']]); db()->prepare("UPDATE users SET $column = ? WHERE id = ?")->execute([$new_hash, $user['id']]);
$msg = 'Password updated successfully.'; $msg = mt('Password updated successfully.');
} catch (Exception $e) { } catch (Exception $e) {
$error = 'Update failed: ' . $e->getMessage(); $error = mt('Update failed') . ': ' . $e->getMessage();
} }
} else { } else {
$error = 'Current password incorrect.'; $error = mt('Current password incorrect.');
} }
} }
} }
@ -65,17 +65,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<style> <style>
.profile-container { .profile-container {
padding: 40px 0; padding: 40px 0;
background-color: var(--bg-color); min-height: 80vh;
min-height: 100vh;
} }
.side-nav { .side-nav {
background-color: var(--card-bg); background-color: #181a20;
border-radius: 24px; border-radius: 24px;
padding: 20px; padding: 20px;
border: 1px solid var(--border-color); border: 1px solid #2b2f36;
} }
.side-nav .nav-link { .side-nav .nav-link {
color: var(--text-muted); color: #848e9c;
padding: 15px 20px; padding: 15px 20px;
border-radius: 12px; border-radius: 12px;
margin-bottom: 5px; margin-bottom: 5px;
@ -94,21 +93,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
color: white; color: white;
} }
.content-card { .content-card {
background-color: var(--card-bg); background-color: #181a20;
border-radius: 24px; border-radius: 24px;
padding: 40px; padding: 40px;
border: 1px solid var(--border-color); border: 1px solid #2b2f36;
height: 100%; height: 100%;
} }
.stat-box { .stat-box {
background: rgba(255,255,255,0.03); background: rgba(255,255,255,0.03);
border: 1px solid var(--border-color); border: 1px solid #2b2f36;
border-radius: 16px; border-radius: 16px;
padding: 25px; padding: 25px;
text-align: center; text-align: center;
} }
.upload-area { .upload-area {
border: 2px dashed var(--border-color); border: 2px dashed #2b2f36;
border-radius: 16px; border-radius: 16px;
padding: 30px; padding: 30px;
text-align: center; text-align: center;
@ -121,37 +120,42 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
} }
.asset-row { .asset-row {
padding: 20px 0; padding: 20px 0;
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid #2b2f36;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.asset-row:last-child { border-bottom: none; } .asset-row:last-child { border-bottom: none; }
.form-control { .form-control {
background-color: var(--bg-color); background-color: #0b0e11;
border: 1px solid var(--border-color); border: 1px solid #2b2f36;
color: white; color: white;
padding: 12px; padding: 12px;
border-radius: 10px; border-radius: 10px;
} }
.form-control:focus { .form-control:focus {
background-color: var(--bg-color); background-color: #0b0e11;
border-color: var(--okx-blue); border-color: var(--okx-blue);
color: white; color: white;
box-shadow: none; box-shadow: none;
} }
@media (max-width: 991px) {
.profile-container { padding: 20px 0; }
.content-card { padding: 25px; margin-top: 20px; }
}
</style> </style>
<div class="profile-container"> <div class="profile-container">
<div class="container"> <div class="container">
<?php if ($msg): ?> <?php if ($msg): ?>
<div class="alert alert-success alert-dismissible fade show" role="alert"> <div class="alert alert-success alert-dismissible fade show border-0 shadow-sm" style="border-radius: 12px;">
<?php echo $msg; ?> <?php echo $msg; ?>
<button type="button" class="btn-close" data-bs-dismiss="alert"></button> <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php if ($error): ?> <?php if ($error): ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert"> <div class="alert alert-danger alert-dismissible fade show border-0 shadow-sm" style="border-radius: 12px;">
<?php echo $error; ?> <?php echo $error; ?>
<button type="button" class="btn-close" data-bs-dismiss="alert"></button> <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div> </div>
@ -160,32 +164,32 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<div class="row g-4"> <div class="row g-4">
<!-- Sidebar --> <!-- Sidebar -->
<div class="col-lg-3"> <div class="col-lg-3">
<div class="side-nav"> <div class="side-nav shadow-sm">
<div class="text-center mb-4"> <div class="text-center mb-4">
<div class="d-inline-block position-relative mb-3"> <div class="d-inline-block position-relative mb-3">
<div class="rounded-circle bg-primary d-flex align-items-center justify-content-center text-white fw-bold fs-2" style="width: 80px; height: 80px;"> <div class="rounded-circle d-flex align-items-center justify-content-center text-white fw-bold fs-2" style="width: 80px; height: 80px; background: var(--bit-gradient);">
<?php echo strtoupper(substr($user['username'], 0, 1)); ?> <?php echo strtoupper(substr($user['username'], 0, 1)); ?>
</div> </div>
<div class="position-absolute bottom-0 end-0 bg-success border border-white rounded-circle" style="width: 15px; height: 15px;"></div> <span class="position-absolute bottom-0 end-0 bg-success border border-dark rounded-circle" style="width: 18px; height: 18px;"></span>
</div> </div>
<h5 class="mb-1 text-white"><?php echo htmlspecialchars($user['username']); ?></h5> <h5 class="mb-1 text-white"><?php echo htmlspecialchars($user['username']); ?></h5>
<p class="small text-muted mb-0">UID: <span class="text-white"><?php echo str_pad($user['uid'], 6, '0', STR_PAD_LEFT); ?></span></p> <p class="small text-muted mb-0">UID: <span class="text-white"><?php echo str_pad($user['uid'], 6, '0', STR_PAD_LEFT); ?></span></p>
</div> </div>
<div class="nav flex-column" id="v-pills-tab" role="tablist" aria-orientation="vertical"> <div class="nav flex-column" id="v-pills-tab" role="tablist">
<button class="nav-link active" id="overview-tab" data-bs-toggle="pill" data-bs-target="#overview" type="button"><i class="fas fa-th-large me-2"></i> <?php echo mt('Overview'); ?></button> <button class="nav-link active" id="overview-tab" data-bs-toggle="pill" data-bs-target="#overview" type="button"><i class="fas fa-th-large me-2"></i> <?php echo mt('Overview'); ?></button>
<button class="nav-link" id="assets-tab" data-bs-toggle="pill" data-bs-target="#assets" type="button"><i class="fas fa-wallet me-2"></i> <?php echo mt('Assets'); ?></button> <button class="nav-link" id="assets-tab" data-bs-toggle="pill" data-bs-target="#assets" type="button"><i class="fas fa-wallet me-2"></i> <?php echo mt('Assets'); ?></button>
<button class="nav-link" id="security-tab" data-bs-toggle="pill" data-bs-target="#security" type="button"><i class="fas fa-shield-alt me-2"></i> <?php echo mt('Security'); ?></button> <button class="nav-link" id="security-tab" data-bs-toggle="pill" data-bs-target="#security" type="button"><i class="fas fa-shield-alt me-2"></i> <?php echo mt('Security'); ?></button>
<button class="nav-link" id="kyc-tab" data-bs-toggle="pill" data-bs-target="#kyc" type="button"><i class="fas fa-user-check me-2"></i> <?php echo mt('KYC'); ?></button> <button class="nav-link" id="kyc-tab" data-bs-toggle="pill" data-bs-target="#kyc" type="button"><i class="fas fa-user-check me-2"></i> <?php echo mt('Verification'); ?></button>
</div> </div>
</div> </div>
</div> </div>
<!-- Content --> <!-- Content -->
<div class="col-lg-9"> <div class="col-lg-9">
<div class="tab-content" id="v-pills-tabContent" style="height: 100%;"> <div class="tab-content h-100 shadow-sm">
<!-- Overview --> <!-- Overview -->
<div class="tab-pane fade show active" id="overview" role="tabpanel"> <div class="tab-pane fade show active" id="overview">
<div class="content-card"> <div class="content-card">
<h3 class="fw-bold mb-4 text-white"><?php echo mt('Account Overview'); ?></h3> <h3 class="fw-bold mb-4 text-white"><?php echo mt('Account Overview'); ?></h3>
<div class="row g-4 mb-5"> <div class="row g-4 mb-5">
@ -199,7 +203,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<div class="stat-box"> <div class="stat-box">
<div class="small text-muted mb-2"><?php echo mt('Identity Verification'); ?></div> <div class="small text-muted mb-2"><?php echo mt('Identity Verification'); ?></div>
<h4 class="fw-bold <?php echo $user['kyc_status'] == 'approved' ? 'text-success' : 'text-warning'; ?>"> <h4 class="fw-bold <?php echo $user['kyc_status'] == 'approved' ? 'text-success' : 'text-warning'; ?>">
<?php echo t(ucfirst($user['kyc_status'] ?: 'none')); ?> <?php echo mt($user['kyc_status'] ?: 'Unverified'); ?>
</h4> </h4>
</div> </div>
</div> </div>
@ -211,21 +215,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
</div> </div>
</div> </div>
<h5 class="fw-bold mb-3 text-white">Recent Activities</h5> <h5 class="fw-bold mb-3 text-white"><?php echo mt('Recent Activities'); ?></h5>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-dark table-hover"> <table class="table table-dark table-hover border-secondary">
<thead> <thead>
<tr class="text-muted border-secondary"> <tr class="text-muted small">
<th>Time</th> <th><?php echo mt('Time'); ?></th>
<th>Action</th> <th><?php echo mt('Action'); ?></th>
<th>Status</th> <th><?php echo mt('Status'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="small">
<tr> <tr>
<td><?php echo date('Y-m-d H:i'); ?></td> <td><?php echo date('Y-m-d H:i'); ?></td>
<td>Account Login</td> <td><?php echo mt('Account Login'); ?></td>
<td><span class="badge bg-success">Success</span></td> <td><span class="badge bg-success bg-opacity-10 text-success border border-success border-opacity-25 px-2"><?php echo mt('Success'); ?></span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -234,24 +238,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
</div> </div>
<!-- Assets --> <!-- Assets -->
<div class="tab-pane fade" id="assets" role="tabpanel"> <div class="tab-pane fade" id="assets">
<div class="content-card"> <div class="content-card">
<div class="d-flex justify-content-between align-items-center mb-4"> <div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-bold mb-0 text-white"><?php echo mt('Assets'); ?></h3> <h3 class="fw-bold mb-0 text-white"><?php echo mt('Assets Overview'); ?></h3>
<div> <div>
<a href="deposit.php" class="btn btn-primary px-4 me-2" style="background-color: var(--okx-blue); border: none;"><?php echo mt('Deposit'); ?></a> <a href="deposit.php" class="btn btn-primary px-4 me-2 border-0" style="background: var(--okx-blue);"><?php echo mt('Deposit'); ?></a>
<a href="withdraw.php" class="btn btn-outline-light px-4"><?php echo mt('Withdraw'); ?></a> <a href="withdraw.php" class="btn btn-outline-light px-4"><?php echo mt('Withdraw'); ?></a>
</div> </div>
</div> </div>
<div class="bg-dark p-4 rounded-4 mb-4 border border-secondary"> <div class="bg-dark bg-opacity-50 p-4 rounded-4 mb-4 border border-secondary">
<div class="row"> <div class="row">
<div class="col-md-6 border-end border-secondary"> <div class="col-md-6 border-end border-secondary">
<div class="small text-muted mb-1">Total Net Value (USDT)</div> <div class="small text-muted mb-1"><?php echo mt('Total Net Value'); ?> (USDT)</div>
<h1 class="fw-bold text-white"><?php echo number_format($user['balance_usdt'], 2); ?></h1> <h1 class="fw-bold text-white"><?php echo number_format($user['balance_usdt'], 2); ?></h1>
</div> </div>
<div class="col-md-6 ps-md-4"> <div class="col-md-6 ps-md-4">
<div class="small text-muted mb-1">Yesterday Profit/Loss</div> <div class="small text-muted mb-1"><?php echo mt('Yesterday Profit/Loss'); ?></div>
<h3 class="fw-bold text-success">+$0.00 (0.00%)</h3> <h3 class="fw-bold text-success">+$0.00 (0.00%)</h3>
</div> </div>
</div> </div>
@ -271,13 +275,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<div class="small text-muted"> $<?php echo number_format($user['balance_usdt'], 2); ?></div> <div class="small text-muted"> $<?php echo number_format($user['balance_usdt'], 2); ?></div>
</div> </div>
</div> </div>
<!-- More assets can be listed here -->
</div> </div>
</div> </div>
</div> </div>
<!-- Security --> <!-- Security -->
<div class="tab-pane fade" id="security" role="tabpanel"> <div class="tab-pane fade" id="security">
<div class="content-card"> <div class="content-card">
<h3 class="fw-bold mb-4 text-white"><?php echo mt('Security Settings'); ?></h3> <h3 class="fw-bold mb-4 text-white"><?php echo mt('Security Settings'); ?></h3>
@ -285,77 +288,77 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary"> <div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary">
<div> <div>
<h6 class="mb-1 text-white"><?php echo mt('Login Password'); ?></h6> <h6 class="mb-1 text-white"><?php echo mt('Login Password'); ?></h6>
<p class="small text-muted mb-0">Last updated: Recently</p> <p class="small text-muted mb-0"><?php echo mt('Last updated'); ?>: <?php echo mt('Recently'); ?></p>
</div> </div>
<button class="btn btn-outline-light btn-sm px-4" data-bs-toggle="modal" data-bs-target="#loginPassModal"><?php echo mt('Change'); ?></button> <button class="btn btn-outline-light btn-sm px-4 rounded-pill" data-bs-toggle="modal" data-bs-target="#loginPassModal"><?php echo mt('Change'); ?></button>
</div> </div>
<div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary"> <div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary">
<div> <div>
<h6 class="mb-1 text-white"><?php echo mt('Trading Password'); ?></h6> <h6 class="mb-1 text-white"><?php echo mt('Trading Password'); ?></h6>
<p class="small text-muted mb-0">Required for withdrawals</p> <p class="small text-muted mb-0"><?php echo mt('Required for withdrawals'); ?></p>
</div> </div>
<button class="btn btn-outline-light btn-sm px-4" data-bs-toggle="modal" data-bs-target="#secPassModal"><?php echo mt('Change'); ?></button> <button class="btn btn-outline-light btn-sm px-4 rounded-pill" data-bs-toggle="modal" data-bs-target="#secPassModal"><?php echo mt('Change'); ?></button>
</div> </div>
<div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary"> <div class="d-flex justify-content-between align-items-center py-4 border-bottom border-secondary">
<div> <div>
<h6 class="mb-1 text-white">2FA Authentication</h6> <h6 class="mb-1 text-white"><?php echo mt('2FA Authentication'); ?></h6>
<p class="small text-muted mb-0">Google Authenticator</p> <p class="small text-muted mb-0"><?php echo mt('Google Authenticator'); ?></p>
</div> </div>
<button class="btn btn-outline-light btn-sm px-4">Link</button> <button class="btn btn-outline-light btn-sm px-4 rounded-pill"><?php echo mt('Link'); ?></button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- KYC --> <!-- KYC -->
<div class="tab-pane fade" id="kyc" role="tabpanel"> <div class="tab-pane fade" id="kyc">
<div class="content-card"> <div class="content-card">
<h3 class="fw-bold mb-4 text-white"><?php echo mt('Identity Verification'); ?></h3> <h3 class="fw-bold mb-4 text-white"><?php echo mt('Identity Verification'); ?></h3>
<?php if ($user['kyc_status'] == 'pending'): ?> <?php if ($user['kyc_status'] == 'pending'): ?>
<div class="text-center py-5"> <div class="text-center py-5">
<i class="fas fa-clock fa-5x text-warning mb-4"></i> <i class="fas fa-clock fa-5x text-warning mb-4"></i>
<h4 class="text-white">Reviewing...</h4> <h4 class="text-white"><?php echo mt('Reviewing...'); ?></h4>
<p class="text-muted">Your identity documents are being verified by our team.</p> <p class="text-muted"><?php echo mt('Your identity documents are being verified by our team.'); ?></p>
</div> </div>
<?php elseif ($user['kyc_status'] == 'approved'): ?> <?php elseif ($user['kyc_status'] == 'approved'): ?>
<div class="text-center py-5"> <div class="text-center py-5">
<i class="fas fa-check-circle fa-5x text-success mb-4"></i> <i class="fas fa-check-circle fa-5x text-success mb-4"></i>
<h4 class="text-white">Verified</h4> <h4 class="text-white"><?php echo mt('Verified'); ?></h4>
<p class="text-muted">Your account is fully verified for all features.</p> <p class="text-muted"><?php echo mt('Your account is fully verified for all features.'); ?></p>
</div> </div>
<?php else: ?> <?php else: ?>
<form action="" method="POST"> <form action="" method="POST">
<div class="row g-4 mb-4"> <div class="row g-4 mb-4">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label text-muted"><?php echo mt('Full Name'); ?></label> <label class="form-label text-muted small"><?php echo mt('Full Name'); ?></label>
<input type="text" name="real_name" class="form-control" placeholder="Enter your real name" required> <input type="text" name="real_name" class="form-control" placeholder="<?php echo mt('Enter your real name'); ?>" required>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label text-muted"><?php echo mt('ID Number'); ?></label> <label class="form-label text-muted small"><?php echo mt('ID Number'); ?></label>
<input type="text" name="id_number" class="form-control" placeholder="Enter ID/Passport Number" required> <input type="text" name="id_number" class="form-control" placeholder="<?php echo mt('Enter ID/Passport Number'); ?>" required>
</div> </div>
</div> </div>
<div class="row g-4 mb-5"> <div class="row g-4 mb-5">
<div class="col-md-4"> <div class="col-md-4">
<div class="upload-area"> <div class="upload-area">
<i class="fas fa-id-card fa-3x mb-3 text-muted"></i> <i class="fas fa-id-card fa-3x mb-3 text-muted opacity-25"></i>
<div class="small text-muted">Front Side</div> <div class="small text-muted"><?php echo mt('Front Side'); ?></div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="upload-area"> <div class="upload-area">
<i class="fas fa-id-card fa-3x mb-3 text-muted"></i> <i class="fas fa-id-card fa-3x mb-3 text-muted opacity-25"></i>
<div class="small text-muted">Back Side</div> <div class="small text-muted"><?php echo mt('Back Side'); ?></div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="upload-area"> <div class="upload-area">
<i class="fas fa-camera fa-3x mb-3 text-muted"></i> <i class="fas fa-camera fa-3x mb-3 text-muted opacity-25"></i>
<div class="small text-muted">Selfie with ID</div> <div class="small text-muted"><?php echo mt('Selfie with ID'); ?></div>
</div> </div>
</div> </div>
</div> </div>
<button type="submit" name="kyc_submit" class="btn btn-primary w-100 py-3 fw-bold" style="background-color: var(--okx-blue); border: none; border-radius: 12px;"><?php echo mt('Submit'); ?></button> <button type="submit" name="kyc_submit" class="btn btn-primary w-100 py-3 fw-bold border-0" style="background: var(--okx-blue); border-radius: 16px;"><?php echo mt('Submit'); ?></button>
</form> </form>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -366,12 +369,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
</div> </div>
</div> </div>
<!-- Login Pass Modal --> <!-- Modals -->
<div class="modal fade" id="loginPassModal" tabindex="-1"> <div class="modal fade" id="loginPassModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-dark border-secondary"> <div class="modal-content bg-dark border-secondary" style="border-radius: 20px;">
<div class="modal-header border-secondary"> <div class="modal-header border-secondary p-4">
<h5 class="modal-title text-white">Change Login Password</h5> <h5 class="modal-title text-white fw-bold"><?php echo mt('Change Login Password'); ?></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div> </div>
<form action="" method="POST"> <form action="" method="POST">
@ -379,33 +382,32 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<input type="hidden" name="change_password" value="1"> <input type="hidden" name="change_password" value="1">
<input type="hidden" name="type" value="login"> <input type="hidden" name="type" value="login">
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Current Password</label> <label class="form-label text-muted small"><?php echo mt('Current Password'); ?></label>
<input type="password" name="old_password" class="form-control" required> <input type="password" name="old_password" class="form-control shadow-none" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">New Password</label> <label class="form-label text-muted small"><?php echo mt('New Password'); ?></label>
<input type="password" name="new_password" class="form-control" required> <input type="password" name="new_password" class="form-control shadow-none" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Confirm New Password</label> <label class="form-label text-muted small"><?php echo mt('Confirm New Password'); ?></label>
<input type="password" name="confirm_password" class="form-control" required> <input type="password" name="confirm_password" class="form-control shadow-none" required>
</div> </div>
</div> </div>
<div class="modal-footer border-secondary"> <div class="modal-footer border-0 p-4 pt-0">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary px-4 rounded-pill" data-bs-dismiss="modal"><?php echo mt('Cancel'); ?></button>
<button type="submit" class="btn btn-primary" style="background-color: var(--okx-blue); border: none;">Save Changes</button> <button type="submit" class="btn btn-primary px-4 rounded-pill border-0" style="background: var(--okx-blue);"><?php echo mt('Save Changes'); ?></button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<!-- Sec Pass Modal -->
<div class="modal fade" id="secPassModal" tabindex="-1"> <div class="modal fade" id="secPassModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered"> <div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-dark border-secondary"> <div class="modal-content bg-dark border-secondary" style="border-radius: 20px;">
<div class="modal-header border-secondary"> <div class="modal-header border-secondary p-4">
<h5 class="modal-title text-white">Change Trading Password</h5> <h5 class="modal-title text-white fw-bold"><?php echo mt('Change Trading Password'); ?></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button> <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div> </div>
<form action="" method="POST"> <form action="" method="POST">
@ -413,39 +415,25 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
<input type="hidden" name="change_password" value="1"> <input type="hidden" name="change_password" value="1">
<input type="hidden" name="type" value="security"> <input type="hidden" name="type" value="security">
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Current Trading Password</label> <label class="form-label text-muted small"><?php echo mt('Current Trading Password'); ?></label>
<input type="password" name="old_password" class="form-control" required> <input type="password" name="old_password" class="form-control shadow-none" required>
<div class="form-text text-muted small">Default is 123456</div>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">New Trading Password (6 digits)</label> <label class="form-label text-muted small"><?php echo mt('New Trading Password'); ?> (6 <?php echo mt('digits'); ?>)</label>
<input type="password" name="new_password" class="form-control" pattern="\d{6}" maxlength="6" required> <input type="password" name="new_password" class="form-control shadow-none" pattern="\d{6}" maxlength="6" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Confirm New Trading Password</label> <label class="form-label text-muted small"><?php echo mt('Confirm New Trading Password'); ?></label>
<input type="password" name="confirm_password" class="form-control" pattern="\d{6}" maxlength="6" required> <input type="password" name="confirm_password" class="form-control shadow-none" pattern="\d{6}" maxlength="6" required>
</div> </div>
</div> </div>
<div class="modal-footer border-secondary"> <div class="modal-footer border-0 p-4 pt-0">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary px-4 rounded-pill" data-bs-dismiss="modal"><?php echo mt('Cancel'); ?></button>
<button type="submit" class="btn btn-primary" style="background-color: var(--okx-blue); border: none;">Save Changes</button> <button type="submit" class="btn btn-primary px-4 rounded-pill border-0" style="background: var(--okx-blue);"><?php echo mt('Save Changes'); ?></button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
<script>
// Handle tab switching if hash exists
window.addEventListener('load', () => {
const hash = window.location.hash;
if (hash) {
const triggerEl = document.querySelector(`button[data-bs-target="${hash}"]`);
if (triggerEl) {
bootstrap.Tab.getOrCreateInstance(triggerEl).show();
}
}
});
</script>
<?php require_once 'includes/footer.php'; ?> <?php require_once 'includes/footer.php'; ?>

339
trade.php
View File

@ -2,42 +2,19 @@
require_once 'includes/header.php'; require_once 'includes/header.php';
$symbol = $_GET['symbol'] ?? 'BTC'; $symbol = $_GET['symbol'] ?? 'BTC';
$type = $_GET['type'] ?? 'spot'; // spot or contract $type = $_GET['type'] ?? 'spot';
// Add some trade-specific translations
$trade_translations = [
'Open Orders' => ['en' => 'Open Orders', 'zh' => '当前委托', 'ja' => 'オープンオーダー', 'ko' => '미체결 주문', 'ru' => 'Открытые ордера', 'fr' => 'Ordres ouverts', 'es' => 'Órdenes abiertas', 'de' => 'Offene Orders'],
'Order History' => ['en' => 'Order History', 'zh' => '历史委托', 'ja' => 'オーダー履歴', 'ko' => '주문 내역', 'ru' => 'История ордеров', 'fr' => 'Historique des ordres', 'es' => 'Historial de órdenes', 'de' => 'Orderverlauf'],
'Positions' => ['en' => 'Positions', 'zh' => '持仓', 'ja' => 'ポジション', 'ko' => '포지션', 'ru' => 'Позиции', 'fr' => 'Positions', 'es' => 'Posiciones', 'de' => 'Positionen'],
'Limit' => ['en' => 'Limit', 'zh' => '限价', 'ja' => '指値', 'ko' => '지정가', 'ru' => 'Лимит', 'fr' => 'Limite', 'es' => 'Límite', 'de' => 'Limit'],
'Market' => ['en' => 'Market', 'zh' => '市价', 'ja' => '成行', 'ko' => '시장가', 'ru' => 'Рынок', 'fr' => 'Marché', 'es' => 'Mercado', 'de' => 'Markt'],
'Buy' => ['en' => 'Buy', 'zh' => '买入', 'ja' => '買い', 'ko' => '매수', 'ru' => 'Купить', 'fr' => 'Acheter', 'es' => 'Comprar', 'de' => 'Kaufen'],
'Sell' => ['en' => 'Sell', 'zh' => '卖出', 'ja' => '売り', 'ko' => '매도', 'ru' => 'Продать', 'fr' => 'Vendre', 'es' => 'Vender', 'de' => 'Verkaufen'],
'Price' => ['en' => 'Price', 'zh' => '价格', 'ja' => '価格', 'ko' => '가격', 'ru' => 'Цена', 'fr' => 'Prix', 'es' => 'Precio', 'de' => 'Preis'],
'Amount' => ['en' => 'Amount', 'zh' => '数量', 'ja' => '数量', 'ko' => '수량', 'ru' => 'Количество', 'fr' => 'Montant', 'es' => 'Cantidad', 'de' => 'Betrag'],
'Available' => ['en' => 'Available', 'zh' => '可用', 'ja' => '利用可能', 'ko' => '사용 가능', 'ru' => 'Доступно', 'fr' => 'Disponible', 'es' => 'Disponible', 'de' => 'Verfügbar'],
'Time' => ['en' => 'Time', 'zh' => '时间', 'ja' => '時間', 'ko' => '시간', 'ru' => 'Время', 'fr' => 'Temps', 'es' => 'Hora', 'de' => 'Zeit'],
'Type' => ['en' => 'Type', 'zh' => '类型', 'ja' => 'タイプ', 'ko' => '유형', 'ru' => 'Тип', 'fr' => 'Type', 'es' => 'Tipo', 'de' => 'Typ'],
'Side' => ['en' => 'Side', 'zh' => '方向', 'ja' => '売買', 'ko' => '구분', 'ru' => 'Сторона', 'fr' => 'Côté', 'es' => 'Lado', 'de' => 'Seite'],
'Action' => ['en' => 'Action', 'zh' => '操作', 'ja' => '操作', 'ko' => '작업', 'ru' => 'Действие', 'fr' => 'Action', 'es' => 'Acción', 'de' => 'Aktion'],
];
function tt($key) {
global $lang, $trade_translations;
return $trade_translations[$key][$lang] ?? ($trade_translations[$key]['en'] ?? $key);
}
?> ?>
<style> <style>
.trade-container { height: calc(100vh - 62px); overflow: hidden; background-color: var(--bg-color); } .trade-container { height: calc(100vh - 62px); overflow: hidden; background-color: #0b0e11; }
.market-list { height: 100%; overflow-y: auto; background-color: #0b0e11; border-right: 1px solid var(--border-color); } .market-list { height: 100%; overflow-y: auto; background-color: #0b0e11; border-right: 1px solid #2b2f36; }
.trade-main { height: 100%; display: flex; flex-direction: column; background-color: #161a1e; } .trade-main { height: 100%; display: flex; flex-direction: column; background-color: #161a1e; }
.order-sidebar { height: 100%; overflow-y: auto; background-color: #0b0e11; border-left: 1px solid var(--border-color); } .order-sidebar { height: 100%; overflow-y: auto; background-color: #0b0e11; border-left: 1px solid #2b2f36; }
.market-bar { background-color: #0b0e11; border-bottom: 1px solid var(--border-color); } .market-bar { background-color: #0b0e11; border-bottom: 1px solid #2b2f36; }
.chart-container { flex-grow: 1; min-height: 450px; } .chart-container { flex-grow: 1; min-height: 400px; }
.trade-tabs .nav-link { color: #848e9c; border: none; font-weight: 600; padding: 12px 20px; font-size: 0.9rem; } .trade-tabs .nav-link { color: #848e9c; border: none; font-weight: 600; padding: 10px 15px; font-size: 0.85rem; background: transparent; }
.trade-tabs .nav-link.active { color: var(--okx-blue); background: transparent; border-bottom: 2px solid var(--okx-blue); } .trade-tabs .nav-link.active { color: var(--okx-blue); background: transparent; border-bottom: 2px solid var(--okx-blue); }
.order-book-row { display: flex; justify-content: space-between; font-size: 0.75rem; padding: 2px 10px; position: relative; cursor: pointer; } .order-book-row { display: flex; justify-content: space-between; font-size: 0.75rem; padding: 2px 10px; position: relative; cursor: pointer; }
@ -51,33 +28,43 @@ function tt($key) {
.depth-bg.ask { background-color: #f6465d; } .depth-bg.ask { background-color: #f6465d; }
.depth-bg.bid { background-color: #0ecb81; } .depth-bg.bid { background-color: #0ecb81; }
.crypto-item { padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s; } /* Shrinked Crypto Item Style */
.crypto-item { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; transition: background 0.2s; }
.crypto-item:hover { background-color: #1e2329; } .crypto-item:hover { background-color: #1e2329; }
.crypto-item.active { background-color: #1e2329; border-left: 3px solid var(--okx-blue); } .crypto-item.active { background-color: #1e2329; border-left: 2px solid var(--okx-blue); }
.crypto-icon { width: 24px; height: 24px; margin-right: 10px; } .crypto-icon { width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; }
.crypto-name-text { font-size: 0.75rem; font-weight: 600; }
.crypto-sub-text { font-size: 0.65rem; color: #848e9c; }
.crypto-price-text { font-size: 0.75rem; font-weight: 600; }
.crypto-change-text { font-size: 0.65rem; }
.btn-buy { background-color: #0ecb81; color: white; border: none; font-weight: bold; } .btn-buy { background-color: #0ecb81; color: white; border: none; font-weight: bold; transition: opacity 0.2s; }
.btn-buy:hover { background-color: #0ba367; } .btn-buy:hover { opacity: 0.9; color: white; }
.btn-sell { background-color: #f6465d; color: white; border: none; font-weight: bold; } .btn-sell { background-color: #f6465d; color: white; border: none; font-weight: bold; transition: opacity 0.2s; }
.btn-sell:hover { background-color: #d13e50; } .btn-sell:hover { opacity: 0.9; color: white; }
/* Fix visibility */ .percent-btn { font-size: 0.65rem; padding: 2px 5px; background: #2b2f36; border: 1px solid #3b3f46; color: #848e9c; border-radius: 4px; }
.text-white { color: #fff !important; } .percent-btn:hover { background: #3b3f46; color: white; }
.text-muted { color: #848e9c !important; }
@media (max-width: 991px) {
.trade-container { height: auto; overflow: visible; }
.market-list { display: none; }
.order-sidebar { border-left: none; border-top: 1px solid #2b2f36; padding-bottom: 80px; }
.chart-container { min-height: 300px; }
}
</style> </style>
<div class="container-fluid trade-container px-0"> <div class="container-fluid trade-container px-0">
<div class="row g-0 h-100"> <div class="row g-0 h-100">
<!-- Market List (Left) --> <!-- Market List (Left) -->
<div class="col-lg-2 market-list d-none d-lg-block"> <div class="col-lg-2 market-list d-none d-lg-block">
<div class="p-3"> <div class="p-2 border-bottom border-secondary">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-dark border-secondary text-muted"><i class="fas fa-search"></i></span> <span class="input-group-text bg-transparent border-0 text-muted"><i class="fas fa-search"></i></span>
<input type="text" id="market-search" class="form-control bg-dark text-white border-secondary" placeholder="Search Pairs"> <input type="text" id="market-search" class="form-control bg-transparent text-white border-0 shadow-none" placeholder="<?php echo mt('Search Pairs'); ?>" style="font-size: 0.75rem;">
</div> </div>
</div> </div>
<div id="crypto-list-container"> <div id="crypto-list-container">
<!-- Loaded via JS -->
<div class="text-center py-5"><div class="spinner-border spinner-border-sm text-primary"></div></div> <div class="text-center py-5"><div class="spinner-border spinner-border-sm text-primary"></div></div>
</div> </div>
</div> </div>
@ -87,28 +74,20 @@ function tt($key) {
<!-- Market Info Bar --> <!-- Market Info Bar -->
<div class="market-bar p-2 d-flex align-items-center flex-wrap gap-4"> <div class="market-bar p-2 d-flex align-items-center flex-wrap gap-4">
<div class="d-flex align-items-center me-2 ps-2"> <div class="d-flex align-items-center me-2 ps-2">
<img id="current-coin-icon" src="https://static.okx.com/cdn/oksupport/asset/currency/icon/<?php echo strtolower($symbol); ?>.png" width="28" class="me-2"> <img id="current-coin-icon" src="https://static.okx.com/cdn/oksupport/asset/currency/icon/<?php echo strtolower($symbol); ?>.png" width="24" class="me-2">
<h5 class="mb-0 fw-bold text-white"><?php echo $symbol; ?>/USDT <span class="badge bg-secondary ms-2 small" style="font-size: 0.7rem;"><?php echo strtoupper($type); ?></span></h5> <h5 class="mb-0 fw-bold text-white" style="font-size: 1.1rem;"><?php echo $symbol; ?>/USDT <span class="badge bg-secondary ms-2" style="font-size: 0.6rem; vertical-align: middle;"><?php echo mt(strtoupper($type)); ?></span></h5>
</div> </div>
<div> <div>
<div id="last-price" class="fw-bold text-success fs-5">--</div> <div id="last-price" class="fw-bold text-success fs-5">--</div>
<div id="price-fiat" class="small text-muted"> ¥0.00</div> <div id="price-fiat" class="small text-muted" style="font-size: 0.7rem;"> $0.00</div>
</div> </div>
<div> <div>
<div class="small text-muted">24h <?php echo tt('Change'); ?></div> <div class="small text-muted" style="font-size: 0.7rem;">24h <?php echo mt('Change'); ?></div>
<div id="24h-change" class="fw-bold">--</div> <div id="24h-change" class="fw-bold" style="font-size: 0.8rem;">--</div>
</div> </div>
<div> <div class="d-none d-md-block">
<div class="small text-muted">24h High</div> <div class="small text-muted" style="font-size: 0.7rem;">24h <?php echo mt('High'); ?></div>
<div id="24h-high" class="fw-bold text-white">--</div> <div id="24h-high" class="fw-bold text-white" style="font-size: 0.8rem;">--</div>
</div>
<div>
<div class="small text-muted">24h Low</div>
<div id="24h-low" class="fw-bold text-white">--</div>
</div>
<div>
<div class="small text-muted">24h Volume</div>
<div id="24h-vol" class="fw-bold text-white">--</div>
</div> </div>
</div> </div>
@ -124,7 +103,7 @@ function tt($key) {
"interval": "15", "interval": "15",
"theme": "dark", "theme": "dark",
"style": "1", "style": "1",
"locale": "en", "locale": "<?php echo ($lang == 'zh' ? 'zh_CN' : 'en'); ?>",
"container_id": "tradingview_chart", "container_id": "tradingview_chart",
"hide_side_toolbar": false, "hide_side_toolbar": false,
"allow_symbol_change": true, "allow_symbol_change": true,
@ -138,30 +117,29 @@ function tt($key) {
</div> </div>
<!-- Orders/History (Bottom) --> <!-- Orders/History (Bottom) -->
<div class="flex-grow-1" style="background-color: #0b0e11;"> <div class="flex-grow-1 overflow-auto" style="background-color: #0b0e11;">
<ul class="nav nav-tabs trade-tabs border-bottom border-secondary" id="bottomTabs"> <ul class="nav nav-tabs trade-tabs border-bottom border-secondary sticky-top bg-dark" id="bottomTabs">
<li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#open-orders"><?php echo tt('Open Orders'); ?></a></li> <li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#open-orders"><?php echo mt('Open Orders'); ?></a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#order-history"><?php echo tt('Order History'); ?></a></li> <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#order-history"><?php echo mt('Order History'); ?></a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#positions"><?php echo tt('Positions'); ?></a></li> <li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#positions"><?php echo mt('Positions'); ?></a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#assets"><?php echo mt('Assets'); ?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade show active p-3" id="open-orders"> <div class="tab-pane fade show active p-2" id="open-orders">
<table class="table table-dark table-sm small"> <table class="table table-dark table-sm small align-middle mb-0">
<thead> <thead>
<tr class="text-muted"> <tr class="text-muted border-0" style="font-size: 0.7rem;">
<th><?php echo tt('Time'); ?></th> <th><?php echo mt('Time'); ?></th>
<th>Pair</th> <th><?php echo mt('Pair'); ?></th>
<th><?php echo tt('Type'); ?></th> <th><?php echo mt('Type'); ?></th>
<th><?php echo tt('Side'); ?></th> <th><?php echo mt('Side'); ?></th>
<th><?php echo tt('Price'); ?></th> <th><?php echo mt('Price'); ?></th>
<th><?php echo tt('Amount'); ?></th> <th><?php echo mt('Amount'); ?></th>
<th>Filled</th> <th><?php echo mt('Filled'); ?></th>
<th><?php echo tt('Action'); ?></th> <th><?php echo mt('Action'); ?></th>
</tr> </tr>
</thead> </thead>
<tbody id="open-orders-list"> <tbody id="open-orders-list">
<tr><td colspan="8" class="text-center py-4 text-muted">No open orders</td></tr> <tr><td colspan="8" class="text-center py-5 text-muted"><?php echo mt('No open orders'); ?></td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -172,15 +150,14 @@ function tt($key) {
<!-- Order Sidepanel (Right) --> <!-- Order Sidepanel (Right) -->
<div class="col-lg-3 order-sidebar"> <div class="col-lg-3 order-sidebar">
<!-- Order Book --> <!-- Order Book -->
<div class="order-book p-0 border-bottom border-secondary" style="height: 400px; display: flex; flex-direction: column;"> <div class="order-book p-0 border-bottom border-secondary" style="height: 320px; display: flex; flex-direction: column;">
<div class="p-2 d-flex justify-content-between small text-muted border-bottom border-secondary" style="background: #161a1e;"> <div class="p-2 d-flex justify-content-between small text-muted border-bottom border-secondary" style="background: #0b0e11; font-size: 0.65rem;">
<span><?php echo tt('Price'); ?> (USDT)</span> <span><?php echo mt('Price'); ?> (USDT)</span>
<span><?php echo tt('Amount'); ?> (<?php echo $symbol; ?>)</span> <span><?php echo mt('Amount'); ?> (<?php echo $symbol; ?>)</span>
</div> </div>
<div id="order-book-asks" style="flex: 1; overflow: hidden; display: flex; flex-direction: column-reverse;"></div> <div id="order-book-asks" style="flex: 1; overflow: hidden; display: flex; flex-direction: column-reverse;"></div>
<div id="mid-price-row" class="px-3 py-2 fs-5 fw-bold text-success bg-dark border-top border-bottom border-secondary"> <div id="mid-price-row" class="px-3 py-1 fs-5 fw-bold text-success bg-black bg-opacity-25 border-top border-bottom border-secondary">
<span id="book-price">--</span> <span id="book-price">--</span>
<i class="fas fa-arrow-up fs-6 ms-2"></i>
</div> </div>
<div id="order-book-bids" style="flex: 1; overflow: hidden;"></div> <div id="order-book-bids" style="flex: 1; overflow: hidden;"></div>
</div> </div>
@ -188,18 +165,18 @@ function tt($key) {
<!-- Order Entry Form --> <!-- Order Entry Form -->
<div class="p-3"> <div class="p-3">
<div class="d-flex justify-content-between align-items-center mb-3"> <div class="d-flex justify-content-between align-items-center mb-3">
<div class="nav nav-pills small" id="order-type-tabs"> <div class="nav nav-pills small bg-dark p-1 rounded-pill" id="order-type-tabs">
<button class="nav-link active py-1 px-3" data-bs-toggle="pill"><?php echo tt('Limit'); ?></button> <button class="nav-link active py-1 px-3 rounded-pill" id="tab-limit" style="font-size: 0.7rem; color: #848e9c;"><?php echo mt('Limit'); ?></button>
<button class="nav-link py-1 px-3" data-bs-toggle="pill"><?php echo tt('Market'); ?></button> <button class="nav-link py-1 px-3 rounded-pill" id="tab-market" style="font-size: 0.7rem; color: #848e9c;"><?php echo mt('Market'); ?></button>
</div> </div>
<?php if ($type === 'contract'): ?> <?php if ($type === 'contract'): ?>
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle py-0" type="button" data-bs-toggle="dropdown">20x</button> <button class="btn btn-sm btn-dark border-secondary dropdown-toggle py-0" type="button" data-bs-toggle="dropdown" id="leverage-btn" style="font-size: 0.7rem;">20x</button>
<ul class="dropdown-menu dropdown-menu-dark"> <ul class="dropdown-menu dropdown-menu-dark">
<li><a class="dropdown-item" href="#">10x</a></li> <li><a class="dropdown-item" href="#" onclick="setLeverage(10)">10x</a></li>
<li><a class="dropdown-item active" href="#">20x</a></li> <li><a class="dropdown-item active" href="#" onclick="setLeverage(20)">20x</a></li>
<li><a class="dropdown-item" href="#">50x</a></li> <li><a class="dropdown-item" href="#" onclick="setLeverage(50)">50x</a></li>
<li><a class="dropdown-item" href="#">100x</a></li> <li><a class="dropdown-item" href="#" onclick="setLeverage(100)">100x</a></li>
</ul> </ul>
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -208,51 +185,63 @@ function tt($key) {
<form id="order-form"> <form id="order-form">
<input type="hidden" id="current-symbol" value="<?php echo $symbol; ?>"> <input type="hidden" id="current-symbol" value="<?php echo $symbol; ?>">
<input type="hidden" id="trade-type" value="<?php echo $type; ?>"> <input type="hidden" id="trade-type" value="<?php echo $type; ?>">
<input type="hidden" id="user-balance" value="<?php echo $user['balance_usdt'] ?? 0; ?>">
<div class="btn-group w-100 mb-3" role="group"> <div class="btn-group w-100 mb-3" role="group">
<input type="radio" class="btn-check" name="side" id="side-buy" value="buy" checked> <input type="radio" class="btn-check" name="side" id="side-buy" value="buy" checked>
<label class="btn btn-outline-success border-0 py-2 fw-bold" for="side-buy" style="background-color: rgba(14, 203, 129, 0.1);"><?php echo tt('Buy'); ?></label> <label class="btn btn-outline-success border-0 py-2 fw-bold" for="side-buy" style="background-color: rgba(14, 203, 129, 0.05); font-size: 0.85rem;"><?php echo mt('Buy'); ?></label>
<input type="radio" class="btn-check" name="side" id="side-sell" value="sell"> <input type="radio" class="btn-check" name="side" id="side-sell" value="sell">
<label class="btn btn-outline-danger border-0 py-2 fw-bold" for="side-sell" style="background-color: rgba(246, 70, 93, 0.1);"><?php echo tt('Sell'); ?></label> <label class="btn btn-outline-danger border-0 py-2 fw-bold" for="side-sell" style="background-color: rgba(246, 70, 93, 0.05); font-size: 0.85rem;"><?php echo mt('Sell'); ?></label>
</div> </div>
<div class="mb-3"> <div class="mb-2" id="price-input-group">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-dark border-secondary text-muted" style="width: 70px;"><?php echo tt('Price'); ?></span> <span class="input-group-text bg-dark border-secondary text-muted" style="min-width: 60px; font-size: 0.7rem;"><?php echo mt('Price'); ?></span>
<input type="number" id="order-price" class="form-control bg-dark text-white border-secondary" step="0.01"> <input type="number" id="order-price" class="form-control bg-dark text-white border-secondary shadow-none" step="0.01" style="font-size: 0.8rem;">
<span class="input-group-text bg-dark border-secondary text-muted">USDT</span> <span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7rem;">USDT</span>
</div> </div>
</div> </div>
<div class="mb-3"> <div class="mb-2">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-dark border-secondary text-muted" style="width: 70px;"><?php echo tt('Amount'); ?></span> <span class="input-group-text bg-dark border-secondary text-muted" style="min-width: 60px; font-size: 0.7rem;"><?php echo mt($type === 'contract' ? 'Lots' : 'Amount'); ?></span>
<input type="number" id="order-amount" class="form-control bg-dark text-white border-secondary" placeholder="0.00"> <input type="number" id="order-amount" class="form-control bg-dark text-white border-secondary shadow-none" placeholder="0.00" style="font-size: 0.8rem;">
<span class="input-group-text bg-dark border-secondary text-muted"><?php echo $symbol; ?></span> <span class="input-group-text bg-dark border-secondary text-muted" style="font-size: 0.7rem;"><?php echo $symbol; ?></span>
</div> </div>
</div> </div>
<div class="mb-4"> <div class="d-flex justify-content-between gap-1 mb-2">
<div class="d-flex justify-content-between small text-muted mb-2"> <button type="button" class="percent-btn flex-grow-1" onclick="setPercent(0.25)">25%</button>
<span><?php echo tt('Available'); ?></span> <button type="button" class="percent-btn flex-grow-1" onclick="setPercent(0.50)">50%</button>
<button type="button" class="percent-btn flex-grow-1" onclick="setPercent(0.75)">75%</button>
<button type="button" class="percent-btn flex-grow-1" onclick="setPercent(1.00)">100%</button>
</div>
<div class="d-flex justify-content-between small text-muted mb-4 px-1" style="font-size: 0.7rem;">
<span><?php echo mt('Available'); ?></span>
<span class="text-white"><?php echo number_format($user['balance_usdt'] ?? 0, 2); ?> USDT</span> <span class="text-white"><?php echo number_format($user['balance_usdt'] ?? 0, 2); ?> USDT</span>
</div> </div>
<div class="d-flex justify-content-between gap-1">
<button type="button" class="btn btn-sm btn-dark border-secondary flex-grow-1 py-0" style="font-size: 0.65rem;">25%</button>
<button type="button" class="btn btn-sm btn-dark border-secondary flex-grow-1 py-0" style="font-size: 0.65rem;">50%</button>
<button type="button" class="btn btn-sm btn-dark border-secondary flex-grow-1 py-0" style="font-size: 0.65rem;">75%</button>
<button type="button" class="btn btn-sm btn-dark border-secondary flex-grow-1 py-0" style="font-size: 0.65rem;">100%</button>
</div>
</div>
<button type="button" id="submit-btn" class="btn btn-buy w-100 py-3 mb-3 fs-5"> <?php if ($type === 'contract'): ?>
<?php echo tt('Buy'); ?> <?php echo $symbol; ?> <div class="row g-2 mb-4">
<div class="col-6">
<div class="input-group input-group-sm">
<span class="input-group-text bg-dark border-secondary text-muted px-2" style="min-width: unset; font-size: 0.7rem;">TP</span>
<input type="number" id="tp-price" class="form-control bg-dark text-white border-secondary shadow-none" placeholder="<?php echo mt('Price'); ?>" style="font-size: 0.7rem;">
</div>
</div>
<div class="col-6">
<div class="input-group input-group-sm">
<span class="input-group-text bg-dark border-secondary text-muted px-2" style="min-width: unset; font-size: 0.7rem;">SL</span>
<input type="number" id="sl-price" class="form-control bg-dark text-white border-secondary shadow-none" placeholder="<?php echo mt('Price'); ?>" style="font-size: 0.7rem;">
</div>
</div>
</div>
<?php endif; ?>
<button type="button" id="submit-btn" class="btn btn-buy w-100 py-3 mb-3 fs-6 rounded-3" onclick="submitOrder()">
<?php echo mt('Buy'); ?> <?php echo $symbol; ?>
</button> </button>
<div class="row g-2 small text-muted">
<div class="col-6">Est. Fee: 0.1%</div>
<div class="col-6 text-end">Max <?php echo tt('Buy'); ?>: 0.00</div>
</div>
</form> </form>
</div> </div>
</div> </div>
@ -261,18 +250,118 @@ function tt($key) {
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script> <script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<script> <script>
let currentLeverage = 20;
function setLeverage(lev) {
currentLeverage = lev;
const btn = document.getElementById('leverage-btn');
if (btn) btn.innerText = lev + 'x';
calculateMax();
}
function calculateMax() {
const balance = parseFloat(document.getElementById('user-balance').value);
const priceInput = document.getElementById('order-price');
let price = parseFloat(priceInput.value);
const symbol = document.getElementById('current-symbol').value;
const isMarket = document.getElementById('tab-market').classList.contains('active');
if (isMarket || !price) {
if (window.currentMarketData && window.currentMarketData[symbol]) {
price = window.currentMarketData[symbol].price;
}
}
if (price > 0) {
let max = balance / price;
if (document.getElementById('trade-type').value === 'contract') {
max *= currentLeverage;
}
// Save max to a hidden property or global for setPercent to use
window.currentMaxAmount = max;
if (isMarket) {
priceInput.value = price.toFixed(2);
}
}
}
function setPercent(p) {
if (window.currentMaxAmount > 0) {
document.getElementById('order-amount').value = (window.currentMaxAmount * p).toFixed(4);
}
}
function submitOrder() {
const amount = document.getElementById('order-amount').value;
if (!amount || amount <= 0) {
alert('Please enter a valid amount.');
return;
}
const side = document.querySelector('input[name="side"]:checked').value;
const type = document.getElementById('tab-limit').classList.contains('active') ? 'Limit' : 'Market';
const symbol = document.getElementById('current-symbol').value;
const price = type === 'Limit' ? document.getElementById('order-price').value : 'Market';
// Add to simulated history
const list = document.getElementById('open-orders-list');
const row = `
<tr class="border-secondary">
<td>${new Date().toLocaleTimeString()}</td>
<td>${symbol}/USDT</td>
<td>${type}</td>
<td class="${side === 'buy' ? 'text-success' : 'text-danger'}">${side.toUpperCase()}</td>
<td>${price}</td>
<td>${amount}</td>
<td>0%</td>
<td><button class="btn btn-sm btn-link text-danger p-0 text-decoration-none">Cancel</button></td>
</tr>
`;
if (list.innerHTML.includes('No open orders') || list.innerHTML.includes('无挂单')) {
list.innerHTML = row;
} else {
list.innerHTML = row + list.innerHTML;
}
alert('Order submitted successfully!');
}
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// Switch side coloring // Initial max calculation
setTimeout(calculateMax, 1000);
setInterval(calculateMax, 3000);
// Limit/Market toggle
document.getElementById('tab-limit').addEventListener('click', function() {
document.getElementById('price-input-group').style.display = 'block';
this.classList.add('active');
document.getElementById('tab-market').classList.remove('active');
calculateMax();
});
document.getElementById('tab-market').addEventListener('click', function() {
document.getElementById('price-input-group').style.display = 'none';
this.classList.add('active');
document.getElementById('tab-limit').classList.remove('active');
calculateMax();
});
// Side coloring
document.querySelectorAll('input[name="side"]').forEach(radio => { document.querySelectorAll('input[name="side"]').forEach(radio => {
radio.addEventListener('change', (e) => { radio.addEventListener('change', (e) => {
const btn = document.getElementById('submit-btn'); const btn = document.getElementById('submit-btn');
const sym = document.getElementById('current-symbol').value; const sym = document.getElementById('current-symbol').value;
const buyText = '<?php echo mt('Buy'); ?>';
const sellText = '<?php echo mt('Sell'); ?>';
if (e.target.value === 'buy') { if (e.target.value === 'buy') {
btn.className = 'btn btn-buy w-100 py-3 mb-3 fs-5'; btn.className = 'btn btn-buy w-100 py-3 mb-3 fs-6 rounded-3';
btn.textContent = '<?php echo tt('Buy'); ?> ' + sym; btn.textContent = buyText + ' ' + sym;
} else { } else {
btn.className = 'btn btn-sell w-100 py-3 mb-3 fs-5'; btn.className = 'btn btn-sell w-100 py-3 mb-3 fs-6 rounded-3';
btn.textContent = '<?php echo tt('Sell'); ?> ' + sym; btn.textContent = sellText + ' ' + sym;
} }
}); });
}); });

View File

@ -15,28 +15,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$security_password = $_POST['security_password'] ?? ''; $security_password = $_POST['security_password'] ?? '';
if ($amount <= 0) { if ($amount <= 0) {
$error = 'Invalid amount.'; $error = mt('Error');
} elseif ($amount > $user['balance_usdt']) { } elseif ($amount > $user['balance_usdt']) {
$error = 'Insufficient balance.'; $error = mt('Error');
} elseif (empty($address)) {
$error = 'Please enter withdrawal address.';
} elseif (!password_verify($security_password, $user['security_password'])) { } elseif (!password_verify($security_password, $user['security_password'])) {
$error = 'Incorrect trading password.'; $error = mt('Current password incorrect.');
} else { } else {
try { try {
db()->beginTransaction(); db()->prepare("UPDATE users SET balance_usdt = balance_usdt - ? WHERE id = ?")->execute([$amount, $user['id']]);
// Deduct balance $success = mt('Success');
$stmt = db()->prepare("UPDATE users SET balance_usdt = balance_usdt - ? WHERE id = ?");
$stmt->execute([$amount, $user['id']]);
// Record transaction (assuming a transactions table exists or just for mock)
// For now just success message
db()->commit();
$success = 'Withdrawal request submitted successfully.';
$user['balance_usdt'] -= $amount; $user['balance_usdt'] -= $amount;
} catch (Exception $e) { } catch (Exception $e) {
db()->rollBack(); $error = mt('Error');
$error = 'Withdrawal failed: ' . $e->getMessage();
} }
} }
} }
@ -45,64 +35,59 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<div class="container my-5 py-5"> <div class="container my-5 py-5">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6"> <div class="col-md-6">
<div class="card bg-dark border-secondary p-4 shadow-lg" style="border-radius: 24px;"> <div class="card bg-dark border-secondary p-4 shadow-lg overflow-hidden" style="border-radius: 24px;">
<h3 class="fw-bold mb-4 text-white"><i class="fas fa-arrow-up me-2 text-danger"></i> <?php echo mt('Withdraw'); ?> USDT</h3> <div class="d-flex align-items-center mb-4">
<button onclick="history.back()" class="btn btn-dark rounded-circle me-3 border-secondary" style="width: 40px; height: 40px;">
<i class="fas fa-arrow-left"></i>
</button>
<h3 class="fw-bold mb-0 text-white"><i class="fas fa-arrow-up me-2 text-danger"></i> <?php echo mt('Withdraw'); ?></h3>
</div>
<?php if ($error): ?> <?php if ($error): ?>
<div class="alert alert-danger"><?php echo $error; ?></div> <div class="alert alert-danger bg-danger bg-opacity-10 border-0 text-danger" style="border-radius: 12px;"><?php echo $error; ?></div>
<?php endif; ?> <?php endif; ?>
<?php if ($success): ?> <?php if ($success): ?>
<div class="alert alert-success"><?php echo $success; ?></div> <div class="alert alert-success bg-success bg-opacity-10 border-0 text-success" style="border-radius: 12px;"><?php echo $success; ?></div>
<?php endif; ?> <?php endif; ?>
<div class="bg-secondary bg-opacity-10 p-3 rounded-3 mb-4 border border-secondary"> <div class="bg-secondary bg-opacity-10 p-4 rounded-4 mb-4 border border-secondary border-opacity-25">
<div class="small text-muted mb-1"><?php echo mt('Available'); ?></div> <div class="small text-muted mb-1"><?php echo mt('Available'); ?></div>
<h4 class="fw-bold text-white mb-0"><?php echo number_format($user['balance_usdt'], 2); ?> USDT</h4> <h4 class="fw-bold text-white mb-0"><?php echo number_format($user['balance_usdt'], 2); ?> <span class="fs-6 text-muted">USDT</span></h4>
</div> </div>
<form method="POST"> <form method="POST">
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Withdrawal Address</label> <label class="form-label text-muted small"><?php echo mt('Withdrawal Address'); ?></label>
<input type="text" name="address" class="form-control bg-dark text-white border-secondary py-3" placeholder="Enter USDT (TRC20) address" required> <input type="text" name="address" class="form-control bg-dark text-white border-secondary py-3 px-3 rounded-3" placeholder="USDT (TRC20)" required>
</div> </div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label text-muted">Amount</label> <label class="form-label text-muted small"><?php echo mt('Amount'); ?></label>
<div class="input-group"> <div class="input-group">
<input type="number" name="amount" class="form-control bg-dark text-white border-secondary py-3" placeholder="Min 10.00" step="0.01" required> <input type="number" name="amount" class="form-control bg-dark text-white border-secondary py-3 px-3 rounded-start-3" placeholder="Min 10.00" step="0.01" required>
<span class="input-group-text bg-dark border-secondary text-muted">USDT</span> <span class="input-group-text bg-dark border-secondary text-white rounded-end-3">USDT</span>
</div> </div>
</div> </div>
<div class="mb-4"> <div class="mb-4">
<label class="form-label text-muted"><?php echo mt('Trading Password'); ?> (6 digits)</label> <label class="form-label text-muted small"><?php echo mt('Trading Password'); ?></label>
<input type="password" name="security_password" class="form-control bg-dark text-white border-secondary py-3" placeholder="Enter your 6-digit password" pattern="\d{6}" maxlength="6" required> <input type="password" name="security_password" class="form-control bg-dark text-white border-secondary py-3 px-3 rounded-3" placeholder="6-digit" pattern="\d{6}" maxlength="6" required>
<div class="form-text text-muted small">Default is 123456</div>
</div> </div>
<button type="submit" class="btn btn-danger w-100 py-3 fw-bold fs-5" style="border-radius: 12px;"><?php echo mt('Withdraw'); ?> USDT</button> <button type="submit" class="btn btn-danger w-100 py-3 fw-bold fs-5 rounded-3 shadow-sm"><?php echo mt('Withdraw'); ?></button>
<div class="mt-4 p-3 bg-light bg-opacity-5 rounded-3 border border-secondary small text-muted">
<p class="mb-1"><i class="fas fa-info-circle me-1"></i> Withdrawal Tips:</p>
<ul class="ps-3 mb-0">
<li>Minimum withdrawal: 10 USDT</li>
<li>Processing time: 10-30 minutes</li>
<li>Network: TRC20 only</li>
</ul>
</div>
</form> </form>
</div> </div>
</div>
</div>
</div>
<style> <div class="mt-4 p-4 bg-secondary bg-opacity-10 rounded-4 border border-secondary border-opacity-25">
.form-control:focus { <h6 class="text-white fw-bold mb-3 small text-uppercase" style="letter-spacing: 1px;"><?php echo mt('Notes'); ?></h6>
background-color: #2b2f36; <ul class="text-muted small mb-0 ps-3">
border-color: #f6465d; <li class="mb-2">Withdrawals are processed within 10-30 minutes.</li>
box-shadow: none; <li class="mb-2">Minimum withdrawal amount is 10 USDT.</li>
color: #fff; <li>Ensure the receiving address supports the TRC20 network.</li>
} </ul>
</style> </div>
</div>
</div>
</div>
<?php require_once 'includes/footer.php'; ?> <?php require_once 'includes/footer.php'; ?>