PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
session_start();
// 1. Ensure the user is logged in
if (!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}
// 2. Database Configuration (Your exact details)
$host = 'localhost';
$dbname = 'u264723324_OcDdB';
$user = 'u264723324_OcUnN';
$pass = '@WdsdsdAq1231';
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// 3. LIVE QUERY: Fetch the user's exact status right now
$stmt = $pdo->prepare("SELECT first_name, last_name, kyc_status FROM users WHERE id = :id LIMIT 1");
$stmt->execute([':id' => $_SESSION['user_id']]);
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);
if ($userRow) {
// Update session with live data
$_SESSION['kyc_status'] = $userRow['kyc_status'];
$_SESSION['first_name'] = $userRow['first_name'];
$_SESSION['last_name'] = $userRow['last_name'];
} else {
// User not found in DB anymore? Force logout
session_destroy();
header("Location: login.php");
exit();
}
// 4. LIVE QUERY: Fetch the user's Bank Account and Balance
$stmtAcc = $pdo->prepare("SELECT account_number, balance FROM accounts WHERE user_id = :id AND account_type IN ('savings', 'current') LIMIT 1");
$stmtAcc->execute([':id' => $_SESSION['user_id']]);
$accRow = $stmtAcc->fetch(PDO::FETCH_ASSOC);
// Format the dynamic account data
$fiatBalance = $accRow ? number_format($accRow['balance'], 2) : "0.00";
$accNumber = $accRow ? $accRow['account_number'] : "Pending";
$hiddenAcc = $accRow ? substr($accNumber, -4) : "****";
} catch (PDOException $e) {
// Fail safe: lock them out if DB fails
$_SESSION['kyc_status'] = 'pending';
$fiatBalance = "0.00";
$accNumber = "Error";
$hiddenAcc = "****";
}
// Setup display variables
$kyc_status = $_SESSION['kyc_status'];
$firstName = $_SESSION['first_name'];
$lastName = $_SESSION['last_name'];
$userInitial = strtoupper(substr($firstName, 0, 1));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Oceanictrusts Banking Dashboard</title>
<style>
/* =========================================
CSS VARIABLES & RESET
========================================= */
:root {
--bg-dark: #0a0e17;
--surface-dark: #131a2a;
--surface-light: #1e2738;
--accent-blue: #0ea5e9;
--accent-yellow: #facc15;
--text-main: #f8fafc;
--text-muted: #94a3b8;
--danger: #ef4444;
--success: #22c55e;
--card-gradient: linear-gradient(135deg, #0284c7, #0f172a);
}
* {
margin: 0; padding: 0; box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
-webkit-tap-highlight-color: transparent;
}
body { background-color: var(--bg-dark); color: var(--text-main); }
/* =========================================
LAYOUT & DASHBOARD ELEMENTS
========================================= */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.sidebar { display: none; }
.main-content { flex: 1; padding: 20px; padding-bottom: 90px; overflow-x: hidden; }
/* Header */
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.user-greeting { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; background: #fff; color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem; }
.user-greeting p { font-size: 0.75rem; color: var(--text-muted); }
.user-greeting h2 { font-size: 1.1rem; font-weight: 600; text-transform: capitalize; }
/* Notifications Icon */
.notifications { position: relative; background: var(--surface-dark); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.notifications:active { transform: scale(0.95); }
.notifications::after { content: '4'; position: absolute; top: 0; right: 0; background: var(--danger); color: white; font-size: 0.6rem; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
/* Common Section Headers */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; margin-top: 32px; }
.section-header h3 { font-size: 1.1rem; font-weight: 600; }
.section-header a { color: var(--accent-blue); text-decoration: none; font-size: 0.85rem; }
/* Swipeable Balances */
.balance-section { margin-bottom: 24px; }
.balance-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 16px; padding-bottom: 10px; }
.balance-slider::-webkit-scrollbar { display: none; }
.balance-slide { min-width: 100%; scroll-snap-align: start; }
.balance-card { padding: 20px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); height: 100%; display: flex; flex-direction: column; justify-content: space-between; min-height: 200px;}
.fiat-card { background: var(--card-gradient); }
.crypto-card { background: linear-gradient(135deg, #3f3f46, #18181b); }
.card-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.balance-card h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 4px; text-align: center; }
.sub-balance { text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; }
.status { background: rgba(255,255,255,0.1); padding: 4px 10px; border-radius: 20px; color: var(--success); display: flex; align-items: center; gap: 4px; }
.status.neutral { color: var(--text-main); }
.swipe-indicators { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dot { width: 6px; height: 6px; background: rgba(255,255,255,0.2); border-radius: 50%; transition: 0.3s; }
.dot.active { background: var(--text-main); width: 16px; border-radius: 4px; }
.swipe-hint { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; }
/* Quick Actions */
.quick-actions { display: flex; justify-content: space-between; padding: 0 10px; }
.action-btn { background: none; border: none; color: var(--text-main); display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: 0.8rem; }
.action-btn .icon { width: 50px; height: 50px; background: var(--surface-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: 0.2s; }
.action-btn:active .icon { transform: scale(0.95); }
.icon.yellow { color: var(--accent-yellow); font-size: 1.5rem; }
/* Quick Transfer */
.quick-transfer-list { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.quick-transfer-list::-webkit-scrollbar { display: none; }
.transfer-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }
.add-new-circle { width: 48px; height: 48px; border-radius: 50%; border: 1px dashed var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text-muted); transition: 0.2s; }
.transfer-item:active .add-new-circle { transform: scale(0.95); background: rgba(255,255,255,0.05); }
.no-saved { display: flex; align-items: center; height: 48px; padding: 0 16px; background: var(--surface-dark); border-radius: 24px; white-space: nowrap; }
/* Active Cards */
.credit-card { background: var(--card-gradient); border-radius: 16px; padding: 20px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; }
.credit-card::after { content: ''; position: absolute; top: -50px; right: -50px; width: 150px; height: 150px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.cc-top h4 { font-size: 1.1rem; }
.cc-top p { font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.cc-chip { width: 40px; height: 30px; background: linear-gradient(135deg, #eab308, #ca8a04); border-radius: 6px; }
.cc-number { font-size: 1.4rem; letter-spacing: 2px; margin-bottom: 24px; font-family: monospace; }
.cc-bottom { display: flex; justify-content: space-between; font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.cc-bottom h5 { font-size: 0.9rem; color: white; margin-top: 4px; text-transform: uppercase; }
.manage-card-btn { width: 100%; background: var(--surface-dark); border: 1px solid rgba(255,255,255,0.05); padding: 12px; border-radius: 12px; color: var(--text-main); cursor: pointer; font-weight: 600; transition: 0.2s;}
.manage-card-btn:active { transform: scale(0.98); }
/* Financial Services Grid */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-card { background: var(--surface-dark); padding: 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.02); }
.service-card .icon-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.service-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.05); }
.badge.available { color: var(--success); }
.badge.rejected { color: var(--danger); }
.service-btn { width: 100%; padding: 8px; border-radius: 8px; border: none; background: rgba(14, 165, 233, 0.1); color: var(--accent-blue); margin-top: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;}
.service-btn.green { background: rgba(34, 197, 94, 0.1); color: var(--success); }
/* Financial Insights */
.insight-card { background: var(--surface-dark); border-radius: 16px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255,255,255,0.02); }
.insight-card h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 4px;}
.insight-card h2 { font-size: 1.2rem; }
.insight-card .ratio { text-align: right; }
.insight-card .ratio h2 { color: var(--accent-blue); }
.income-expense-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;}
.ie-card { background: var(--surface-dark); padding: 16px; border-radius: 16px; text-align: center; }
.ie-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.ie-card h3 { font-size: 1.1rem; }
.ie-card.income h3 { color: var(--success); }
.ie-card.expense h3 { color: var(--danger); }
.tip-card { background: rgba(14, 165, 233, 0.1); border-left: 4px solid var(--accent-blue); padding: 12px 16px; border-radius: 8px; font-size: 0.8rem; display: flex; align-items: center; gap: 12px; }
/* Recent Activity */
.activity-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--surface-dark); border-radius: 12px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,0.02); }
.activity-left { display: flex; align-items: center; gap: 12px; }
.tx-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.tx-icon.in { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.tx-icon.achievement { background: rgba(234, 179, 8, 0.1); color: var(--accent-yellow); }
.activity-details h4 { font-size: 0.9rem; margin-bottom: 2px; }
.activity-details p { font-size: 0.75rem; color: var(--text-muted); }
.activity-right { text-align: right; }
.activity-right a { font-size: 0.75rem; color: var(--accent-blue); text-decoration: none; }
/* Need Help */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.help-card { background: var(--surface-dark); padding: 16px; border-radius: 16px; text-align: center; border: 1px solid rgba(255,255,255,0.02); cursor: pointer;}
.help-card .icon { font-size: 1.5rem; margin-bottom: 8px; }
.help-card h4 { font-size: 0.9rem; margin-bottom: 4px; }
.help-card p { font-size: 0.7rem; color: var(--text-muted); }
/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; width: 100%; background: rgba(19, 26, 42, 0.95); backdrop-filter: blur(10px); display: flex; justify-content: space-around; padding: 12px 0 24px 0; border-top: 1px solid rgba(255,255,255,0.05); z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.7rem; gap: 4px; }
.nav-item.active { color: var(--accent-blue); }
/* =========================================
MODALS & FORMS
========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s ease-in-out; z-index: 1000; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-container { background: var(--surface-dark); width: 100%; max-width: 500px; border-radius: 24px 24px 0 0; padding: 24px; transform: translateY(100%); transition: 0.3s ease-in-out; border-top: 1px solid rgba(255,255,255,0.05); max-height: 90vh; overflow-y: auto;}
.modal-overlay.active .modal-container { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-header h3 { font-size: 1.2rem; }
.close-btn { background: rgba(255,255,255,0.1); border: none; color: white; width: 30px; height: 30px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
/* Transfer CSS Additions */
.back-btn { background: none; border: none; color: var(--accent-blue); font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.form-group { margin-bottom: 16px; }
.form-input { width: 100%; background: var(--bg-dark); border: 1px solid rgba(255,255,255,0.1); color: var(--text-main); padding: 16px; border-radius: 12px; font-size: 1rem; outline: none; transition: 0.2s; }
.form-input:focus { border-color: var(--accent-blue); }
.form-input::placeholder { color: rgba(255,255,255,0.3); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em; }
.balance-preview { display: flex; justify-content: space-between; background: rgba(255,255,255,0.03); padding: 12px 16px; border-radius: 12px; margin-bottom: 24px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.05); }
.balance-preview span { color: var(--text-muted); }
.balance-preview strong { color: var(--success); }
/* Toggle Switch (For Manage Card Modal) */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--danger); }
input:checked + .slider:before { transform: translateX(22px); }
/* Reusable List Option */
.list-option { background: var(--surface-light); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; cursor: pointer; border: 1px solid transparent; transition: 0.2s;}
.list-option:active { transform: scale(0.98); background: rgba(255,255,255,0.05); }
.option-icon { font-size: 1.5rem; }
.option-details h4 { font-size: 1rem; margin-bottom: 4px; }
.option-details p { font-size: 0.75rem; color: var(--text-muted); }
.arrow { margin-left: auto; color: var(--text-muted); }
/* Bank Account Details Card */
.bank-details-card { background: var(--surface-light); border-radius: 16px; padding: 20px; margin-bottom: 24px; border: 1px solid rgba(255,255,255,0.05); }
.bank-details-card h4 { font-size: 1rem; margin-bottom: 16px; color: var(--accent-blue); display: flex; align-items: center; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row span { font-size: 0.8rem; color: var(--text-muted); }
.detail-row strong { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.copy-icon-btn { background: rgba(255,255,255,0.1); border: none; color: var(--text-main); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 0.7rem; }
/* Forms & Inputs */
.form-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; margin-top: 16px;}
.crypto-selector { display: flex; flex-direction: column; gap: 10px; }
.crypto-radio { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--surface-light); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); cursor: pointer; }
.crypto-radio.selected { border-color: var(--accent-blue); background: rgba(14, 165, 233, 0.1); }
.amount-input-wrapper { position: relative; display: flex; align-items: center; background: var(--bg-dark); border-radius: 12px; padding: 0 16px; border: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px;}
.amount-input-wrapper span { font-size: 1.5rem; color: var(--text-muted); }
.amount-input-wrapper input { background: transparent; border: none; color: white; font-size: 1.5rem; padding: 16px 8px; width: 100%; outline: none; }
.quick-amounts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none;}
.quick-amounts::-webkit-scrollbar { display: none; }
.chip { background: var(--surface-light); padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.05); cursor: pointer; white-space: nowrap; }
.primary-btn { width: 100%; background: var(--accent-blue); color: white; border: none; padding: 16px; border-radius: 12px; font-size: 1rem; font-weight: 600; margin-top: 24px; cursor: pointer; }
/* QR Code Screen */
.qr-container { background: white; padding: 16px; border-radius: 16px; width: 200px; height: 200px; margin: 0 auto 24px auto; display: flex; align-items: center; justify-content: center; }
.qr-placeholder { border: 4px dashed #ccc; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #999; text-align: center; font-size: 0.8rem;}
.address-box { background: var(--bg-dark); padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: space-between; word-break: break-all; gap: 12px;}
.address-text { font-size: 0.8rem; color: var(--text-muted); }
/* Toast Notification */
.toast { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); background: var(--success); color: white; padding: 12px 24px; border-radius: 30px; font-size: 0.9rem; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 2000; }
.toast.show { top: 40px; }
/* =========================================
DESKTOP MEDIA QUERY
========================================= */
@media (min-width: 1024px) {
.app-container { flex-direction: row; }
.bottom-nav { display: none; }
.sidebar { display: flex; flex-direction: column; width: 260px; background: var(--surface-dark); border-right: 1px solid rgba(255,255,255,0.05); padding: 32px 24px; height: 100vh; position: sticky; top: 0; }
.sidebar .logo { font-size: 1.5rem; font-weight: bold; margin-bottom: 48px; color: var(--accent-blue); }
.side-nav { display: flex; flex-direction: column; gap: 12px; }
.side-nav a { color: var(--text-muted); text-decoration: none; padding: 12px 16px; border-radius: 12px; transition: 0.2s; display: flex; align-items: center; gap: 12px; }
.side-nav a:hover, .side-nav a.active { background: rgba(14, 165, 233, 0.1); color: var(--accent-blue); }
.main-content { padding: 40px 60px; max-width: 1200px; margin: 0 auto; }
.balance-slider { overflow-x: visible; gap: 24px; }
.balance-slide { min-width: calc(50% - 12px); }
.swipe-indicators, .swipe-hint { display: none; }
.services-grid, .help-grid { grid-template-columns: repeat(4, 1fr); }
.modal-overlay { align-items: center; }
.modal-container { border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); }
}
</style>
</head>
<!-- Smartsupp Live Chat script -->
<script type="text/javascript">
var _smartsupp = _smartsupp || {};
_smartsupp.key = '88dd736a86bde59e385ad126b142bdbf95589f1a';
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='https://www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
</script>
<noscript>Powered by <a href="https://www.smartsupp.com" target="_blank">Smartsupp</a></noscript>
<body>
<?php if ($kyc_status === 'pending' || $kyc_status === 'rejected'): ?>
<style>
body { overflow: hidden !important; }
.restriction-overlay {
position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
background: rgba(10, 14, 23, 0.85); backdrop-filter: blur(12px);
z-index: 9999; display: flex; align-items: center; justify-content: center;
padding: 20px;
}
.restriction-box {
background: var(--surface-dark); border: 1px solid rgba(255,255,255,0.1);
padding: 40px; border-radius: 24px; text-align: center; max-width: 450px;
box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.restriction-icon { font-size: 3rem; margin-bottom: 16px; }
.restriction-box h2 { margin-bottom: 12px; color: var(--text-main); font-size: 1.5rem;}
.restriction-box p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 24px;}
.logout-btn-large {
display: inline-block; width: 100%; background: rgba(239, 68, 68, 0.1);
color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3);
padding: 16px; border-radius: 12px; text-decoration: none; font-weight: 600;
transition: 0.2s;
}
.logout-btn-large:active { transform: scale(0.98); background: rgba(239, 68, 68, 0.2); }
</style>
<div class="restriction-overlay">
<div class="restriction-box">
<?php if ($kyc_status === 'pending'): ?>
<div class="restriction-icon">⏳</div>
<h2>Account Under Review</h2>
<p>Welcome, <?php echo htmlspecialchars($firstName); ?>! Your account has been created successfully. For your security, our compliance team is reviewing your details.</p>
<p>You will receive an email as soon as your dashboard is unlocked.</p>
<?php else: ?>
<div class="restriction-icon">🚫</div>
<h2>Account Restricted</h2>
<p>Your application could not be verified. Please contact Oceanictrusts support for further assistance.</p>
<?php endif; ?>
<a href="logout.php" class="logout-btn-large">Sign Out</a>
</div>
</div>
<?php endif; ?>
<div id="toast" class="toast">Action Successful!</div>
<div class="app-container">
<aside class="sidebar">
<div class="logo">Oceanictrusts</div>
<nav class="side-nav">
<a href="#" class="active"><span>🏠</span> Home</a>
<a href="activity.php"><span>📊</span> Activity</a>
<a href="transfer.php"><span>💸</span> Transfer</a>
<a href="cards.php"><span>💳</span> Cards</a>
<a href="profile.php"><span>👤</span> Profile</a>
</nav>
</aside>
<main class="main-content">
<header class="top-header">
<div class="user-greeting">
<div class="avatar"><?php echo htmlspecialchars($userInitial); ?></div>
<div>
<p>Good Morning 👋</p>
<h2><?php echo htmlspecialchars($firstName . ' ' . $lastName); ?></h2>
</div>
</div>
<div class="notifications" data-target="notificationModal"><span>🔔</span></div>
</header>
<section class="balance-section">
<div class="balance-slider" id="balanceSlider">
<div class="balance-slide">
<div class="balance-card fiat-card">
<div class="card-header"><span>Oceanictrusts Bank</span><span>Account **** <?php echo htmlspecialchars($hiddenAcc); ?></span></div>
<div><p style="text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.7);">Available Balance</p><h1>$<?php echo htmlspecialchars($fiatBalance); ?></h1></div>
<div class="card-footer"><span class="status">● Active</span><span>Last updated: Just now</span></div>
</div>
</div>
<div class="balance-slide">
<div class="balance-card crypto-card">
<div class="card-header"><span>Bitcoin Wallet</span><span>Crypto Account ₿</span></div>
<div><p style="text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.7);">Bitcoin Balance</p><h1>0.408736 BTC</h1><p class="sub-balance">≈ $35,179.44</p></div>
<div class="card-footer"><span>1 BTC = $86,069</span><span class="status neutral">Live Rate</span></div>
</div>
</div>
</div>
<div class="swipe-indicators"><span class="dot active"></span><span class="dot"></span></div>
<p class="swipe-hint">↔ Swipe to switch between accounts</p>
</section>
<section class="quick-actions">
<button class="action-btn" data-target="topupModal"><div class="icon yellow">+</div> Top Up</button>
<button class="action-btn" data-target="sendModal"><div class="icon">↗</div> Send</button>
<button class="action-btn" data-target="receiveModal"><div class="icon">↙</div> Receive</button>
<button class="action-btn" data-target="moreModal"><div class="icon">⋮</div> More</button>
</section>
<section class="quick-transfer">
<div class="section-header"><h3>Quick Transfer</h3><a href="beneficiaries.php">View All ></a></div>
<div class="quick-transfer-list">
<div class="transfer-item" data-target="addBeneficiaryModal">
<div class="add-new-circle">+</div>
<p>Add New</p>
</div>
<div class="transfer-item">
<div class="no-saved">No saved beneficiaries</div>
</div>
</div>
</section>
<section class="active-cards-section">
<div class="section-header"><h3>Your Active Cards</h3><a href="cards.php">Manage ></a></div>
<div class="credit-card">
<div class="cc-top">
<div><h4>Oceanictrusts</h4><p>Virtual Banking</p></div>
<div class="cc-chip"></div>
</div>
<div class="cc-number">**** **** **** 3061</div>
<div class="cc-bottom">
<div><p>Card Holder</p><h5><?php echo htmlspecialchars($firstName . ' ' . $lastName); ?></h5></div>
<div><p>Valid</p><h5>11/28</h5></div>
</div>
</div>
<button class="manage-card-btn" data-target="manageCardModal">Manage Card</button>
</section>
<section class="services-section">
<div class="section-header"><h3>Financial Services</h3><a href="services.php">View All ></a></div>
<div class="services-grid">
<div class="service-card">
<div class="icon-row"><span>🏦</span> <h4>Loans</h4></div>
<span class="badge available">● Available</span>
<button class="service-btn" onclick="window.location.href='loans.php'">Apply Now</button>
</div>
<div class="service-card">
<div class="icon-row"><span>🤝</span> <h4>Grants</h4></div>
<span class="badge rejected">● Rejected</span>
<button class="service-btn green" onclick="window.location.href='grants.php'">View Status</button>
</div>
<div class="service-card">
<div class="icon-row"><span>📄</span> <h4>Tax Refunds</h4></div>
<span class="badge available">Fast processing</span>
<button class="service-btn" onclick="window.location.href='tax.php'">Apply Now</button>
</div>
<div class="service-card">
<div class="icon-row"><span>💳</span> <h4>Virtual Cards</h4></div>
<span class="badge available">● Active</span>
<button class="service-btn" data-target="manageCardModal">Manage Cards</button>
</div>
</div>
</section>
<section class="insights-section">
<div class="section-header"><h3>Financial Insights</h3><a href="insights.php">View Report ></a></div>
<div class="insight-card">
<div><h4>Account Health</h4><h2>Fair</h2></div>
<div class="ratio"><h4>Balance Ratio</h4><h2>12.9%</h2></div>
</div>
<div class="section-header" style="margin-top: 16px;"><h3>This Month</h3></div>
<div class="income-expense-grid">
<div class="ie-card income"><p>Income</p><h3>$0.00</h3></div>
<div class="ie-card expense"><p>Expenses</p><h3>$0.41</h3></div>
</div>
<div class="tip-card">
<span style="font-size: 1.5rem;">💡</span>
<div>
<strong>Save Regularly</strong>
<p style="color: var(--text-muted); margin-top: 4px;">Set up automatic transfers to build your emergency fund.</p>
</div>
</div>
</section>
<section class="activity-section">
<div class="section-header"><h3>Recent Activity</h3><a href="activity.php">View All ></a></div>
<div class="activity-item">
<div class="activity-left">
<div class="tx-icon in">↓</div>
<div class="activity-details"><h4>Credit</h4><p>02 Nov 2025, 17:00</p></div>
</div>
<div class="activity-right">
<h4 style="color: var(--success); margin-bottom: 4px;">+$0.41</h4>
<a href="transaction-details.php?id=1">View Details</a>
</div>
</div>
<div class="activity-item">
<div class="activity-left">
<div class="tx-icon in">↓</div>
<div class="activity-details"><h4>Credit</h4><p>21 Nov 2025, 05:59</p></div>
</div>
<div class="activity-right">
<h4 style="color: var(--success); margin-bottom: 4px;">+$65,000.00</h4>
<a href="transaction-details.php?id=2">View Details</a>
</div>
</div>
<div class="section-header" style="margin-top: 16px;"><h3>Achievements</h3></div>
<div class="activity-item">
<div class="activity-left">
<div class="tx-icon achievement">🏆</div>
<div class="activity-details"><h4>First Deposit</h4><p>Great start to your financial journey!</p></div>
</div>
</div>
</section>
<section class="help-section">
<div class="section-header"><h3>Need Help?</h3><a href="support.php">Support Center ></a></div>
<div class="help-grid">
<div class="help-card" onclick="window.location.href='chat.php'">
<div class="icon">💬</div><h4>Live Chat</h4><p>Get instant help from our team</p>
</div>
<div class="help-card" onclick="window.location.href='mailto:support@cityprime.com'">
<div class="icon">✉️</div><h4>Email Support</h4><p>Send us a detailed message</p>
</div>
</div>
</section>
</main>
<nav class="bottom-nav">
<a href="activity.php" class="nav-item"><span class="nav-icon">📊</span>Activity</a>
<a href="transfer.php" class="nav-item"><span class="nav-icon">💸</span>Transfer</a>
<a href="#" class="nav-item active"><span class="nav-icon">🏠</span>Home</a>
<a href="cards.php" class="nav-item"><span class="nav-icon">💳</span>Cards</a>
<a href="profile.php" class="nav-item"><span class="nav-icon">👤</span>Profile</a>
</nav>
</div>
<div class="modal-overlay" id="notificationModal">
<div class="modal-container">
<div class="modal-header">
<h3>Notifications</h3>
<button class="close-btn">×</button>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
<p class="modal-subtitle" style="margin-bottom: 0;">You have 2 unread alerts</p>
<button style="background: none; border: none; color: var(--accent-blue); cursor: pointer; font-size: 0.8rem;" onclick="showToast('All notifications marked as read')">Mark all read</button>
</div>
<div style="max-height: 400px; overflow-y: auto; padding-right: 4px;">
<div class="list-option" style="border-left: 3px solid var(--accent-blue);">
<div class="option-icon" style="background: rgba(14, 165, 233, 0.1); color: var(--accent-blue); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;">🔐</div>
<div class="option-details" style="flex: 1;">
<h4 style="display: flex; justify-content: space-between;">New Login Detected <span style="font-size: 0.65rem; color: var(--text-muted); font-weight: normal;">Just now</span></h4>
<p style="margin-top: 4px;">We noticed a login from a new device (MacBook Pro) in Lagos, Nigeria.</p>
</div>
</div>
<div class="list-option" style="border-left: 3px solid var(--success);">
<div class="option-icon" style="background: rgba(34, 197, 94, 0.1); color: var(--success); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;">💵</div>
<div class="option-details" style="flex: 1;">
<h4 style="display: flex; justify-content: space-between;">Deposit Successful <span style="font-size: 0.65rem; color: var(--text-muted); font-weight: normal;">2 hrs ago</span></h4>
<p style="margin-top: 4px;">Your deposit of $<?php echo htmlspecialchars($fiatBalance); ?> has been credited to your Account.</p>
</div>
</div>
</div>
</div>
</div>
<div class="modal-overlay" id="sendModal">
<div class="modal-container">
<div class="modal-header"><h3>Send Money</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Swift & Secure Money Transfer</p>
<div class="list-option" id="openLocalTransferBtn">
<div class="option-icon">🏦</div><div class="option-details"><h4>Local Transfer</h4><p>Send money to local accounts instantly</p></div><div class="arrow">→</div>
</div>
<div class="list-option" id="openWireTransferBtn">
<div class="option-icon">🌍</div><div class="option-details"><h4>International Wire</h4><p>Global transfers via SWIFT/IBAN</p></div><div class="arrow">→</div>
</div>
</div>
</div>
<div class="modal-overlay" id="localTransferModal">
<div class="modal-container">
<div class="modal-header">
<button class="back-btn" id="backToSendMenu">← Back</button>
<button class="close-btn">×</button>
</div>
<h3 style="margin-top: 8px; margin-bottom: 4px;">Local Transfer</h3>
<p class="modal-subtitle">Send money instantly to any local bank.</p>
<div class="balance-preview">
<span>From Account ****<?php echo htmlspecialchars($hiddenAcc); ?>:</span>
<strong>$<?php echo htmlspecialchars($fiatBalance); ?> Available</strong>
</div>
<form id="localTransferForm" onsubmit="handleTransfer(event, 'localTransferModal')">
<div class="form-group">
<label class="form-label">Amount ($)</label>
<input type="number" class="form-input" placeholder="0.00" required min="1">
</div>
<div class="form-group">
<label class="form-label">Select Bank</label>
<select class="form-input" required>
<option value="" disabled selected>Choose Beneficiary Bank...</option>
<option value="chase">Chase Bank</option>
<option value="boa">Bank of America</option>
<option value="citi">CitiBank</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Account Number</label>
<input type="number" class="form-input" id="accNumberInput" placeholder="Enter 10-digit account number" required>
</div>
<div class="form-group">
<label class="form-label">Account Name</label>
<input type="text" class="form-input" id="accNameInput" placeholder="Enter account name" required readonly style="background: rgba(255,255,255,0.02); color: var(--text-muted);">
</div>
<button type="submit" class="primary-btn">Proceed with Transfer</button>
</form>
</div>
</div>
<div class="modal-overlay" id="wireTransferModal">
<div class="modal-container">
<div class="modal-header">
<button class="back-btn" id="backToSendMenuFromWire">← Back</button>
<button class="close-btn">×</button>
</div>
<h3 style="margin-top: 8px; margin-bottom: 4px;">International Wire</h3>
<p class="modal-subtitle">Global transfers via SWIFT network.</p>
<div class="balance-preview">
<span>From Account ****<?php echo htmlspecialchars($hiddenAcc); ?>:</span>
<strong>$<?php echo htmlspecialchars($fiatBalance); ?> Available</strong>
</div>
<form id="wireTransferForm" onsubmit="handleTransfer(event, 'wireTransferModal')">
<div class="form-group">
<label class="form-label">Amount ($)</label>
<input type="number" class="form-input" placeholder="0.00" required min="100">
</div>
<div class="form-group">
<label class="form-label">Recipient's Country</label>
<select class="form-input" required>
<option value="" disabled selected>Select Country...</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
<option value="ng">Nigeria</option>
<option value="ae">United Arab Emirates</option>
</select>
</div>
<div class="form-group">
<label class="form-label">SWIFT / BIC Code</label>
<input type="text" class="form-input" placeholder="e.g. BOFAUS3N" required style="text-transform: uppercase;">
</div>
<div class="form-group">
<label class="form-label">IBAN / Account Number</label>
<input type="text" class="form-input" placeholder="Enter IBAN or Account Number" required>
</div>
<div class="form-group">
<label class="form-label">Beneficiary Full Name</label>
<input type="text" class="form-input" placeholder="Name on the bank account" required>
</div>
<button type="submit" class="primary-btn">Initiate Wire Transfer</button>
</form>
</div>
</div>
<div class="modal-overlay" id="addBeneficiaryModal">
<div class="modal-container">
<div class="modal-header"><h3>Add Beneficiary</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Save details for quicker transfers later.</p>
<form id="addBeneficiaryForm" onsubmit="handleFormSubmit(event, 'addBeneficiaryModal', 'Beneficiary Saved Successfully!')">
<div class="form-group">
<label class="form-label">Select Bank</label>
<select class="form-input" required>
<option value="" disabled selected>Choose Bank...</option>
<option value="chase">Chase Bank</option>
<option value="boa">Bank of America</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Account Number</label>
<input type="number" class="form-input" placeholder="Enter account number" required>
</div>
<div class="form-group">
<label class="form-label">Alias / Nickname (Optional)</label>
<input type="text" class="form-input" placeholder="e.g. Landlord, Mom">
</div>
<button type="submit" class="primary-btn">Save Beneficiary</button>
</form>
</div>
</div>
<div class="modal-overlay" id="manageCardModal">
<div class="modal-container">
<div class="modal-header"><h3>Card Settings</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Manage your virtual Oceanictrusts card.</p>
<div class="credit-card" style="margin-bottom: 24px;">
<div class="cc-top">
<div><h4>Oceanictrusts</h4><p>Virtual Banking</p></div>
<div class="cc-chip"></div>
</div>
<div class="cc-number">**** **** **** 3061</div>
<div class="cc-bottom">
<div><p>Card Holder</p><h5><?php echo htmlspecialchars($firstName . ' ' . $lastName); ?></h5></div>
<div><p>Valid</p><h5>11/28</h5></div>
</div>
</div>
<div class="detail-row" style="padding: 16px 0;">
<div>
<strong style="color: white; font-size: 1rem;">Freeze Card</strong>
<p style="font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;">Temporarily disable all transactions</p>
</div>
<label class="toggle-switch">
<input type="checkbox" onchange="showToast(this.checked ? 'Card Frozen ❄️' : 'Card Unfrozen ✅')">
<span class="slider"></span>
</label>
</div>
<div class="list-option" style="margin-top: 16px;" onclick="showToast('Verification Code Sent')">
<div class="option-icon" style="font-size: 1.2rem;">👁️</div>
<div class="option-details"><h4>View Card Details</h4><p>Reveal CVV and full card number</p></div>
</div>
<div class="list-option" onclick="showToast('PIN Reset Initiated')">
<div class="option-icon" style="font-size: 1.2rem;">🔢</div>
<div class="option-details"><h4>Change PIN</h4><p>Set a new 4-digit card PIN</p></div>
</div>
</div>
</div>
<div class="modal-overlay" id="topupModal">
<div class="modal-container">
<div class="modal-header"><h3>Fund Your Account</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Choose your preferred deposit method and amount</p>
<label class="form-label">Select Deposit Method</label>
<div class="crypto-selector">
<div class="crypto-radio selected"><div style="display:flex; align-items:center; gap:12px;"><span>💵</span><strong>USDT</strong></div><div style="width:16px; height:16px; border-radius:50%; background:var(--accent-blue);"></div></div>
<div class="crypto-radio"><div style="display:flex; align-items:center; gap:12px;"><span>🔷</span><strong>Ethereum</strong></div><div style="width:16px; height:16px; border-radius:50%; border:2px solid #555;"></div></div>
</div>
<label class="form-label">Deposit Amount</label>
<div class="amount-input-wrapper"><span>$</span><input type="number" id="depositAmount" placeholder="0.00"></div>
<div class="quick-amounts">
<div class="chip" onclick="document.getElementById('depositAmount').value = 100">$100</div>
<div class="chip" onclick="document.getElementById('depositAmount').value = 500">$500</div>
<div class="chip" onclick="document.getElementById('depositAmount').value = 1000">$1000</div>
</div>
<button class="primary-btn" onclick="showToast('Generating Deposit Address...')">Continue to Deposit</button>
</div>
</div>
<div class="modal-overlay" id="receiveModal">
<div class="modal-container">
<div class="modal-header"><h3>Receive Funds</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Share your account details to receive money</p>
<div class="bank-details-card">
<h4><span>🏦</span> Direct Bank Transfer</h4>
<div class="detail-row"><span>Bank Name</span><strong>Oceanictrusts Bank</strong></div>
<div class="detail-row"><span>Account Name</span><strong><?php echo htmlspecialchars($firstName . ' ' . $lastName); ?></strong></div>
<div class="detail-row"><span>Account Number</span><strong><?php echo htmlspecialchars($accNumber); ?> <button class="copy-icon-btn" onclick="copyText('<?php echo htmlspecialchars($accNumber); ?>')">Copy</button></strong></div>
<div class="detail-row"><span>Routing Number</span><strong>021000021 <button class="copy-icon-btn" onclick="copyText('021000021')">Copy</button></strong></div>
</div>
<p class="form-label" style="text-align: center; margin-bottom: 12px;">OR</p>
<div class="list-option" id="openCryptoReceiveBtn">
<div class="option-icon">₿</div><div class="option-details"><h4>Receive Cryptocurrency</h4><p>Bitcoin, Ethereum, USDT</p></div><div class="arrow">→</div>
</div>
</div>
</div>
<div class="modal-overlay" id="cryptoReceiveModal">
<div class="modal-container">
<div class="modal-header">
<div style="display:flex; align-items:center; gap:12px;">
<button class="copy-icon-btn" id="backToReceiveBtn">← Back</button>
<h3>Receive Crypto</h3>
</div>
<button class="close-btn">×</button>
</div>
<p class="modal-subtitle">Scan with your wallet app</p>
<div class="qr-container"><div class="qr-placeholder">QR Code Image Here</div></div>
<label class="form-label">Bitcoin Address</label>
<div class="address-box">
<span class="address-text" id="btcAddress">bc1qxy2kgdygjrsqtzq2n0yrf249...</span>
<button class="copy-icon-btn" style="padding: 8px 16px; background: rgba(255,255,255,0.2);" onclick="copyText(document.getElementById('btcAddress').innerText)">Copy</button>
</div>
</div>
</div>
<div class="modal-overlay" id="moreModal">
<div class="modal-container">
<div class="modal-header"><h3>More Options</h3><button class="close-btn">×</button></div>
<p class="modal-subtitle">Manage your account and settings</p>
<div class="list-option" onclick="window.location.href='settings.php'"><div class="option-icon">⚙️</div><div class="option-details"><h4>Settings</h4><p>App preferences and security</p></div></div>
<div class="list-option" onclick="window.location.href='limits.php'"><div class="option-icon">📈</div><div class="option-details"><h4>Account Limits</h4><p>View your transaction tiers</p></div></div>
</div>
</div>
<script>
// --- Toast & Copy Logic ---
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.classList.add('show');
document.querySelectorAll('.modal-overlay').forEach(m => m.classList.remove('active'));
setTimeout(() => { toast.classList.remove('show'); }, 3000);
}
function copyText(text) {
navigator.clipboard.writeText(text);
const toast = document.getElementById('toast');
toast.textContent = 'Copied to Clipboard!';
toast.classList.add('show');
setTimeout(() => { toast.classList.remove('show'); }, 3000);
}
document.addEventListener('DOMContentLoaded', () => {
// --- Slider Logic ---
const slider = document.getElementById('balanceSlider');
const dots = document.querySelectorAll('.swipe-indicators .dot');
if (slider && dots.length > 0) {
slider.addEventListener('scroll', () => {
const scrollPosition = slider.scrollLeft;
const slideWidth = slider.clientWidth;
const activeIndex = Math.round(scrollPosition / slideWidth);
dots.forEach((dot, index) => { dot.classList.toggle('active', index === activeIndex); });
});
}
// --- Standard Modal Opening/Closing ---
const openButtons = document.querySelectorAll('[data-target]');
const closeButtons = document.querySelectorAll('.close-btn');
const overlays = document.querySelectorAll('.modal-overlay');
openButtons.forEach(btn => {
btn.addEventListener('click', () => {
const targetId = btn.getAttribute('data-target');
document.getElementById(targetId).classList.add('active');
});
});
closeButtons.forEach(btn => {
btn.addEventListener('click', (e) => { e.target.closest('.modal-overlay').classList.remove('active'); });
});
overlays.forEach(overlay => {
overlay.addEventListener('click', (e) => {
if (e.target === overlay) { overlay.classList.remove('active'); }
});
});
// --- Nested Modal Logics ---
const sendModal = document.getElementById('sendModal');
// 1. Send -> Local Transfer
const localTransferModal = document.getElementById('localTransferModal');
const openLocalTransferBtn = document.getElementById('openLocalTransferBtn');
const backToSendMenu = document.getElementById('backToSendMenu');
if(openLocalTransferBtn && backToSendMenu) {
openLocalTransferBtn.addEventListener('click', () => {
sendModal.classList.remove('active');
localTransferModal.classList.add('active');
});
backToSendMenu.addEventListener('click', () => {
localTransferModal.classList.remove('active');
sendModal.classList.add('active');
});
}
// 2. Send -> Wire Transfer
const wireTransferModal = document.getElementById('wireTransferModal');
const openWireTransferBtn = document.getElementById('openWireTransferBtn');
const backToSendMenuFromWire = document.getElementById('backToSendMenuFromWire');
if(openWireTransferBtn && backToSendMenuFromWire) {
openWireTransferBtn.addEventListener('click', () => {
sendModal.classList.remove('active');
wireTransferModal.classList.add('active');
});
backToSendMenuFromWire.addEventListener('click', () => {
wireTransferModal.classList.remove('active');
sendModal.classList.add('active');
});
}
// 3. Receive -> Crypto Receive
const openCryptoBtn = document.getElementById('openCryptoReceiveBtn');
const backToReceiveBtn = document.getElementById('backToReceiveBtn');
const primaryReceiveModal = document.getElementById('receiveModal');
const cryptoReceiveModal = document.getElementById('cryptoReceiveModal');
if(openCryptoBtn && backToReceiveBtn) {
openCryptoBtn.addEventListener('click', () => {
primaryReceiveModal.classList.remove('active');
cryptoReceiveModal.classList.add('active');
});
backToReceiveBtn.addEventListener('click', () => {
cryptoReceiveModal.classList.remove('active');
primaryReceiveModal.classList.add('active');
});
}
// --- Local Transfer Fake Name Resolution ---
const accNumberInput = document.getElementById('accNumberInput');
const accNameInput = document.getElementById('accNameInput');
if(accNumberInput && accNameInput) {
accNumberInput.addEventListener('input', (e) => {
const val = e.target.value;
if (val.length >= 10) {
accNameInput.value = "Resolving name...";
setTimeout(() => {
const names = ["John Doe", "Sarah Connor", "Acme Corp Ltd.", "Michael Scott"];
accNameInput.value = names[Math.floor(Math.random() * names.length)];
accNameInput.style.color = "var(--text-main)";
accNameInput.style.background = "var(--bg-dark)";
}, 800);
} else {
accNameInput.value = "";
accNameInput.style.color = "var(--text-muted)";
accNameInput.style.background = "rgba(255,255,255,0.02)";
}
});
}
});
// --- Universal Form Submission Handlers ---
function handleTransfer(event, modalId) {
event.preventDefault();
document.getElementById(modalId).classList.remove('active');
showToast('Transfer Processing...');
setTimeout(() => {
showToast('Transfer Successful! ✅');
event.target.reset(); // Clears the form you just submitted
}, 1500);
}
function handleFormSubmit(event, modalId, successMessage) {
event.preventDefault();
document.getElementById(modalId).classList.remove('active');
showToast(successMessage);
event.target.reset();
}
</script>
</body>
</html>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E