File manager - Edit - /home/justdoit/portal.springpasscapital.com/index.php
Back
<?php session_start(); require_once 'config/database.php'; require_once 'includes/functions.php'; // This MUST be here // Check if user is logged in $isLoggedIn = isset($_SESSION['user_id']); $userData = null; $accounts = []; $totalBalance = 0; $isAdmin = false; if ($isLoggedIn) { $userId = $_SESSION['user_id']; // Get user data try { $stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$userId]); $userData = $stmt->fetch(); if (!$userData) { // User not found in database, destroy session session_destroy(); header('Location: index.php?error=' . urlencode('User account not found')); exit; } // Get user accounts $stmt = $pdo->prepare("SELECT * FROM accounts WHERE user_id = ? AND status = 'active'"); $stmt->execute([$userId]); $accounts = $stmt->fetchAll(); // Calculate total balance $totalBalance = 0; foreach ($accounts as $account) { if ($account['account_type'] != 'credit') { $totalBalance += $account['balance']; } } // Get recent transactions $stmt = $pdo->prepare(" SELECT t.*, a.account_type FROM transactions t JOIN accounts a ON t.account_id = a.id WHERE t.user_id = ? ORDER BY t.created_at DESC LIMIT 5 "); $stmt->execute([$userId]); $recentTransactions = $stmt->fetchAll(); // Get beneficiaries $stmt = $pdo->prepare("SELECT * FROM beneficiaries WHERE user_id = ? ORDER BY is_favorite DESC LIMIT 4"); $stmt->execute([$userId]); $beneficiaries = $stmt->fetchAll(); // Check if admin $isAdmin = ($userData['role'] == 'admin' || $userData['role'] == 'super_admin'); // Admin stats (if admin) $adminStats = null; $allUsers = []; if ($isAdmin) { // Get admin statistics $stmt = $pdo->query("SELECT COUNT(*) as total_users FROM users"); $totalUsers = $stmt->fetch()['total_users']; $stmt = $pdo->query("SELECT COUNT(*) as active_users FROM users WHERE status = 'active'"); $activeUsers = $stmt->fetch()['active_users']; $stmt = $pdo->query("SELECT COALESCE(SUM(balance), 0) as total_deposits FROM accounts WHERE account_type IN ('savings', 'checking', 'fixed_deposit')"); $totalDeposits = $stmt->fetch()['total_deposits']; $stmt = $pdo->query("SELECT COUNT(*) as total_txns FROM transactions WHERE DATE(created_at) = CURDATE()"); $totalTxns = $stmt->fetch()['total_txns']; $stmt = $pdo->query("SELECT COALESCE(SUM(amount), 0) as total_transfers FROM transactions WHERE DATE(created_at) = CURDATE() AND transaction_type IN ('transfer_out', 'transfer_in')"); $totalTransfers = $stmt->fetch()['total_transfers']; $adminStats = [ 'total_users' => number_format($totalUsers), 'active_users' => number_format($activeUsers), 'total_deposits' => '$' . number_format($totalDeposits / 1000000, 1) . 'M', 'total_transfers' => '$' . number_format($totalTransfers / 1000000, 1) . 'M', 'total_txns' => number_format($totalTxns), 'revenue' => '$4.6M' ]; // Get all users $stmt = $pdo->query("SELECT id, full_name, email, role, status FROM users LIMIT 10"); $allUsers = $stmt->fetchAll(); } } catch (PDOException $e) { error_log("Database error in index.php: " . $e->getMessage()); $error = "A database error occurred. Please try again later."; } } // Get current page $page = isset($_GET['page']) ? $_GET['page'] : 'dashboard'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Spring Pass Capital | Enterprise Digital Banking</title> <meta name="theme-color" content="#2596be"> <meta name="description" content="Spring Pass Capital - Premium Digital Banking Platform"> <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@300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800&family=Manrope:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/toastr/build/toastr.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/dataTables.bootstrap5.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/apexcharts@3.45.1/dist/apexcharts.css"> <style> :root { --primary: #2596be; --primary-dark: #1c7fa3; --primary-deeper: #0f5e78; --primary-light: #eaf7fc; --bg-light: #f8fbfd; --white: #ffffff; --success: #16a34a; --danger: #dc2626; --warning: #f59e0b; --gradient: linear-gradient(135deg, #2596be, #1c7fa3, #0f5e78); --gradient-light: linear-gradient(135deg, #eaf7fc, #f8fbfd, #ffffff); --shadow-sm: 0 2px 8px rgba(37, 150, 190, 0.08); --shadow: 0 4px 20px rgba(37, 150, 190, 0.12); --shadow-lg: 0 12px 40px rgba(37, 150, 190, 0.18); --shadow-xl: 0 20px 60px rgba(37, 150, 190, 0.22); --radius-sm: 12px; --radius: 18px; --radius-lg: 24px; --radius-xl: 28px; --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); --font-inter: 'Inter', sans-serif; --font-poppins: 'Poppins', sans-serif; --font-manrope: 'Manrope', sans-serif; --sidebar-width: 280px; --sidebar-collapsed: 80px; --topbar-height: 70px; } * { margin: 0; padding: 0; box-sizing: border-box; } html { scroll-behavior: smooth; font-size: 15px; } body { font-family: var(--font-inter); background: var(--bg-light); color: #1a1a2e; overflow-x: hidden; min-height: 100vh; -webkit-font-smoothing: antialiased; } /* Glass Effect */ .glass { background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, 0.6); } .glass-strong { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(37, 150, 190, 0.12); } /* Sidebar */ .sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; background: var(--white); z-index: 1000; transition: all var(--transition); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; border-right: 1px solid rgba(37, 150, 190, 0.08); } .sidebar.collapsed { width: var(--sidebar-collapsed); } .sidebar-logo { padding: 20px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(37, 150, 190, 0.08); min-height: var(--topbar-height); flex-shrink: 0; } .sidebar-logo .logo-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--gradient); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.4rem; flex-shrink: 0; box-shadow: 0 4px 15px rgba(37, 150, 190, 0.35); } .sidebar-logo .logo-text { font-family: var(--font-poppins); font-weight: 700; font-size: 1.15rem; color: #1a1a2e; white-space: nowrap; transition: all var(--transition); } .sidebar.collapsed .logo-text { opacity: 0; width: 0; overflow: hidden; } .sidebar-nav { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; } .sidebar-nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition); color: #555; font-weight: 500; font-size: 0.9rem; white-space: nowrap; position: relative; text-decoration: none; font-family: var(--font-inter); } .sidebar-nav .nav-item:hover { background: var(--primary-light); color: var(--primary); transform: translateX(4px); } .sidebar-nav .nav-item.active { background: var(--gradient); color: #fff; box-shadow: var(--shadow); font-weight: 600; } .sidebar-nav .nav-item i { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; } .sidebar-nav .nav-item .nav-label { transition: all var(--transition); } .sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; } .sidebar-nav .nav-section { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: #999; padding: 16px 16px 6px; font-weight: 700; white-space: nowrap; } .sidebar.collapsed .nav-section { opacity: 0; height: 0; padding: 0; overflow: hidden; } .sidebar-toggle { position: absolute; top: 50%; right: -14px; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 2px solid rgba(37, 150, 190, 0.2); cursor: pointer; z-index: 1001; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--primary); transition: all var(--transition); box-shadow: var(--shadow-sm); } .sidebar-toggle:hover { background: var(--primary); color: #fff; border-color: var(--primary); } /* Main Content */ .main-content { margin-left: var(--sidebar-width); transition: all var(--transition); min-height: 100vh; background: var(--bg-light); } .main-content.expanded { margin-left: var(--sidebar-collapsed); } .topbar { height: var(--topbar-height); background: var(--white); border-bottom: 1px solid rgba(37, 150, 190, 0.08); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 999; gap: 20px; box-shadow: var(--shadow-sm); } .topbar .search-box { display: flex; align-items: center; gap: 10px; background: var(--bg-light); border-radius: 50px; padding: 9px 18px; flex: 0 0 320px; border: 1px solid transparent; transition: all var(--transition); } .topbar .search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.08); background: #fff; } .topbar .search-box input { border: none; background: transparent; outline: none; flex: 1; font-size: 0.88rem; font-family: var(--font-inter); } .topbar .search-box i { color: #999; font-size: 0.9rem; } .topbar-actions { display: flex; align-items: center; gap: 16px; } .topbar-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--bg-light); cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; position: relative; font-size: 1rem; color: #555; } .topbar-btn:hover { background: var(--primary-light); color: var(--primary); } .topbar-btn .badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; } .user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: var(--shadow-sm); transition: all var(--transition); } .user-avatar:hover { box-shadow: var(--shadow); transform: scale(1.05); } /* Dashboard Content */ .dashboard-content { padding: 24px 28px; display: flex; flex-direction: column; gap: 24px; } .welcome-section { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; } .welcome-text h1 { font-family: var(--font-poppins); font-weight: 700; font-size: 1.8rem; color: #1a1a2e; margin: 0; } .welcome-text .subtitle { color: #777; font-size: 0.88rem; margin-top: 2px; } .badge-premium { background: var(--gradient); color: #fff; padding: 8px 16px; border-radius: 50px; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow); } .stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; } .stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); transition: all var(--transition); cursor: pointer; position: relative; overflow: hidden; border: 1px solid rgba(37, 150, 190, 0.06); display: flex; flex-direction: column; gap: 8px; } .stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: rgba(37, 150, 190, 0.2); } .stat-card .stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; } .stat-card .stat-icon.blue { background: var(--primary-light); color: var(--primary); } .stat-card .stat-icon.green { background: #e6f7ee; color: var(--success); } .stat-card .stat-icon.amber { background: #fef3e0; color: var(--warning); } .stat-card .stat-icon.red { background: #fde8e8; color: var(--danger); } .stat-card .stat-value { font-family: var(--font-poppins); font-weight: 700; font-size: 1.6rem; color: #1a1a2e; } .stat-card .stat-label { font-size: 0.82rem; color: #888; font-weight: 500; } .stat-card .stat-change { font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 4px; } .stat-card .stat-change.up { color: var(--success); } .stat-card .stat-change.down { color: var(--danger); } .stat-card .mini-chart { position: absolute; right: 16px; bottom: 14px; opacity: 0.2; font-size: 3rem; color: var(--primary); } /* Card Styles */ .dashboard-card { background: var(--white); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); border: 1px solid rgba(37, 150, 190, 0.05); transition: all var(--transition); } .dashboard-card .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; } .dashboard-card .card-title { font-family: var(--font-poppins); font-weight: 600; font-size: 1.05rem; color: #1a1a2e; } .dashboard-card .card-badge { font-size: 0.75rem; padding: 5px 12px; border-radius: 50px; font-weight: 600; } .grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; } @media (max-width: 1200px) { .grid-2col, .grid-3col { grid-template-columns: 1fr; } .topbar .search-box { flex: 0 0 200px; } } @media (max-width: 768px) { .sidebar { width: var(--sidebar-collapsed); left: -100%; z-index: 1050; } .sidebar.mobile-open { left: 0; width: var(--sidebar-width); } .sidebar.mobile-open .nav-label, .sidebar.mobile-open .logo-text, .sidebar.mobile-open .nav-section { opacity: 1; width: auto; overflow: visible; height: auto; padding: inherit; } .main-content { margin-left: 0 !important; } .stat-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .topbar .search-box { display: none; } .mobile-menu-btn { display: flex !important; } } .mobile-menu-btn { display: none; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--bg-light); cursor: pointer; align-items: center; justify-content: center; font-size: 1.1rem; color: #555; } /* Buttons */ .btn-primary-custom { background: var(--gradient); color: #fff; border: none; padding: 10px 20px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: var(--font-inter); font-size: 0.88rem; box-shadow: var(--shadow); } .btn-primary-custom:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); opacity: 0.95; color: #fff; } .btn-outline-custom { background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 9px 18px; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: var(--font-inter); font-size: 0.88rem; } .btn-outline-custom:hover { background: var(--primary-light); } /* Table */ .table-custom { width: 100%; border-collapse: collapse; font-size: 0.85rem; } .table-custom th { background: var(--bg-light); padding: 12px 14px; text-align: left; font-weight: 600; color: #555; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid rgba(37, 150, 190, 0.1); } .table-custom td { padding: 13px 14px; border-bottom: 1px solid rgba(37, 150, 190, 0.05); vertical-align: middle; } .table-custom tr:hover td { background: var(--primary-light); } .status-badge { padding: 5px 11px; border-radius: 50px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.3px; } .status-completed { background: #e6f7ee; color: var(--success); } .status-pending { background: #fef3e0; color: var(--warning); } .status-failed { background: #fde8e8; color: var(--danger); } .status-processing { background: #e8f4fd; color: var(--primary); } /* Overlay */ .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1049; } .sidebar-overlay.active { display: block; } /* Savings Goal Ring */ .goal-ring-container { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; } .goal-ring { position: relative; width: 130px; height: 130px; } .goal-ring svg { transform: rotate(-90deg); } .goal-ring .bg-circle { fill: none; stroke: #e8f0f5; stroke-width: 10; } .goal-ring .fg-circle { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease; } .goal-ring .goal-percent { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-poppins); font-weight: 700; font-size: 1.5rem; color: #1a1a2e; } /* Admin highlight */ .admin-indicator { background: #fef3e0; color: #b45309; padding: 4px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } } /* Scrollbar */ ::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; } ::-webkit-scrollbar-thumb:hover { background: #bbb; } /* Quick Transfer */ .quick-transfer-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; box-shadow: var(--shadow-sm); } .page-section { display: none; } .page-section.active { display: flex; flex-direction: column; gap: 24px; } .custom-tabs { display: flex; gap: 4px; background: var(--bg-light); border-radius: 50px; padding: 4px; flex-wrap: wrap; } .custom-tabs .tab-btn { padding: 8px 18px; border-radius: 50px; border: none; background: transparent; cursor: pointer; font-weight: 500; font-size: 0.82rem; transition: all var(--transition); font-family: var(--font-inter); white-space: nowrap; } .custom-tabs .tab-btn.active { background: var(--white); box-shadow: var(--shadow-sm); color: var(--primary); font-weight: 600; } /* Modal Styles */ .modal-content { border-radius: 20px !important; border: none !important; box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important; } .modal-header { border-radius: 20px 20px 0 0 !important; padding: 20px 24px !important; } .modal-body { padding: 24px !important; } .modal-backdrop { background-color: rgba(0,0,0,0.5); } /* Card type selection */ #debitOption, #creditOption, #virtualOption { transition: all 0.3s ease; cursor: pointer; } #debitOption:hover, #creditOption:hover, #virtualOption:hover { border-color: #2596be !important; background: #f8fbfd !important; } /* Ensure modals display properly */ .modal { z-index: 1060; } .modal-backdrop { z-index: 1050; } .alert { border-radius: 12px; font-size: 0.9rem; } /* Fix dropdown z-index */ .dropdown-menu { z-index: 9999 !important; } .dropdown { position: relative; z-index: 1000; } /* Ensure stat cards don't overlap dropdowns */ .stat-cards { position: relative; z-index: 1; } .stat-card { position: relative; z-index: 1; } /* Fix for all dropdowns in the page */ .btn-group, .dropdown, .dropup, .dropstart, .dropend { position: relative; } .dropdown-menu.show { z-index: 9999 !important; display: block; } /* Ensure the topbar dropdown also works */ .topbar-actions .dropdown-menu { z-index: 9999 !important; } /* Card headers with dropdowns */ .card-header .dropdown { z-index: 10; } .card-header .dropdown-menu { z-index: 9999 !important; }/* Fix dropdowns */ .dropdown { position: relative; } .dropdown-menu { z-index: 9999 !important; position: absolute; } .dropdown-menu.show { display: block; } .topbar-actions .dropdown-menu { margin-top: 10px; } /* Remove default button styling from user avatar */ .user-avatar.dropdown-toggle { border: none !important; outline: none !important; } .user-avatar.dropdown-toggle:focus { box-shadow: var(--shadow) !important; } /* Remove dropdown toggle arrow from avatar */ .user-avatar.dropdown-toggle::after { display: none !important; } /* Notification badge */ .badge-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; border: 2px solid #fff; } /* Dropdown header */ .dropdown-header { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #888; padding: 8px 16px; font-weight: 700; } </style> </head> <body> <?php if (!$isLoggedIn): ?> <!-- Login Page --> <?php if (file_exists('pages/login.php')) { include 'pages/login.php'; } else { echo '<div style="text-align:center;padding:50px;">'; echo '<h2>Welcome to Spring Pass Capital</h2>'; echo '<p>Login page is not available. Please check your installation.</p>'; echo '<a href="register.php">Register</a> | <a href="forgot-password.php">Forgot Password</a>'; echo '</div>'; } ?> <?php else: ?> <!-- Sidebar Overlay --> <div class="sidebar-overlay" id="sidebarOverlay" onclick="closeMobileSidebar()"></div> <!-- Sidebar --> <aside class="sidebar" id="sidebar"> <div class="sidebar-logo"> <div class="logo-icon"><i class="fas fa-mountain-sun"></i></div> <span class="logo-text">Spring Pass<br><small style="font-size:0.65rem;color:#888;">Capital</small></span> <button class="sidebar-toggle" id="sidebarToggleBtn" onclick="toggleSidebar()" title="Toggle Sidebar"> <i class="fas fa-chevron-left" id="toggleIcon"></i> </button> </div> <nav class="sidebar-nav" id="sidebarNav"> <?php if (file_exists('includes/sidebar-nav.php')) { include 'includes/sidebar-nav.php'; } else { // Fallback navigation if file doesn't exist ?> <div class="nav-section">Main Menu</div> <a class="nav-item <?php echo ($page == 'dashboard') ? 'active' : ''; ?>" href="index.php?page=dashboard"> <i class="fas fa-th-large"></i><span class="nav-label">Dashboard</span></a> <a class="nav-item <?php echo ($page == 'accounts') ? 'active' : ''; ?>" href="index.php?page=accounts"> <i class="fas fa-wallet"></i><span class="nav-label">Accounts</span></a> <a class="nav-item <?php echo ($page == 'transfers') ? 'active' : ''; ?>" href="index.php?page=transfers"> <i class="fas fa-paper-plane"></i><span class="nav-label">Transfers</span></a> <a class="nav-item <?php echo ($page == 'beneficiaries') ? 'active' : ''; ?>" href="index.php?page=beneficiaries"> <i class="fas fa-users"></i><span class="nav-label">Beneficiaries</span></a> <a class="nav-item <?php echo ($page == 'cards') ? 'active' : ''; ?>" href="index.php?page=cards"> <i class="fas fa-credit-card"></i><span class="nav-label">Cards</span></a> <a class="nav-item <?php echo ($page == 'deposits') ? 'active' : ''; ?>" href="index.php?page=deposits"> <i class="fas fa-piggy-bank"></i><span class="nav-label">Deposits</span></a> <a class="nav-item <?php echo ($page == 'loans') ? 'active' : ''; ?>" href="index.php?page=loans"> <i class="fas fa-hand-holding-usd"></i><span class="nav-label">Loans</span></a> <a class="nav-item <?php echo ($page == 'investments') ? 'active' : ''; ?>" href="index.php?page=investments"> <i class="fas fa-chart-line"></i><span class="nav-label">Investments</span></a> <div class="nav-section">Activity</div> <a class="nav-item <?php echo ($page == 'transactions') ? 'active' : ''; ?>" href="index.php?page=transactions"> <i class="fas fa-exchange-alt"></i><span class="nav-label">Transactions</span></a> <a class="nav-item" href="#" onclick="showLogoutAlert()"> <i class="fas fa-sign-out-alt"></i><span class="nav-label">Logout</span></a> <?php } ?> </nav> </aside> <!-- Main Content --> <div class="main-content" id="mainContent"> <!-- Topbar --> <header class="topbar glass-strong"> <button class="mobile-menu-btn" onclick="toggleMobileSidebar()"> <i class="fas fa-bars"></i> </button> <div class="search-box"> <i class="fas fa-search"></i> <input type="text" placeholder="Search transactions, accounts..." id="globalSearch"> </div> <div class="topbar-actions"> <?php if ($isAdmin): ?> <a href="admin/dashboard.php" class="admin-indicator" style="text-decoration:none;">🔒 ADMIN MODE</a> <?php endif; ?> <!-- Notification Button --> <div class="dropdown"> <button class="topbar-btn dropdown-toggle" type="button" data-bs-toggle="dropdown" title="Notifications"> <i class="fas fa-bell"></i> <?php $unreadNotifs = $pdo->query("SELECT COUNT(*) FROM messages WHERE user_id = $userId AND is_read = 0")->fetchColumn(); if ($unreadNotifs > 0): ?> <span class="badge-dot"></span> <?php endif; ?> </button> <ul class="dropdown-menu dropdown-menu-end" style="width:320px;max-height:400px;overflow-y:auto;"> <li><h6 class="dropdown-header">Notifications</h6></li> <?php $notifs = $pdo->prepare("SELECT * FROM messages WHERE user_id = ? ORDER BY created_at DESC LIMIT 5"); $notifs->execute([$userId]); $notifications = $notifs->fetchAll(); if (!empty($notifications)): foreach ($notifications as $notif): ?> <li> <a class="dropdown-item" href="index.php?page=messages" style="white-space:normal;"> <strong><?php echo htmlspecialchars($notif['subject']); ?></strong> <br><small style="color:#888;"><?php echo date('M d, h:i A', strtotime($notif['created_at'])); ?></small> <?php if (!$notif['is_read']): ?> <span class="badge" style="background:#2596be;float:right;">New</span> <?php endif; ?> </a> </li> <?php endforeach; ?> <li><hr class="dropdown-divider"></li> <?php endif; ?> <li><a class="dropdown-item text-center" href="index.php?page=messages">View All Messages</a></li> </ul> </div> <!-- Messages Button --> <a href="index.php?page=messages" class="topbar-btn" title="Messages"> <i class="fas fa-comment-dots"></i> <?php if ($unreadNotifs > 0): ?> <span class="badge-dot"></span> <?php endif; ?> </a> <!-- User Avatar Dropdown --> <div class="dropdown"> <button class="user-avatar dropdown-toggle" type="button" data-bs-toggle="dropdown" title="<?php echo htmlspecialchars($userData['full_name']); ?>" style="border:none;"> <?php $avatar = $userData['avatar'] ?? ''; if (empty($avatar)) { $nameParts = explode(' ', $userData['full_name']); $avatar = strtoupper(substr($nameParts[0], 0, 1) . (isset($nameParts[1]) ? substr($nameParts[1], 0, 1) : '')); } echo htmlspecialchars($avatar); ?> </button> <ul class="dropdown-menu dropdown-menu-end" style="min-width:200px;"> <li style="padding:10px 16px;border-bottom:1px solid #eee;"> <strong><?php echo htmlspecialchars($userData['full_name']); ?></strong> <br><small style="color:#888;"><?php echo htmlspecialchars($userData['email']); ?></small> </li> <li><a class="dropdown-item" href="index.php?page=profile"><i class="fas fa-user"></i> My Profile</a></li> <li><a class="dropdown-item" href="index.php?page=security"><i class="fas fa-shield-alt"></i> Security Settings</a></li> <li><a class="dropdown-item" href="index.php?page=messages"><i class="fas fa-envelope"></i> Messages <?php if ($unreadNotifs > 0): ?> <span class="badge" style="background:#2596be;color:white;float:right;"><?php echo $unreadNotifs; ?></span> <?php endif; ?> </a></li> <?php if ($isAdmin): ?> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="admin/dashboard.php"><i class="fas fa-crown"></i> Admin Panel</a></li> <?php endif; ?> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item" href="#" onclick="showLogoutAlert()" style="color:#dc2626;"><i class="fas fa-sign-out-alt"></i> Logout</a></li> </ul> </div> </div> </header> <!-- Dashboard Content Area --> <div class="dashboard-content"> <?php // Load the appropriate page content $pageFile = 'pages/' . $page . '.php'; if (file_exists($pageFile)) { include $pageFile; } else { // Default dashboard if page doesn't exist ?> <div class="page-section active"> <div class="welcome-section animate__animated animate__fadeIn"> <div class="welcome-text"> <h1>Welcome Back, <?php echo htmlspecialchars($userData['full_name'] ?? 'User'); ?> 👋</h1> <p class="subtitle">Page "<?php echo htmlspecialchars($page); ?>" is under construction.</p> </div> </div> <div class="dashboard-card"> <h2>🚧 Page Under Construction</h2> <p>The page you're looking for is being developed. Please check back later.</p> <a href="index.php?page=dashboard" class="btn-primary-custom" style="text-decoration:none;display:inline-block;margin-top:20px;"> Go to Dashboard </a> </div> </div> <?php } ?> </div> </div> <?php endif; ?> <!-- Scripts --> <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/apexcharts@3.45.1/dist/apexcharts.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/toastr/build/toastr.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script> <script> // Toastr config toastr.options = { closeButton: true, progressBar: true, positionClass: 'toast-top-right', timeOut: 4000, showDuration: 300, hideDuration: 300, }; function showToast(msg, type = 'info') { toastr[type](msg); } function showLogoutAlert() { Swal.fire({ title: 'Logout?', text: 'Are you sure you want to logout from Spring Pass Capital?', icon: 'question', showCancelButton: true, confirmButtonColor: '#2596be', cancelButtonColor: '#dc2626', confirmButtonText: 'Yes, logout', background: '#fff', borderRadius: '18px', }).then((result) => { if (result.isConfirmed) { window.location.href = 'auth/logout.php'; } }); } // Sidebar Toggle let sidebarCollapsed = false; function toggleSidebar() { sidebarCollapsed = !sidebarCollapsed; const sidebar = document.getElementById('sidebar'); const mainContent = document.getElementById('mainContent'); const toggleIcon = document.getElementById('toggleIcon'); if (sidebarCollapsed) { sidebar.classList.add('collapsed'); mainContent.classList.add('expanded'); toggleIcon.classList.remove('fa-chevron-left'); toggleIcon.classList.add('fa-chevron-right'); } else { sidebar.classList.remove('collapsed'); mainContent.classList.remove('expanded'); toggleIcon.classList.remove('fa-chevron-right'); toggleIcon.classList.add('fa-chevron-left'); } } function toggleMobileSidebar() { const sidebar = document.getElementById('sidebar'); const overlay = document.getElementById('sidebarOverlay'); sidebar.classList.toggle('mobile-open'); overlay.classList.toggle('active'); } function closeMobileSidebar() { const sidebar = document.getElementById('sidebar'); const overlay = document.getElementById('sidebarOverlay'); sidebar.classList.remove('mobile-open'); overlay.classList.remove('active'); } </script> <script> // Search functionality const searchInput = document.querySelector('.topbar .search-box input'); if (searchInput) { searchInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') { const query = this.value.trim(); if (query.length > 0) { // Search across pages window.location.href = 'index.php?page=transactions&search=' + encodeURIComponent(query); } } }); // Live search suggestions searchInput.addEventListener('input', function() { const query = this.value.trim(); if (query.length >= 2) { // Could add AJAX live search here console.log('Searching for:', query); } }); } </script> <script> // Fix dropdown z-index issues document.addEventListener('DOMContentLoaded', function() { // Ensure all dropdowns have proper z-index document.querySelectorAll('.dropdown-menu').forEach(function(menu) { menu.style.zIndex = '9999'; }); // Fix dropdown toggle document.querySelectorAll('[data-bs-toggle="dropdown"]').forEach(function(btn) { btn.addEventListener('click', function(e) { e.stopPropagation(); var menu = this.nextElementSibling; if (menu && menu.classList.contains('dropdown-menu')) { menu.style.zIndex = '9999'; menu.style.position = 'absolute'; } }); }); }); // Override Bootstrap's dropdown to ensure z-index $(document).on('show.bs.dropdown', function(e) { $(e.relatedTarget).next('.dropdown-menu').css({ 'z-index': '9999', 'position': 'absolute' }); }); </script> <script> // Fix Bootstrap dropdown issues document.addEventListener('DOMContentLoaded', function() { // Initialize all dropdowns var dropdownElements = document.querySelectorAll('[data-bs-toggle="dropdown"]'); dropdownElements.forEach(function(el) { new bootstrap.Dropdown(el); }); // Fix dropdown z-index document.querySelectorAll('.dropdown-menu').forEach(function(menu) { menu.style.zIndex = '9999'; }); }); // Ensure dropdowns close when clicking outside document.addEventListener('click', function(e) { if (!e.target.closest('.dropdown')) { document.querySelectorAll('.dropdown-menu.show').forEach(function(menu) { menu.classList.remove('show'); }); } }); </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 1.7 |
proxy
|
phpinfo
|
Settings