106 lines
5.0 KiB
PHP
106 lines
5.0 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$user = $stmt->fetch();
|
|
|
|
// Fetch other users with role 'founder' (potential partners)
|
|
$stmt = db()->prepare("SELECT * FROM users WHERE role = 'founder' AND id != ? ORDER BY created_at DESC");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$partners = $stmt->fetchAll();
|
|
|
|
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
|
?>
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Find Partners — <?= htmlspecialchars($platformName) ?></title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
|
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
|
<nav class="nav-links">
|
|
<a href="dashboard.php">Dashboard</a>
|
|
<?php if ($user['role'] === 'founder'): ?>
|
|
<a href="startups.php">My Startups</a>
|
|
<a href="partners.php" class="active">Find Partners</a>
|
|
<?php else: ?>
|
|
<a href="discover.php">Discover</a>
|
|
<a href="portfolio.php">Portfolio</a>
|
|
<?php endif; ?>
|
|
<a href="messages.php">Messages</a>
|
|
</nav>
|
|
<div style="display: flex; align-items: center; gap: 15px;">
|
|
<span><?= htmlspecialchars($user['full_name']) ?></span>
|
|
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="container" style="padding-top: 50px;">
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
|
<div>
|
|
<h1>Find Co-Founders</h1>
|
|
<p style="color: var(--text-secondary);">Connect with ambitious students building the future.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (empty($partners)): ?>
|
|
<div class="card" style="text-align: center; padding: 60px 0;">
|
|
<i class="fas fa-users-slash" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 20px;"></i>
|
|
<h3>No potential partners found</h3>
|
|
<p style="color: var(--text-secondary);">Be the first to list your profile or check back later.</p>
|
|
</div>
|
|
<?php else: ?>
|
|
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;">
|
|
<?php foreach ($partners as $partner): ?>
|
|
<div class="card">
|
|
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 20px;">
|
|
<div style="width: 50px; height: 50px; background: var(--surface-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 1px solid var(--border-color);">
|
|
<?= substr($partner['full_name'], 0, 1) ?>
|
|
</div>
|
|
<div>
|
|
<div style="font-weight: 600;"><?= htmlspecialchars($partner['full_name']) ?></div>
|
|
<div style="font-size: 12px; color: var(--text-secondary);"><?= htmlspecialchars($partner['university']) ?> '<?= substr($partner['graduation_year'], -2) ?></div>
|
|
</div>
|
|
</div>
|
|
<p style="color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; height: 60px; overflow: hidden;"><?= htmlspecialchars($partner['bio']) ?></p>
|
|
<div style="display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;">
|
|
<?php if ($partner['interests']): ?>
|
|
<?php foreach (explode(',', $partner['interests']) as $tag): ?>
|
|
<span style="background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); padding: 2px 8px; border-radius: 4px; font-size: 10px;"><?= htmlspecialchars(trim($tag)) ?></span>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<a href="messages.php?to=<?= $partner['id'] ?>" class="btn btn-secondary" style="width: 100%; text-align: center;">Send Message</a>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<style>
|
|
.active {
|
|
color: var(--text-primary) !important;
|
|
border-bottom: 2px solid var(--accent-blue);
|
|
padding-bottom: 5px;
|
|
}
|
|
</style>
|
|
|
|
</body>
|
|
</html>
|