prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();
// Check if profile is complete (e.g., bio or interests)
if (empty($user['bio']) && empty($user['interests'])) {
if ($user['role'] === 'investor') {
header("Location: investor_onboarding.php");
} else {
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();
}
?>
Dashboard — = htmlspecialchars($platformName) ?>
= htmlspecialchars($platformName) ?>
= htmlspecialchars($user['full_name']) ?> (= ucfirst($user['role']) ?>)Log Out