= $user_role === 'founder' ? 'Partner Matching' : 'Discovery Hub' ?>
No more founders found for now.
Check back later!
No data for this week yet.
$item): ?>No investments this week yet.
$item): ?>prepare("SELECT onboarding_completed FROM users WHERE id = ?"); $stmt->execute([$current_user_id]); $user_onboard = $stmt->fetch(); if (!$user_onboard['onboarding_completed']) { header("Location: founder_onboarding.php"); exit; } } // Handle Swipe via AJAX/POST (only for founders) if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'swipe' && $user_role === 'founder') { $swiped_id = (int)$_POST['swiped_id']; $direction = $_POST['direction']; // 'like' or 'dislike' if ($swiped_id > 0 && in_array($direction, ['like', 'dislike'])) { $stmt = db()->prepare("INSERT IGNORE INTO swipes (swiper_id, swiped_id, direction) VALUES (?, ?, ?)"); $stmt->execute([$current_user_id, $swiped_id, $direction]); // Check for match if ($direction === 'like') { $stmt = db()->prepare("SELECT id FROM swipes WHERE swiper_id = ? AND swiped_id = ? AND direction = 'like'"); $stmt->execute([$swiped_id, $current_user_id]); if ($stmt->fetch()) { // It's a match! $stmt = db()->prepare("INSERT IGNORE INTO matches (user1_id, user2_id) VALUES (?, ?)"); $u1 = min($current_user_id, $swiped_id); $u2 = max($current_user_id, $swiped_id); $stmt->execute([$u1, $u2]); // Add notification $stmt = db()->prepare("INSERT INTO notifications (user_id, content) VALUES (?, ?)"); $stmt->execute([$swiped_id, "You have a new match!"]); $stmt->execute([$current_user_id, "You have a new match!"]); echo json_encode(['status' => 'success', 'match' => true]); exit; } } echo json_encode(['status' => 'success', 'match' => false]); exit; } } // Fetch founders to swipe on (if founder) $founders = []; if ($user_role === 'founder') { $stmt = db()->prepare(" SELECT * FROM users WHERE role = 'founder' AND id != ? AND onboarding_completed = 1 AND id NOT IN (SELECT swiped_id FROM swipes WHERE swiper_id = ?) LIMIT 10 "); $stmt->execute([$current_user_id, $current_user_id]); $founders = $stmt->fetchAll(); } // Leaderboard: Most Followed This Week $stmt = db()->prepare(" SELECT s.id, s.name, u.full_name as founder_name, COUNT(sf.id) as followers_count FROM startups s JOIN users u ON s.founder_id = u.id JOIN startup_followers sf ON s.id = sf.startup_id WHERE sf.created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) GROUP BY s.id ORDER BY followers_count DESC LIMIT 5 "); $stmt->execute(); $mostFollowed = $stmt->fetchAll(); // Leaderboard: Most Funded This Week $stmt = db()->prepare(" SELECT s.id, s.name, u.full_name as founder_name, SUM(i.amount) as funded_amount FROM startups s JOIN users u ON s.founder_id = u.id JOIN investments i ON s.id = i.startup_id WHERE i.status = 'approved' AND i.created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) GROUP BY s.id ORDER BY funded_amount DESC LIMIT 5 "); $stmt->execute(); $mostFunded = $stmt->fetchAll(); $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; ?>
No more founders found for now.
Check back later!
No data for this week yet.
$item): ?>No investments this week yet.
$item): ?>You and this founder both swiped right on each other.