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'; // Leaderboard: Most Followed $stmt = db()->query(" SELECT s.*, u.full_name as founder_name, s.followers_count 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 $q = $_GET['q'] ?? ''; $where = "onboarding_completed = 1"; $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 FROM startups s JOIN users u ON s.founder_id = u.id WHERE $where ORDER BY s.created_at DESC LIMIT 12 "); $stmt->execute($params); $browseStartups = $stmt->fetchAll(); ?>
Explore the best student-led innovation across the network.