Discovery Hub.
Explore the best student-led innovation across the network.
prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); if (!$user) { header('Location: login.php'); exit; } $user_role = $user['role']; if ($user_role === 'founder') { header('Location: dashboard.php'); exit; } $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; // Get user's followed startups $stmt = db()->prepare("SELECT startup_id FROM startup_followers WHERE user_id = ?"); $stmt->execute([$user_id]); $followedStartups = $stmt->fetchAll(PDO::FETCH_COLUMN); // Leaderboard: Most Followed $stmt = db()->query(" SELECT s.*, u.full_name as founder_name FROM startups s JOIN users u ON s.founder_id = u.id ORDER BY s.followers_count DESC LIMIT 3 "); $mostFollowed = $stmt->fetchAll(); // Leaderboard: Most Funded (Total funding raised) $stmt = db()->query(" SELECT s.id, s.name, u.full_name as founder_name, s.funding_raised as funded_amount FROM startups s JOIN users u ON s.founder_id = u.id ORDER BY s.funding_raised DESC LIMIT 3 "); $mostFunded = $stmt->fetchAll(); // General Browse - ONLY Founding Rounds (Active) $q = $_GET['q'] ?? ''; $where = "fr.status = 'Active'"; $params = []; if ($q) { $where .= " AND (s.name LIKE ? OR s.description LIKE ? OR s.industry LIKE ?)"; $params[] = "%$q%"; $params[] = "%$q%"; $params[] = "%$q%"; } $stmt = db()->prepare(" SELECT s.*, u.full_name as founder_name, fr.funding_goal as active_goal, fr.funding_raised as active_raised FROM funding_rounds fr JOIN startups s ON fr.startup_id = s.id JOIN users u ON s.founder_id = u.id WHERE $where ORDER BY fr.created_at DESC LIMIT 12 "); $stmt->execute($params); $browseStartups = $stmt->fetchAll(); ?>
Explore the best student-led innovation across the network.