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';
// Fetch user's data based on role
$myStartups = [];
$myInvestments = [];
if ($user['role'] === 'founder') {
$stmt = db()->prepare("SELECT * FROM startups WHERE founder_id = ? ORDER BY 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, = htmlspecialchars(explode(' ', $user['full_name'])[0]) ?>!
Manage your projects and network from one place.
= htmlspecialchars($startup['name']) ?>
= strtoupper($startup['status']) ?>
Target: £= number_get_formatted($startup['funding_target']) ?>
£= number_get_formatted($startup['funding_raised']) ?>
Raised so far
= htmlspecialchars($inv['startup_name']) ?>
Committed on = date('M d, Y', strtotime($inv['created_at'])) ?>
£= number_get_formatted($inv['amount']) ?>
= strtoupper($inv['status']) ?>
Insights & Activity
Coming soon: Real-time insights from your network and matching suggestions based on your profile.
= substr($user['full_name'], 0, 1) ?>
= htmlspecialchars($user['full_name']) ?>
= htmlspecialchars($user['university']) ?> '= substr($user['graduation_year'], -2) ?>
= htmlspecialchars($user['bio'] ?: 'No bio provided yet.') ?>
= htmlspecialchars(trim($skill)) ?>
Gatsby Pro
Get advanced analytics and direct intros to top-tier VC scouts.