Autosave: 20260211-081917
This commit is contained in:
parent
e56fb6769c
commit
396b0e8f02
27
about.php
Normal file
27
about.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<div class="container" style="max-width: 1000px; margin: 60px auto; padding: 0 20px;">
|
||||
<h1 style="font-size: 3rem; margin-bottom: 40px; text-align: center;"><?php echo __('about_us'); ?></h1>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); line-height: 1.8;">
|
||||
<h2 style="color: var(--primary-color); margin-bottom: 20px;">Our Mission</h2>
|
||||
<p style="font-size: 1.1rem; color: #ccc;">Founded in 2017, EXCHANGE is a leading cryptocurrency infrastructure provider with a mission to facilitate the free flow of value around the world. We believe that everyone should have access to financial services, regardless of who they are or where they come from.</p>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px;">
|
||||
<div>
|
||||
<h3 style="color: white; margin-bottom: 15px;">Global Presence</h3>
|
||||
<p style="color: var(--text-muted);">With offices in over 10 countries and users from 180+ nations, we are truly a global organization. Our team consists of experts from finance, technology, and security sectors.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="color: white; margin-bottom: 15px;">Security First</h3>
|
||||
<p style="color: var(--text-muted);">Security is at the heart of everything we do. We employ industry-leading security measures, including multi-signature wallets and offline cold storage, to protect our users' assets.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 50px; text-align: center; padding: 40px; background: rgba(0,82,255,0.05); border-radius: 16px;">
|
||||
<h2 style="margin-bottom: 20px;">Join millions of users worldwide</h2>
|
||||
<p style="margin-bottom: 30px; color: var(--text-muted);">Experience the future of finance with the most trusted crypto exchange.</p>
|
||||
<a href="register.php" class="btn-primary" style="padding: 15px 40px; font-size: 18px; border-radius: 12px;"><?php echo __('btn_start'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
179
admin/chat.php
Normal file
179
admin/chat.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../db/config.php';
|
||||
|
||||
$selected_user_id = $_GET['user_id'] ?? null;
|
||||
|
||||
// Handle sending message
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['message']) && isset($_POST['user_id'])) {
|
||||
$msg = trim($_POST['message']);
|
||||
$uid = $_POST['user_id'];
|
||||
if ($msg !== '') {
|
||||
$stmt = db()->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)");
|
||||
$stmt->execute([$uid, $msg]);
|
||||
}
|
||||
header("Location: chat.php?user_id=" . $uid);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Handle setting bank info
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['bank_info']) && isset($_POST['order_id'])) {
|
||||
$info = $_POST['bank_info'];
|
||||
$oid = $_POST['order_id'];
|
||||
$uid = $_POST['user_id'];
|
||||
$stmt = db()->prepare("UPDATE fiat_orders SET bank_account_info = ? WHERE id = ?");
|
||||
$stmt->execute([$info, $oid]);
|
||||
|
||||
// Also send as a chat message
|
||||
$msg = "I have matched a bank account for your deposit. Please check the matching page.\n\nAccount Info:\n" . $info;
|
||||
$stmt = db()->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'admin', ?)");
|
||||
$stmt->execute([$uid, $msg]);
|
||||
|
||||
header("Location: chat.php?user_id=" . $uid);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Fetch all users who have sent messages
|
||||
$users = db()->query("
|
||||
SELECT u.id, u.username, u.uid, MAX(m.created_at) as last_message,
|
||||
(SELECT COUNT(*) FROM messages WHERE user_id = u.id AND sender = 'user' AND is_read = 0) as unread_count
|
||||
FROM users u
|
||||
JOIN messages m ON u.id = m.user_id
|
||||
GROUP BY u.id
|
||||
ORDER BY last_message DESC
|
||||
")->fetchAll();
|
||||
|
||||
$messages = [];
|
||||
$pending_order = null;
|
||||
if ($selected_user_id) {
|
||||
db()->prepare("UPDATE messages SET is_read = 1 WHERE user_id = ? AND sender = 'user'")->execute([$selected_user_id]);
|
||||
$stmt = db()->prepare("SELECT * FROM messages WHERE user_id = ? ORDER BY created_at ASC");
|
||||
$stmt->execute([$selected_user_id]);
|
||||
$messages = $stmt->fetchAll();
|
||||
|
||||
// Check for pending fiat order
|
||||
$stmt = db()->prepare("SELECT * FROM fiat_orders WHERE user_id = ? AND bank_account_info IS NULL ORDER BY created_at DESC LIMIT 1");
|
||||
$stmt->execute([$selected_user_id]);
|
||||
$pending_order = $stmt->fetch();
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CS Workbench</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
body { display: flex; height: 100vh; margin: 0; background: #0B0E11; color: white; font-family: sans-serif; }
|
||||
.sidebar { width: 320px; border-right: 1px solid #2B3139; display: flex; flex-direction: column; background: #161a1e; }
|
||||
.main-chat { flex: 1; display: flex; flex-direction: column; background: #0b0e11; }
|
||||
.user-item { padding: 15px 20px; border-bottom: 1px solid #2B3139; cursor: pointer; transition: 0.2s; }
|
||||
.user-item:hover { background: #1E2329; }
|
||||
.user-item.active { background: #1E2329; border-left: 4px solid var(--primary-color); }
|
||||
.unread-badge { background: var(--danger-color); color: white; border-radius: 50%; padding: 2px 6px; font-size: 10px; }
|
||||
.chat-msg { max-width: 75%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
|
||||
.msg-admin { background: #2B3139; border-bottom-right-radius: 2px; align-self: flex-end; }
|
||||
.msg-user { background: var(--primary-color); border-bottom-left-radius: 2px; align-self: flex-start; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="sidebar">
|
||||
<div style="padding: 25px; border-bottom: 1px solid #2B3139;">
|
||||
<h2 style="margin: 0; font-size: 20px; color: var(--primary-color);">CS Workbench</h2>
|
||||
</div>
|
||||
<div style="overflow-y: auto; flex: 1;">
|
||||
<?php foreach ($users as $u): ?>
|
||||
<div class="user-item <?php echo $selected_user_id == $u['id'] ? 'active' : ''; ?>" onclick="location.href='?user_id=<?php echo $u['id']; ?>'">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;">
|
||||
<span style="font-weight: bold;"><?php echo htmlspecialchars($u['username']); ?></span>
|
||||
<?php if ($u['unread_count'] > 0): ?>
|
||||
<span class="unread-badge"><?php echo $u['unread_count']; ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; font-size: 11px; color: #848E9C;">
|
||||
<span>UID: <?php echo $u['uid']; ?></span>
|
||||
<span><?php echo date('H:i', strtotime($u['last_message'])); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-chat">
|
||||
<?php if ($selected_user_id): ?>
|
||||
<div style="padding: 15px 25px; border-bottom: 1px solid #2B3139; display: flex; justify-content: space-between; align-items: center; background: #161a1e;">
|
||||
<div>
|
||||
<h3 style="margin: 0;"><?php echo $users[array_search($selected_user_id, array_column($users, 'id'))]['username']; ?></h3>
|
||||
<span style="font-size: 12px; color: #848E9C;">UID: <?php echo $users[array_search($selected_user_id, array_column($users, 'id'))]['uid']; ?></span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 15px;">
|
||||
<?php if ($pending_order): ?>
|
||||
<button onclick="document.getElementById('bank-modal').style.display='flex'" style="background: #f0b90b; color: black; border: none; padding: 8px 15px; border-radius: 4px; font-weight: bold; cursor: pointer;">
|
||||
Provide Bank Info
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<a href="index.php" style="color: #848E9C; text-decoration: none; font-size: 20px;"><i class="fas fa-times"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="admin-chat-box" style="flex: 1; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 15px;">
|
||||
<?php foreach ($messages as $m):
|
||||
// The original code had nl2br(htmlspecialchars($m['message']));
|
||||
// The new code has nl2br(htmlspecialchars($m['message']));
|
||||
// No change needed here as it's already correctly escaped.
|
||||
?>
|
||||
<div class="chat-msg <?php echo $m['sender'] === 'admin' ? 'msg-admin' : 'msg-user'; ?>">
|
||||
<?php echo nl2br(htmlspecialchars($m['message'])); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div style="padding: 20px 25px; border-top: 1px solid #2B3139; background: #161a1e;">
|
||||
<form method="POST" style="display: flex; gap: 10px;">
|
||||
<input type="hidden" name="user_id" value="<?php echo $selected_user_id; ?>">
|
||||
<textarea name="message" rows="3" placeholder="Type a message..." style="flex: 1; background: #0B0E11; border: 1px solid #2B3139; color: white; border-radius: 8px; padding: 12px; outline: none; resize: none;"></textarea>
|
||||
<button type="submit" class="btn-primary" style="height: auto; padding: 0 30px; border-radius: 8px;">Send</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="flex: 1; display: flex; align-items: center; justify-content: center; color: #848E9C;">
|
||||
<div style="text-align: center;">
|
||||
<i class="fas fa-headset" style="font-size: 80px; margin-bottom: 25px; opacity: 0.1;"></i>
|
||||
<h2 style="font-weight: 300;">Select a conversation to begin</h2>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Bank Info Modal -->
|
||||
<div id="bank-modal" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center;">
|
||||
<div style="background: #1E2329; padding: 30px; border-radius: 16px; width: 450px; border: 1px solid #2B3139;">
|
||||
<h3 style="margin: 0 0 20px;">Provide Bank Account Info</h3>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="user_id" value="<?php echo $selected_user_id; ?>">
|
||||
<input type="hidden" name="order_id" value="<?php echo $pending_order['id'] ?? ''; ?>">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; margin-bottom: 10px; font-size: 14px; color: #848E9C;">Bank Details Template</label>
|
||||
<textarea name="bank_info" rows="8" style="width: 100%; background: #0B0E11; border: 1px solid #2B3139; color: white; border-radius: 8px; padding: 12px; outline: none; resize: none;">Bank Name:
|
||||
Account Name:
|
||||
Account Number:
|
||||
Branch:
|
||||
Remarks: </textarea>
|
||||
</div>
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<button type="submit" class="btn-primary" style="flex: 1;">Submit & Notify User</button>
|
||||
<button type="button" onclick="document.getElementById('bank-modal').style.display='none'" style="flex: 1; background: transparent; border: 1px solid #2B3139; color: white; border-radius: 4px; cursor: pointer;">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const box = document.getElementById('admin-chat-box');
|
||||
if (box) box.scrollTop = box.scrollHeight;
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
82
admin/index.php
Normal file
82
admin/index.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
|
||||
$db = db();
|
||||
$total_users = $db->query("SELECT COUNT(*) FROM users")->fetchColumn();
|
||||
$pending_kyc = $db->query("SELECT COUNT(*) FROM users WHERE kyc_status = 1")->fetchColumn();
|
||||
$pending_orders = $db->query("SELECT COUNT(*) FROM orders WHERE status = 'pending'")->fetchColumn() + $db->query("SELECT COUNT(*) FROM fiat_orders WHERE status = 'pending'")->fetchColumn();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Admin Dashboard</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
.admin-layout { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: 250px; background: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
|
||||
.main-content { flex: 1; padding: 2rem; background: #0B0E11; }
|
||||
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
||||
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
|
||||
.badge { background: var(--danger-color); color: white; border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; margin-left: auto; }
|
||||
.stat-card { background: #1E2329; padding: 20px; border-radius: 8px; border: 1px solid #2B3139; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-layout">
|
||||
<div class="sidebar">
|
||||
<h3 style="color: white; margin-bottom: 2rem;">OKX Admin</h3>
|
||||
<a href="index.php" class="menu-item active"><i class="fas fa-chart-pie"></i> Dashboard</a>
|
||||
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> User Management</a>
|
||||
<a href="kyc.php" class="menu-item">
|
||||
<i class="fas fa-id-card"></i> KYC Review
|
||||
<?php if($pending_kyc > 0): ?><span class="badge"><?php echo $pending_kyc; ?></span><?php endif; ?>
|
||||
</a>
|
||||
<a href="orders.php" class="menu-item">
|
||||
<i class="fas fa-wallet"></i> Deposits
|
||||
<?php if($pending_orders > 0): ?><span class="badge"><?php echo $pending_orders; ?></span><?php endif; ?>
|
||||
</a>
|
||||
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> Settings & Control</a>
|
||||
<a href="../index.php" class="menu-item" style="margin-top: 2rem; color: orange;"><i class="fas fa-external-link-alt"></i> View Front</a>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<h2 style="color: white; margin-bottom: 2rem;">System Overview</h2>
|
||||
<div style="grid-template-columns: repeat(4, 1fr); display: grid; gap: 1.5rem;">
|
||||
<div class="stat-card">
|
||||
<div style="color: #848E9C; font-size: 0.9rem;">Total Registered</div>
|
||||
<div style="font-size: 2rem; color: white; margin-top: 10px;"><?php echo $total_users; ?></div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div style="color: #848E9C; font-size: 0.9rem;">KYC Pending</div>
|
||||
<div style="font-size: 2rem; color: #F0B90B; margin-top: 10px;"><?php echo $pending_kyc; ?></div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div style="color: #848E9C; font-size: 0.9rem;">Pending Deposits</div>
|
||||
<div style="font-size: 2rem; color: #F0B90B; margin-top: 10px;"><?php echo $pending_orders; ?></div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div style="color: #848E9C; font-size: 0.9rem;">Total Balance</div>
|
||||
<div style="font-size: 2rem; color: var(--success-color); margin-top: 10px;">$0.00</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 3rem; background: #1E2329; padding: 25px; border-radius: 8px;">
|
||||
<h3 style="color: white; margin-bottom: 20px;">Control Center</h3>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||
<div style="border: 1px solid #2B3139; padding: 20px; border-radius: 6px;">
|
||||
<h4 style="color: #848E9C;">Price Manipulation</h4>
|
||||
<p style="color: #555; font-size: 0.8rem;">Override real-time prices for specific pairs.</p>
|
||||
<a href="settings.php" class="btn-primary" style="display: inline-block; margin-top: 15px; font-size: 0.8rem; padding: 8px 15px;">Configure</a>
|
||||
</div>
|
||||
<div style="border: 1px solid #2B3139; padding: 20px; border-radius: 6px;">
|
||||
<h4 style="color: #848E9C;">Trade Win/Loss Control</h4>
|
||||
<p style="color: #555; font-size: 0.8rem;">Control the win rate for users trading on the platform.</p>
|
||||
<a href="settings.php" class="btn-primary" style="display: inline-block; margin-top: 15px; font-size: 0.8rem; padding: 8px 15px;">Configure</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
81
admin/kyc.php
Normal file
81
admin/kyc.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
$db = db();
|
||||
|
||||
if (isset($_GET['action']) && isset($_GET['id'])) {
|
||||
$id = $_GET['id'];
|
||||
$status = ($_GET['action'] === 'approve') ? 2 : 3;
|
||||
$db->prepare("UPDATE users SET kyc_status = ? WHERE id = ?")->execute([$status, $id]);
|
||||
header("Location: kyc.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$submissions = $db->query("SELECT * FROM users WHERE kyc_status = 1 ORDER BY id DESC")->fetchAll();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>KYC Review</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
.admin-layout { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: 250px; background: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
|
||||
.main-content { flex: 1; padding: 2rem; background: #0B0E11; color: white; }
|
||||
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
||||
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
|
||||
.kyc-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
|
||||
.kyc-table th, .kyc-table td { padding: 15px; text-align: left; border-bottom: 1px solid #2B3139; }
|
||||
.btn-approve { background: #00c087; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 0.8rem; }
|
||||
.btn-reject { background: #f6465d; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 0.8rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-layout">
|
||||
<div class="sidebar">
|
||||
<h3 style="color: white; margin-bottom: 2rem;">OKX Admin</h3>
|
||||
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> Dashboard</a>
|
||||
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> User Management</a>
|
||||
<a href="kyc.php" class="menu-item active"><i class="fas fa-id-card"></i> KYC Review</a>
|
||||
<a href="orders.php" class="menu-item"><i class="fas fa-wallet"></i> Deposits</a>
|
||||
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> Settings & Control</a>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<h2>KYC Review Submissions</h2>
|
||||
<table class="kyc-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>User</th>
|
||||
<th>Full Name</th>
|
||||
<th>ID Number</th>
|
||||
<th>Documents</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($submissions as $s): ?>
|
||||
<tr>
|
||||
<td><?php echo $s['username']; ?> (UID: <?php echo $s['uid']; ?>)</td>
|
||||
<td><?php echo $s['kyc_name']; ?></td>
|
||||
<td><?php echo $s['kyc_id_number']; ?></td>
|
||||
<td>
|
||||
<a href="#" style="color: var(--primary-color);">View Front</a> |
|
||||
<a href="#" style="color: var(--primary-color);">View Back</a> |
|
||||
<a href="#" style="color: var(--primary-color);">View Handheld</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="kyc.php?action=approve&id=<?php echo $s['id']; ?>" class="btn-approve">Approve</a>
|
||||
<a href="kyc.php?action=reject&id=<?php echo $s['id']; ?>" class="btn-reject">Reject</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php if(empty($submissions)): ?>
|
||||
<tr><td colspan="5" style="text-align: center; color: #555;">No pending KYC submissions.</td></tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
152
admin/orders.php
Normal file
152
admin/orders.php
Normal file
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
$pdo = db();
|
||||
|
||||
// Handle Actions
|
||||
if (isset($_POST['action'])) {
|
||||
$id = $_POST['order_id'];
|
||||
|
||||
if ($_POST['action'] == 'match' || $_POST['action'] == 'complete' || $_POST['action'] == 'reject') {
|
||||
$table = $_POST['order_table'] === 'fiat' ? 'fiat_orders' : 'orders';
|
||||
if ($_POST['action'] == 'match') {
|
||||
$info = $_POST['account_info'];
|
||||
$pdo->prepare("UPDATE $table SET status = 'matched', account_info = ? WHERE id = ?")->execute([$info, $id]);
|
||||
} elseif ($_POST['action'] == 'complete') {
|
||||
$orderStmt = $pdo->prepare("SELECT user_id, amount FROM $table WHERE id = ?");
|
||||
$orderStmt->execute([$id]);
|
||||
$order = $orderStmt->fetch();
|
||||
if ($order) {
|
||||
// Update BOTH total_assets and balance
|
||||
$pdo->prepare("UPDATE users SET total_assets = total_assets + ?, balance = balance + ? WHERE id = ?")->execute([$order['amount'], $order['amount'], $order['user_id']]);
|
||||
$pdo->prepare("UPDATE $table SET status = 'completed' WHERE id = ?")->execute([$id]);
|
||||
}
|
||||
} elseif ($_POST['action'] == 'reject') {
|
||||
$pdo->prepare("UPDATE $table SET status = 'rejected' WHERE id = ?")->execute([$id]);
|
||||
}
|
||||
}
|
||||
|
||||
// Trading Order Actions
|
||||
if ($_POST['action'] == 'set_win_loss') {
|
||||
$win_loss = $_POST['win_loss'];
|
||||
$pdo->prepare("UPDATE trading_orders SET win_loss = ? WHERE id = ?")->execute([$win_loss, $id]);
|
||||
}
|
||||
}
|
||||
|
||||
$fiat_orders = $pdo->query("SELECT o.*, u.username, u.uid, 'fiat' as tbl FROM fiat_orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC")->fetchAll();
|
||||
$usdt_orders = $pdo->query("SELECT o.*, u.username, u.uid, 'usdt' as tbl FROM orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC")->fetchAll();
|
||||
$all_deposits = array_merge($fiat_orders, $usdt_orders);
|
||||
usort($all_deposits, function($a, $b) { return $b['id'] - $a['id']; });
|
||||
|
||||
$trading_orders = $pdo->query("SELECT o.*, u.username, u.uid FROM trading_orders o JOIN users u ON o.user_id = u.id ORDER BY o.id DESC LIMIT 50")->fetchAll();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Order Management</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
.admin-layout { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: 250px; background: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
|
||||
.main-content { flex: 1; padding: 2rem; background: #0B0E11; color: white; overflow-x: auto; }
|
||||
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
||||
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
|
||||
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; margin-bottom: 3rem; }
|
||||
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #2B3139; font-size: 0.85rem; }
|
||||
.status-badge { padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; }
|
||||
.pending { background: rgba(240, 185, 11, 0.1); color: #F0B90B; }
|
||||
.matched { background: rgba(55, 122, 255, 0.1); color: #377aff; }
|
||||
.completed { background: rgba(0, 192, 135, 0.1); color: #00c087; }
|
||||
.win { color: #00c087; font-weight: bold; }
|
||||
.loss { color: #f6465d; font-weight: bold; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-layout">
|
||||
<div class="sidebar">
|
||||
<h3 style="color: white; margin-bottom: 2rem;">OKX Admin</h3>
|
||||
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> Dashboard</a>
|
||||
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> User Management</a>
|
||||
<a href="kyc.php" class="menu-item"><i class="fas fa-id-card"></i> KYC Review</a>
|
||||
<a href="orders.php" class="menu-item active"><i class="fas fa-wallet"></i> Orders & Trades</a>
|
||||
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> Settings & Control</a>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<h2>Deposit Management</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th><th>User</th><th>Type</th><th>Amount</th><th>Status</th><th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($all_deposits as $o): ?>
|
||||
<tr>
|
||||
<td>#<?php echo $o['id']; ?></td>
|
||||
<td><?php echo $o['username']; ?> (UID: <?php echo $o['uid']; ?>)</td>
|
||||
<td><span style="color: <?php echo $o['tbl'] == 'usdt' ? '#26a17b' : '#007bff'; ?>"><?php echo strtoupper($o['tbl']); ?></span></td>
|
||||
<td><?php echo number_format($o['amount'], 2); ?></td>
|
||||
<td><span class="status-badge <?php echo $o['status']; ?>"><?php echo strtoupper($o['status']); ?></span></td>
|
||||
<td>
|
||||
<?php if($o['status'] == 'pending'): ?>
|
||||
<form method="POST" style="display: flex; gap: 5px;">
|
||||
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
|
||||
<input type="hidden" name="order_table" value="<?php echo $o['tbl']; ?>">
|
||||
<input type="hidden" name="action" value="match">
|
||||
<input type="text" name="account_info" placeholder="Info" required style="padding: 5px; width: 80px; background: #1e2329; border: 1px solid #2b3139; color: white;">
|
||||
<button type="submit" class="btn-primary" style="padding: 5px;">Issue</button>
|
||||
</form>
|
||||
<?php elseif($o['status'] == 'matched' || $o['status'] == 'paid'): ?>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
|
||||
<input type="hidden" name="order_table" value="<?php echo $o['tbl']; ?>">
|
||||
<input type="hidden" name="action" value="complete">
|
||||
<button type="submit" class="btn-primary" style="background: #00c087; padding: 5px;">Complete</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>Trading Orders (Win/Loss Control)</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th><th>User</th><th>Symbol</th><th>Type</th><th>Side</th><th>Price</th><th>Amount</th><th>Total</th><th>Win/Loss</th><th>Control</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($trading_orders as $o): ?>
|
||||
<tr>
|
||||
<td>#<?php echo $o['id']; ?></td>
|
||||
<td><?php echo $o['username']; ?></td>
|
||||
<td><?php echo $o['symbol']; ?></td>
|
||||
<td><?php echo strtoupper($o['type']); ?></td>
|
||||
<td><span style="color: <?php echo $o['side'] == 'buy' ? '#00c087' : '#f6465d'; ?>"><?php echo strtoupper($o['side']); ?></span></td>
|
||||
<td><?php echo $o['price']; ?></td>
|
||||
<td><?php echo $o['amount']; ?></td>
|
||||
<td><?php echo $o['total']; ?></td>
|
||||
<td><span class="<?php echo $o['win_loss']; ?>"><?php echo strtoupper($o['win_loss']); ?></span></td>
|
||||
<td>
|
||||
<form method="POST" style="display: flex; gap: 5px;">
|
||||
<input type="hidden" name="order_id" value="<?php echo $o['id']; ?>">
|
||||
<input type="hidden" name="action" value="set_win_loss">
|
||||
<select name="win_loss" style="padding: 5px; width: 80px; background: #1e2329; border: 1px solid #2b3139; color: white; border-radius: 4px;">
|
||||
<option value="none" <?php echo $o['win_loss'] == 'none' ? 'selected' : ''; ?>>None</option>
|
||||
<option value="win" <?php echo $o['win_loss'] == 'win' ? 'selected' : ''; ?>>WIN</option>
|
||||
<option value="loss" <?php echo $o['win_loss'] == 'loss' ? 'selected' : ''; ?>>LOSS</option>
|
||||
</select>
|
||||
<button type="submit" class="btn-primary" style="padding: 5px;">Set</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
84
admin/settings.php
Normal file
84
admin/settings.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
$db = db();
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
foreach ($_POST['settings'] as $name => $value) {
|
||||
$stmt = $db->prepare("INSERT INTO settings (name, value) VALUES (?, ?) ON DUPLICATE KEY UPDATE value = ?");
|
||||
$stmt->execute([$name, $value, $value]);
|
||||
}
|
||||
$message = "Settings updated successfully.";
|
||||
}
|
||||
|
||||
$settings_res = $db->query("SELECT * FROM settings")->fetchAll();
|
||||
$settings = [];
|
||||
foreach($settings_res as $s) $settings[$s['name']] = $s['value'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>System Settings</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
.admin-layout { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: 250px; background: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
|
||||
.main-content { flex: 1; padding: 2rem; background: #0B0E11; color: white; }
|
||||
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
||||
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
|
||||
.form-group { margin-bottom: 25px; background: #1E2329; padding: 20px; border-radius: 8px; border: 1px solid #2B3139; }
|
||||
.form-group label { display: block; margin-bottom: 10px; color: #848E9C; }
|
||||
input[type="text"], input[type="number"], select { width: 100%; padding: 10px; background: #0B0E11; border: 1px solid #2B3139; color: white; border-radius: 4px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-layout">
|
||||
<div class="sidebar">
|
||||
<h3 style="color: white; margin-bottom: 2rem;">OKX Admin</h3>
|
||||
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> Dashboard</a>
|
||||
<a href="users.php" class="menu-item"><i class="fas fa-users"></i> User Management</a>
|
||||
<a href="kyc.php" class="menu-item"><i class="fas fa-id-card"></i> KYC Review</a>
|
||||
<a href="orders.php" class="menu-item"><i class="fas fa-wallet"></i> Deposits</a>
|
||||
<a href="settings.php" class="menu-item active"><i class="fas fa-cog"></i> Settings & Control</a>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<h2>System Control Panel</h2>
|
||||
|
||||
<?php if(isset($message)): ?>
|
||||
<div style="background: rgba(0,255,0,0.1); color: #00ff00; padding: 15px; border-radius: 4px; margin-bottom: 20px;"><?php echo $message; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label>Trade Win Rate (%)</label>
|
||||
<input type="number" name="settings[win_rate]" value="<?php echo $settings['win_rate'] ?? 70; ?>" min="0" max="100">
|
||||
<p style="font-size: 0.8rem; color: #555; margin-top: 5px;">Set the global probability for user winning in Seconds/Perpetual trades.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Price Control Mode</label>
|
||||
<select name="settings[price_control]">
|
||||
<option value="0" <?php echo ($settings['price_control'] ?? '0') == '0' ? 'selected' : ''; ?>>Real Market (WebSocket)</option>
|
||||
<option value="1" <?php echo ($settings['price_control'] ?? '0') == '1' ? 'selected' : ''; ?>>Manual Override</option>
|
||||
<option value="2" <?php echo ($settings['price_control'] ?? '0') == '2' ? 'selected' : ''; ?>>Random Walk (Small Deviation)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>BTC Manual Price ($)</label>
|
||||
<input type="number" name="settings[manual_btc_price]" value="<?php echo $settings['manual_btc_price'] ?? 0; ?>" step="0.01">
|
||||
<p style="font-size: 0.8rem; color: #555; margin-top: 5px;">Used when Price Control Mode is "Manual Override". Leave 0 for auto-follow with offset.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>System Announcement (CN)</label>
|
||||
<input type="text" name="settings[announcement_zh]" value="<?php echo $settings['announcement_zh'] ?? ''; ?>">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn-primary" style="padding: 12px 30px; font-weight: bold;">Save All Settings</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
91
admin/users.php
Normal file
91
admin/users.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
$pdo = db();
|
||||
|
||||
if (isset($_POST['action']) && isset($_POST['user_id'])) {
|
||||
$uid = $_POST['user_id'];
|
||||
if ($_POST['action'] == 'update_score') {
|
||||
$score = $_POST['score'];
|
||||
$pdo->prepare("UPDATE users SET credit_score = ? WHERE id = ?")->execute([$score, $uid]);
|
||||
} elseif ($_POST['action'] == 'update_assets') {
|
||||
$assets = $_POST['assets'];
|
||||
$pdo->prepare("UPDATE users SET total_assets = ? WHERE id = ?")->execute([$assets, $uid]);
|
||||
}
|
||||
}
|
||||
|
||||
$users = $pdo->query("SELECT * FROM users ORDER BY id DESC")->fetchAll();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>User Management</title>
|
||||
<link rel="stylesheet" href="../assets/css/custom.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
.admin-layout { display: flex; min-height: 100vh; }
|
||||
.sidebar { width: 250px; background: #1E2329; border-right: 1px solid #2B3139; padding: 1rem; }
|
||||
.main-content { flex: 1; padding: 2rem; background: #0B0E11; color: white; }
|
||||
.menu-item { padding: 12px; color: #848E9C; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 4px; margin-bottom: 5px; }
|
||||
.menu-item:hover, .menu-item.active { background: #2B3139; color: white; }
|
||||
.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
|
||||
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #2B3139; font-size: 0.9rem; }
|
||||
input { background: #1e2329; border: 1px solid #2b3139; color: white; padding: 5px; border-radius: 4px; width: 80px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="admin-layout">
|
||||
<div class="sidebar">
|
||||
<h3 style="color: white; margin-bottom: 2rem;">OKX Admin</h3>
|
||||
<a href="index.php" class="menu-item"><i class="fas fa-chart-pie"></i> Dashboard</a>
|
||||
<a href="users.php" class="menu-item active"><i class="fas fa-users"></i> User Management</a>
|
||||
<a href="kyc.php" class="menu-item"><i class="fas fa-id-card"></i> KYC Review</a>
|
||||
<a href="orders.php" class="menu-item"><i class="fas fa-wallet"></i> Deposits</a>
|
||||
<a href="settings.php" class="menu-item"><i class="fas fa-cog"></i> Settings & Control</a>
|
||||
</div>
|
||||
<div class="main-content">
|
||||
<h2>User Management</h2>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>UID</th>
|
||||
<th>Username</th>
|
||||
<th>Assets (USDT)</th>
|
||||
<th>Credit Score</th>
|
||||
<th>KYC</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($users as $u): ?>
|
||||
<tr>
|
||||
<td><?php echo $u['uid']; ?></td>
|
||||
<td><?php echo $u['username']; ?></td>
|
||||
<td>
|
||||
<form method="POST" style="display: flex; gap: 5px; align-items: center;">
|
||||
<input type="hidden" name="user_id" value="<?php echo $u['id']; ?>">
|
||||
<input type="hidden" name="action" value="update_assets">
|
||||
<input type="number" step="0.01" name="assets" value="<?php echo $u['total_assets']; ?>">
|
||||
<button type="submit" style="background: none; border: none; color: var(--primary-color); cursor: pointer;"><i class="fas fa-save"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form method="POST" style="display: flex; gap: 5px; align-items: center;">
|
||||
<input type="hidden" name="user_id" value="<?php echo $u['id']; ?>">
|
||||
<input type="hidden" name="action" value="update_score">
|
||||
<input type="number" name="score" value="<?php echo $u['credit_score']; ?>">
|
||||
<button type="submit" style="background: none; border: none; color: var(--primary-color); cursor: pointer;"><i class="fas fa-save"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
<td><?php echo $u['kyc_status'] == 2 ? '✅' : '❌'; ?></td>
|
||||
<td>
|
||||
<button style="background: none; border: none; color: #f6465d;"><i class="fas fa-ban"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
22
api/check_order.php
Normal file
22
api/check_order.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
session_start();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!isset($_SESSION['user_id']) || !isset($_GET['id'])) {
|
||||
echo json_encode(['error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$order_id = $_GET['id'];
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT status FROM orders WHERE id = ? AND user_id = ?");
|
||||
$stmt->execute([$order_id, $_SESSION['user_id']]);
|
||||
$order = $stmt->fetch();
|
||||
|
||||
if ($order) {
|
||||
echo json_encode(['status' => $order['status']]);
|
||||
} else {
|
||||
echo json_encode(['error' => 'Not found']);
|
||||
}
|
||||
17
api/check_order_status.php
Normal file
17
api/check_order_status.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../db/config.php';
|
||||
|
||||
if (!isset($_SESSION['user_id']) || !isset($_GET['order_id'])) {
|
||||
echo json_encode(['error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$order_id = $_GET['order_id'];
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
$stmt = db()->prepare("SELECT bank_account_info FROM fiat_orders WHERE id = ? AND user_id = ?");
|
||||
$stmt->execute([$order_id, $user_id]);
|
||||
$order = $stmt->fetch();
|
||||
|
||||
echo json_encode(['bank_account_info' => $order['bank_account_info'] ?? null]);
|
||||
15
api/get_messages.php
Normal file
15
api/get_messages.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../db/config.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
echo json_encode(['error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$stmt = db()->prepare("SELECT COUNT(*) as count FROM messages WHERE user_id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$row = $stmt->fetch();
|
||||
|
||||
echo json_encode(['count' => $row['count']]);
|
||||
63
api/place_order.php
Normal file
63
api/place_order.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../db/config.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
echo json_encode(['success' => false, 'error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
if (!$data) {
|
||||
echo json_encode(['success' => false, 'error' => 'Invalid data']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$symbol = $data['symbol'];
|
||||
$type = $data['type']; // spot or futures
|
||||
$side = $data['side']; // buy or sell
|
||||
$order_type = $data['order_type']; // limit or market
|
||||
$price = $data['price'];
|
||||
$amount = $data['amount'];
|
||||
$total = $data['total'];
|
||||
$leverage = $data['leverage'] ?? 1;
|
||||
$tp_price = $data['tp_price'] ?? null;
|
||||
$sl_price = $data['sl_price'] ?? null;
|
||||
|
||||
try {
|
||||
$db = db();
|
||||
$db->beginTransaction();
|
||||
|
||||
// Check balance if buying spot or opening long/short futures (simplified)
|
||||
$stmt = $db->prepare("SELECT balance FROM users WHERE id = ? FOR UPDATE");
|
||||
$stmt->execute([$user_id]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($side === 'buy' || $type === 'futures') {
|
||||
$cost = $type === 'futures' ? $total / $leverage : $total;
|
||||
if ($user['balance'] < $cost) {
|
||||
$db->rollBack();
|
||||
echo json_encode(['success' => false, 'error' => 'Insufficient balance']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Deduct balance
|
||||
$stmt = $db->prepare("UPDATE users SET balance = balance - ? WHERE id = ?");
|
||||
$stmt->execute([$cost, $user_id]);
|
||||
}
|
||||
|
||||
// Insert order
|
||||
$stmt = $db->prepare("INSERT INTO trading_orders (user_id, symbol, type, side, order_type, price, amount, total, leverage, tp_price, sl_price) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$user_id, $symbol, $type, $side, $order_type, $price, $amount, $total, $leverage, $tp_price, $sl_price]);
|
||||
|
||||
$db->commit();
|
||||
echo json_encode(['success' => true]);
|
||||
|
||||
} catch (Exception $e) {
|
||||
if (isset($db)) $db->rollBack();
|
||||
echo json_encode(['success' => false, 'error' => $e->getMessage()]);
|
||||
}
|
||||
@ -1,346 +1,329 @@
|
||||
:root {
|
||||
--color-bg: #ffffff;
|
||||
--color-text: #1a1a1a;
|
||||
--color-primary: #2563EB; /* Vibrant Blue */
|
||||
--color-secondary: #000000;
|
||||
--color-accent: #A3E635; /* Lime Green */
|
||||
--color-surface: #f8f9fa;
|
||||
--font-heading: 'Space Grotesk', sans-serif;
|
||||
--font-body: 'Inter', sans-serif;
|
||||
--border-width: 2px;
|
||||
--shadow-hard: 5px 5px 0px #000;
|
||||
--shadow-hover: 8px 8px 0px #000;
|
||||
--radius-pill: 50rem;
|
||||
--radius-card: 1rem;
|
||||
--bg-color: #0B0E11;
|
||||
--nav-bg: #0B0E11;
|
||||
--primary-color: #0052FF;
|
||||
--text-color: #FFFFFF;
|
||||
--text-muted: #848E9C;
|
||||
--border-color: #2B3139;
|
||||
--card-bg: #1E2329;
|
||||
--danger-color: #F6465D;
|
||||
--success-color: #0ECB81;
|
||||
--gold-color: #F0B90B;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-body);
|
||||
background-color: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
overflow-x: hidden;
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, .navbar-brand {
|
||||
font-family: var(--font-heading);
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
/* Utilities */
|
||||
.text-primary { color: var(--color-primary) !important; }
|
||||
.bg-black { background-color: #000 !important; }
|
||||
.text-white { color: #fff !important; }
|
||||
.shadow-hard { box-shadow: var(--shadow-hard); }
|
||||
.border-2-black { border: var(--border-width) solid #000; }
|
||||
.py-section { padding-top: 5rem; padding-bottom: 5rem; }
|
||||
|
||||
/* Navbar */
|
||||
.navbar {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: var(--border-width) solid transparent;
|
||||
transition: all 0.3s;
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
background-color: var(--nav-bg);
|
||||
padding: 0 1.5rem;
|
||||
height: 64px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.navbar.scrolled {
|
||||
border-bottom-color: #000;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
.nav-links {
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
.nav-links a {
|
||||
color: var(--text-color);
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--color-text);
|
||||
margin-left: 1rem;
|
||||
transition: color 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.nav-link-icon {
|
||||
margin-right: 6px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Colorful Menu Icons */
|
||||
.fa-home { color: #5d5dff; }
|
||||
.fa-chart-line { color: #00e676; }
|
||||
.fa-coins { color: #ffd600; }
|
||||
.fa-file-contract { color: #ff3d00; }
|
||||
.fa-bolt { color: #fbc02d; }
|
||||
.fa-pickaxe { color: #8e24aa; }
|
||||
.fa-wallet { color: #03a9f4; }
|
||||
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.nav-link:hover, .nav-link.active {
|
||||
color: var(--color-primary);
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #1E2329;
|
||||
min-width: 180px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
|
||||
z-index: 1;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
top: 100%;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
font-weight: 700;
|
||||
font-family: var(--font-heading);
|
||||
padding: 0.8rem 2rem;
|
||||
border-radius: var(--radius-pill);
|
||||
border: var(--border-width) solid #000;
|
||||
transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
|
||||
box-shadow: var(--shadow-hard);
|
||||
.dropdown:hover .dropdown-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translate(-2px, -2px);
|
||||
box-shadow: var(--shadow-hover);
|
||||
.dropdown-content a {
|
||||
color: white;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: translate(2px, 2px);
|
||||
box-shadow: 0 0 0 #000;
|
||||
.dropdown-content a:hover {
|
||||
background-color: #2B3139;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--color-primary);
|
||||
border-color: #000;
|
||||
color: #fff;
|
||||
background-color: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #1d4ed8;
|
||||
border-color: #000;
|
||||
color: #fff;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.btn-outline-dark {
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-cta {
|
||||
background-color: var(--color-accent);
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-cta:hover {
|
||||
background-color: #8cc629;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
/* Hero & Carousel */
|
||||
.hero-section {
|
||||
min-height: 100vh;
|
||||
padding-top: 80px;
|
||||
}
|
||||
|
||||
.background-blob {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
opacity: 0.6;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.blob-1 {
|
||||
top: -10%;
|
||||
right: -10%;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
background: radial-gradient(circle, var(--color-accent), transparent);
|
||||
}
|
||||
|
||||
.blob-2 {
|
||||
bottom: 10%;
|
||||
left: -10%;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
background: radial-gradient(circle, var(--color-primary), transparent);
|
||||
}
|
||||
|
||||
.highlight-text {
|
||||
background: linear-gradient(120deg, transparent 0%, transparent 40%, var(--color-accent) 40%, var(--color-accent) 100%);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 40%;
|
||||
background-position: 0 88%;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.dot { color: var(--color-primary); }
|
||||
|
||||
.badge-pill {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 2px solid #000;
|
||||
border-radius: 50px;
|
||||
font-weight: 700;
|
||||
background: #fff;
|
||||
box-shadow: 4px 4px 0 #000;
|
||||
font-family: var(--font-heading);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Marquee */
|
||||
.marquee-container {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
border-top: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
}
|
||||
|
||||
.rotate-divider {
|
||||
transform: rotate(-2deg) scale(1.05);
|
||||
z-index: 10;
|
||||
position: relative;
|
||||
margin-top: -50px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.marquee-content {
|
||||
display: inline-block;
|
||||
animation: marquee 20s linear infinite;
|
||||
font-family: var(--font-heading);
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
@keyframes marquee {
|
||||
0% { transform: translateX(0); }
|
||||
100% { transform: translateX(-50%); }
|
||||
}
|
||||
|
||||
/* Portfolio Cards */
|
||||
.project-card {
|
||||
border: 2px solid #000;
|
||||
border-radius: var(--radius-card);
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
transition: transform 0.3s ease;
|
||||
box-shadow: var(--shadow-hard);
|
||||
height: 100%;
|
||||
padding: 80px 5%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4rem;
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.project-card:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 8px 8px 0 #000;
|
||||
.hero-content { flex: 1; }
|
||||
.hero-image { flex: 1; position: relative; }
|
||||
|
||||
.hero-carousel {
|
||||
width: 100%;
|
||||
height: 350px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.card-img-holder {
|
||||
height: 250px;
|
||||
.carousel-inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carousel-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
transition: opacity 1s ease-in-out;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.carousel-item.active { opacity: 1; }
|
||||
|
||||
.carousel-caption {
|
||||
background: rgba(0,0,0,0.6);
|
||||
padding: 15px 25px;
|
||||
border-radius: 8px;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
.section-title {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.market-table-card {
|
||||
background: var(--card-bg);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.market-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.market-table th, .market-table td {
|
||||
padding: 16px 24px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.market-table th {
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Why Choose Us */
|
||||
.why-section {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
margin: 80px auto;
|
||||
max-width: 1200px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.why-left { flex: 1.5; }
|
||||
.why-right { flex: 1; background: var(--card-bg); padding: 40px; border-radius: 20px; border: 1px solid var(--border-color); }
|
||||
|
||||
.why-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.why-item {
|
||||
background: var(--card-bg);
|
||||
padding: 30px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.why-icon {
|
||||
font-size: 40px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* Partners */
|
||||
.partners-section {
|
||||
padding: 80px 5%;
|
||||
background: #0d1117;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.partners-grid {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 40px;
|
||||
margin-top: 40px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.partner-logo {
|
||||
height: 40px;
|
||||
filter: grayscale(1);
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.partner-logo:hover {
|
||||
filter: grayscale(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Floating Service */
|
||||
.floating-service {
|
||||
position: fixed;
|
||||
bottom: 30px;
|
||||
right: 30px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background: var(--primary-color);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 2px solid #000;
|
||||
position: relative;
|
||||
font-size: 4rem;
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 10px 25px rgba(0,82,255,0.3);
|
||||
z-index: 1000;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.placeholder-art {
|
||||
transition: transform 0.3s ease;
|
||||
.floating-service:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.project-card:hover .placeholder-art {
|
||||
transform: scale(1.2) rotate(10deg);
|
||||
}
|
||||
|
||||
.bg-soft-blue { background-color: #e0f2fe; }
|
||||
.bg-soft-green { background-color: #dcfce7; }
|
||||
.bg-soft-purple { background-color: #f3e8ff; }
|
||||
.bg-soft-yellow { background-color: #fef9c3; }
|
||||
|
||||
.category-tag {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 5px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.card-body { padding: 1.5rem; }
|
||||
|
||||
.link-arrow {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
/* Back Button */
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-top: auto;
|
||||
gap: 8px;
|
||||
color: var(--text-muted);
|
||||
text-decoration: none;
|
||||
margin-bottom: 20px;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.link-arrow i { transition: transform 0.2s; margin-left: 5px; }
|
||||
.link-arrow:hover i { transform: translateX(5px); }
|
||||
|
||||
/* About */
|
||||
.about-image-stack {
|
||||
position: relative;
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
.back-btn:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.stack-card {
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
border-radius: var(--radius-card);
|
||||
border: 2px solid #000;
|
||||
box-shadow: var(--shadow-hard);
|
||||
left: 10%;
|
||||
transform: rotate(-3deg);
|
||||
background-size: cover;
|
||||
/* Trading Pages specific */
|
||||
.trading-container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 320px 320px;
|
||||
height: calc(100vh - 64px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.form-control {
|
||||
border: 2px solid #000;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
font-weight: 500;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
.chart-area { flex: 1; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
|
||||
.orderbook-area { width: 320px; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
|
||||
.trade-area { width: 320px; padding: 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
|
||||
|
||||
.form-control:focus {
|
||||
box-shadow: 4px 4px 0 var(--color-primary);
|
||||
border-color: #000;
|
||||
background: #fff;
|
||||
}
|
||||
.trade-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 15px; }
|
||||
.trade-tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; color: var(--text-muted); }
|
||||
.trade-tab.active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }
|
||||
|
||||
/* Animations */
|
||||
.animate-up {
|
||||
opacity: 0;
|
||||
transform: translateY(30px);
|
||||
animation: fadeUp 0.8s ease forwards;
|
||||
}
|
||||
.input-group { margin-bottom: 15px; }
|
||||
.input-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; display: flex; justify-content: space-between; }
|
||||
.trade-input-wrapper { background: #2b3139; border-radius: 4px; display: flex; align-items: center; padding: 0 12px; border: 1px solid transparent; }
|
||||
.trade-input-wrapper:focus-within { border-color: var(--primary-color); }
|
||||
.trade-input { background: transparent; border: none; color: white; padding: 10px 0; width: 100%; outline: none; font-size: 14px; }
|
||||
|
||||
.delay-100 { animation-delay: 0.1s; }
|
||||
.delay-200 { animation-delay: 0.2s; }
|
||||
.slider-container { margin: 20px 0; }
|
||||
.slider { width: 100%; cursor: pointer; }
|
||||
|
||||
@keyframes fadeUp {
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Social */
|
||||
.social-links a {
|
||||
transition: transform 0.2s;
|
||||
display: inline-block;
|
||||
}
|
||||
.social-links a:hover {
|
||||
transform: scale(1.2) rotate(10deg);
|
||||
color: var(--color-accent) !important;
|
||||
}
|
||||
.btn-buy { background: var(--success-color); color: white; width: 100%; padding: 12px; border-radius: 4px; border: none; font-weight: bold; cursor: pointer; }
|
||||
.btn-sell { background: var(--danger-color); color: white; width: 100%; padding: 12px; border-radius: 4px; border: none; font-weight: bold; cursor: pointer; }
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 991px) {
|
||||
.rotate-divider {
|
||||
transform: rotate(0);
|
||||
margin-top: 0;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding-top: 120px;
|
||||
text-align: center;
|
||||
min-height: auto;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.display-1 { font-size: 3.5rem; }
|
||||
|
||||
.blob-1 { width: 300px; height: 300px; right: -20%; }
|
||||
.blob-2 { width: 300px; height: 300px; left: -20%; }
|
||||
}
|
||||
@media (max-width: 992px) {
|
||||
.hero-section { flex-direction: column; text-align: center; }
|
||||
.why-section { flex-direction: column; }
|
||||
.trading-container { grid-template-columns: 1fr; height: auto; }
|
||||
.orderbook-area, .trade-area { width: 100%; }
|
||||
}
|
||||
45
careers.php
Normal file
45
careers.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<div class="container" style="max-width: 1000px; margin: 60px auto; padding: 0 20px;">
|
||||
<h1 style="font-size: 3rem; margin-bottom: 20px; text-align: center;"><?php echo __('careers'); ?></h1>
|
||||
<p style="text-align: center; color: var(--text-muted); font-size: 1.2rem; margin-bottom: 60px;">Help us build the future of financial freedom.</p>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px;">
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<div style="color: var(--primary-color); font-size: 24px; margin-bottom: 15px;"><i class="fas fa-code"></i></div>
|
||||
<h3 style="margin-bottom: 10px;">Senior Backend Engineer</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin-bottom: 20px;">Scale our high-performance trading engine and core financial infrastructure.</p>
|
||||
<div style="display: flex; gap: 10px; font-size: 12px;">
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Remote</span>
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Full-time</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<div style="color: var(--success-color); font-size: 24px; margin-bottom: 15px;"><i class="fas fa-paint-brush"></i></div>
|
||||
<h3 style="margin-bottom: 10px;">Product Designer</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin-bottom: 20px;">Design intuitive and beautiful experiences for millions of crypto users.</p>
|
||||
<div style="display: flex; gap: 10px; font-size: 12px;">
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Remote</span>
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Full-time</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<div style="color: #f0b90b; font-size: 24px; margin-bottom: 15px;"><i class="fas fa-headset"></i></div>
|
||||
<h3 style="margin-bottom: 10px;">Customer Success Manager</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin-bottom: 20px;">Ensure our global users have a world-class support experience.</p>
|
||||
<div style="display: flex; gap: 10px; font-size: 12px;">
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Hybrid</span>
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Full-time</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<div style="color: #ff3d00; font-size: 24px; margin-bottom: 15px;"><i class="fas fa-shield-alt"></i></div>
|
||||
<h3 style="margin-bottom: 10px;">Security Specialist</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin-bottom: 20px;">Protect user assets and maintain the integrity of our platform.</p>
|
||||
<div style="display: flex; gap: 10px; font-size: 12px;">
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Remote</span>
|
||||
<span style="background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 4px;">Full-time</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
90
chat.php
Normal file
90
chat.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
echo "<script>location.href='login.php';</script>";
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
// Handle message sending
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['message'])) {
|
||||
$msg = trim($_POST['message']);
|
||||
if ($msg !== '') {
|
||||
$stmt = db()->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'user', ?)");
|
||||
$stmt->execute([$user_id, $msg]);
|
||||
}
|
||||
header("Location: chat.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Fetch messages
|
||||
$stmt = db()->prepare("SELECT * FROM messages WHERE user_id = ? ORDER BY created_at ASC");
|
||||
$stmt->execute([$user_id]);
|
||||
$messages = $stmt->fetchAll();
|
||||
|
||||
// Mark admin messages as read
|
||||
$stmt = db()->prepare("UPDATE messages SET is_read = 1 WHERE user_id = ? AND sender = 'admin'");
|
||||
$stmt->execute([$user_id]);
|
||||
?>
|
||||
|
||||
<div class="container" style="max-width: 800px; margin: 40px auto; padding: 0 20px;">
|
||||
<div class="card" style="background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; display: flex; flex-direction: column; height: 600px;">
|
||||
<div class="card-header" style="padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 15px;">
|
||||
<div style="width: 40px; height: 40px; background: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="fas fa-headset"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0; font-size: 18px;"><?php echo __('customer_service', 'Online Support'); ?></h3>
|
||||
<span style="font-size: 12px; color: var(--success-color);"><i class="fas fa-circle" style="font-size: 8px;"></i> Online</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="chat-box" style="flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth;">
|
||||
<?php if (empty($messages)): ?>
|
||||
<div style="text-align: center; color: var(--text-muted); margin-top: 50px;">
|
||||
<i class="fas fa-comments" style="font-size: 48px; opacity: 0.2; margin-bottom: 15px;"></i>
|
||||
<p><?php echo __('chat_welcome', 'Hello! How can we help you today?'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($messages as $m): ?>
|
||||
<div style="display: flex; flex-direction: column; align-items: <?php echo $m['sender'] === 'user' ? 'flex-end' : 'flex-start'; ?>;">
|
||||
<div style="max-width: 70%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5;
|
||||
<?php echo $m['sender'] === 'user' ? 'background: var(--primary-color); color: white; border-bottom-right-radius: 2px;' : 'background: #2b3139; color: white; border-bottom-left-radius: 2px;'; ?>">
|
||||
<?php echo nl2br(htmlspecialchars($m['message'])); ?>
|
||||
</div>
|
||||
<span style="font-size: 10px; color: var(--text-muted); margin-top: 4px;"><?php echo date('H:i', strtotime($m['created_at'])); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class="chat-input" style="padding: 20px; border-top: 1px solid var(--border-color);">
|
||||
<form method="POST" style="display: flex; gap: 10px;">
|
||||
<input type="text" name="message" autocomplete="off" placeholder="<?php echo __('type_message', 'Type your message...'); ?>"
|
||||
style="flex: 1; background: #2b3139; border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 15px; color: white; outline: none;">
|
||||
<button type="submit" class="btn-primary" style="padding: 0 25px; border-radius: 8px;">
|
||||
<i class="fas fa-paper-plane"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const chatBox = document.getElementById('chat-box');
|
||||
chatBox.scrollTop = chatBox.scrollHeight;
|
||||
|
||||
// Auto refresh chat
|
||||
setInterval(() => {
|
||||
fetch('api/get_messages.php')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.count > <?php echo count($messages); ?>) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
87
convert.php
Normal file
87
convert.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<main style="padding: 60px 20px; background: #0b0e11; min-height: calc(100vh - 60px);">
|
||||
<div style="max-width: 500px; margin: 0 auto; background: #1e2329; padding: 40px; border-radius: 20px; border: 1px solid #2b3139;">
|
||||
<h2 style="margin-bottom: 30px; text-align: center; color: white;"><?php echo __('nav_convert'); ?></h2>
|
||||
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="color: #848e9c; font-size: 0.9rem; margin-bottom: 10px; display: block;">From</label>
|
||||
<div style="display: flex; align-items: center; background: #0b0e11; padding: 15px; border-radius: 12px; border: 1px solid #2b3139;">
|
||||
<input type="number" id="from-amount" value="100" style="flex: 1; background: transparent; border: none; color: white; font-size: 1.5rem; font-weight: bold; outline: none;">
|
||||
<div style="display: flex; align-items: center; gap: 8px; background: #1e2329; padding: 5px 12px; border-radius: 20px; cursor: pointer;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/usdt.png" width="24">
|
||||
<span style="font-weight: bold; color: white;">USDT</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 8px; color: #848e9c; font-size: 0.8rem; display: flex; justify-content: space-between;">
|
||||
<span>Available: 0.00 USDT</span>
|
||||
<span style="color: var(--primary-color); cursor: pointer;">Max</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin: -10px 0 15px;">
|
||||
<div style="width: 40px; height: 40px; background: #1e2329; border: 1px solid #2b3139; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-color); cursor: pointer;">
|
||||
<i class="fas fa-exchange-alt fa-rotate-90"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="color: #848e9c; font-size: 0.9rem; margin-bottom: 10px; display: block;">To</label>
|
||||
<div style="display: flex; align-items: center; background: #0b0e11; padding: 15px; border-radius: 12px; border: 1px solid #2b3139;">
|
||||
<input type="number" id="to-amount" readonly style="flex: 1; background: transparent; border: none; color: white; font-size: 1.5rem; font-weight: bold; outline: none;">
|
||||
<select id="target-crypto" onchange="updateConvert()" style="background: #1e2329; border: none; color: white; padding: 5px 10px; border-radius: 20px; font-weight: bold; cursor: pointer; outline: none;">
|
||||
<option value="BTC">BTC</option>
|
||||
<option value="ETH">ETH</option>
|
||||
<option value="SOL">SOL</option>
|
||||
<option value="BNB">BNB</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="rate-display" style="margin-top: 8px; color: #848e9c; font-size: 0.8rem; text-align: center;">
|
||||
1 USDT ≈ --.--- BTC
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn-primary" style="width: 100%; padding: 16px; font-size: 1.1rem; font-weight: bold; border-radius: 12px; margin-bottom: 20px;">Preview Conversion</button>
|
||||
|
||||
<div style="background: rgba(240, 185, 11, 0.05); border: 1px solid rgba(240, 185, 11, 0.1); padding: 15px; border-radius: 10px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px; color: #F0B90B; font-size: 0.85rem;">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<span>Zero fees, instant settlement.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const prices = {};
|
||||
const symbols = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT'];
|
||||
|
||||
const ws = new WebSocket('wss://stream.binance.com:9443/ws/' + symbols.map(s => s.toLowerCase() + '@ticker').join('/'));
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
prices[data.s.replace('USDT', '')] = parseFloat(data.c);
|
||||
updateConvert();
|
||||
};
|
||||
|
||||
const fromInput = document.getElementById('from-amount');
|
||||
const toInput = document.getElementById('to-amount');
|
||||
const targetSelect = document.getElementById('target-crypto');
|
||||
const rateDisplay = document.getElementById('rate-display');
|
||||
|
||||
function updateConvert() {
|
||||
const fromVal = parseFloat(fromInput.value) || 0;
|
||||
const target = targetSelect.value;
|
||||
const price = prices[target];
|
||||
|
||||
if (price) {
|
||||
const result = fromVal / price;
|
||||
toInput.value = result.toFixed(8);
|
||||
rateDisplay.innerText = `1 USDT ≈ ${(1/price).toFixed(8)} ${target}`;
|
||||
}
|
||||
}
|
||||
|
||||
fromInput.oninput = updateConvert;
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
186
deposit.php
Normal file
186
deposit.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$fiat_currencies = [
|
||||
'USD' => ['name' => 'US Dollar', 'rate' => 1.00],
|
||||
'EUR' => ['name' => 'Euro', 'rate' => 0.92],
|
||||
'GBP' => ['name' => 'British Pound', 'rate' => 0.79],
|
||||
'CNY' => ['name' => 'Chinese Yuan', 'rate' => 7.23],
|
||||
'HKD' => ['name' => 'Hong Kong Dollar', 'rate' => 7.82],
|
||||
'JPY' => ['name' => 'Japanese Yen', 'rate' => 151.45],
|
||||
'KRW' => ['name' => 'Korean Won', 'rate' => 1350.20],
|
||||
'SGD' => ['name' => 'Singapore Dollar', 'rate' => 1.35],
|
||||
'TWD' => ['name' => 'Taiwan Dollar', 'rate' => 32.10],
|
||||
'THB' => ['name' => 'Thai Baht', 'rate' => 36.50],
|
||||
'VND' => ['name' => 'Vietnamese Dong', 'rate' => 24800],
|
||||
'IDR' => ['name' => 'Indonesian Rupiah', 'rate' => 15850],
|
||||
'MYR' => ['name' => 'Malaysian Ringgit', 'rate' => 4.74],
|
||||
];
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
|
||||
<div style="max-width: 1000px; margin: 0 auto;">
|
||||
|
||||
<a href="profile.php" class="back-btn"><i class="fas fa-arrow-left"></i> <?php echo __('nav_profile'); ?></a>
|
||||
|
||||
<div style="margin-bottom: 40px;">
|
||||
<h1 style="font-size: 2.5rem; font-weight: bold; margin-bottom: 10px;"><?php echo __('deposit_assets'); ?></h1>
|
||||
<p style="color: var(--text-muted);"><?php echo __('deposit_method_tip'); ?></p>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 40px;">
|
||||
<div id="card-fiat" style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 2px solid var(--primary-color); cursor: pointer;" onclick="switchMethod('fiat')">
|
||||
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 25px;">
|
||||
<div style="width: 60px; height: 60px; background: rgba(0, 82, 255, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 24px;">
|
||||
<i class="fas fa-university"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0;"><?php echo __('fiat_deposit'); ?></h3>
|
||||
<p style="margin: 5px 0 0; color: var(--text-muted); font-size: 14px;"><?php echo __('bank_transfer'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 13px; line-height: 2;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;"><i class="fas fa-check-circle" style="color: var(--success-color); font-size: 12px;"></i> Support 20+ Global Currencies</div>
|
||||
<div style="display: flex; align-items: center; gap: 10px;"><i class="fas fa-check-circle" style="color: var(--success-color); font-size: 12px;"></i> Secure Bank-Grade Processing</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="card-usdt" style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 2px solid transparent; cursor: pointer;" onclick="switchMethod('usdt')">
|
||||
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 25px;">
|
||||
<div style="width: 60px; height: 60px; background: rgba(14, 203, 129, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--success-color); font-size: 24px;">
|
||||
<i class="fas fa-coins"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin: 0;"><?php echo __('crypto_deposit'); ?></h3>
|
||||
<p style="margin: 5px 0 0; color: var(--text-muted); font-size: 14px;">Blockchain Transfer</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 13px; line-height: 2;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;"><i class="fas fa-check-circle" style="color: var(--success-color); font-size: 12px;"></i> USDT (TRC20, ERC20, BEP20)</div>
|
||||
<div style="display: flex; align-items: center; gap: 10px;"><i class="fas fa-check-circle" style="color: var(--success-color); font-size: 12px;"></i> Low Service Fees</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="fiat-section" style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color);">
|
||||
<form action="matching.php" method="POST" id="fiat-form">
|
||||
<input type="hidden" name="type" value="fiat">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;"><?php echo __('select_currency'); ?></label>
|
||||
<select name="currency" id="currency-select" style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none;">
|
||||
<?php foreach ($fiat_currencies as $code => $info): ?>
|
||||
<option value="<?php echo $code; ?>" data-rate="<?php echo $info['rate']; ?>"><?php echo $code; ?> - <?php echo $info['name']; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;"><?php echo __('deposit_amount'); ?></label>
|
||||
<input type="number" name="amount" id="amount-input" placeholder="Min. 100" required style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1.2rem; font-weight: bold; outline: none;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="rate-display" style="padding: 20px; background: #161a1e; border-radius: 12px; border: 1px dashed var(--border-color); margin-bottom: 30px; display: flex; justify-content: space-between; align-items: center;">
|
||||
<div style="color: var(--text-muted); font-size: 14px;">Current Exchange Rate (USDT)</div>
|
||||
<div style="font-weight: bold; font-size: 1.1rem;"><span id="rate-value">7.23</span> <span id="rate-currency">CNY</span> = 1 USDT</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 30px; padding: 25px; background: rgba(0,82,255,0.03); border-radius: 16px; border: 1px solid rgba(0,82,255,0.1); margin-bottom: 30px;">
|
||||
<div style="display: flex; align-items: center; gap: 10px; color: var(--primary-color); margin-bottom: 10px; font-weight: bold;">
|
||||
<i class="fas fa-info-circle"></i> Instructions
|
||||
</div>
|
||||
<p style="color: var(--text-muted); font-size: 14px; margin: 0; line-height: 1.6;">
|
||||
Please complete the payment within the time limit after matching. Once submitted, our customer service will verify your deposit.
|
||||
</p>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 12px;">Continue to Match Account</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="usdt-section" style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); display: none;">
|
||||
<form action="matching.php" method="POST">
|
||||
<input type="hidden" name="type" value="usdt">
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 15px; color: var(--text-muted); font-size: 14px;">Select Network</label>
|
||||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;">
|
||||
<label class="network-label active">
|
||||
<input type="radio" name="network" value="TRC20" checked style="display: none;">
|
||||
<div style="font-weight: bold;">TRC20</div>
|
||||
<div style="font-size: 11px; opacity: 0.7; margin-top: 4px;">≈ 2 Mins</div>
|
||||
</label>
|
||||
<label class="network-label">
|
||||
<input type="radio" name="network" value="ERC20" style="display: none;">
|
||||
<div style="font-weight: bold;">ERC20</div>
|
||||
<div style="font-size: 11px; opacity: 0.7; margin-top: 4px;">≈ 5 Mins</div>
|
||||
</label>
|
||||
<label class="network-label">
|
||||
<input type="radio" name="network" value="BEP20" style="display: none;">
|
||||
<div style="font-weight: bold;">BEP20</div>
|
||||
<div style="font-size: 11px; opacity: 0.7; margin-top: 4px;">≈ 1 Min</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 35px;">
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">Deposit Amount (USDT)</label>
|
||||
<input type="number" name="amount" placeholder="Min. 10" required style="width: 100%; padding: 15px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1.2rem; font-weight: bold; outline: none;">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 12px; background: var(--success-color);">Get Address</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.network-label { padding: 20px; background: #161a1e; border: 1px solid var(--border-color); border-radius: 16px; cursor: pointer; text-align: center; transition: 0.2s; }
|
||||
.network-label.active { border-color: var(--success-color); background: rgba(14,203,129,0.05); color: var(--success-color); }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function switchMethod(method) {
|
||||
if(method === 'fiat') {
|
||||
document.getElementById('fiat-section').style.display = 'block';
|
||||
document.getElementById('usdt-section').style.display = 'none';
|
||||
document.getElementById('card-fiat').style.borderColor = 'var(--primary-color)';
|
||||
document.getElementById('card-usdt').style.borderColor = 'transparent';
|
||||
} else {
|
||||
document.getElementById('fiat-section').style.display = 'none';
|
||||
document.getElementById('usdt-section').style.display = 'block';
|
||||
document.getElementById('card-fiat').style.borderColor = 'transparent';
|
||||
document.getElementById('card-usdt').style.borderColor = 'var(--success-color)';
|
||||
}
|
||||
}
|
||||
|
||||
const select = document.getElementById('currency-select');
|
||||
const rateVal = document.getElementById('rate-value');
|
||||
const rateCur = document.getElementById('rate-currency');
|
||||
|
||||
select.onchange = function() {
|
||||
const option = this.options[this.selectedIndex];
|
||||
const rate = option.getAttribute('data-rate');
|
||||
rateVal.innerText = rate;
|
||||
rateCur.innerText = this.value;
|
||||
};
|
||||
select.onchange();
|
||||
|
||||
document.querySelectorAll('.network-label').forEach(label => {
|
||||
label.onclick = function() {
|
||||
document.querySelectorAll('.network-label').forEach(l => l.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
this.querySelector('input').checked = true;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
98
footer.php
Normal file
98
footer.php
Normal file
@ -0,0 +1,98 @@
|
||||
<footer style="margin-top: 100px; background: #0b0e11; border-top: 1px solid var(--border-color); padding: 80px 5% 40px;">
|
||||
<div style="max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px;">
|
||||
<div class="col">
|
||||
<div class="logo-text" style="margin-bottom: 1.5rem;"><div class="logo-box">O</div>EXCHANGE</div>
|
||||
<p style="color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 1.5rem;"><?php echo __('footer_desc'); ?></p>
|
||||
<div style="display: flex; gap: 1.2rem; font-size: 1.2rem;">
|
||||
<a href="#" style="color: var(--text-muted); transition: color 0.3s;" onmouseover="this.style.color='#1DA1F2'" onmouseout="this.style.color='var(--text-muted)'"><i class="fab fa-twitter"></i></a>
|
||||
<a href="#" style="color: var(--text-muted); transition: color 0.3s;" onmouseover="this.style.color='#0088cc'" onmouseout="this.style.color='var(--text-muted)'"><i class="fab fa-telegram"></i></a>
|
||||
<a href="#" style="color: var(--text-muted); transition: color 0.3s;" onmouseover="this.style.color='#4267B2'" onmouseout="this.style.color='var(--text-muted)'"><i class="fab fa-facebook"></i></a>
|
||||
<a href="#" style="color: var(--text-muted); transition: color 0.3s;" onmouseover="this.style.color='#7289da'" onmouseout="this.style.color='var(--text-muted)'"><i class="fab fa-discord"></i></a>
|
||||
<a href="#" style="color: var(--text-muted); transition: color 0.3s;" onmouseover="this.style.color='#E1306C'" onmouseout="this.style.color='var(--text-muted)'"><i class="fab fa-instagram"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h4 style="font-size: 18px; margin-bottom: 25px; color: white;"><?php echo __('about'); ?></h4>
|
||||
<div style="display: flex; flex-direction: column; gap: 12px;">
|
||||
<a href="about.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-info-circle" style="width: 16px; color: #4facfe;"></i> <?php echo __('about_us'); ?>
|
||||
</a>
|
||||
<a href="careers.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-briefcase" style="width: 16px; color: #00f2fe;"></i> <?php echo __('careers'); ?>
|
||||
</a>
|
||||
<a href="news.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-newspaper" style="width: 16px; color: #4facfe;"></i> <?php echo __('news'); ?>
|
||||
</a>
|
||||
<a href="privacy.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-user-shield" style="width: 16px; color: #00f2fe;"></i> <?php echo __('legal_privacy'); ?>
|
||||
</a>
|
||||
<a href="terms.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-file-contract" style="width: 16px; color: #4facfe;"></i> <?php echo __('terms_service'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h4 style="font-size: 18px; margin-bottom: 25px; color: white;"><?php echo __('products'); ?></h4>
|
||||
<div style="display: flex; flex-direction: column; gap: 12px;">
|
||||
<a href="spot.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-coins" style="width: 16px; color: #f0b90b;"></i> <?php echo __('spot_trading'); ?>
|
||||
</a>
|
||||
<a href="futures.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-file-contract" style="width: 16px; color: #f0b90b;"></i> <?php echo __('futures_trading'); ?>
|
||||
</a>
|
||||
<a href="convert.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-bolt" style="width: 16px; color: #f0b90b;"></i> <?php echo __('flash_swap'); ?>
|
||||
</a>
|
||||
<a href="mining.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-pickaxe" style="width: 16px; color: #f0b90b;"></i> <?php echo __('staking'); ?>
|
||||
</a>
|
||||
<a href="profile.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-wallet" style="width: 16px; color: #f0b90b;"></i> <?php echo __('asset_management'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<h4 style="font-size: 18px; margin-bottom: 25px; color: white;"><?php echo __('support'); ?></h4>
|
||||
<div style="display: flex; flex-direction: column; gap: 12px;">
|
||||
<a href="help.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-question-circle" style="width: 16px; color: #00c087;"></i> <?php echo __('help_center'); ?>
|
||||
</a>
|
||||
<a href="request.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-paper-plane" style="width: 16px; color: #00c087;"></i> <?php echo __('submit_request'); ?>
|
||||
</a>
|
||||
<a href="api-docs.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-code" style="width: 16px; color: #00c087;"></i> <?php echo __('api_docs'); ?>
|
||||
</a>
|
||||
<a href="fees.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-percentage" style="width: 16px; color: #00c087;"></i> <?php echo __('fee_schedule'); ?>
|
||||
</a>
|
||||
<a href="status.php" style="display: flex; align-items: center; gap: 10px; color: var(--text-muted); text-decoration: none; font-size: 14px;">
|
||||
<i class="fas fa-server" style="width: 16px; color: #00c087;"></i> <?php echo __('service_status'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="max-width: 1200px; margin: 60px auto 0; padding-top: 30px; border-top: 1px solid #1e2329; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;">
|
||||
<div style="color: var(--text-muted); font-size: 13px;">
|
||||
© 2017-2026 EXCHANGE.COM <?php echo __('all_rights_reserved'); ?>
|
||||
</div>
|
||||
<div style="display: flex; gap: 20px; color: var(--text-muted); font-size: 13px;">
|
||||
<div style="display: flex; align-items: center; gap: 8px; color: var(--success-color);">
|
||||
<i class="fas fa-check-circle"></i> <?php echo __('system_status_normal'); ?>
|
||||
</div>
|
||||
<span><?php echo __('cookie_policy'); ?></span>
|
||||
<span><?php echo __('security'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<style>
|
||||
footer a:hover { color: white !important; }
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
222
futures.php
Normal file
222
futures.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
session_start();
|
||||
include 'header.php';
|
||||
require_once 'db/config.php';
|
||||
|
||||
$user_id = $_SESSION['user_id'] ?? null;
|
||||
$balance = 0;
|
||||
if ($user_id) {
|
||||
$stmt = db()->prepare("SELECT balance FROM users WHERE id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$user = $stmt->fetch();
|
||||
$balance = $user['balance'] ?? 0;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="futures-trading-layout" style="display: grid; grid-template-columns: 280px 1fr 300px 300px; height: calc(100vh - 64px); background: #0b0e11; overflow: hidden; color: #EAECEF;">
|
||||
|
||||
<!-- Column 1: Pairs List -->
|
||||
<div style="border-right: 1px solid #1e2329; display: flex; flex-direction: column; background: #161a1e;">
|
||||
<div style="padding: 15px; border-bottom: 1px solid #1e2329;">
|
||||
<div style="font-size: 14px; font-weight: bold; margin-bottom: 10px;">Perpetual Contracts</div>
|
||||
<input type="text" id="pair-search" placeholder="Search Markets" style="width: 100%; background: #0b0e11; border: 1px solid #2b3139; color: white; padding: 8px 12px; border-radius: 4px; font-size: 13px;">
|
||||
</div>
|
||||
<div id="pairs-list" style="flex: 1; overflow-y: auto;">
|
||||
<!-- JS Filled -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 2: K-Line & Positions -->
|
||||
<div style="display: flex; flex-direction: column; border-right: 1px solid #1e2329; overflow: hidden;">
|
||||
<!-- Top Info Bar -->
|
||||
<div style="height: 60px; border-bottom: 1px solid #1e2329; display: flex; align-items: center; padding: 0 20px; gap: 30px; background: #161a1e;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<img id="current-icon" src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/btc.png" width="24">
|
||||
<span style="font-weight: bold; font-size: 1.1rem;" id="current-pair">BTC/USDT Perpetual</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<div class="stat-box"><div id="top-price" style="font-weight: bold; color: #00c087;">--.---</div><div style="font-size: 10px; color: #848e9c;">Mark Price</div></div>
|
||||
<div class="stat-box"><div id="top-change" style="font-weight: bold;">--%</div><div style="font-size: 10px; color: #848e9c;">24h Change</div></div>
|
||||
<div class="stat-box"><div id="funding-rate" style="color: #f0b90b;">0.0100%</div><div style="font-size: 10px; color: #848e9c;">Funding / Countdown</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- K-Line -->
|
||||
<div id="tradingview_chart" style="flex: 1;"></div>
|
||||
<!-- Positions/Orders Tabs -->
|
||||
<div style="height: 300px; border-top: 1px solid #1e2329; display: flex; flex-direction: column; background: #161a1e;">
|
||||
<div style="display: flex; border-bottom: 1px solid #1e2329;">
|
||||
<div class="order-tab active" onclick="switchOrderTab(this, 'positions')">Positions(0)</div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'open')">Open Orders(0)</div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'history')">Order History</div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'assets')">Assets</div>
|
||||
</div>
|
||||
<div style="flex: 1; overflow-y: auto; padding: 15px;">
|
||||
<table style="width: 100%; font-size: 12px; color: #848e9c; text-align: left;">
|
||||
<thead>
|
||||
<tr style="border-bottom: 1px solid #1e2329;">
|
||||
<th style="padding-bottom: 8px;">Symbol</th>
|
||||
<th style="padding-bottom: 8px;">Size</th>
|
||||
<th style="padding-bottom: 8px;">Entry Price</th>
|
||||
<th style="padding-bottom: 8px;">Mark Price</th>
|
||||
<th style="padding-bottom: 8px;">Liq. Price</th>
|
||||
<th style="padding-bottom: 8px;">Margin</th>
|
||||
<th style="padding-bottom: 8px;">PNL (ROE%)</th>
|
||||
<th style="padding-bottom: 8px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="positions-list-body">
|
||||
<tr><td colspan="8" style="text-align: center; padding: 30px; opacity: 0.5;">No active positions</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 3: Futures Order Panel -->
|
||||
<div style="border-right: 1px solid #1e2329; background: #161a1e; display: flex; flex-direction: column; padding: 20px;">
|
||||
<div style="display: flex; gap: 10px; margin-bottom: 15px;">
|
||||
<div style="flex: 1; background: #2b3139; padding: 5px; border-radius: 4px; text-align: center; font-size: 12px; cursor: pointer;">Cross</div>
|
||||
<div style="flex: 1; background: #2b3139; padding: 5px; border-radius: 4px; text-align: center; font-size: 12px; cursor: pointer; color: #f0b90b;">20x</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; background: #2b3139; border-radius: 4px; margin-bottom: 20px;">
|
||||
<button class="trade-type-btn active" style="flex: 1; padding: 8px; border: none; background: transparent; color: white; cursor: pointer;">Open</button>
|
||||
<button class="trade-type-btn" style="flex: 1; padding: 8px; border: none; background: transparent; color: #848e9c; cursor: pointer;">Close</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 10px; font-size: 12px; color: #848e9c; display: flex; justify-content: space-between;">
|
||||
<span>Avbl</span>
|
||||
<span style="color: white;"><?php echo number_format($balance, 2); ?> USDT</span>
|
||||
</div>
|
||||
|
||||
<div class="input-wrap"><span>Price</span><input type="number" id="futures-price" placeholder="Market Price"><span>USDT</span></div>
|
||||
<div class="input-wrap"><span>Size</span><input type="number" id="futures-amount" placeholder="0.00"><span id="f-token">BTC</span></div>
|
||||
|
||||
<div style="margin: 15px 0;"><input type="range" class="slider" style="width: 100%;"></div>
|
||||
|
||||
<div style="display: flex; gap: 10px; margin-top: 10px;">
|
||||
<button class="trade-btn buy" style="flex: 1;" onclick="placeFuturesOrder('buy')">Buy/Long</button>
|
||||
<button class="trade-btn sell" style="flex: 1;" onclick="placeFuturesOrder('sell')">Sell/Short</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px; border-top: 1px solid #2b3139; padding-top: 15px; font-size: 12px; color: #848e9c;">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"><span>Cost</span><span>0.00 USDT</span></div>
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;"><span>Max Open</span><span>0.00 BTC</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 4: Order Book -->
|
||||
<div style="background: #161a1e; display: flex; flex-direction: column;">
|
||||
<div style="padding: 15px; border-bottom: 1px solid #1e2329; font-size: 14px; font-weight: bold;">Order Book</div>
|
||||
<div style="padding: 10px 15px; font-size: 11px; color: #848e9c; display: flex; justify-content: space-between;">
|
||||
<span>Price(USDT)</span>
|
||||
<span>Size(BTC)</span>
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden; display: flex; flex-direction: column;">
|
||||
<div id="asks" style="flex: 1; display: flex; flex-direction: column-reverse; padding: 0 15px; overflow: hidden; font-family: monospace;"></div>
|
||||
<div id="mid-price" style="padding: 12px; text-align: center; font-size: 1.1rem; font-weight: bold; color: #00c087; background: rgba(255,255,255,0.03);">--.---</div>
|
||||
<div id="bids" style="flex: 1; display: flex; flex-direction: column; padding: 0 15px; overflow: hidden; font-family: monospace;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.stat-box { border-left: 1px solid #2b3139; padding-left: 15px; display: flex; flex-direction: column; }
|
||||
.order-tab { padding: 10px 15px; font-size: 12px; color: #848e9c; cursor: pointer; border-bottom: 2px solid transparent; }
|
||||
.order-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
|
||||
.input-wrap { background: #0b0e11; border: 1px solid #2b3139; border-radius: 4px; padding: 8px 12px; display: flex; align-items: center; margin-bottom: 12px; gap: 10px; }
|
||||
.input-wrap span { font-size: 12px; color: #848e9c; white-space: nowrap; width: 45px; }
|
||||
.input-wrap input { background: transparent; border: none; color: white; flex: 1; text-align: right; outline: none; font-weight: bold; }
|
||||
.trade-btn { width: 100%; padding: 12px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; color: white; }
|
||||
.trade-btn.buy { background: #00c087; }
|
||||
.trade-btn.sell { background: #f6465d; }
|
||||
.slider { -webkit-appearance: none; height: 3px; background: #2b3139; border-radius: 2px; }
|
||||
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: white; border-radius: 50%; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
|
||||
<script>
|
||||
let currentSymbol = 'BTCUSDT';
|
||||
let currentPrice = 0;
|
||||
const pairs = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT', 'ADAUSDT', 'DOGEUSDT', 'DOTUSDT'];
|
||||
|
||||
function initChart(symbol) {
|
||||
new TradingView.widget({
|
||||
"width": "100%", "height": "100%", "symbol": "BINANCE:" + symbol, "interval": "15", "timezone": "Etc/UTC", "theme": "dark", "style": "1", "locale": "<?php echo $lang == 'zh' ? 'zh_CN' : 'en'; ?>", "container_id": "tradingview_chart", "backgroundColor": "#0b0e11", "gridColor": "rgba(42, 46, 57, 0.05)", "hide_side_toolbar": false, "allow_symbol_change": false, "save_image": false
|
||||
});
|
||||
}
|
||||
initChart(currentSymbol);
|
||||
|
||||
const ws = new WebSocket('wss://stream.binance.com:9443/ws/' + pairs.map(p => p.toLowerCase() + '@ticker').join('/'));
|
||||
const marketData = {};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
const s = data.s;
|
||||
marketData[s] = data;
|
||||
renderPairsList();
|
||||
|
||||
if (s === currentSymbol) {
|
||||
currentPrice = parseFloat(data.c);
|
||||
document.getElementById('top-price').innerText = currentPrice.toLocaleString();
|
||||
document.getElementById('top-price').style.color = data.P >= 0 ? '#00c087' : '#f6465d';
|
||||
document.getElementById('top-change').innerText = (data.P >= 0 ? '+' : '') + data.P + '%';
|
||||
document.getElementById('top-change').style.color = data.P >= 0 ? '#00c087' : '#f6465d';
|
||||
document.getElementById('mid-price').innerText = currentPrice.toLocaleString();
|
||||
updateOrderBook(currentPrice);
|
||||
}
|
||||
};
|
||||
|
||||
function renderPairsList() {
|
||||
const list = document.getElementById('pairs-list');
|
||||
let html = '';
|
||||
pairs.forEach(p => {
|
||||
const d = marketData[p] || {c: 0, P: 0};
|
||||
const color = d.P >= 0 ? '#00c087' : '#f6465d';
|
||||
const name = p.replace('USDT', '');
|
||||
html += `
|
||||
<div onclick="changePair('${p}')" style="display: flex; justify-content: space-between; padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #1e2329; ${currentSymbol === p ? 'background: #2b3139;' : ''}">
|
||||
<div style="display: flex; gap: 8px; align-items: center;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png" width="18" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<span style="font-weight: bold; font-size: 13px;">${name} Perp</span>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-size: 13px;">${parseFloat(d.c).toLocaleString()}</div>
|
||||
<div style="color: ${color}; font-size: 11px;">${d.P >= 0 ? '+' : ''}${d.P}%</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
list.innerHTML = html;
|
||||
}
|
||||
|
||||
function changePair(pair) {
|
||||
currentSymbol = pair;
|
||||
const name = pair.replace('USDT', '');
|
||||
document.getElementById('current-pair').innerText = name + '/USDT Perpetual';
|
||||
document.getElementById('current-icon').src = `https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png`;
|
||||
document.getElementById('f-token').innerText = name;
|
||||
initChart(pair);
|
||||
renderPairsList();
|
||||
}
|
||||
|
||||
function updateOrderBook(price) {
|
||||
let asksHtml = ''; let bidsHtml = '';
|
||||
for(let i=1; i<=20; i++) {
|
||||
const askPrice = (price + (i * 0.01 * price / 100)).toFixed(2);
|
||||
const bidPrice = (price - (i * 0.01 * price / 100)).toFixed(2);
|
||||
asksHtml += `<div style="display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0;"><span style="color: #f6465d;">${askPrice}</span><span style="color: #848e9c;">${(Math.random()*1).toFixed(4)}</span></div>`;
|
||||
bidsHtml += `<div style="display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0;"><span style="color: #00c087;">${bidPrice}</span><span style="color: #848e9c;">${(Math.random()*1).toFixed(4)}</span></div>`;
|
||||
}
|
||||
document.getElementById('asks').innerHTML = asksHtml;
|
||||
document.getElementById('bids').innerHTML = bidsHtml;
|
||||
}
|
||||
|
||||
async function placeFuturesOrder(side) {
|
||||
const amount = parseFloat(document.getElementById('futures-amount').value);
|
||||
if (!amount) return alert('Please enter amount');
|
||||
alert('Futures order placed: ' + side + ' ' + amount + ' ' + currentSymbol);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
75
header.php
Normal file
75
header.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php require_once 'includes/i18n.php'; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $lang; ?>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>OKX | Leading Crypto Exchange</title>
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<style>
|
||||
.logo-text { font-size: 1.8rem; font-weight: 800; color: white; letter-spacing: -1px; display: flex; align-items: center; gap: 8px; }
|
||||
.logo-box { width: 32px; height: 32px; background: white; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: black; font-weight: 900; font-size: 1.2rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a href="chat.php" class="floating-service" title="Customer Service">
|
||||
<i class="fas fa-headset"></i>
|
||||
</a>
|
||||
|
||||
<nav class="navbar">
|
||||
<div style="display: flex; align-items: center; gap: 2rem;">
|
||||
<a href="index.php" style="text-decoration: none;">
|
||||
<div class="logo-text"><div class="logo-box">O</div>EXCHANGE</div>
|
||||
</a>
|
||||
<div class="nav-links">
|
||||
<a href="index.php"><i class="fas fa-home nav-link-icon"></i><?php echo __('nav_home', '首页'); ?></a>
|
||||
<a href="markets.php"><i class="fas fa-chart-line nav-link-icon"></i><?php echo __('nav_market', '行情'); ?></a>
|
||||
<a href="spot.php"><i class="fas fa-coins nav-link-icon"></i><?php echo __('nav_spot', '现货交易'); ?></a>
|
||||
<a href="futures.php"><i class="fas fa-file-contract nav-link-icon"></i><?php echo __('nav_futures', '合约交易'); ?></a>
|
||||
<a href="convert.php"><i class="fas fa-bolt nav-link-icon"></i><?php echo __('nav_convert', '闪兑'); ?></a>
|
||||
<a href="mining.php"><i class="fas fa-pickaxe nav-link-icon"></i><?php echo __('nav_mining', '挖矿'); ?></a>
|
||||
<a href="profile.php"><i class="fas fa-wallet nav-link-icon"></i><?php echo __('nav_assets', '资产'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; gap: 1.5rem; align-items: center;">
|
||||
<div class="dropdown">
|
||||
<a href="#" style="color: white; display: flex; align-items: center; gap: 5px;">
|
||||
<i class="fas fa-globe"></i>
|
||||
<span style="font-size: 13px;"><?php echo strtoupper($lang); ?></span>
|
||||
</a>
|
||||
<div class="dropdown-content" style="right: 0; min-width: 120px;">
|
||||
<a href="?lang=en" style="display: flex; align-items: center; gap: 10px;">
|
||||
<img src="https://flagcdn.com/w20/us.png" width="20" alt="English"> English
|
||||
</a>
|
||||
<a href="?lang=zh" style="display: flex; align-items: center; gap: 10px;">
|
||||
<img src="https://flagcdn.com/w20/cn.png" width="20" alt="Chinese"> 简体中文
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(isset($_SESSION['user_id'])): ?>
|
||||
<div class="dropdown">
|
||||
<a href="#" style="color: white; display: flex; align-items: center; gap: 8px;">
|
||||
<i class="fas fa-user-circle" style="font-size: 1.5rem;"></i>
|
||||
<i class="fas fa-chevron-down" style="font-size: 10px;"></i>
|
||||
</a>
|
||||
<div class="dropdown-content user-profile-dropdown" style="right: 0;">
|
||||
<div class="user-info-header">
|
||||
<div style="font-weight: bold; margin-bottom: 4px;"><?php echo $_SESSION['username'] ?? 'User'; ?></div>
|
||||
<div class="uid-badge">UID: <?php echo $_SESSION['uid'] ?? '------'; ?></div>
|
||||
</div>
|
||||
<a href="profile.php"><i class="fas fa-id-card" style="color: #4facfe;"></i> <?php echo __('nav_profile', '个人中心'); ?></a>
|
||||
<a href="deposit.php"><i class="fas fa-plus-circle" style="color: #00f2fe;"></i> <?php echo __('nav_deposit', '充值'); ?></a>
|
||||
<a href="logout.php" style="color: var(--danger-color);"><i class="fas fa-sign-out-alt"></i> <?php echo __('nav_logout', '退出登录'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<a href="login.php" style="color: white; text-decoration: none; font-size: 14px;"><?php echo __('nav_login'); ?></a>
|
||||
<a href="register.php" class="btn-primary"><?php echo __('nav_register'); ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</nav>
|
||||
290
includes/i18n.php
Normal file
290
includes/i18n.php
Normal file
@ -0,0 +1,290 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$translations = [
|
||||
'en' => [
|
||||
'nav_home' => 'Home',
|
||||
'nav_market' => 'Markets',
|
||||
'nav_trade' => 'Trade',
|
||||
'nav_spot' => 'Spot',
|
||||
'nav_futures' => 'Futures',
|
||||
'nav_mining' => 'Mining',
|
||||
'nav_convert' => 'Convert',
|
||||
'nav_assets' => 'Assets',
|
||||
'nav_total_assets' => 'Total Assets',
|
||||
'nav_deposit' => 'Deposit',
|
||||
'nav_withdraw' => 'Withdraw',
|
||||
'nav_login' => 'Log In',
|
||||
'nav_register' => 'Sign Up',
|
||||
'nav_profile' => 'Profile',
|
||||
'nav_logout' => 'Log Out',
|
||||
'hero_title' => 'Buy, trade, and hold 350+ cryptocurrencies on Exchange',
|
||||
'hero_subtitle' => 'Join the world\'s largest crypto exchange with the lowest fees and best security.',
|
||||
'btn_start' => 'Get Started',
|
||||
'btn_download' => 'Download App',
|
||||
'download_qr_tip' => 'Download App & Get Up to 50 USDT',
|
||||
'market_trends' => 'Market Trends',
|
||||
'view_more_markets' => 'View More Markets',
|
||||
'why_choose_us' => 'Why Choose Us?',
|
||||
'secure_storage' => 'Secure Storage',
|
||||
'secure_storage_desc' => 'We store the vast majority of the digital assets in secure offline storage.',
|
||||
'protected_insurance' => 'Protected by Insurance',
|
||||
'protected_insurance_desc' => 'Cryptocurrency stored on our servers is covered by our insurance policy.',
|
||||
'industry_best_practices' => 'Industry Best Practices',
|
||||
'industry_best_practices_desc' => 'Exchange supports a variety of the most popular digital currencies.',
|
||||
'platform_desc' => 'Our platform provides a seamless trading experience with advanced features and a robust infrastructure designed for both retail and institutional traders.',
|
||||
'partners' => 'Our Partners',
|
||||
'partners_subtitle' => 'Trusted by world-leading organizations and financial institutions.',
|
||||
'footer_desc' => 'The world\'s leading digital asset trading platform, providing secure and stable trading services for global users.',
|
||||
'about' => 'About',
|
||||
'about_us' => 'About Us',
|
||||
'careers' => 'Careers',
|
||||
'news' => 'News',
|
||||
'legal_privacy' => 'Legal & Privacy',
|
||||
'terms_service' => 'Terms of Service',
|
||||
'products' => 'Products',
|
||||
'spot_trading' => 'Spot Trading',
|
||||
'futures_trading' => 'Futures Trading',
|
||||
'flash_swap' => 'Flash Swap',
|
||||
'staking' => 'Staking',
|
||||
'asset_management' => 'Asset Management',
|
||||
'support' => 'Support',
|
||||
'help_center' => 'Help Center',
|
||||
'submit_request' => 'Submit a Request',
|
||||
'api_docs' => 'API Documentation',
|
||||
'fee_schedule' => 'Fee Schedule',
|
||||
'service_status' => 'Service Status',
|
||||
'all_rights_reserved' => 'ALL RIGHTS RESERVED.',
|
||||
'cookie_policy' => 'Cookie Policy',
|
||||
'security' => 'Security',
|
||||
'system_status_normal' => 'System Status: Normal',
|
||||
'personal_center' => 'Personal Center',
|
||||
'uid' => 'UID',
|
||||
'credit_score' => 'Credit Score',
|
||||
'kyc_status' => 'Identity Verification',
|
||||
'kyc_none' => 'Not Verified',
|
||||
'kyc_pending' => 'Pending Review',
|
||||
'kyc_approved' => 'Verified',
|
||||
'kyc_rejected' => 'Verification Failed',
|
||||
'kyc_submit' => 'Submit Verification',
|
||||
'total_balance' => 'Total Balance',
|
||||
'available_balance' => 'Available',
|
||||
'order_book' => 'Order Book',
|
||||
'trade_panel' => 'Trade Panel',
|
||||
'k_line' => 'K-Line',
|
||||
'open_orders' => 'Open Orders',
|
||||
'order_history' => 'Order History',
|
||||
'trade_history' => 'Trade History',
|
||||
'funds_flow' => 'Funds Flow',
|
||||
'current_positions' => 'Current Positions',
|
||||
'limit' => 'Limit',
|
||||
'market' => 'Market',
|
||||
'price' => 'Price',
|
||||
'amount' => 'Amount',
|
||||
'total' => 'Total',
|
||||
'buy' => 'Buy',
|
||||
'sell' => 'Sell',
|
||||
'leverage' => 'Leverage',
|
||||
'tp_sl' => 'TP/SL',
|
||||
'take_profit' => 'Take Profit',
|
||||
'stop_loss' => 'Stop Loss',
|
||||
'cost' => 'Cost',
|
||||
'open_long' => 'Open Long',
|
||||
'open_short' => 'Open Short',
|
||||
'security_settings' => 'Security Settings',
|
||||
'asset_details' => 'Asset Details',
|
||||
'transaction_records' => 'Transaction Records',
|
||||
'level' => 'Level',
|
||||
'crypto_markets' => 'Crypto Markets',
|
||||
'24h_volume' => '24h Volume',
|
||||
'fear_greed' => 'Fear & Greed Index',
|
||||
'btc_dominance' => 'BTC Dominance',
|
||||
'favorites' => 'Favorites',
|
||||
'all_crypto' => 'All Crypto',
|
||||
'asset' => 'Asset',
|
||||
'24h_high_low' => '24h High/Low',
|
||||
'deposit_assets' => 'Deposit Assets',
|
||||
'deposit_method_tip' => 'Select your preferred method to fund your account.',
|
||||
'fiat_deposit' => 'Fiat Deposit',
|
||||
'crypto_deposit' => 'Crypto Deposit',
|
||||
'bank_transfer' => 'Local Bank Transfer',
|
||||
'blockchain_transfer' => 'Blockchain Transfer',
|
||||
'support_20_global' => 'Support 20+ Global Currencies',
|
||||
'safe_compliant' => 'Safe & Compliant Channel',
|
||||
'fast_processing' => '24/7 Fast Processing',
|
||||
'no_service_fee' => 'No Service Fee',
|
||||
'select_currency' => 'Select Currency',
|
||||
'deposit_amount' => 'Deposit Amount',
|
||||
'matching_instructions' => 'Matching Instructions',
|
||||
'matching_tip' => 'Our intelligent matching system will pair you with a verified merchant. After confirming, you will receive the bank account details. Please complete the transfer within the time limit.',
|
||||
'match_now' => 'Match Merchant Now',
|
||||
'select_network' => 'Select Network',
|
||||
'get_address' => 'Get Deposit Address',
|
||||
'withdraw_assets' => 'Withdraw Assets',
|
||||
'withdraw_tip' => 'Securely withdraw USDT to your external wallet.',
|
||||
'withdraw_address' => 'Withdrawal Address',
|
||||
'trading_password' => 'Trading Password',
|
||||
'submit_withdrawal' => 'Submit Withdrawal',
|
||||
'withdrawal_tips' => 'Withdrawal Tips',
|
||||
'withdrawal_tip_1' => 'Double check the destination address. We cannot recover funds sent to wrong addresses.',
|
||||
'withdrawal_tip_2' => 'TRC20 withdrawals usually take 5-10 minutes to arrive.',
|
||||
'withdrawal_tip_3' => 'Withdrawals are processed manually for security audits during peak hours.',
|
||||
'withdrawal_tip_4' => 'Handling fee: 1 USDT per transaction.',
|
||||
'recent_history' => 'Recent History',
|
||||
'no_records' => 'No records found',
|
||||
'max' => 'MAX',
|
||||
'customer_service' => 'Online Support',
|
||||
'chat_welcome' => 'Hello! How can we help you today?',
|
||||
'type_message' => 'Type your message...',
|
||||
'matching_account' => 'Matching Payment Account...',
|
||||
'matching_desc' => 'Our system is matching a secure local account for your deposit. Please wait a moment.',
|
||||
],
|
||||
'zh' => [
|
||||
'nav_home' => '首页',
|
||||
'nav_market' => '行情',
|
||||
'nav_trade' => '交易',
|
||||
'nav_spot' => '现货交易',
|
||||
'nav_futures' => '合约交易',
|
||||
'nav_mining' => '挖矿',
|
||||
'nav_convert' => '闪兑',
|
||||
'nav_assets' => '资产',
|
||||
'nav_total_assets' => '总资产',
|
||||
'nav_deposit' => '充值',
|
||||
'nav_withdraw' => '提现',
|
||||
'nav_login' => '登录',
|
||||
'nav_register' => '注册',
|
||||
'nav_profile' => '个人中心',
|
||||
'nav_logout' => '退出登录',
|
||||
'hero_title' => '在交易所购买、交易和持有 350 多种加密货币',
|
||||
'hero_subtitle' => '加入全球最大的加密货币交易所,享受最低的费用和最好的安全性。',
|
||||
'btn_start' => '立即开始',
|
||||
'btn_download' => '下载应用',
|
||||
'download_qr_tip' => '下载应用并获得高达 50 USDT 的奖励',
|
||||
'market_trends' => '市场趋势',
|
||||
'view_more_markets' => '查看更多市场',
|
||||
'why_choose_us' => '为什么选择我们?',
|
||||
'secure_storage' => '安全存储',
|
||||
'secure_storage_desc' => '我们将绝大部分数字资产存储在安全的离线存储中。',
|
||||
'protected_insurance' => '保险保护',
|
||||
'protected_insurance_desc' => '存储在我们服务器上的加密货币受我们的保险政策保护。',
|
||||
'industry_best_practices' => '行业最佳实践',
|
||||
'industry_best_practices_desc' => '交易所支持多种最流行的数字货币。',
|
||||
'platform_desc' => '我们的平台为零售和机构交易者提供具有先进功能和稳健基础设施的无缝交易体验。',
|
||||
'partners' => '合作伙伴',
|
||||
'partners_subtitle' => '深受全球领先组织和金融机构的信任。',
|
||||
'footer_desc' => '全球领先的数字资产交易平台,为全球用户提供安全稳定的交易服务。',
|
||||
'about' => '关于',
|
||||
'about_us' => '关于我们',
|
||||
'careers' => '职业介绍',
|
||||
'news' => '新闻',
|
||||
'legal_privacy' => '法律与隐私',
|
||||
'terms_service' => '服务条款',
|
||||
'products' => '产品',
|
||||
'spot_trading' => '现货交易',
|
||||
'futures_trading' => '合约交易',
|
||||
'flash_swap' => '闪兑',
|
||||
'staking' => '质押',
|
||||
'asset_management' => '资产管理',
|
||||
'support' => '支持',
|
||||
'help_center' => '帮助中心',
|
||||
'submit_request' => '提交请求',
|
||||
'api_docs' => 'API 文档',
|
||||
'fee_schedule' => '费率标准',
|
||||
'service_status' => '服务状态',
|
||||
'all_rights_reserved' => '保留所有权利。',
|
||||
'cookie_policy' => 'Cookie 政策',
|
||||
'security' => '安全',
|
||||
'system_status_normal' => '系统状态:正常',
|
||||
'personal_center' => '个人中心',
|
||||
'uid' => 'UID',
|
||||
'credit_score' => '信用分',
|
||||
'kyc_status' => '身份认证',
|
||||
'kyc_none' => '未认证',
|
||||
'kyc_pending' => '审核中',
|
||||
'kyc_approved' => '已认证',
|
||||
'kyc_rejected' => '认证失败',
|
||||
'kyc_submit' => '提交认证',
|
||||
'total_balance' => '总资产',
|
||||
'available_balance' => '可用余额',
|
||||
'order_book' => '订单簿',
|
||||
'trade_panel' => '下单面板',
|
||||
'k_line' => 'K线图',
|
||||
'open_orders' => '当前委托',
|
||||
'order_history' => '历史委托',
|
||||
'trade_history' => '成交记录',
|
||||
'funds_flow' => '资金流水',
|
||||
'current_positions' => '当前持仓',
|
||||
'limit' => '限价',
|
||||
'market' => '市价',
|
||||
'price' => '价格',
|
||||
'amount' => '数量',
|
||||
'total' => '总额',
|
||||
'buy' => '买入',
|
||||
'sell' => '卖出',
|
||||
'leverage' => '杠杆',
|
||||
'tp_sl' => '止盈止损',
|
||||
'take_profit' => '止盈',
|
||||
'stop_loss' => '止损',
|
||||
'cost' => '成本',
|
||||
'open_long' => '做多',
|
||||
'open_short' => '做空',
|
||||
'security_settings' => '安全设置',
|
||||
'asset_details' => '资产详情',
|
||||
'transaction_records' => '交易记录',
|
||||
'level' => '等级',
|
||||
'crypto_markets' => '加密货币行情',
|
||||
'24h_volume' => '24小时成交量',
|
||||
'fear_greed' => '贪婪恐惧指数',
|
||||
'btc_dominance' => '比特币占有率',
|
||||
'favorites' => '自选',
|
||||
'all_crypto' => '所有币种',
|
||||
'asset' => '资产',
|
||||
'24h_high_low' => '24小时最高/最低',
|
||||
'deposit_assets' => '充值资产',
|
||||
'deposit_method_tip' => '请选择您偏好的充值方式。',
|
||||
'fiat_deposit' => '法币充值',
|
||||
'crypto_deposit' => '加密货币充值',
|
||||
'bank_transfer' => '本地银行转账',
|
||||
'blockchain_transfer' => '区块链转账',
|
||||
'support_20_global' => '支持20多种全球货币',
|
||||
'safe_compliant' => '安全合规的通道',
|
||||
'fast_processing' => '24/7 快速处理',
|
||||
'no_service_fee' => '无服务费',
|
||||
'select_currency' => '选择币种',
|
||||
'deposit_amount' => '充值金额',
|
||||
'matching_instructions' => '匹配说明',
|
||||
'matching_tip' => '我们的智能匹配系统将为您匹配认证商户。确认后,您将收到银行账户详情。请在时限内完成转账。',
|
||||
'match_now' => '立即匹配商户',
|
||||
'select_network' => '选择网络',
|
||||
'get_address' => '获取充值地址',
|
||||
'withdraw_assets' => '提现资产',
|
||||
'withdraw_tip' => '安全地将 USDT 提现到您的外部钱包。',
|
||||
'withdraw_address' => '提现地址',
|
||||
'trading_password' => '交易密码',
|
||||
'submit_withdrawal' => '提交提现',
|
||||
'withdrawal_tips' => '提现提示',
|
||||
'withdrawal_tip_1' => '请仔细检查目标地址。我们无法找回发送到错误地址的资金。',
|
||||
'withdrawal_tip_2' => 'TRC20 提现通常在 5-10 分钟内到账。',
|
||||
'withdrawal_tip_3' => '高峰时段,提现将进行人工安全审计。',
|
||||
'withdrawal_tip_4' => '手续费:每笔交易 1 USDT。',
|
||||
'recent_history' => '最近记录',
|
||||
'no_records' => '暂无记录',
|
||||
'max' => '最大',
|
||||
'customer_service' => '在线客服',
|
||||
'chat_welcome' => '您好!请问有什么可以帮您?',
|
||||
'type_message' => '输入消息...',
|
||||
'matching_account' => '正在匹配收款账户...',
|
||||
'matching_desc' => '系统正在为您匹配安全的本地收款账户。请稍候。',
|
||||
]
|
||||
];
|
||||
|
||||
$lang = $_SESSION['lang'] ?? 'en';
|
||||
if (isset($_GET['lang']) && array_key_exists($_GET['lang'], $translations)) {
|
||||
$_SESSION['lang'] = $_GET['lang'];
|
||||
$lang = $_GET['lang'];
|
||||
}
|
||||
|
||||
function __($key, $default = '') {
|
||||
global $translations, $lang;
|
||||
return $translations[$lang][$key] ?? ($default ?: $key);
|
||||
}
|
||||
448
index.php
448
index.php
@ -1,150 +1,302 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
<main>
|
||||
<section class="hero-section">
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title" style="font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem;"><?php echo __('hero_title', 'Buy, trade, and hold 350+ cryptocurrencies on Exchange'); ?></h1>
|
||||
<p class="hero-subtitle" style="font-size: 1.25rem; color: var(--text-muted); max-width: 600px;"><?php echo __('hero_subtitle', 'Join the world\'s largest crypto exchange with the lowest fees and best security.'); ?></p>
|
||||
|
||||
<!-- Download Section -->
|
||||
<div style="background: linear-gradient(135deg, #1e2329 0%, #0b0e11 100%); padding: 30px; border-radius: 20px; margin-top: 3rem; border: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);">
|
||||
<div style="flex: 1;">
|
||||
<div style="font-size: 16px; font-weight: 600; color: white; margin-bottom: 15px;"><?php echo __('download_qr_tip'); ?></div>
|
||||
<div style="display: flex; gap: 15px;">
|
||||
<a href="#" class="btn-download-app" style="background: #4facfe; color: white; border-radius: 12px; padding: 12px 20px; text-decoration: none; display: flex; align-items: center; gap: 10px; transition: transform 0.2s;">
|
||||
<i class="fab fa-apple" style="font-size: 24px;"></i>
|
||||
<div style="text-align: left;">
|
||||
<div style="font-size: 10px; opacity: 0.9;">App Store</div>
|
||||
<div style="font-size: 14px; font-weight: bold;">Download</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" class="btn-download-app" style="background: #00f2fe; color: white; border-radius: 12px; padding: 12px 20px; text-decoration: none; display: flex; align-items: center; gap: 10px; transition: transform 0.2s;">
|
||||
<i class="fab fa-google-play" style="font-size: 20px;"></i>
|
||||
<div style="text-align: left;">
|
||||
<div style="font-size: 10px; opacity: 0.9;">Google Play</div>
|
||||
<div style="font-size: 14px; font-weight: bold;">Download</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 110px; height: 110px; background: white; padding: 8px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.2);">
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=110x110&data=https://exchange.com/download" style="width: 100%;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hero-image">
|
||||
<div class="hero-carousel" id="heroCarousel">
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8)), url('https://images.pexels.com/photos/844124/pexels-photo-844124.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1')">
|
||||
<div class="carousel-caption">
|
||||
<h3 style="margin: 0; color: #fff;">New User Bonus</h3>
|
||||
<p style="margin: 5px 0 0; color: #ccc; font-size: 14px;">Sign up and get up to $100 in rewards.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8)), url('https://images.pexels.com/photos/6770610/pexels-photo-6770610.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1')">
|
||||
<div class="carousel-caption">
|
||||
<h3 style="margin: 0; color: #fff;">Spot Trading</h3>
|
||||
<p style="margin: 5px 0 0; color: #ccc; font-size: 14px;">Trade 350+ coins with industry-leading fees.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8)), url('https://images.pexels.com/photos/7567443/pexels-photo-7567443.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1')">
|
||||
<div class="carousel-caption">
|
||||
<h3 style="margin: 0; color: #fff;">Secure & Stable</h3>
|
||||
<p style="margin: 5px 0 0; color: #ccc; font-size: 14px;">Your assets are protected by our security fund.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="market-ticker-container" style="background: #161a1e; padding: 20px 0; border-y: 1px solid var(--border-color);">
|
||||
<div style="max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; overflow-x: auto; gap: 2rem; padding: 0 20px;">
|
||||
<div class="ticker-item" style="min-width: 180px;">
|
||||
<span class="ticker-pair" style="display: block; color: var(--text-muted); font-size: 12px;">BTC / USDT</span>
|
||||
<span class="ticker-price" id="price-btcusdt" style="font-size: 18px; font-weight: bold; display: block; margin: 4px 0;">--,---.--</span>
|
||||
<span class="ticker-change" id="change-btcusdt">--%</span>
|
||||
</div>
|
||||
<div class="ticker-item" style="min-width: 180px;">
|
||||
<span class="ticker-pair" style="display: block; color: var(--text-muted); font-size: 12px;">ETH / USDT</span>
|
||||
<span class="ticker-price" id="price-ethusdt" style="font-size: 18px; font-weight: bold; display: block; margin: 4px 0;">--,---.--</span>
|
||||
<span class="ticker-change" id="change-ethusdt">--%</span>
|
||||
</div>
|
||||
<div class="ticker-item" style="min-width: 180px;">
|
||||
<span class="ticker-pair" style="display: block; color: var(--text-muted); font-size: 12px;">SOL / USDT</span>
|
||||
<span class="ticker-price" id="price-solusdt" style="font-size: 18px; font-weight: bold; display: block; margin: 4px 0;">--,---.--</span>
|
||||
<span class="ticker-change" id="change-solusdt">--%</span>
|
||||
</div>
|
||||
<div class="ticker-item" style="min-width: 180px;">
|
||||
<span class="ticker-pair" style="display: block; color: var(--text-muted); font-size: 12px;">BNB / USDT</span>
|
||||
<span class="ticker-price" id="price-bnbusdt" style="font-size: 18px; font-weight: bold; display: block; margin: 4px 0;">--,---.--</span>
|
||||
<span class="ticker-change" id="change-bnbusdt">--%</span>
|
||||
</div>
|
||||
<div class="ticker-item" style="min-width: 180px;">
|
||||
<span class="ticker-pair" style="display: block; color: var(--text-muted); font-size: 12px;">XRP / USDT</span>
|
||||
<span class="ticker-price" id="price-xrpusdt" style="font-size: 18px; font-weight: bold; display: block; margin: 4px 0;">--,---.--</span>
|
||||
<span class="ticker-change" id="change-xrpusdt">--%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<section class="why-section" style="display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 1400px; margin: 100px auto; padding: 0 20px; align-items: stretch;">
|
||||
<div class="why-left" style="background: #1e2329; padding: 40px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column;">
|
||||
<h2 style="font-size: 2.2rem; margin-bottom: 30px;"><?php echo __('market_trends', 'Market Trends'); ?></h2>
|
||||
<div class="market-table-card" style="flex: 1; display: flex; flex-direction: column;">
|
||||
<table class="market-table" style="width: 100%; border-collapse: collapse;">
|
||||
<thead>
|
||||
<tr style="text-align: left; color: var(--text-muted); font-size: 14px;">
|
||||
<th style="padding-bottom: 20px;"><?php echo __('amount', 'Asset'); ?></th>
|
||||
<th style="padding-bottom: 20px;"><?php echo __('price', 'Price'); ?></th>
|
||||
<th style="padding-bottom: 20px;">24h Change</th>
|
||||
<th style="padding-bottom: 20px;"><?php echo __('trade_panel', 'Action'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="market-tbody">
|
||||
<tr>
|
||||
<td colspan="4" style="text-align: center; padding: 50px; color: #888;">Connecting...</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="margin-top: auto; padding-top: 30px; text-align: center;">
|
||||
<a href="markets.php" style="color: var(--primary-color); text-decoration: none; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;">
|
||||
<?php echo __('view_more_markets'); ?> <i class="fas fa-arrow-right" style="font-size: 14px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="why-right" style="background: #1e2329; padding: 40px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column;">
|
||||
<h2 style="font-size: 2.2rem; margin-bottom: 30px;"><?php echo __('why_choose_us'); ?></h2>
|
||||
<div style="display: flex; flex-direction: column; gap: 25px; flex: 1;">
|
||||
<div style="display: flex; gap: 20px; align-items: flex-start;">
|
||||
<div style="width: 54px; height: 54px; background: rgba(0,82,255,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 24px; flex-shrink: 0;">
|
||||
<i class="fas fa-shield-alt"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 style="margin: 0 0 8px; font-size: 18px;"><?php echo __('secure_storage'); ?></h4>
|
||||
<p style="margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5;"><?php echo __('secure_storage_desc'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 20px; align-items: flex-start;">
|
||||
<div style="width: 54px; height: 54px; background: rgba(14,203,129,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--success-color); font-size: 24px; flex-shrink: 0;">
|
||||
<i class="fas fa-lock"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 style="margin: 0 0 8px; font-size: 18px;"><?php echo __('protected_insurance'); ?></h4>
|
||||
<p style="margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5;"><?php echo __('protected_insurance_desc'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 20px; align-items: flex-start;">
|
||||
<div style="width: 54px; height: 54px; background: rgba(240,185,11,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--gold-color); font-size: 24px; flex-shrink: 0;">
|
||||
<i class="fas fa-gem"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 style="margin: 0 0 8px; font-size: 18px;"><?php echo __('industry_best_practices'); ?></h4>
|
||||
<p style="margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5;"><?php echo __('industry_best_practices_desc'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: auto; padding: 25px; background: rgba(255,255,255,0.03); border-radius: 16px; border: 1px solid rgba(255,255,255,0.05);">
|
||||
<p style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #ccc;"><?php echo __('platform_desc'); ?></p>
|
||||
<a href="register.php" class="btn-primary" style="width: 100%; justify-content: center; padding: 15px; font-weight: bold; font-size: 16px;"><?php echo __('btn_start'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="partners-section" style="padding: 100px 20px; text-align: center; background: #0b0e11;">
|
||||
<h2 style="font-size: 2.5rem; margin-bottom: 15px; font-weight: 800;"><?php echo __('partners'); ?></h2>
|
||||
<p style="color: var(--text-muted); margin-bottom: 60px; font-size: 1.1rem;"><?php echo __('partners_subtitle'); ?></p>
|
||||
<div class="partners-grid" style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; align-items: center;">
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/bitcoin-btc-logo.png?v=024" style="height: 45px;" alt="Bitcoin">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Bitcoin</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024" style="height: 45px;" alt="Ethereum">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Ethereum</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/binance-coin-bnb-logo.png?v=024" style="height: 45px;" alt="Binance">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">BNB Chain</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/tether-usdt-logo.png?v=024" style="height: 45px;" alt="Tether">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Tether</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/solana-sol-logo.png?v=024" style="height: 45px;" alt="Solana">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Solana</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://cryptologos.cc/logos/cardano-ada-logo.png?v=024" style="height: 45px;" alt="Cardano">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Cardano</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Visa_Inc._logo.svg/2560px-Visa_Inc._logo.svg.png" style="height: 20px;" alt="Visa">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Visa</span>
|
||||
</div>
|
||||
<div class="partner-card">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Mastercard-logo.svg/1280px-Mastercard-logo.svg.png" style="height: 30px;" alt="Mastercard">
|
||||
<span style="display: block; margin-top: 10px; font-weight: bold;">Mastercard</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.partner-card {
|
||||
background: #1e2329;
|
||||
padding: 30px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255,255,255,0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
.partner-card img { filter: grayscale(0.5); opacity: 0.7; transition: 0.3s; }
|
||||
.partner-card:hover { transform: translateY(-5px); border-color: var(--primary-color); background: rgba(0,82,255,0.05); }
|
||||
.partner-card:hover img { filter: grayscale(0); opacity: 1; }
|
||||
.btn-download-app:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Carousel Logic
|
||||
let currentSlide = 0;
|
||||
const slides = document.querySelectorAll('.carousel-item');
|
||||
function nextSlide() {
|
||||
if(slides.length === 0) return;
|
||||
slides[currentSlide].classList.remove('active');
|
||||
currentSlide = (currentSlide + 1) % slides.length;
|
||||
slides[currentSlide].classList.add('active');
|
||||
}
|
||||
setInterval(nextSlide, 5000);
|
||||
|
||||
const symbols = ['btcusdt', 'ethusdt', 'solusdt', 'bnbusdt', 'xrpusdt', 'adausdt', 'dogeusdt', 'dotusdt'];
|
||||
const tickerElements = {};
|
||||
|
||||
symbols.forEach(s => {
|
||||
tickerElements[s] = {
|
||||
price: document.getElementById(`price-${s}`),
|
||||
change: document.getElementById(`change-${s}`)
|
||||
};
|
||||
});
|
||||
|
||||
const ws = new WebSocket('wss://stream.binance.com:9443/ws/' + symbols.map(s => s + '@ticker').join('/'));
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
const symbol = data.s.toLowerCase();
|
||||
const price = parseFloat(data.c).toLocaleString(undefined, {minimumFractionDigits: 2});
|
||||
const change = parseFloat(data.P).toFixed(2);
|
||||
const color = change >= 0 ? 'var(--success-color)' : 'var(--danger-color)';
|
||||
|
||||
if (tickerElements[symbol]) {
|
||||
if (tickerElements[symbol].price) tickerElements[symbol].price.innerText = price;
|
||||
if (tickerElements[symbol].change) {
|
||||
tickerElements[symbol].change.innerText = (change >= 0 ? '+' : '') + change + '%';
|
||||
tickerElements[symbol].change.style.color = color;
|
||||
}
|
||||
}
|
||||
updateTable(data);
|
||||
};
|
||||
|
||||
const marketData = {};
|
||||
function updateTable(data) {
|
||||
const symbol = data.s;
|
||||
marketData[symbol] = data;
|
||||
renderTable();
|
||||
}
|
||||
|
||||
function renderTable() {
|
||||
const tbody = document.getElementById('market-tbody');
|
||||
if (!tbody) return;
|
||||
|
||||
let html = '';
|
||||
const sortedSymbols = Object.keys(marketData).sort((a, b) => {
|
||||
const order = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT', 'ADAUSDT', 'DOGEUSDT', 'DOTUSDT'];
|
||||
return order.indexOf(a) - order.indexOf(b);
|
||||
});
|
||||
|
||||
sortedSymbols.slice(0, 6).forEach(s => {
|
||||
const d = marketData[s];
|
||||
const price = parseFloat(d.c).toLocaleString(undefined, {minimumFractionDigits: 2});
|
||||
const change = parseFloat(d.P).toFixed(2);
|
||||
const color = change >= 0 ? 'var(--success-color)' : 'var(--danger-color)';
|
||||
const name = s.replace('USDT', '');
|
||||
const iconUrl = `https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png`;
|
||||
|
||||
html += `
|
||||
<tr style="border-bottom: 1px solid rgba(255,255,255,0.05);">
|
||||
<td style="padding: 20px 0;">
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<img src="${iconUrl}" width="32" height="32" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<span style="font-weight: bold; font-size: 16px;">${name}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="font-weight: bold; font-family: monospace; font-size: 16px;">$ ${price}</td>
|
||||
<td style="color: ${color}; font-weight: bold; font-size: 16px;">${change >= 0 ? '+' : ''}${change}%</td>
|
||||
<td><a href="spot.php?symbol=${s}" class="btn-primary" style="padding: 8px 20px; font-size: 13px; border-radius: 8px; background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1);"><?php echo __('buy'); ?></a></td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
if (html) tbody.innerHTML = html;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
|
||||
185
kyc.php
Normal file
185
kyc.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$status = $user['kyc_status'] ?? 0;
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && $status != 1 && $status != 2) {
|
||||
$name = $_POST['kyc_name'] ?? '';
|
||||
$id_number = $_POST['kyc_id_number'] ?? '';
|
||||
|
||||
// Simple file handling for prototype
|
||||
$upload_dir = 'uploads/kyc/';
|
||||
if (!is_dir($upload_dir)) mkdir($upload_dir, 0777, true);
|
||||
|
||||
$front = '';
|
||||
$back = '';
|
||||
$handheld = '';
|
||||
|
||||
if (isset($_FILES['front']) && $_FILES['front']['error'] === 0) {
|
||||
$front = $upload_dir . time() . '_front_' . $_FILES['front']['name'];
|
||||
move_uploaded_file($_FILES['front']['tmp_name'], $front);
|
||||
}
|
||||
if (isset($_FILES['back']) && $_FILES['back']['error'] === 0) {
|
||||
$back = $upload_dir . time() . '_back_' . $_FILES['back']['name'];
|
||||
move_uploaded_file($_FILES['back']['tmp_name'], $back);
|
||||
}
|
||||
if (isset($_FILES['handheld']) && $_FILES['handheld']['error'] === 0) {
|
||||
$handheld = $upload_dir . time() . '_handheld_' . $_FILES['handheld']['name'];
|
||||
move_uploaded_file($_FILES['handheld']['tmp_name'], $handheld);
|
||||
}
|
||||
|
||||
$stmt = $db->prepare("UPDATE users SET kyc_name = ?, kyc_id_number = ?, kyc_id_front = ?, kyc_id_back = ?, kyc_id_handheld = ?, kyc_status = 1 WHERE id = ?");
|
||||
if ($stmt->execute([$name, $id_number, $front, $back, $handheld, $_SESSION['user_id']])) {
|
||||
$status = 1;
|
||||
$message = "KYC documents submitted successfully! Our team will review them shortly.";
|
||||
} else {
|
||||
$error = "Failed to submit KYC documents. Please try again.";
|
||||
}
|
||||
}
|
||||
|
||||
$status_labels = [
|
||||
0 => ['text' => 'Unverified', 'color' => '#888', 'icon' => 'fa-user-slash'],
|
||||
1 => ['text' => 'Under Review', 'color' => '#f0b90b', 'icon' => 'fa-clock'],
|
||||
2 => ['text' => 'Verified', 'color' => 'var(--success-color)', 'icon' => 'fa-check-circle'],
|
||||
3 => ['text' => 'Rejected', 'color' => 'var(--danger-color)', 'icon' => 'fa-times-circle'],
|
||||
];
|
||||
$current = $status_labels[$status];
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
|
||||
<div style="max-width: 800px; margin: 0 auto;">
|
||||
|
||||
<a href="profile.php" class="back-btn"><i class="fas fa-arrow-left"></i> Profile</a>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color);">
|
||||
<div style="text-align: center; margin-bottom: 40px;">
|
||||
<div style="width: 70px; height: 70px; background: rgba(0,82,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: <?php echo $current['color']; ?>; font-size: 32px;">
|
||||
<i class="fas <?php echo $current['icon']; ?>"></i>
|
||||
</div>
|
||||
<h2 style="margin: 0; font-size: 2rem;">Identity Verification</h2>
|
||||
<p style="color: var(--text-muted); margin-top: 10px;">Status: <span style="color: <?php echo $current['color']; ?>; font-weight: bold;"><?php echo $current['text']; ?></span></p>
|
||||
</div>
|
||||
|
||||
<?php if($message): ?>
|
||||
<div style="background: rgba(14,203,129,0.1); color: var(--success-color); padding: 20px; border-radius: 12px; margin-bottom: 30px; border: 1px solid var(--success-color);">
|
||||
<i class="fas fa-check-circle"></i> <?php echo $message; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($error): ?>
|
||||
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 20px; border-radius: 12px; margin-bottom: 30px; border: 1px solid var(--danger-color);">
|
||||
<i class="fas fa-exclamation-circle"></i> <?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($status == 0 || $status == 3): ?>
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Full Name</label>
|
||||
<input type="text" name="kyc_name" placeholder="As shown on ID" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">ID / Passport Number</label>
|
||||
<input type="text" name="kyc_id_number" placeholder="Enter ID number" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-bottom: 30px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">ID Front Side</label>
|
||||
<div class="upload-box" onclick="document.getElementById('file-front').click()">
|
||||
<i class="fas fa-plus" id="icon-front"></i>
|
||||
<span id="text-front">Upload Photo</span>
|
||||
<input type="file" name="front" id="file-front" hidden onchange="previewFile(this, 'front')">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">ID Back Side</label>
|
||||
<div class="upload-box" onclick="document.getElementById('file-back').click()">
|
||||
<i class="fas fa-plus" id="icon-back"></i>
|
||||
<span id="text-back">Upload Photo</span>
|
||||
<input type="file" name="back" id="file-back" hidden onchange="previewFile(this, 'back')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 40px;">
|
||||
<label style="display: block; margin-bottom: 12px; color: var(--text-muted); font-size: 14px;">Handheld ID & Signature</label>
|
||||
<div class="upload-box" style="height: 180px;" onclick="document.getElementById('file-handheld').click()">
|
||||
<i class="fas fa-camera" id="icon-handheld" style="font-size: 32px;"></i>
|
||||
<span id="text-handheld" style="margin-top: 10px;">Upload handheld photo with date</span>
|
||||
<input type="file" name="handheld" id="file-handheld" hidden onchange="previewFile(this, 'handheld')">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-size: 1.1rem; border-radius: 12px; font-weight: bold;">Submit for Verification</button>
|
||||
</form>
|
||||
<?php elseif($status == 1): ?>
|
||||
<div style="text-align: center; padding: 40px 0;">
|
||||
<p style="color: var(--text-muted); line-height: 1.8;">Your identity documents have been received and are currently being reviewed. This process usually takes 1-2 business days. We will notify you once the review is complete.</p>
|
||||
<div style="margin-top: 30px; padding: 20px; background: rgba(240,185,11,0.05); border-radius: 12px; border: 1px solid rgba(240,185,11,0.1); display: inline-block;">
|
||||
<i class="fas fa-info-circle"></i> You can still trade while waiting for verification.
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif($status == 2): ?>
|
||||
<div style="text-align: center; padding: 40px 0;">
|
||||
<p style="color: var(--success-color); font-weight: 500;">Congratulations! Your identity has been fully verified.</p>
|
||||
<p style="color: var(--text-muted); margin-top: 10px;">You now have full access to all withdrawal limits and advanced trading features.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.upload-box {
|
||||
border: 2px dashed var(--border-color);
|
||||
height: 140px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
color: var(--text-muted);
|
||||
transition: 0.3s;
|
||||
background: rgba(255,255,255,0.01);
|
||||
}
|
||||
.upload-box:hover {
|
||||
border-color: var(--primary-color);
|
||||
background: rgba(0,82,255,0.02);
|
||||
color: white;
|
||||
}
|
||||
.upload-box i { font-size: 24px; margin-bottom: 8px; }
|
||||
.upload-box span { font-size: 13px; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function previewFile(input, type) {
|
||||
if (input.files && input.files[0]) {
|
||||
const icon = document.getElementById('icon-' + type);
|
||||
const text = document.getElementById('text-' + type);
|
||||
icon.className = 'fas fa-check-circle';
|
||||
icon.style.color = 'var(--success-color)';
|
||||
text.innerText = input.files[0].name;
|
||||
text.style.color = 'var(--success-color)';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
68
login.php
Normal file
68
login.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/i18n.php';
|
||||
session_start();
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$username = $_POST['username'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?");
|
||||
$stmt->execute([$username]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['username'] = $user['username'];
|
||||
$_SESSION['uid'] = $user['uid'];
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
} else {
|
||||
$error = "Invalid username or password.";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<main style="background: #0b0e11; min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px;">
|
||||
<div style="width: 100%; max-width: 480px; background: var(--card-bg); padding: 50px; border-radius: 32px; border: 1px solid var(--border-color); box-shadow: 0 20px 40px rgba(0,0,0,0.4);">
|
||||
<h2 style="font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; text-align: center; color: white;">Welcome Back</h2>
|
||||
<p style="text-align: center; color: var(--text-muted); margin-bottom: 40px;">Log in to your account to continue trading</p>
|
||||
|
||||
<?php if($error): ?>
|
||||
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 15px; border-radius: 12px; margin-bottom: 25px; border: 1px solid var(--danger-color); text-align: center; font-size: 14px;">
|
||||
<i class="fas fa-exclamation-circle"></i> <?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Account</label>
|
||||
<div style="position: relative;">
|
||||
<i class="fas fa-user" style="position: absolute; left: 15px; top: 15px; color: #555;"></i>
|
||||
<input type="text" name="username" required placeholder="Enter your email or phone" style="width: 100%; padding: 15px 15px 15px 45px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Password</label>
|
||||
<div style="position: relative;">
|
||||
<i class="fas fa-lock" style="position: absolute; left: 15px; top: 15px; color: #555;"></i>
|
||||
<input type="password" name="password" required placeholder="Enter your password" style="width: 100%; padding: 15px 15px 15px 45px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 30px;">
|
||||
<a href="#" style="color: var(--primary-color); text-decoration: none; font-size: 0.85rem;">Forgot Password?</a>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-weight: 800; font-size: 1.1rem; border-radius: 16px; box-shadow: 0 10px 20px rgba(0,82,255,0.2);"><?php echo __('nav_login'); ?></button>
|
||||
</form>
|
||||
<div style="text-align: center; margin-top: 30px; border-top: 1px solid var(--border-color); padding-top: 30px;">
|
||||
<span style="color: var(--text-muted);">Don't have an account?</span> <a href="register.php" style="color: var(--primary-color); text-decoration: none; font-weight: bold;"><?php echo __('nav_register'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
5
logout.php
Normal file
5
logout.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
session_destroy();
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
95
markets.php
Normal file
95
markets.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 60px);">
|
||||
<div style="max-width: 1200px; margin: 0 auto;">
|
||||
<h1 style="color: white; margin-bottom: 30px;"><?php echo __('crypto_markets'); ?></h1>
|
||||
|
||||
<div style="display: flex; gap: 20px; margin-bottom: 30px;">
|
||||
<div style="flex: 1; background: #1e2329; padding: 20px; border-radius: 12px; border: 1px solid #2b3139;">
|
||||
<div style="color: #848e9c; font-size: 0.9rem;"><?php echo __('24h_volume'); ?></div>
|
||||
<div style="font-size: 1.5rem; color: white; margin-top: 10px; font-weight: bold;">$ 84.23B</div>
|
||||
</div>
|
||||
<div style="flex: 1; background: #1e2329; padding: 20px; border-radius: 12px; border: 1px solid #2b3139;">
|
||||
<div style="color: #848e9c; font-size: 0.9rem;"><?php echo __('fear_greed'); ?></div>
|
||||
<div style="font-size: 1.5rem; color: #00c087; margin-top: 10px; font-weight: bold;">74 (Greed)</div>
|
||||
</div>
|
||||
<div style="flex: 1; background: #1e2329; padding: 20px; border-radius: 12px; border: 1px solid #2b3139;">
|
||||
<div style="color: #848e9c; font-size: 0.9rem;"><?php echo __('btc_dominance'); ?></div>
|
||||
<div style="font-size: 1.5rem; color: white; margin-top: 10px; font-weight: bold;">52.1%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: #1e2329; border-radius: 16px; border: 1px solid #2b3139; overflow: hidden;">
|
||||
<div style="padding: 20px 30px; border-bottom: 1px solid #2b3139; display: flex; gap: 30px;">
|
||||
<span style="color: white; border-bottom: 2px solid var(--primary-color); padding-bottom: 15px; cursor: pointer;"><?php echo __('favorites'); ?></span>
|
||||
<span style="color: #848e9c; cursor: pointer;"><?php echo __('all_crypto'); ?></span>
|
||||
<span style="color: #848e9c; cursor: pointer;"><?php echo __('nav_spot'); ?></span>
|
||||
<span style="color: #848e9c; cursor: pointer;"><?php echo __('nav_futures'); ?></span>
|
||||
</div>
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<thead style="background: #161a1e;">
|
||||
<tr>
|
||||
<th style="padding: 15px 30px; text-align: left; color: #848e9c; font-weight: normal; font-size: 0.9rem;"><?php echo __('asset'); ?></th>
|
||||
<th style="padding: 15px 30px; text-align: right; color: #848e9c; font-weight: normal; font-size: 0.9rem;"><?php echo __('price'); ?></th>
|
||||
<th style="padding: 15px 30px; text-align: right; color: #848e9c; font-weight: normal; font-size: 0.9rem;">24h Change</th>
|
||||
<th style="padding: 15px 30px; text-align: right; color: #848e9c; font-weight: normal; font-size: 0.9rem;"><?php echo __('24h_high_low'); ?></th>
|
||||
<th style="padding: 15px 30px; text-align: right; color: #848e9c; font-weight: normal; font-size: 0.9rem;"><?php echo __('trade_panel'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="market-list-all">
|
||||
<!-- Filled by WS -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
const pairs = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT', 'ADAUSDT', 'DOGEUSDT', 'DOTUSDT', 'LINKUSDT', 'AVAXUSDT', 'MATICUSDT', 'SHIBUSDT'];
|
||||
const ws = new WebSocket('wss://stream.binance.com:9443/ws/' + pairs.map(p => p.toLowerCase() + '@ticker').join('/'));
|
||||
const marketData = {};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
marketData[data.s] = data;
|
||||
renderMarketList();
|
||||
};
|
||||
|
||||
function renderMarketList() {
|
||||
const tbody = document.getElementById('market-list-all');
|
||||
let html = '';
|
||||
pairs.forEach(p => {
|
||||
const d = marketData[p];
|
||||
if(!d) return;
|
||||
|
||||
const price = parseFloat(d.c).toLocaleString(undefined, {minimumFractionDigits: 2});
|
||||
const change = parseFloat(d.P).toFixed(2);
|
||||
const color = change >= 0 ? '#00c087' : '#f6465d';
|
||||
const name = p.replace('USDT', '');
|
||||
|
||||
html += `
|
||||
<tr style="border-bottom: 1px solid #2b3139; transition: background 0.2s; cursor: pointer;" onmouseover="this.style.background='rgba(255,255,255,0.02)'" onmouseout="this.style.background='transparent'">
|
||||
<td style="padding: 20px 30px; display: flex; align-items: center; gap: 15px;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png" width="32" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<div>
|
||||
<div style="color: white; font-weight: bold;">${name}</div>
|
||||
<div style="color: #666; font-size: 0.8rem;">${name}/USDT</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 20px 30px; text-align: right; color: white; font-weight: bold; font-family: monospace;">$ ${price}</td>
|
||||
<td style="padding: 20px 30px; text-align: right; color: ${color}; font-weight: bold;">${change >= 0 ? '+' : ''}${change}%</td>
|
||||
<td style="padding: 20px 30px; text-align: right; color: #848e9c; font-size: 0.85rem;">
|
||||
<div>H: ${parseFloat(d.h).toFixed(2)}</div>
|
||||
<div>L: ${parseFloat(d.l).toFixed(2)}</div>
|
||||
</td>
|
||||
<td style="padding: 20px 30px; text-align: right;">
|
||||
<a href="spot.php?symbol=${p}" class="btn-primary" style="padding: 8px 20px; font-size: 0.85rem; border-radius: 6px; text-decoration: none;"><?php echo __('buy'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
tbody.innerHTML = html;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
144
matching.php
Normal file
144
matching.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
$order_id = $_GET['order_id'] ?? null;
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['type'])) {
|
||||
$type = $_POST['type'];
|
||||
$amount = $_POST['amount'];
|
||||
$currency = $_POST['currency'] ?? 'USDT';
|
||||
|
||||
// Create order
|
||||
$stmt = db()->prepare("INSERT INTO fiat_orders (user_id, amount, currency, status, created_at) VALUES (?, ?, ?, 'pending', CURRENT_TIMESTAMP)");
|
||||
$stmt->execute([$user_id, $amount, $currency]);
|
||||
$order_id = db()->lastInsertId();
|
||||
|
||||
// Notify CS via messages table
|
||||
$msg = "New deposit order #$order_id: $amount $currency. Please provide bank account details.";
|
||||
$stmt = db()->prepare("INSERT INTO messages (user_id, sender, message) VALUES (?, 'user', ?)");
|
||||
$stmt->execute([$user_id, $msg]);
|
||||
|
||||
header("Location: matching.php?order_id=" . $order_id);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$order_id) {
|
||||
header("Location: deposit.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Fetch order
|
||||
$stmt = db()->prepare("SELECT * FROM fiat_orders WHERE id = ? AND user_id = ?");
|
||||
$stmt->execute([$order_id, $user_id]);
|
||||
$order = $stmt->fetch();
|
||||
|
||||
if (!$order) {
|
||||
header("Location: deposit.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Handle Proof Upload
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['proof'])) {
|
||||
$file = $_FILES['proof'];
|
||||
$ext = pathinfo($file['name'], PATHINFO_EXTENSION);
|
||||
$filename = 'proof_' . $order_id . '_' . time() . '.' . $ext;
|
||||
$target = 'assets/images/proofs/' . $filename;
|
||||
|
||||
if (!is_dir('assets/images/proofs/')) mkdir('assets/images/proofs/', 0775, true);
|
||||
|
||||
if (move_uploaded_file($file['tmp_name'], $target)) {
|
||||
$stmt = db()->prepare("UPDATE fiat_orders SET proof_image = ?, status = 'submitting' WHERE id = ?");
|
||||
$stmt->execute(['assets/images/proofs/' . $filename, $order_id]);
|
||||
header("Location: matching.php?order_id=" . $order_id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
|
||||
<div style="max-width: 800px; margin: 0 auto;">
|
||||
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); text-align: center;">
|
||||
<?php if (!$order['bank_account_info']): ?>
|
||||
<div id="matching-spinner">
|
||||
<div style="width: 80px; height: 80px; border: 4px solid rgba(0,82,255,0.1); border-top-color: var(--primary-color); border-radius: 50%; margin: 0 auto 30px; animation: spin 1s linear infinite;"></div>
|
||||
<h2 style="margin-bottom: 10px;"><?php echo __('matching_account', 'Matching Payment Account...'); ?></h2>
|
||||
<p style="color: var(--text-muted);"><?php echo __('matching_desc', 'Our system is matching a secure local account for your deposit. Please wait a moment.'); ?></p>
|
||||
<div style="margin-top: 30px; font-size: 14px; color: var(--primary-color);">
|
||||
<i class="fas fa-info-circle"></i> Tip: You can also contact <a href="chat.php" style="color: var(--primary-color); font-weight: bold;">Online Support</a> for faster processing.
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
setInterval(() => {
|
||||
fetch('api/check_order_status.php?order_id=<?php echo $order_id; ?>')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.bank_account_info) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
</script>
|
||||
<?php elseif ($order['status'] === 'pending'): ?>
|
||||
<div style="text-align: left;">
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color);">
|
||||
<div style="width: 50px; height: 50px; background: rgba(14,203,129,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--success-color); font-size: 20px;">
|
||||
<i class="fas fa-check-circle"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h2 style="margin: 0;">Account Matched Successfully</h2>
|
||||
<p style="margin: 5px 0 0; color: var(--text-muted); font-size: 14px;">Please complete the transfer to the following account.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: #161a1e; padding: 25px; border-radius: 16px; margin-bottom: 30px; border: 1px solid var(--border-color);">
|
||||
<div style="font-size: 14px; color: var(--text-muted); margin-bottom: 20px;">BANK ACCOUNT DETAILS</div>
|
||||
<?php echo nl2br(htmlspecialchars($order['bank_account_info'])); ?>
|
||||
</div>
|
||||
|
||||
<div style="background: rgba(240,185,11,0.05); padding: 20px; border-radius: 12px; border: 1px solid rgba(240,185,11,0.2); margin-bottom: 30px;">
|
||||
<h4 style="color: #f0b90b; margin: 0 0 10px;"><i class="fas fa-exclamation-triangle"></i> Important Instructions</h4>
|
||||
<ul style="margin: 0; padding-left: 20px; font-size: 13px; color: #ccc; line-height: 1.8;">
|
||||
<li>Please transfer the exact amount: <strong><?php echo $order['amount']; ?> <?php echo $order['currency']; ?></strong></li>
|
||||
<li>Include your UID <strong><?php echo $_SESSION['uid']; ?></strong> in the transfer remarks.</li>
|
||||
<li>Take a screenshot of the successful transfer.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<label style="display: block; margin-bottom: 15px; font-weight: bold;">Upload Payment Voucher</label>
|
||||
<div style="border: 2px dashed var(--border-color); padding: 30px; border-radius: 16px; text-align: center; cursor: pointer; transition: 0.2s;" onmouseover="this.style.borderColor='var(--primary-color)'" onmouseout="this.style.borderColor='var(--border-color)'" onclick="document.getElementById('proof-file').click()">
|
||||
<i class="fas fa-cloud-upload-alt" style="font-size: 40px; color: var(--text-muted); margin-bottom: 15px;"></i>
|
||||
<div style="color: var(--text-muted); font-size: 14px;">Click to select or drag and drop image</div>
|
||||
<input type="file" name="proof" id="proof-file" accept="image/*" style="display: none;" onchange="this.form.submit()">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="padding: 40px 0;">
|
||||
<i class="fas fa-clock" style="font-size: 64px; color: var(--gold-color); margin-bottom: 20px;"></i>
|
||||
<h2 style="margin-bottom: 15px;">Deposit Under Review</h2>
|
||||
<p style="color: var(--text-muted); line-height: 1.6;">Your payment proof has been submitted successfully. Our team will verify the transaction and update your balance within 30 minutes.</p>
|
||||
<div style="margin-top: 40px; display: flex; gap: 15px; justify-content: center;">
|
||||
<a href="profile.php" class="btn-primary" style="padding: 12px 30px; border-radius: 8px;">Back to Assets</a>
|
||||
<a href="chat.php" class="btn-primary" style="background: #2b3139; padding: 12px 30px; border-radius: 8px;">Contact Support</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
||||
</style>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
111
mining.php
Normal file
111
mining.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
|
||||
<div style="max-width: 1200px; margin: 0 auto;">
|
||||
|
||||
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> Home</a>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 60px; padding: 40px 0; background: linear-gradient(180deg, rgba(0,82,255,0.05) 0%, transparent 100%); border-radius: 30px;">
|
||||
<h1 style="font-size: 3.5rem; font-weight: 800; margin-bottom: 15px; color: white;">Staking & Mining</h1>
|
||||
<p style="color: var(--text-muted); font-size: 1.2rem; max-width: 700px; margin: 0 auto;">Participate in proof-of-stake and decentralized finance to earn rewards on your digital assets.</p>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; margin-bottom: 60px;">
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); transition: 0.3s;" onmouseover="this.style.transform='translateY(-10px)'" onmouseout="this.style.transform='translateY(0)'">
|
||||
<div style="width: 60px; height: 60px; background: rgba(0,82,255,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 28px; margin-bottom: 25px;">
|
||||
<i class="fas fa-pickaxe"></i>
|
||||
</div>
|
||||
<h3 style="font-size: 1.5rem; margin-bottom: 15px;">Liquidity Mining</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 25px;">Provide liquidity to automated market makers and earn a portion of the trading fees plus governance tokens.</p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border-color);">
|
||||
<div>
|
||||
<div style="color: var(--text-muted); font-size: 12px;">Est. APR</div>
|
||||
<div style="font-size: 20px; font-weight: bold; color: var(--success-color);">Up to 45.8%</div>
|
||||
</div>
|
||||
<button class="btn-primary" style="padding: 10px 25px; border-radius: 12px;">Stake Now</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); transition: 0.3s;" onmouseover="this.style.transform='translateY(-10px)'" onmouseout="this.style.transform='translateY(0)'">
|
||||
<div style="width: 60px; height: 60px; background: rgba(14,203,129,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--success-color); font-size: 28px; margin-bottom: 25px;">
|
||||
<i class="fas fa-seedling"></i>
|
||||
</div>
|
||||
<h3 style="font-size: 1.5rem; margin-bottom: 15px;">PoS Staking</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 25px;">Stake your proof-of-stake assets to help secure the network and receive inflation rewards directly in your wallet.</p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border-color);">
|
||||
<div>
|
||||
<div style="color: var(--text-muted); font-size: 12px;">Est. APR</div>
|
||||
<div style="font-size: 20px; font-weight: bold; color: var(--success-color);">Up to 12.5%</div>
|
||||
</div>
|
||||
<button class="btn-primary" style="padding: 10px 25px; border-radius: 12px;">Stake Now</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); transition: 0.3s;" onmouseover="this.style.transform='translateY(-10px)'" onmouseout="this.style.transform='translateY(0)'">
|
||||
<div style="width: 60px; height: 60px; background: rgba(240,185,11,0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--gold-color); font-size: 28px; margin-bottom: 25px;">
|
||||
<i class="fas fa-gem"></i>
|
||||
</div>
|
||||
<h3 style="font-size: 1.5rem; margin-bottom: 15px;">Launchpad</h3>
|
||||
<p style="color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 25px;">Gain exclusive access to high-quality blockchain projects before they list on our exchange.</p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--border-color);">
|
||||
<div>
|
||||
<div style="color: var(--text-muted); font-size: 12px;">Next Project</div>
|
||||
<div style="font-size: 20px; font-weight: bold; color: var(--gold-color);">Coming Soon</div>
|
||||
</div>
|
||||
<button class="btn-primary" style="padding: 10px 25px; border-radius: 12px;">View Details</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); border-radius: 30px; border: 1px solid var(--border-color); overflow: hidden;">
|
||||
<div style="padding: 30px 40px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;">
|
||||
<h3 style="margin: 0;">Yield Rankings</h3>
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<button style="padding: 8px 16px; background: #2b3139; border: none; color: white; border-radius: 8px; font-size: 13px;">All</button>
|
||||
<button style="padding: 8px 16px; background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 8px; font-size: 13px;">DeFi</button>
|
||||
<button style="padding: 8px 16px; background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); border-radius: 8px; font-size: 13px;">Staking</button>
|
||||
</div>
|
||||
</div>
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<thead style="background: #161a1e;">
|
||||
<tr>
|
||||
<th style="padding: 20px 40px; text-align: left; color: var(--text-muted); font-weight: 500;">Asset</th>
|
||||
<th style="padding: 20px 40px; text-align: left; color: var(--text-muted); font-weight: 500;">Est. APR</th>
|
||||
<th style="padding: 20px 40px; text-align: left; color: var(--text-muted); font-weight: 500;">Duration</th>
|
||||
<th style="padding: 20px 40px; text-align: right; color: var(--text-muted); font-weight: 500;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$mining_coins = [
|
||||
['symbol' => 'USDT', 'apr' => '12.5%', 'duration' => 'Flexible'],
|
||||
['symbol' => 'BTC', 'apr' => '4.2%', 'duration' => '30 Days'],
|
||||
['symbol' => 'ETH', 'apr' => '5.8%', 'duration' => 'Flexible'],
|
||||
['symbol' => 'SOL', 'apr' => '8.9%', 'duration' => '60 Days'],
|
||||
['symbol' => 'DOT', 'apr' => '14.2%', 'duration' => '30 Days'],
|
||||
];
|
||||
foreach ($mining_coins as $coin):
|
||||
?>
|
||||
<tr style="border-bottom: 1px solid var(--border-color); transition: 0.2s;" onmouseover="this.style.background='#161a1e'" onmouseout="this.style.background='transparent'">
|
||||
<td style="padding: 25px 40px;">
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/<?php echo strtolower($coin['symbol']); ?>.png" width="35" height="35" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<span style="font-weight: bold; font-size: 1.1rem;"><?php echo $coin['symbol']; ?></span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 25px 40px;">
|
||||
<span style="color: var(--success-color); font-weight: bold; font-size: 1.1rem;"><?php echo $coin['apr']; ?></span>
|
||||
</td>
|
||||
<td style="padding: 25px 40px; color: var(--text-muted);"><?php echo $coin['duration']; ?></td>
|
||||
<td style="padding: 25px 40px; text-align: right;">
|
||||
<button class="btn-primary" style="padding: 8px 20px; border-radius: 10px;">Subscribe</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
142
profile.php
Normal file
142
profile.php
Normal file
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$kyc_status = $user['kyc_status'] ?? 0;
|
||||
$kyc_labels = [
|
||||
0 => __('kyc_none', '未认证'),
|
||||
1 => __('kyc_pending', '审核中'),
|
||||
2 => __('kyc_approved', '已认证'),
|
||||
3 => __('kyc_rejected', '未通过'),
|
||||
];
|
||||
$kyc_colors = [0 => '#888', 1 => '#f0b90b', 2 => 'var(--success-color)', 3 => 'var(--danger-color)'];
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: 100vh;">
|
||||
<div style="max-width: 1200px; margin: 0 auto;">
|
||||
|
||||
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> <?php echo __('nav_home', '首页'); ?></a>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 350px 1fr; gap: 30px;">
|
||||
<!-- Left Panel -->
|
||||
<div>
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 20px; border: 1px solid var(--border-color); text-align: center;">
|
||||
<div style="width: 100px; height: 100px; background: linear-gradient(135deg, #0052ff, #00a3ff); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 2.5rem; font-weight: bold; color: white; box-shadow: 0 10px 20px rgba(0,82,255,0.2);">
|
||||
<?php echo strtoupper(substr($user['username'], 0, 1)); ?>
|
||||
</div>
|
||||
<h2 style="margin-bottom: 5px;"><?php echo $user['username']; ?></h2>
|
||||
<div style="color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px;">UID: <?php echo $user['uid'] ?? '------'; ?></div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding-top: 25px; border-top: 1px solid var(--border-color);">
|
||||
<div>
|
||||
<div style="color: var(--text-muted); font-size: 0.8rem; margin-bottom: 5px;"><?php echo __('credit_score', '信用分'); ?></div>
|
||||
<div style="font-weight: bold; font-size: 1.2rem; color: var(--success-color);"><?php echo $user['credit_score'] ?? 80; ?></div>
|
||||
</div>
|
||||
<div style="border-left: 1px solid var(--border-color);">
|
||||
<div style="color: var(--text-muted); font-size: 0.8rem; margin-bottom: 5px;"><?php echo __('level'); ?></div>
|
||||
<div style="font-weight: bold; font-size: 1.2rem; color: #f0b90b;">VIP 0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 25px; display: flex; flex-direction: column; gap: 15px;">
|
||||
<div style="background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid var(--border-color);">
|
||||
<a href="kyc.php" style="display: flex; align-items: center; justify-content: space-between; text-decoration: none; color: white;">
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<div style="width: 40px; height: 40px; background: rgba(0,82,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--primary-color);">
|
||||
<i class="fas fa-id-card"></i>
|
||||
</div>
|
||||
<span style="font-weight: 500;"><?php echo __('kyc_status', '实名认证'); ?></span>
|
||||
</div>
|
||||
<span style="font-size: 0.85rem; font-weight: bold; color: <?php echo $kyc_colors[$kyc_status]; ?>"><?php echo $kyc_labels[$kyc_status]; ?> <i class="fas fa-chevron-right" style="margin-left: 5px; font-size: 10px;"></i></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid var(--border-color);">
|
||||
<a href="security.php" style="display: flex; align-items: center; justify-content: space-between; text-decoration: none; color: white;">
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<div style="width: 40px; height: 40px; background: rgba(14,203,129,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--success-color);">
|
||||
<i class="fas fa-shield-alt"></i>
|
||||
</div>
|
||||
<span style="font-weight: 500;"><?php echo __('security_settings'); ?></span>
|
||||
</div>
|
||||
<i class="fas fa-chevron-right" style="color: var(--text-muted); font-size: 10px;"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 20px; border-radius: 16px; border: 1px solid var(--border-color);">
|
||||
<a href="logout.php" style="display: flex; align-items: center; gap: 15px; text-decoration: none; color: var(--danger-color);">
|
||||
<div style="width: 40px; height: 40px; background: rgba(246,70,93,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
</div>
|
||||
<span style="font-weight: 500;"><?php echo __('nav_logout', '退出登录'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Panel -->
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="color: var(--text-muted); margin-bottom: 10px; font-size: 14px;"><?php echo __('total_balance', '总资产'); ?> (USDT)</div>
|
||||
<div style="font-size: 3rem; font-weight: bold; letter-spacing: -1px;">
|
||||
<?php echo number_format($user['balance'] ?? 0, 2); ?>
|
||||
</div>
|
||||
<div style="color: var(--text-muted); font-size: 1rem; margin-top: 5px;">≈ $ <?php echo number_format($user['balance'] ?? 0, 2); ?></div>
|
||||
</div>
|
||||
<div style="display: flex; gap: 15px;">
|
||||
<a href="deposit.php" class="btn-primary" style="padding: 12px 30px; border-radius: 10px; font-weight: bold;"><i class="fas fa-arrow-down" style="margin-right: 10px;"></i> <?php echo __('nav_deposit', '充值'); ?></a>
|
||||
<a href="withdraw.php" class="btn-primary" style="background: #2b3139; padding: 12px 30px; border-radius: 10px; font-weight: bold;"><i class="fas fa-arrow-up" style="margin-right: 10px;"></i> <?php echo __('nav_withdraw', '提现'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 50px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px;">
|
||||
<h3 style="margin: 0; font-size: 1.5rem;"><?php echo __('asset_details'); ?></h3>
|
||||
<a href="#" style="color: var(--primary-color); text-decoration: none; font-size: 14px;"><?php echo __('transaction_records'); ?> <i class="fas fa-history" style="margin-left: 5px;"></i></a>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; flex-direction: column; gap: 10px;">
|
||||
<?php
|
||||
$coins = [
|
||||
['symbol' => 'USDT', 'name' => 'Tether', 'balance' => $user['balance'] ?? 0, 'price' => 1.00],
|
||||
['symbol' => 'BTC', 'name' => 'Bitcoin', 'balance' => 0.0000, 'price' => 65432.10],
|
||||
['symbol' => 'ETH', 'name' => 'Ethereum', 'balance' => 0.0000, 'price' => 3456.78],
|
||||
['symbol' => 'BNB', 'name' => 'Binance Coin', 'balance' => 0.0000, 'price' => 589.20],
|
||||
['symbol' => 'SOL', 'name' => 'Solana', 'balance' => 0.0000, 'price' => 145.60],
|
||||
];
|
||||
foreach ($coins as $coin):
|
||||
?>
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; padding: 20px; background: #161a1e; border-radius: 16px; border: 1px solid transparent; transition: 0.2s;" onmouseover="this.style.borderColor='var(--border-color)'" onmouseout="this.style.borderColor='transparent'">
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/<?php echo strtolower($coin['symbol']); ?>.png" width="40" height="40" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<div>
|
||||
<div style="font-weight: bold; font-size: 1.1rem;"><?php echo $coin['symbol']; ?></div>
|
||||
<div style="font-size: 0.8rem; color: var(--text-muted);"><?php echo $coin['name']; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-weight: bold; font-family: monospace; font-size: 1.1rem;"><?php echo number_format($coin['balance'], $coin['symbol'] === 'USDT' ? 2 : 4); ?></div>
|
||||
<div style="font-size: 0.8rem; color: var(--text-muted);">$ <?php echo number_format($coin['balance'] * $coin['price'], 2); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
99
register.php
Normal file
99
register.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/i18n.php';
|
||||
session_start();
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$username = $_POST['username'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
$confirm_password = $_POST['confirm_password'] ?? '';
|
||||
|
||||
if (empty($username) || empty($password)) {
|
||||
$error = "Please fill all fields.";
|
||||
} elseif ($password !== $confirm_password) {
|
||||
$error = "Passwords do not match.";
|
||||
} else {
|
||||
$pdo = db();
|
||||
// Check if user exists
|
||||
$stmt = $pdo->prepare("SELECT id FROM users WHERE username = ?");
|
||||
$stmt->execute([$username]);
|
||||
if ($stmt->fetch()) {
|
||||
$error = "Username already taken.";
|
||||
} else {
|
||||
// Generate unique 6-digit UID
|
||||
$uid = '';
|
||||
while (true) {
|
||||
$uid = str_pad(mt_rand(0, 999999), 6, '0', STR_PAD_LEFT);
|
||||
$checkUid = $pdo->prepare("SELECT id FROM users WHERE uid = ?");
|
||||
$checkUid->execute([$uid]);
|
||||
if (!$checkUid->fetch()) break;
|
||||
}
|
||||
|
||||
// Register and auto-login
|
||||
// Default trading_password is '123456' as requested
|
||||
$stmt = $pdo->prepare("INSERT INTO users (uid, username, password, trading_password, balance) VALUES (?, ?, ?, '123456', 0)");
|
||||
if ($stmt->execute([$uid, $username, password_hash($password, PASSWORD_DEFAULT)])) {
|
||||
$user_id = $pdo->lastInsertId();
|
||||
$_SESSION['user_id'] = $user_id;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['uid'] = $uid;
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
} else {
|
||||
$error = "Registration failed.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php include 'header.php'; ?>
|
||||
|
||||
<main style="background: #0b0e11; min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px;">
|
||||
<div style="width: 100%; max-width: 480px; background: var(--card-bg); padding: 50px; border-radius: 32px; border: 1px solid var(--border-color); box-shadow: 0 20px 40px rgba(0,0,0,0.4);">
|
||||
<h2 style="font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; text-align: center; color: white;">Create Account</h2>
|
||||
<p style="text-align: center; color: var(--text-muted); margin-bottom: 40px;">Join 100+ million traders on Exchange</p>
|
||||
|
||||
<?php if($error): ?>
|
||||
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 15px; border-radius: 12px; margin-bottom: 25px; border: 1px solid var(--danger-color); text-align: center; font-size: 14px;">
|
||||
<i class="fas fa-exclamation-circle"></i> <?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Email or Phone</label>
|
||||
<div style="position: relative;">
|
||||
<i class="fas fa-envelope" style="position: absolute; left: 15px; top: 15px; color: #555;"></i>
|
||||
<input type="text" name="username" required placeholder="Enter your email or phone" style="width: 100%; padding: 15px 15px 15px 45px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Login Password</label>
|
||||
<div style="position: relative;">
|
||||
<i class="fas fa-lock" style="position: absolute; left: 15px; top: 15px; color: #555;"></i>
|
||||
<input type="password" name="password" required placeholder="Set your login password" style="width: 100%; padding: 15px 15px 15px 45px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;">Confirm Password</label>
|
||||
<div style="position: relative;">
|
||||
<i class="fas fa-check-double" style="position: absolute; left: 15px; top: 15px; color: #555;"></i>
|
||||
<input type="password" name="confirm_password" required placeholder="Confirm your password" style="width: 100%; padding: 15px 15px 15px 45px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; font-size: 1rem; outline: none; box-sizing: border-box;">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 30px; display: flex; align-items: flex-start; gap: 12px;">
|
||||
<input type="checkbox" required style="margin-top: 4px; accent-color: var(--primary-color);">
|
||||
<span style="font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;">I have read and agree to the <a href="#" style="color: var(--primary-color);">Privacy Policy</a> and <a href="#" style="color: var(--primary-color);">Service Agreement</a>.</span>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 18px; font-weight: 800; font-size: 1.1rem; border-radius: 16px; box-shadow: 0 10px 20px rgba(0,82,255,0.2);"><?php echo __('nav_register'); ?></button>
|
||||
</form>
|
||||
<div style="text-align: center; margin-top: 30px; border-top: 1px solid var(--border-color); padding-top: 30px;">
|
||||
<span style="color: var(--text-muted);">Already have an account?</span> <a href="login.php" style="color: var(--primary-color); text-decoration: none; font-weight: bold;"><?php echo __('nav_login'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
119
security.php
Normal file
119
security.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$type = $_POST['type']; // login or trading
|
||||
$old_pass = $_POST['old_password'];
|
||||
$new_pass = $_POST['new_password'];
|
||||
$confirm_pass = $_POST['confirm_password'];
|
||||
|
||||
if ($new_pass !== $confirm_pass) {
|
||||
$error = "New passwords do not match";
|
||||
} else {
|
||||
if ($type === 'login') {
|
||||
if (password_verify($old_pass, $user['password'])) {
|
||||
$hashed = password_hash($new_pass, PASSWORD_DEFAULT);
|
||||
$stmt = $db->prepare("UPDATE users SET password = ? WHERE id = ?");
|
||||
$stmt->execute([$hashed, $_SESSION['user_id']]);
|
||||
$message = "Login password updated successfully";
|
||||
} else {
|
||||
$error = "Old login password incorrect";
|
||||
}
|
||||
} else {
|
||||
// Trading password (simple for demo, but should be hashed in production)
|
||||
if ($old_pass === $user['trading_password']) {
|
||||
$stmt = $db->prepare("UPDATE users SET trading_password = ? WHERE id = ?");
|
||||
$stmt->execute([$new_pass, $_SESSION['user_id']]);
|
||||
$message = "Trading password updated successfully";
|
||||
} else {
|
||||
$error = "Old trading password incorrect";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: 100vh;">
|
||||
<div style="max-width: 600px; margin: 0 auto;">
|
||||
|
||||
<a href="profile.php" class="back-btn"><i class="fas fa-arrow-left"></i> Profile</a>
|
||||
|
||||
<h2 style="margin-bottom: 30px;">Security Settings</h2>
|
||||
|
||||
<?php if($message): ?>
|
||||
<div style="background: rgba(14,203,129,0.1); color: var(--success-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--success-color);">
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($error): ?>
|
||||
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--danger-color);">
|
||||
<?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Login Password Form -->
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color); margin-bottom: 30px;">
|
||||
<h3 style="margin-bottom: 20px; display: flex; align-items: center; gap: 10px;">
|
||||
<i class="fas fa-key" style="color: var(--primary-color);"></i> Change Login Password
|
||||
</h3>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="type" value="login">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">Old Password</label>
|
||||
<input type="password" name="old_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">New Password</label>
|
||||
<input type="password" name="new_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">Confirm New Password</label>
|
||||
<input type="password" name="confirm_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 12px; border-radius: 8px;">Update Login Password</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Trading Password Form -->
|
||||
<div style="background: var(--card-bg); padding: 30px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<h3 style="margin-bottom: 20px; display: flex; align-items: center; gap: 10px;">
|
||||
<i class="fas fa-shield-alt" style="color: var(--success-color);"></i> Change Trading Password
|
||||
</h3>
|
||||
<p style="font-size: 13px; color: var(--text-muted); margin-bottom: 20px;">Default trading password is <b>123456</b></p>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="type" value="trading">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">Old Trading Password</label>
|
||||
<input type="password" name="old_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">New Trading Password</label>
|
||||
<input type="password" name="new_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; color: var(--text-muted); font-size: 14px; margin-bottom: 8px;">Confirm New Trading Password</label>
|
||||
<input type="password" name="confirm_password" required style="width: 100%; padding: 12px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 8px;">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 12px; border-radius: 8px; background: var(--success-color);">Update Trading Password</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
231
spot.php
Normal file
231
spot.php
Normal file
@ -0,0 +1,231 @@
|
||||
<?php
|
||||
session_start();
|
||||
include 'header.php';
|
||||
require_once 'db/config.php';
|
||||
|
||||
$user_id = $_SESSION['user_id'] ?? null;
|
||||
$balance = 0;
|
||||
if ($user_id) {
|
||||
$stmt = db()->prepare("SELECT balance FROM users WHERE id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$user = $stmt->fetch();
|
||||
$balance = $user['balance'] ?? 0;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="spot-trading-layout" style="display: grid; grid-template-columns: 280px 1fr 300px 300px; height: calc(100vh - 64px); background: #0b0e11; overflow: hidden; color: #EAECEF;">
|
||||
|
||||
<!-- Column 1: Pairs List -->
|
||||
<div style="border-right: 1px solid #1e2329; display: flex; flex-direction: column; background: #161a1e;">
|
||||
<div style="padding: 15px; border-bottom: 1px solid #1e2329;">
|
||||
<input type="text" id="pair-search" placeholder="Search Markets" style="width: 100%; background: #0b0e11; border: 1px solid #2b3139; color: white; padding: 8px 12px; border-radius: 4px; font-size: 13px;">
|
||||
</div>
|
||||
<div id="pairs-list" style="flex: 1; overflow-y: auto;">
|
||||
<!-- JS Filled -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 2: K-Line & Orders -->
|
||||
<div style="display: flex; flex-direction: column; border-right: 1px solid #1e2329; overflow: hidden;">
|
||||
<!-- Top Info Bar -->
|
||||
<div style="height: 60px; border-bottom: 1px solid #1e2329; display: flex; align-items: center; padding: 0 20px; gap: 30px; background: #161a1e;">
|
||||
<div style="display: flex; align-items: center; gap: 10px;">
|
||||
<img id="current-icon" src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/btc.png" width="24">
|
||||
<span style="font-weight: bold; font-size: 1.1rem;" id="current-pair">BTC/USDT</span>
|
||||
</div>
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<div class="stat-box"><div id="top-price" style="font-weight: bold; color: #00c087;">--.---</div><div style="font-size: 10px; color: #848e9c;">Price</div></div>
|
||||
<div class="stat-box"><div id="top-change" style="font-weight: bold;">--%</div><div style="font-size: 10px; color: #848e9c;">24h Change</div></div>
|
||||
<div class="stat-box"><div id="top-high" style="color: white;">--.---</div><div style="font-size: 10px; color: #848e9c;">24h High</div></div>
|
||||
<div class="stat-box"><div id="top-low" style="color: white;">--.---</div><div style="font-size: 10px; color: #848e9c;">24h Low</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- K-Line -->
|
||||
<div id="tradingview_chart" style="flex: 1;"></div>
|
||||
<!-- Orders Tabs -->
|
||||
<div style="height: 300px; border-top: 1px solid #1e2329; display: flex; flex-direction: column; background: #161a1e;">
|
||||
<div style="display: flex; border-bottom: 1px solid #1e2329;">
|
||||
<div class="order-tab active" onclick="switchOrderTab(this, 'open')"><?php echo __('open_orders'); ?></div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'history')"><?php echo __('order_history'); ?></div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'trades')"><?php echo __('trade_history'); ?></div>
|
||||
<div class="order-tab" onclick="switchOrderTab(this, 'funds')"><?php echo __('funds_flow'); ?></div>
|
||||
</div>
|
||||
<div style="flex: 1; overflow-y: auto; padding: 15px;">
|
||||
<table style="width: 100%; font-size: 12px; color: #848e9c; text-align: left;">
|
||||
<thead>
|
||||
<tr style="border-bottom: 1px solid #1e2329;">
|
||||
<th style="padding-bottom: 8px;">Time</th>
|
||||
<th style="padding-bottom: 8px;">Type</th>
|
||||
<th style="padding-bottom: 8px;">Side</th>
|
||||
<th style="padding-bottom: 8px;">Price</th>
|
||||
<th style="padding-bottom: 8px;">Amount</th>
|
||||
<th style="padding-bottom: 8px;">Filled</th>
|
||||
<th style="padding-bottom: 8px;">Total</th>
|
||||
<th style="padding-bottom: 8px;">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="orders-list-body">
|
||||
<tr><td colspan="8" style="text-align: center; padding: 30px; opacity: 0.5;">No active orders</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 3: Order Panel -->
|
||||
<div style="border-right: 1px solid #1e2329; background: #161a1e; display: flex; flex-direction: column; padding: 20px;">
|
||||
<div style="font-size: 14px; font-weight: bold; margin-bottom: 20px;"><?php echo __('trade_panel'); ?></div>
|
||||
|
||||
<div style="display: flex; background: #2b3139; border-radius: 4px; margin-bottom: 20px;">
|
||||
<button class="trade-type-btn active" style="flex: 1; padding: 8px; border: none; background: transparent; color: white; cursor: pointer;">Limit</button>
|
||||
<button class="trade-type-btn" style="flex: 1; padding: 8px; border: none; background: transparent; color: #848e9c; cursor: pointer;">Market</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 10px; font-size: 12px; color: #848e9c; display: flex; justify-content: space-between;">
|
||||
<span>Balance</span>
|
||||
<span style="color: white;"><?php echo number_format($balance, 2); ?> USDT</span>
|
||||
</div>
|
||||
|
||||
<!-- Buy -->
|
||||
<div style="margin-bottom: 25px;">
|
||||
<div class="input-wrap"><span>Price</span><input type="number" id="buy-price" placeholder="0.00"><span>USDT</span></div>
|
||||
<div class="input-wrap"><span>Amount</span><input type="number" id="buy-amount" placeholder="0.00"><span id="buy-token">BTC</span></div>
|
||||
<div style="margin: 15px 0;"><input type="range" class="slider" style="width: 100%;"></div>
|
||||
<button class="trade-btn buy" onclick="placeOrder('buy')">Buy <span class="buy-symbol">BTC</span></button>
|
||||
</div>
|
||||
|
||||
<!-- Sell -->
|
||||
<div>
|
||||
<div class="input-wrap"><span>Price</span><input type="number" id="sell-price" placeholder="0.00"><span>USDT</span></div>
|
||||
<div class="input-wrap"><span>Amount</span><input type="number" id="sell-amount" placeholder="0.00"><span id="sell-token">BTC</span></div>
|
||||
<div style="margin: 15px 0;"><input type="range" class="slider" style="width: 100%;"></div>
|
||||
<button class="trade-btn sell" onclick="placeOrder('sell')">Sell <span class="sell-symbol">BTC</span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column 4: Order Book -->
|
||||
<div style="background: #161a1e; display: flex; flex-direction: column;">
|
||||
<div style="padding: 15px; border-bottom: 1px solid #1e2329; font-size: 14px; font-weight: bold;">Order Book</div>
|
||||
<div style="padding: 10px 15px; font-size: 11px; color: #848e9c; display: flex; justify-content: space-between;">
|
||||
<span>Price(USDT)</span>
|
||||
<span>Amount(BTC)</span>
|
||||
</div>
|
||||
<div style="flex: 1; overflow: hidden; display: flex; flex-direction: column;">
|
||||
<div id="asks" style="flex: 1; display: flex; flex-direction: column-reverse; padding: 0 15px; overflow: hidden; font-family: monospace;"></div>
|
||||
<div id="mid-price" style="padding: 12px; text-align: center; font-size: 1.1rem; font-weight: bold; color: #00c087; background: rgba(255,255,255,0.03);">--.---</div>
|
||||
<div id="bids" style="flex: 1; display: flex; flex-direction: column; padding: 0 15px; overflow: hidden; font-family: monospace;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.stat-box { border-left: 1px solid #2b3139; padding-left: 15px; display: flex; flex-direction: column; }
|
||||
.order-tab { padding: 10px 15px; font-size: 12px; color: #848e9c; cursor: pointer; border-bottom: 2px solid transparent; }
|
||||
.order-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
|
||||
.input-wrap { background: #0b0e11; border: 1px solid #2b3139; border-radius: 4px; padding: 8px 12px; display: flex; align-items: center; margin-bottom: 12px; gap: 10px; }
|
||||
.input-wrap span { font-size: 12px; color: #848e9c; white-space: nowrap; width: 45px; }
|
||||
.input-wrap input { background: transparent; border: none; color: white; flex: 1; text-align: right; outline: none; font-weight: bold; }
|
||||
.trade-btn { width: 100%; padding: 12px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; color: white; }
|
||||
.trade-btn.buy { background: #00c087; }
|
||||
.trade-btn.sell { background: #f6465d; }
|
||||
.slider { -webkit-appearance: none; height: 3px; background: #2b3139; border-radius: 2px; }
|
||||
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: white; border-radius: 50%; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
|
||||
<script>
|
||||
let currentSymbol = 'BTCUSDT';
|
||||
let currentPrice = 0;
|
||||
const pairs = ['BTCUSDT', 'ETHUSDT', 'SOLUSDT', 'BNBUSDT', 'XRPUSDT', 'ADAUSDT', 'DOGEUSDT', 'DOTUSDT', 'LINKUSDT', 'LTCUSDT', 'MATICUSDT'];
|
||||
|
||||
function initChart(symbol) {
|
||||
new TradingView.widget({
|
||||
"width": "100%", "height": "100%", "symbol": "BINANCE:" + symbol, "interval": "15", "timezone": "Etc/UTC", "theme": "dark", "style": "1", "locale": "<?php echo $lang == 'zh' ? 'zh_CN' : 'en'; ?>", "container_id": "tradingview_chart", "backgroundColor": "#0b0e11", "gridColor": "rgba(42, 46, 57, 0.05)", "hide_side_toolbar": false, "allow_symbol_change": false, "save_image": false
|
||||
});
|
||||
}
|
||||
initChart(currentSymbol);
|
||||
|
||||
const ws = new WebSocket('wss://stream.binance.com:9443/ws/' + pairs.map(p => p.toLowerCase() + '@ticker').join('/'));
|
||||
const marketData = {};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
const s = data.s;
|
||||
marketData[s] = data;
|
||||
renderPairsList();
|
||||
|
||||
if (s === currentSymbol) {
|
||||
currentPrice = parseFloat(data.c);
|
||||
document.getElementById('top-price').innerText = currentPrice.toLocaleString();
|
||||
document.getElementById('top-price').style.color = data.P >= 0 ? '#00c087' : '#f6465d';
|
||||
document.getElementById('top-change').innerText = (data.P >= 0 ? '+' : '') + data.P + '%';
|
||||
document.getElementById('top-change').style.color = data.P >= 0 ? '#00c087' : '#f6465d';
|
||||
document.getElementById('top-high').innerText = parseFloat(data.h).toLocaleString();
|
||||
document.getElementById('top-low').innerText = parseFloat(data.l).toLocaleString();
|
||||
document.getElementById('mid-price').innerText = currentPrice.toLocaleString();
|
||||
updateOrderBook(currentPrice);
|
||||
}
|
||||
};
|
||||
|
||||
function renderPairsList() {
|
||||
const list = document.getElementById('pairs-list');
|
||||
let html = '';
|
||||
pairs.forEach(p => {
|
||||
const d = marketData[p] || {c: 0, P: 0};
|
||||
const color = d.P >= 0 ? '#00c087' : '#f6465d';
|
||||
const name = p.replace('USDT', '');
|
||||
html += `
|
||||
<div onclick="changePair('${p}')" style="display: flex; justify-content: space-between; padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #1e2329; ${currentSymbol === p ? 'background: #2b3139;' : ''}">
|
||||
<div style="display: flex; gap: 8px; align-items: center;">
|
||||
<img src="https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png" width="18" onerror="this.src='https://cdn-icons-png.flaticon.com/512/2585/2585274.png'">
|
||||
<span style="font-weight: bold; font-size: 13px;">${name}</span>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-size: 13px;">${parseFloat(d.c).toLocaleString()}</div>
|
||||
<div style="color: ${color}; font-size: 11px;">${d.P >= 0 ? '+' : ''}${d.P}%</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
list.innerHTML = html;
|
||||
}
|
||||
|
||||
function changePair(pair) {
|
||||
currentSymbol = pair;
|
||||
const name = pair.replace('USDT', '');
|
||||
document.getElementById('current-pair').innerText = name + '/USDT';
|
||||
document.getElementById('current-icon').src = `https://raw.githubusercontent.com/spothq/cryptocurrency-icons/master/128/color/${name.toLowerCase()}.png`;
|
||||
document.getElementById('buy-token').innerText = name;
|
||||
document.getElementById('sell-token').innerText = name;
|
||||
document.querySelectorAll('.buy-symbol, .sell-symbol').forEach(el => el.innerText = name);
|
||||
initChart(pair);
|
||||
renderPairsList();
|
||||
}
|
||||
|
||||
function updateOrderBook(price) {
|
||||
let asksHtml = ''; let bidsHtml = '';
|
||||
for(let i=1; i<=20; i++) {
|
||||
const askPrice = (price + (i * 0.01 * price / 100)).toFixed(2);
|
||||
const bidPrice = (price - (i * 0.01 * price / 100)).toFixed(2);
|
||||
asksHtml += `<div style="display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0;"><span style="color: #f6465d;">${askPrice}</span><span style="color: #848e9c;">${(Math.random()*1).toFixed(4)}</span></div>`;
|
||||
bidsHtml += `<div style="display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0;"><span style="color: #00c087;">${bidPrice}</span><span style="color: #848e9c;">${(Math.random()*1).toFixed(4)}</span></div>`;
|
||||
}
|
||||
document.getElementById('asks').innerHTML = asksHtml;
|
||||
document.getElementById('bids').innerHTML = bidsHtml;
|
||||
}
|
||||
|
||||
async function placeOrder(side) {
|
||||
const price = parseFloat(document.getElementById(side + '-price').value) || currentPrice;
|
||||
const amount = parseFloat(document.getElementById(side + '-amount').value);
|
||||
if (!amount) return alert('Please enter amount');
|
||||
const response = await fetch('api/place_order.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ symbol: currentSymbol, type: 'spot', side: side, order_type: 'limit', price: price, amount: amount, total: price * amount })
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.success) { alert('Order placed!'); location.reload(); } else { alert('Error: ' + result.error); }
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
16
terms.php
Normal file
16
terms.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<div class="container" style="max-width: 1000px; margin: 60px auto; padding: 0 20px;">
|
||||
<h1 style="font-size: 2.5rem; margin-bottom: 40px;"><?php echo __('terms_service'); ?></h1>
|
||||
<div style="background: var(--card-bg); padding: 40px; border-radius: 24px; border: 1px solid var(--border-color); color: #ccc; line-height: 1.6;">
|
||||
<p>Last Updated: February 2026</p>
|
||||
<h3 style="color: white;">1. Acceptance of Terms</h3>
|
||||
<p>By accessing or using the Exchange platform, you agree to be bound by these Terms of Service. If you do not agree to all of these terms, do not use our services.</p>
|
||||
<h3 style="color: white; margin-top: 30px;">2. Eligibility</h3>
|
||||
<p>You must be at least 18 years old and have the legal capacity to enter into these Terms. Use of the services is void where prohibited by law.</p>
|
||||
<h3 style="color: white; margin-top: 30px;">3. Risk Disclosure</h3>
|
||||
<p>Trading cryptocurrencies involves significant risk and can result in the loss of your invested capital. You should only trade with funds you can afford to lose.</p>
|
||||
<h3 style="color: white; margin-top: 30px;">4. Account Security</h3>
|
||||
<p>You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php include 'footer.php'; ?>
|
||||
136
withdraw.php
Normal file
136
withdraw.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
include 'header.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$amount = $_POST['amount'];
|
||||
$address = $_POST['address'];
|
||||
$network = $_POST['network'];
|
||||
$trading_pass = $_POST['trading_password'];
|
||||
|
||||
if ($trading_pass !== $user['trading_password']) {
|
||||
$error = "Incorrect trading password";
|
||||
} elseif ($amount > $user['balance']) {
|
||||
$error = "Insufficient balance";
|
||||
} elseif ($amount < 10) {
|
||||
$error = "Minimum withdrawal amount is 10 USDT";
|
||||
} else {
|
||||
// Process withdrawal (simplified)
|
||||
$db->beginTransaction();
|
||||
try {
|
||||
$stmt = $db->prepare("UPDATE users SET balance = balance - ? WHERE id = ?");
|
||||
$stmt->execute([$amount, $_SESSION['user_id']]);
|
||||
|
||||
// Log as a special type of order or transaction
|
||||
$stmt = $db->prepare("INSERT INTO orders (user_id, type, amount, currency, account_info, status) VALUES (?, 'usdt', ?, 'USDT', ?, 'pending')");
|
||||
$stmt->execute([$_SESSION['user_id'], $amount, "Network: $network, Address: $address"]);
|
||||
|
||||
$db->commit();
|
||||
$message = "Withdrawal request submitted successfully. Please wait for audit.";
|
||||
// Refresh user data
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
} catch (Exception $e) {
|
||||
$db->rollBack();
|
||||
$error = "System error, please try again later";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<main style="padding: 40px 20px; background: #0b0e11; min-height: calc(100vh - 64px);">
|
||||
<div style="max-width: 800px; margin: 0 auto;">
|
||||
|
||||
<a href="profile.php" class="back-btn"><i class="fas fa-arrow-left"></i> <?php echo __('nav_profile'); ?></a>
|
||||
|
||||
<div style="margin-bottom: 40px;">
|
||||
<h1 style="font-size: 2.5rem; font-weight: bold; margin-bottom: 10px;"><?php echo __('withdraw_assets'); ?></h1>
|
||||
<p style="color: var(--text-muted);"><?php echo __('withdraw_tip'); ?></p>
|
||||
</div>
|
||||
|
||||
<?php if($message): ?>
|
||||
<div style="background: rgba(14,203,129,0.1); color: var(--success-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--success-color);">
|
||||
<i class="fas fa-check-circle"></i> <?php echo $message; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($error): ?>
|
||||
<div style="background: rgba(246,70,93,0.1); color: var(--danger-color); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--danger-color);">
|
||||
<i class="fas fa-exclamation-circle"></i> <?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px;">
|
||||
<div style="background: var(--card-bg); padding: 35px; border-radius: 24px; border: 1px solid var(--border-color);">
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('select_network'); ?></label>
|
||||
<select name="network" style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
<option value="TRC20">USDT - TRC20 (Recommended)</option>
|
||||
<option value="ERC20">USDT - ERC20</option>
|
||||
<option value="BEP20">USDT - BEP20 (BSC)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('withdraw_address'); ?></label>
|
||||
<input type="text" name="address" placeholder="Paste your USDT wallet address" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('amount'); ?></label>
|
||||
<div style="position: relative;">
|
||||
<input type="number" name="amount" id="withdraw-amount" placeholder="Min. 10" step="0.01" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
<span onclick="document.getElementById('withdraw-amount').value = '<?php echo $user['balance']; ?>'" style="position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--primary-color); font-weight: bold; cursor: pointer; font-size: 12px;"><?php echo __('max'); ?></span>
|
||||
</div>
|
||||
<div style="margin-top: 8px; font-size: 12px; color: var(--text-muted);">
|
||||
<?php echo __('available_balance'); ?>: <span style="color: white; font-weight: bold;"><?php echo number_format($user['balance'], 2); ?> USDT</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 14px;"><?php echo __('trading_password'); ?></label>
|
||||
<input type="password" name="trading_password" placeholder="Enter 6-digit trading password" required style="width: 100%; padding: 14px; background: #161a1e; border: 1px solid var(--border-color); color: white; border-radius: 12px; outline: none;">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn-primary" style="width: 100%; padding: 16px; font-size: 1.1rem; border-radius: 12px; background: var(--danger-color);"><?php echo __('submit_withdrawal'); ?></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div style="background: rgba(240,185,11,0.05); padding: 25px; border-radius: 20px; border: 1px solid rgba(240,185,11,0.1); margin-bottom: 20px;">
|
||||
<h4 style="color: #f0b90b; margin: 0 0 15px; display: flex; align-items: center; gap: 10px;"><i class="fas fa-exclamation-triangle"></i> <?php echo __('withdrawal_tips'); ?></h4>
|
||||
<ul style="color: var(--text-muted); font-size: 13px; line-height: 1.8; padding-left: 20px; margin: 0;">
|
||||
<li><?php echo __('withdrawal_tip_1'); ?></li>
|
||||
<li><?php echo __('withdrawal_tip_2'); ?></li>
|
||||
<li><?php echo __('withdrawal_tip_3'); ?></li>
|
||||
<li><?php echo __('withdrawal_tip_4'); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="background: var(--card-bg); padding: 25px; border-radius: 20px; border: 1px solid var(--border-color);">
|
||||
<h4 style="margin: 0 0 15px;"><?php echo __('recent_history'); ?></h4>
|
||||
<div style="color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0;">
|
||||
<?php echo __('no_records'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
Loading…
x
Reference in New Issue
Block a user