Meet Your Team.
Connect with high-potential founders and engineers in the university ecosystem.
Active Connections
The well is dry!
Check back tomorrow for more visionaries.
prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); if (!$user) { header('Location: login.php'); exit; } $current_user_id = $user_id; $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; // Blocked users logic $stmt = db()->prepare("SELECT blocked_id FROM blocked_users WHERE blocker_id = ?"); $stmt->execute([$current_user_id]); $blocked_ids = $stmt->fetchAll(PDO::FETCH_COLUMN); $stmt = db()->prepare("SELECT blocker_id FROM blocked_users WHERE blocked_id = ?"); $stmt->execute([$current_user_id]); $blocked_by_ids = $stmt->fetchAll(PDO::FETCH_COLUMN); $all_blocked = array_unique(array_merge($blocked_ids, $blocked_by_ids)); $placeholders = empty($all_blocked) ? "0" : implode(',', array_fill(0, count($all_blocked), '?')); function calculateMatchScore($me, $them) { $score = 0; $mySkills = array_map('trim', explode(',', strtolower($me['skills'] ?? ''))); $theirSkills = array_map('trim', explode(',', strtolower($them['skills'] ?? ''))); $myPreferred = array_map('trim', explode(',', strtolower($me['preferred_co_founder_skills'] ?? ''))); $theirPreferred = array_map('trim', explode(',', strtolower($them['preferred_co_founder_skills'] ?? ''))); $myIndustries = array_map('trim', explode(',', strtolower($me['startup_industries'] ?? ''))); $theirIndustries = array_map('trim', explode(',', strtolower($them['startup_industries'] ?? ''))); $skillMatches = array_intersect($theirSkills, $myPreferred); $score += count($skillMatches) * 5; $industryMatches = array_intersect($myIndustries, $theirIndustries); $score += count($industryMatches) * 3; if (!empty($me['university']) && $me['university'] === $them['university']) { $score += 5; } return ['total' => $score, 'skillMatches' => array_values($skillMatches), 'industryMatches' => array_values($industryMatches)]; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'swipe') { header('Content-Type: application/json'); $swiped_id = (int)$_POST['swiped_id']; $direction = $_POST['direction']; 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]); $isMatch = false; 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()) { $isMatch = true; $u1 = min($current_user_id, $swiped_id); $u2 = max($current_user_id, $swiped_id); $stmt = db()->prepare("INSERT INTO matches (user1_id, user2_id, status) VALUES (?, ?, 'active') ON DUPLICATE KEY UPDATE status = 'active'"); $stmt->execute([$u1, $u2]); $stmt = db()->prepare("INSERT INTO notifications (user_id, content) VALUES (?, ?)"); $stmt->execute([$swiped_id, "You have a new match! Start a conversation now."]); $stmt->execute([$current_user_id, "You have a new match! Start a conversation now."]); } } echo json_encode(['status' => 'success', 'match' => $isMatch]); exit; } echo json_encode(['status' => 'error']); exit; } // Fetch active matches $sql = "SELECT u.*, m.created_at as matched_at FROM matches m JOIN users u ON (m.user1_id = u.id OR m.user2_id = u.id) WHERE (m.user1_id = ? OR m.user2_id = ?) AND u.id != ? AND m.status = 'active' AND u.id NOT IN ($placeholders) ORDER BY m.created_at DESC"; $stmt = db()->prepare($sql); $stmt->execute(array_merge([$current_user_id, $current_user_id, $current_user_id], $all_blocked ?: [])); $matches = $stmt->fetchAll(); // Fetch swipe candidates $sql = "SELECT * FROM users WHERE role = 'founder' AND id != ? AND onboarding_completed = 1 AND id NOT IN (SELECT swiped_id FROM swipes WHERE swiper_id = ?) AND id NOT IN ($placeholders) LIMIT 50"; $stmt = db()->prepare($sql); $stmt->execute(array_merge([$current_user_id, $current_user_id], $all_blocked ?: [])); $allCandidates = $stmt->fetchAll(); foreach ($allCandidates as &$c) { $c['match_data'] = calculateMatchScore($user, $c); $c['score'] = $c['match_data']['total']; } usort($allCandidates, function($a, $b) { return $b['score'] <=> $a['score']; }); $swipeCandidates = array_slice($allCandidates, 0, 10); // Fetch partners for Browse $search = $_GET['q'] ?? ''; $where = "role = 'founder' AND id != ? AND onboarding_completed = 1 AND id NOT IN (SELECT swiped_id FROM swipes WHERE swiper_id = ?) AND id NOT IN ($placeholders)"; $params = array_merge([$current_user_id, $current_user_id], $all_blocked ?: []); if ($search) { $where .= " AND (full_name LIKE ? OR skills LIKE ? OR university LIKE ? OR startup_industries LIKE ?)"; $params[] = "%$search%"; $params[] = "%$search%"; $params[] = "%$search%"; $params[] = "%$search%"; } $stmt = db()->prepare("SELECT * FROM users WHERE $where LIMIT 40"); $stmt->execute($params); $browseCandidates = $stmt->fetchAll(); foreach ($browseCandidates as &$c) { $c['match_data'] = calculateMatchScore($user, $c); $c['score'] = $c['match_data']['total']; } if (!$search) { usort($browseCandidates, function($a, $b) { return $b['score'] <=> $a['score']; }); } ?>
Connect with high-potential founders and engineers in the university ecosystem.
Check back tomorrow for more visionaries.