prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$_SESSION['user_id']]); $user = $stmt->fetch(); if (!$user) { session_destroy(); header("Location: login.php"); exit; } // Security: Check if verified if ($user['verified'] == 0) { session_destroy(); header("Location: login.php?error=not_verified"); exit; } // Check if onboarding is complete if ($user['role'] === 'founder' && $user['onboarding_completed'] == 0) { header("Location: founder_onboarding.php"); exit; } $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; // Identify Trending Startups (Top 3 in followers or funding) $trendingIds = []; // Top 3 Followed $stmt = db()->prepare(" SELECT s.id FROM startups s LEFT JOIN startup_followers sf ON s.id = sf.startup_id GROUP BY s.id ORDER BY COUNT(sf.id) DESC LIMIT 3 "); $stmt->execute(); $topFollowed = $stmt->fetchAll(PDO::FETCH_COLUMN); $trendingIds = array_merge($trendingIds, $topFollowed); // Top 3 Funded (Total) $stmt = db()->prepare(" SELECT id FROM startups ORDER BY funding_raised DESC LIMIT 3 "); $stmt->execute(); $topFunded = $stmt->fetchAll(PDO::FETCH_COLUMN); $trendingIds = array_unique(array_merge($trendingIds, $topFunded)); // Fetch user's data based on role $myStartups = []; $myInvestments = []; if ($user['role'] === 'founder') { $stmt = db()->prepare(" SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status, fr.id as round_id FROM startups s LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active' WHERE s.founder_id = ? ORDER BY s.created_at DESC "); $stmt->execute([$_SESSION['user_id']]); $myStartups = $stmt->fetchAll(); } else { $stmt = db()->prepare("SELECT i.*, s.name as startup_name FROM investments i JOIN startups s ON i.startup_id = s.id WHERE i.investor_id = ? ORDER BY i.created_at DESC"); $stmt->execute([$_SESSION['user_id']]); $myInvestments = $stmt->fetchAll(); } function number_get_formatted($num) { return number_format((float)$num, 0, '.', ','); } ?> Dashboard — <?= htmlspecialchars($platformName) ?>

Welcome back, !

Here's what's happening in your venture ecosystem.

My Ventures

+ Register New Startup

No startups registered

Ready to change the world? Start by registering your venture.

Get Started

0): ?>
Active Funding Round %
£ Target: £
Start Funding Round

Portfolio Overview

Find New Deals

Start backing the next generation of founders.

Start Investing
Committed on
£

Ecosystem Activity

Insights from your network and trending matches will appear here.

My Money Pot

Available Balance
£

Manage your startup capital and dividend funds. Manage your investment capital and earnings.

My Profile

Edit