diff --git a/dashboard.php b/dashboard.php index 9b45cc2..f65427a 100644 --- a/dashboard.php +++ b/dashboard.php @@ -37,7 +37,14 @@ $myStartups = []; $myInvestments = []; if ($user['role'] === 'founder') { - $stmt = db()->prepare("SELECT * FROM startups WHERE founder_id = ? ORDER BY created_at DESC"); + // Fetch startups and their active round if any + $stmt = db()->prepare(" + SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status + 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 { @@ -93,7 +100,7 @@ function number_get_formatted($num) {