v12
This commit is contained in:
parent
ffc61a8ab0
commit
7fc6180066
@ -68,7 +68,6 @@ $myStartups = [];
|
||||
$myInvestments = [];
|
||||
|
||||
if ($user['role'] === 'founder') {
|
||||
// Fetch startups and their active round if any
|
||||
$stmt = db()->prepare("
|
||||
SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status
|
||||
FROM startups s
|
||||
@ -122,12 +121,12 @@ function number_get_formatted($num) {
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="discover.php">Find Partners</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discovery</a>
|
||||
<a href="startups.php">Browse Startups</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
@ -139,6 +138,11 @@ function number_get_formatted($num) {
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px; padding-bottom: 50px;">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 10%; left: -10%;"></div>
|
||||
<div class="hero-blob" style="bottom: 10%; right: -10%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, rgba(0, 242, 255, 0.1) 100%);"></div>
|
||||
</div>
|
||||
|
||||
<h1>Welcome, <?= htmlspecialchars(explode(' ', $user['full_name'])[0]) ?>!</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Manage your projects and network from one place.</p>
|
||||
|
||||
@ -253,7 +257,7 @@ function number_get_formatted($num) {
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
|
||||
<?php
|
||||
$skills = explode(',', $user['skills'] ?? '');
|
||||
foreach (array_slice($skills, 0, 3) as $skill): if(empty($skill)) continue; ?>
|
||||
foreach (array_slice($skills, 0, 3) as $skill): if(empty(trim($skill))) continue; ?>
|
||||
<span style="font-size: 11px; padding: 4px 10px; background: rgba(255,255,255,0.05); border-radius: 20px; border: 1px solid var(--border-color);"><?= htmlspecialchars(trim($skill)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@ -261,11 +265,13 @@ function number_get_formatted($num) {
|
||||
</div>
|
||||
|
||||
<div class="card" style="background: var(--gradient-primary); color: #fff; border: none; margin-bottom: 30px;">
|
||||
<h3 style="color: #fff; margin-bottom: 10px;"><?= $user['role'] === 'founder' ? 'Find Partners' : 'Trending Startups' ?></h3>
|
||||
<h3 style="color: #fff; margin-bottom: 10px;"><?= $user['role'] === 'founder' ? 'Find My Co-Founder' : 'Discovery Hub' ?></h3>
|
||||
<p style="font-size: 14px; opacity: 0.9; margin-bottom: 20px;">
|
||||
<?= $user['role'] === 'founder' ? 'Ready to find your perfect co-founder? Start swiping through profiles.' : 'Check out the most followed and funded startups this week!' ?>
|
||||
<?= $user['role'] === 'founder' ? 'Ready to find your perfect partner? Start matching with other student founders.' : 'Check out the most followed and funded startups this week!' ?>
|
||||
</p>
|
||||
<a href="discover.php" class="btn" style="width: 100%; background: #fff; color: var(--accent-blue); font-weight: 700; text-align: center; display: block; text-decoration: none;">Explore Discovery Hub</a>
|
||||
<a href="<?= $user['role'] === 'founder' ? 'partners.php' : 'discover.php' ?>" class="btn" style="width: 100%; background: #fff; color: var(--accent-blue); font-weight: 700; text-align: center; display: block; text-decoration: none;">
|
||||
<?= $user['role'] === 'founder' ? 'Launch Partner Matching' : 'Explore Discovery Hub' ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card" style="background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border-color);">
|
||||
@ -279,9 +285,8 @@ function number_get_formatted($num) {
|
||||
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 10, 0.8);
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
position: sticky;
|
||||
@ -302,4 +307,4 @@ function number_get_formatted($num) {
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
494
discover.php
494
discover.php
@ -8,96 +8,68 @@ if (!isset($_SESSION['user_id'])) {
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$current_user_id = $_SESSION['user_id'];
|
||||
$user_role = $_SESSION['role'];
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$current_user_id]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
// Check if onboarding is completed (for founders)
|
||||
if ($user_role === 'founder') {
|
||||
$stmt = db()->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;
|
||||
}
|
||||
if (!$user) {
|
||||
session_destroy();
|
||||
header("Location: login.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();
|
||||
}
|
||||
$user_role = $user['role'];
|
||||
|
||||
// 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
|
||||
SELECT s.id, s.name, s.description, 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
|
||||
LIMIT 10
|
||||
");
|
||||
$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
|
||||
SELECT s.id, s.name, s.description, 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
|
||||
LIMIT 10
|
||||
");
|
||||
$stmt->execute();
|
||||
$mostFunded = $stmt->fetchAll();
|
||||
|
||||
// Search logic
|
||||
$q = $_GET['q'] ?? '';
|
||||
$browseStartups = [];
|
||||
$where = "s.status = 'public'";
|
||||
$params = [];
|
||||
if ($q) {
|
||||
$where .= " AND (s.name LIKE ? OR s.description LIKE ? OR u.full_name 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 20
|
||||
");
|
||||
$stmt->execute($params);
|
||||
$browseStartups = $stmt->fetchAll();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
?>
|
||||
<!doctype html>
|
||||
@ -105,313 +77,137 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Discover — <?= htmlspecialchars($platformName) ?></title>
|
||||
<title>Discovery Hub — <?= 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">
|
||||
<style>
|
||||
.discover-container {
|
||||
max-width: 400px;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
height: 600px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.swipe-card {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
transition: transform 0.4s ease, opacity 0.4s ease;
|
||||
user-select: none;
|
||||
cursor: grab;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.swipe-card:active { cursor: grabbing; }
|
||||
.card-img {
|
||||
height: 250px;
|
||||
background: linear-gradient(45deg, #2c3e50, #000000);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 80px;
|
||||
color: rgba(255,255,255,0.1);
|
||||
}
|
||||
.card-body { padding: 20px; flex-grow: 1; }
|
||||
.card-name { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
|
||||
.card-meta { color: var(--text-secondary); font-size: 14px; margin-bottom: 15px; }
|
||||
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
|
||||
.tag { background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 6px; font-size: 12px; }
|
||||
.card-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
|
||||
|
||||
.swipe-actions {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-top: 550px;
|
||||
z-index: 10;
|
||||
}
|
||||
.swipe-btn {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
border: none;
|
||||
}
|
||||
.swipe-btn:hover { transform: scale(1.1); }
|
||||
.btn-dislike { background: #ff4d4d; color: #fff; }
|
||||
.btn-like { background: #2ecc71; color: #fff; }
|
||||
|
||||
#match-modal {
|
||||
position: fixed;
|
||||
top: 0; left: 0; width: 100%; height: 100%;
|
||||
background: rgba(0,0,0,0.9);
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
.hub-header { padding: 60px 0 40px; text-align: center; }
|
||||
.hub-header h1 { font-size: 48px; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 12px; }
|
||||
.hub-header p { color: var(--text-secondary); font-size: 18px; }
|
||||
|
||||
/* Leaderboard Styling */
|
||||
.leaderboard-section {
|
||||
margin-top: 50px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 30px;
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.leaderboard-section { grid-template-columns: 1fr; }
|
||||
}
|
||||
.leaderboard-card {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 20px;
|
||||
padding: 25px;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
||||
}
|
||||
.leaderboard-title {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.leaderboard-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
||||
transition: transform 0.2s;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
.leaderboard-item:hover { transform: translateX(5px); }
|
||||
.leaderboard-item:last-child { border-bottom: none; }
|
||||
.rank {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.05);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--accent-blue);
|
||||
}
|
||||
.leaderboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 60px; }
|
||||
@media (max-width: 900px) { .leaderboard-grid { grid-template-columns: 1fr; } }
|
||||
|
||||
.lb-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px; padding: 30px; backdrop-filter: blur(20px); }
|
||||
.lb-title { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; font-size: 20px; font-weight: 700; }
|
||||
.lb-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 16px; margin-bottom: 12px; transition: all 0.3s; text-decoration: none; color: inherit; }
|
||||
.lb-item:hover { background: rgba(255,255,255,0.06); transform: translateX(8px); border-color: var(--accent-blue); }
|
||||
.lb-rank { width: 32px; height: 32px; background: var(--surface-color); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-blue); font-size: 14px; }
|
||||
.rank-1 { background: gold; color: #000; }
|
||||
.rank-2 { background: silver; color: #000; }
|
||||
.rank-3 { background: #cd7f32; color: #000; }
|
||||
|
||||
.item-info { flex-grow: 1; }
|
||||
.item-name { font-weight: 600; font-size: 15px; }
|
||||
.item-meta { font-size: 12px; color: var(--text-secondary); }
|
||||
.item-stat { font-weight: 700; font-size: 14px; color: var(--accent-blue); }
|
||||
|
||||
.startup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; }
|
||||
.startup-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px; padding: 30px; transition: all 0.3s; }
|
||||
.startup-card:hover { transform: translateY(-5px); border-color: var(--accent-blue); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav>
|
||||
<a href="dashboard.php"><i class="fas fa-home"></i> Dashboard</a>
|
||||
<?php if ($user_role === 'founder'): ?>
|
||||
<a href="discover.php" class="active"><i class="fas fa-search"></i> Partner Matching</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php" class="active"><i class="fas fa-search"></i> Discovery</a>
|
||||
<?php endif; ?>
|
||||
<a href="startups.php"><i class="fas fa-rocket"></i> <?= $user_role === 'founder' ? 'My Startups' : 'Browse Startups' ?></a>
|
||||
<a href="portfolio.php"><i class="fas fa-chart-line"></i> Portfolio</a>
|
||||
<a href="messages.php"><i class="fas fa-comment"></i> Messages</a>
|
||||
<a href="notifications.php"><i class="fas fa-bell"></i> Notifications</a>
|
||||
</nav>
|
||||
<div style="margin-top: auto; padding: 20px;">
|
||||
<a href="logout.php" style="color: #ff5555;"><i class="fas fa-sign-out-alt"></i> Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="header">
|
||||
<h1><?= $user_role === 'founder' ? 'Partner Matching' : 'Discovery Hub' ?></h1>
|
||||
<div class="user-profile">
|
||||
<span><?= htmlspecialchars($_SESSION['full_name']) ?></span>
|
||||
<div class="avatar"><?= strtoupper(substr($_SESSION['full_name'], 0, 1)) ?></div>
|
||||
<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">
|
||||
<?php if ($user_role === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="startups.php">Browse Startups</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="discover.php" class="active">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if ($user_role === 'founder'): ?>
|
||||
<div class="discover-container" id="card-stack">
|
||||
<?php if (empty($founders)): ?>
|
||||
<div style="text-align: center; color: var(--text-secondary);">
|
||||
<i class="fas fa-user-friends" style="font-size: 48px; margin-bottom: 20px;"></i>
|
||||
<p>No more founders found for now.<br>Check back later!</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach (array_reverse($founders) as $f): ?>
|
||||
<div class="swipe-card" data-id="<?= $f['id'] ?>">
|
||||
<div class="card-img"><i class="fas fa-user"></i></div>
|
||||
<div class="card-body">
|
||||
<div class="card-name"><?= htmlspecialchars($f['full_name']) ?></div>
|
||||
<div class="card-meta"><?= htmlspecialchars($f['university']) ?> • <?= htmlspecialchars($f['degree_program']) ?> '<?= substr($f['graduation_year'], -2) ?></div>
|
||||
<div class="card-tags">
|
||||
<?php
|
||||
$skills = explode(',', $f['skills']);
|
||||
foreach (array_slice($skills, 0, 3) as $skill):
|
||||
?>
|
||||
<span class="tag"><?= htmlspecialchars(trim($skill)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="card-bio"><?= htmlspecialchars($f['bio']) ?></div>
|
||||
<div style="margin-top: 15px; font-size: 12px; color: var(--accent-blue);">
|
||||
<i class="fas fa-bolt"></i> Interested in: <?= htmlspecialchars($f['startup_industries']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<main class="container">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 20%; right: -5%;"></div>
|
||||
<div class="hero-blob" style="bottom: 10%; left: -5%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, rgba(0, 242, 255, 0.1) 100%);"></div>
|
||||
</div>
|
||||
|
||||
<div class="hub-header">
|
||||
<h1>Discovery Hub</h1>
|
||||
<p>Explore the best student-led innovation across the network.</p>
|
||||
</div>
|
||||
|
||||
<div class="leaderboard-grid">
|
||||
<div class="lb-card">
|
||||
<div class="lb-title"><i class="fas fa-heart" style="color: #ff3b30;"></i> Most Followed</div>
|
||||
<?php foreach ($mostFollowed as $i => $s): ?>
|
||||
<a href="startup_details.php?id=<?= $s['id'] ?>" class="lb-item">
|
||||
<div class="lb-rank rank-<?= $i+1 ?>"><?= $i+1 ?></div>
|
||||
<div style="flex: 1;">
|
||||
<div style="font-weight: 700;"><?= htmlspecialchars($s['name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">by <?= htmlspecialchars($s['founder_name']) ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div style="font-weight: 700; color: var(--accent-blue);"><?= number_format($s['followers_count']) ?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="lb-card">
|
||||
<div class="lb-title"><i class="fas fa-rocket" style="color: var(--accent-blue);"></i> Most Funded</div>
|
||||
<?php foreach ($mostFunded as $i => $s): ?>
|
||||
<a href="startup_details.php?id=<?= $s['id'] ?>" class="lb-item">
|
||||
<div class="lb-rank rank-<?= $i+1 ?>"><?= $i+1 ?></div>
|
||||
<div style="flex: 1;">
|
||||
<div style="font-weight: 700;"><?= htmlspecialchars($s['name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">by <?= htmlspecialchars($s['founder_name']) ?></div>
|
||||
</div>
|
||||
<div style="font-weight: 700; color: #2ecc71;">£<?= number_format($s['funded_amount']) ?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="swipe-actions">
|
||||
<button class="swipe-btn btn-dislike" onclick="swipe('dislike')"><i class="fas fa-times"></i></button>
|
||||
<button class="swipe-btn btn-like" onclick="swipe('like')"><i class="fas fa-heart"></i></button>
|
||||
<div style="margin-bottom: 40px; text-align: center;">
|
||||
<h2 style="margin-bottom: 25px;">Browse All Startups</h2>
|
||||
<form method="GET" style="display: flex; gap: 10px; max-width: 600px; margin: 0 auto;">
|
||||
<input type="text" name="q" value="<?= htmlspecialchars($q) ?>" placeholder="Search startups..." class="form-control" style="flex: 1; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; padding: 12px 20px; border-radius: 12px;">
|
||||
<button type="submit" class="btn btn-primary">Filter</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="startup-grid">
|
||||
<?php foreach ($browseStartups as $s): ?>
|
||||
<div class="startup-card" onclick="location.href='startup_details.php?id=<?= $s['id'] ?>'" style="cursor: pointer;">
|
||||
<div style="display: flex; gap: 20px; align-items: center; margin-bottom: 20px;">
|
||||
<div style="width: 60px; height: 60px; background: var(--gradient-primary); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff;">
|
||||
<?= substr($s['name'], 0, 1) ?>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-weight: 700; font-size: 20px;"><?= htmlspecialchars($s['name']) ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary);">by <?= htmlspecialchars($s['founder_name']) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 20px; height: 66px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;">
|
||||
<?= htmlspecialchars($s['description']) ?>
|
||||
</p>
|
||||
<div style="display: flex; justify-content: space-between; border-top: 1px solid var(--border-color); padding-top: 20px;">
|
||||
<div>
|
||||
<div style="font-size: 11px; color: var(--text-secondary); text-transform: uppercase;">Raised</div>
|
||||
<div style="font-weight: 700; color: #fff;">£<?= number_format($s['funding_raised']) ?></div>
|
||||
</div>
|
||||
<button class="btn btn-secondary" style="padding: 8px 16px; font-size: 12px;">Details</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Leaderboards -->
|
||||
<div class="leaderboard-section">
|
||||
<!-- Most Followed -->
|
||||
<div class="leaderboard-card">
|
||||
<div class="leaderboard-title">
|
||||
<i class="fas fa-users" style="color: var(--accent-blue);"></i>
|
||||
Most Followed This Week
|
||||
</div>
|
||||
<?php if (empty($mostFollowed)): ?>
|
||||
<p style="color: var(--text-secondary); font-size: 14px;">No data for this week yet.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($mostFollowed as $index => $item): ?>
|
||||
<a href="startup_details.php?id=<?= $item['id'] ?>" class="leaderboard-item">
|
||||
<div class="rank rank-<?= $index + 1 ?>"><?= $index + 1 ?></div>
|
||||
<div class="item-info">
|
||||
<div class="item-name"><?= htmlspecialchars($item['name']) ?></div>
|
||||
<div class="item-meta">by <?= htmlspecialchars($item['founder_name']) ?></div>
|
||||
</div>
|
||||
<div class="item-stat"><?= number_format($item['followers_count']) ?> <i class="fas fa-heart" style="font-size: 10px; opacity: 0.7;"></i></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Most Funded -->
|
||||
<div class="leaderboard-card">
|
||||
<div class="leaderboard-title">
|
||||
<i class="fas fa-chart-line" style="color: #2ecc71;"></i>
|
||||
Most Funded This Week
|
||||
</div>
|
||||
<?php if (empty($mostFunded)): ?>
|
||||
<p style="color: var(--text-secondary); font-size: 14px;">No investments this week yet.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($mostFunded as $index => $item): ?>
|
||||
<a href="startup_details.php?id=<?= $item['id'] ?>" class="leaderboard-item">
|
||||
<div class="rank rank-<?= $index + 1 ?>"><?= $index + 1 ?></div>
|
||||
<div class="item-info">
|
||||
<div class="item-name"><?= htmlspecialchars($item['name']) ?></div>
|
||||
<div class="item-meta">by <?= htmlspecialchars($item['founder_name']) ?></div>
|
||||
</div>
|
||||
<div class="item-stat">£<?= number_format($item['funded_amount']) ?></div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div id="match-modal">
|
||||
<h1 style="font-size: 60px; color: var(--accent-blue); margin-bottom: 20px;">IT'S A MATCH!</h1>
|
||||
<p style="font-size: 20px; margin-bottom: 40px;">You and this founder both swiped right on each other.</p>
|
||||
<div style="display: flex; gap: 20px;">
|
||||
<button class="btn btn-primary" onclick="window.location.href='messages.php'">Send a Message</button>
|
||||
<button class="btn" style="border: 1px solid #fff;" onclick="closeMatch()">Keep Swiping</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function swipe(direction) {
|
||||
const stack = document.getElementById('card-stack');
|
||||
const cards = stack.querySelectorAll('.swipe-card');
|
||||
if (cards.length === 0) return;
|
||||
|
||||
const topCard = cards[cards.length - 1];
|
||||
const swipedId = topCard.getAttribute('data-id');
|
||||
|
||||
// Animation
|
||||
if (direction === 'like') {
|
||||
topCard.style.transform = 'translateX(500px) rotate(20deg)';
|
||||
} else {
|
||||
topCard.style.transform = 'translateX(-500px) rotate(-20deg)';
|
||||
}
|
||||
topCard.style.opacity = '0';
|
||||
|
||||
// Logic
|
||||
fetch('discover.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: `action=swipe&swiped_id=${swipedId}&direction=${direction}`
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.match) {
|
||||
document.getElementById('match-modal').style.display = 'flex';
|
||||
}
|
||||
setTimeout(() => {
|
||||
topCard.remove();
|
||||
if (stack.querySelectorAll('.swipe-card').length === 0) {
|
||||
location.reload(); // Refresh to show empty state or new batch
|
||||
}
|
||||
}, 400);
|
||||
});
|
||||
}
|
||||
|
||||
function closeMatch() {
|
||||
document.getElementById('match-modal').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
header { background: rgba(10, 10, 15, 0.8); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); padding: 15px 0; position: sticky; top: 0; z-index: 1000; }
|
||||
.nav-links a { color: var(--text-secondary); text-decoration: none; margin: 0 15px; font-size: 14px; font-weight: 500; transition: color 0.2s; }
|
||||
.nav-links a:hover, .nav-links a.active { color: #fff; }
|
||||
.form-control:focus { outline: none; border-color: var(--accent-blue); }
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@ -7,15 +7,23 @@ if (!isset($_SESSION['user_id'])) {
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$current_user_id = $_SESSION['user_id'];
|
||||
|
||||
// Mark all as read if requested
|
||||
if (isset($_POST['mark_read'])) {
|
||||
$stmt = db()->prepare("UPDATE notifications SET is_read = 1 WHERE user_id = ?");
|
||||
$stmt->execute([$current_user_id]);
|
||||
}
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$stmt->execute([$current_user_id]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM notifications WHERE user_id = ? ORDER BY created_at DESC LIMIT 20");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$stmt = db()->prepare("SELECT * FROM notifications WHERE user_id = ? ORDER BY created_at DESC");
|
||||
$stmt->execute([$current_user_id]);
|
||||
$notifications = $stmt->fetchAll();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
@ -37,46 +45,85 @@ $notifications = $stmt->fetchAll();
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="startups.php">Browse Startups</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php" class="active">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<h1>Notifications</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Stay up to date with your network's latest updates.</p>
|
||||
<main class="container" style="padding-top: 50px; padding-bottom: 50px;">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 10%; right: -10%;"></div>
|
||||
</div>
|
||||
|
||||
<div style="max-width: 800px; margin: 0 auto;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<h1>Notifications</h1>
|
||||
<?php if (!empty($notifications)): ?>
|
||||
<form method="POST">
|
||||
<button type="submit" name="mark_read" class="btn btn-secondary" style="font-size: 13px;">Mark all as read</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<?php if (empty($notifications)): ?>
|
||||
<div class="card" style="text-align: center; padding: 60px 20px;">
|
||||
<i class="fas fa-bell-slash" style="font-size: 64px; color: var(--accent-blue); opacity: 0.1; margin-bottom: 30px;"></i>
|
||||
<h3>No new notifications</h3>
|
||||
<p style="color: var(--text-secondary);">We'll alert you here when something important happens.</p>
|
||||
<a href="discover.php" class="btn btn-secondary" style="margin-top: 25px;">Explore the Network</a>
|
||||
<div style="text-align: center; padding: 60px 20px;">
|
||||
<i class="fas fa-bell-slash" style="font-size: 48px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 20px;"></i>
|
||||
<p style="color: var(--text-secondary);">No notifications yet. We'll let you know when something happens!</p>
|
||||
<a href="partners.php" class="btn btn-primary" style="margin-top: 25px;">Find Partners</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($notifications as $note): ?>
|
||||
<div class="card" style="margin-bottom: 15px; padding: 20px; display: flex; gap: 20px; align-items: flex-start; <?= $note['is_read'] ? 'opacity: 0.6;' : 'border-left: 4px solid var(--accent-blue);' ?>">
|
||||
<div style="width: 40px; height: 40px; background: rgba(0, 242, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent-blue);">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<div style="display: flex; flex-direction: column; gap: 0;">
|
||||
<?php foreach ($notifications as $n): ?>
|
||||
<div style="padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: flex-start; gap: 20px; <?= $n['is_read'] ? 'opacity: 0.6;' : 'background: rgba(0, 242, 255, 0.03);' ?>">
|
||||
<div style="width: 40px; height: 40px; border-radius: 12px; background: <?= $n['is_read'] ? 'var(--surface-color)' : 'var(--gradient-primary)' ?>; display: flex; align-items: center; justify-content: center; color: #fff;">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
<p style="margin: 0; font-size: 15px; color: #fff; font-weight: <?= $n['is_read'] ? '400' : '600' ?>;">
|
||||
<?= htmlspecialchars($n['content']) ?>
|
||||
</p>
|
||||
<div style="font-size: 12px; color: var(--text-secondary); margin-top: 8px;">
|
||||
<?= date('M d, Y • H:i', strtotime($n['created_at'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size: 14px; margin-bottom: 5px; color: #fff; line-height: 1.5;"><?= htmlspecialchars($note['content']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);"><?= date('M d, Y • H:i', strtotime($note['created_at'])) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
.nav-links a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
margin: 0 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.nav-links a:hover, .nav-links a.active {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
492
partners.php
492
partners.php
@ -1,3 +1,491 @@
|
||||
<?php
|
||||
header("Location: discover.php");
|
||||
exit;
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$current_user_id = $_SESSION['user_id'];
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$current_user_id]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if (!$user || $user['role'] !== 'founder') {
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Onboarding check
|
||||
if (!$user['onboarding_completed']) {
|
||||
header("Location: founder_onboarding.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Handle Swipe Logic
|
||||
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']; // '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]);
|
||||
|
||||
$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;
|
||||
$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]);
|
||||
|
||||
$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 matches
|
||||
$stmt = db()->prepare("
|
||||
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 != ?
|
||||
ORDER BY m.created_at DESC
|
||||
");
|
||||
$stmt->execute([$current_user_id, $current_user_id, $current_user_id]);
|
||||
$matches = $stmt->fetchAll();
|
||||
|
||||
// Fetch swipe candidates
|
||||
$stmt = db()->prepare("
|
||||
SELECT * FROM users
|
||||
WHERE role = 'founder'
|
||||
AND id != ?
|
||||
AND onboarding_completed = 1
|
||||
AND looking_for_cofounder = 1
|
||||
AND id NOT IN (SELECT swiped_id FROM swipes WHERE swiper_id = ?)
|
||||
ORDER BY RAND()
|
||||
LIMIT 10
|
||||
");
|
||||
$stmt->execute([$current_user_id, $current_user_id]);
|
||||
$swipeCandidates = $stmt->fetchAll();
|
||||
|
||||
// Fetch partners for Browse view
|
||||
$search = $_GET['q'] ?? '';
|
||||
$where = "role = 'founder' AND id != ? AND onboarding_completed = 1 AND id NOT IN (SELECT swiped_id FROM swipes WHERE swiper_id = ?)";
|
||||
$params = [$current_user_id, $current_user_id];
|
||||
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 20");
|
||||
$stmt->execute($params);
|
||||
$browseCandidates = $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">
|
||||
<style>
|
||||
.page-header {
|
||||
padding: 60px 0 40px;
|
||||
text-align: center;
|
||||
}
|
||||
.page-header h1 {
|
||||
font-size: 48px;
|
||||
font-weight: 800;
|
||||
margin-bottom: 12px;
|
||||
background: var(--gradient-primary);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
.page-header p {
|
||||
color: var(--text-secondary);
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* Matches Scroller */
|
||||
.matches-section {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.matches-scroller {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
overflow-x: auto;
|
||||
padding: 15px 5px;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.matches-scroller::-webkit-scrollbar { display: none; }
|
||||
.match-card {
|
||||
flex: 0 0 80px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.match-card:hover { transform: scale(1.05); }
|
||||
.match-avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 24px;
|
||||
background: var(--surface-color);
|
||||
border: 2px solid var(--accent-blue);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
margin-bottom: 8px;
|
||||
box-shadow: 0 10px 20px rgba(0, 242, 255, 0.2);
|
||||
position: relative;
|
||||
}
|
||||
.match-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
|
||||
.match-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
|
||||
|
||||
/* Tabs */
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 15px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.tab-btn {
|
||||
padding: 12px 24px;
|
||||
border-radius: 50px;
|
||||
background: var(--surface-color);
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.tab-btn.active {
|
||||
background: var(--gradient-primary);
|
||||
color: #fff;
|
||||
border-color: transparent;
|
||||
box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
|
||||
}
|
||||
|
||||
/* Swipe UI */
|
||||
.swipe-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.card-stack {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
height: 550px;
|
||||
}
|
||||
.swipe-card {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--surface-color);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 32px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.4);
|
||||
transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
|
||||
cursor: grab;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.card-header-img {
|
||||
height: 280px;
|
||||
background: var(--gradient-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 100px;
|
||||
color: rgba(255,255,255,0.2);
|
||||
}
|
||||
.card-details { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
|
||||
.card-title { font-size: 26px; font-weight: 800; margin-bottom: 5px; }
|
||||
.card-subtitle { font-size: 14px; color: var(--accent-blue); font-weight: 600; margin-bottom: 15px; }
|
||||
.card-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 15px; }
|
||||
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.card-tag { font-size: 11px; padding: 5px 12px; background: rgba(255,255,255,0.05); border-radius: 20px; border: 1px solid var(--border-color); }
|
||||
|
||||
.swipe-actions { display: flex; gap: 20px; margin-top: 30px; }
|
||||
.action-btn {
|
||||
width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
|
||||
font-size: 28px; cursor: pointer; border: none; transition: transform 0.2s; box-shadow: 0 10px 20px rgba(0,0,0,0.2);
|
||||
}
|
||||
.action-btn:hover { transform: scale(1.1); }
|
||||
.btn-dislike { background: #1a1a24; color: #ff3b30; border: 1px solid rgba(255, 39, 48, 0.2); }
|
||||
.btn-like { background: var(--gradient-primary); color: #fff; }
|
||||
|
||||
/* Browse UI */
|
||||
.browse-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 25px;
|
||||
}
|
||||
.candidate-card {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 24px;
|
||||
padding: 25px;
|
||||
transition: transform 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
.candidate-card:hover { transform: translateY(-5px); border-color: var(--accent-blue); }
|
||||
.candidate-header { display: flex; gap: 15px; align-items: center; margin-bottom: 20px; }
|
||||
.candidate-avatar { width: 60px; height: 60px; border-radius: 18px; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 20px; }
|
||||
|
||||
/* Match Modal */
|
||||
#match-modal {
|
||||
position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background: rgba(10, 10, 15, 0.95); z-index: 2000; display: none;
|
||||
align-items: center; justify-content: center; text-align: center;
|
||||
backdrop-filter: blur(20px);
|
||||
}
|
||||
.match-popup { max-width: 400px; padding: 40px; }
|
||||
.match-title { font-size: 56px; font-weight: 900; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 20px; }
|
||||
</style>
|
||||
</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="startups.php">My Startups</a>
|
||||
<a href="partners.php" class="active">Find Partners</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 10%; left: -10%;"></div>
|
||||
<div class="hero-blob" style="top: 40%; right: -10%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, rgba(0, 242, 255, 0.1) 100%);"></div>
|
||||
</div>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Partnership Discovery</h1>
|
||||
<p>Find your next co-founder, advisor, or early collaborator.</p>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($matches)): ?>
|
||||
<section class="matches-section">
|
||||
<h3 style="margin-bottom: 20px; font-size: 18px; color: var(--text-secondary);">Your Recent Matches</h3>
|
||||
<div class="matches-scroller">
|
||||
<?php foreach ($matches as $match): ?>
|
||||
<div class="match-card" onclick="location.href='messages.php?user_id=<?= $match['id'] ?>'">
|
||||
<div class="match-avatar">
|
||||
<?php if ($match['profile_photo']): ?>
|
||||
<img src="<?= htmlspecialchars($match['profile_photo']) ?>">
|
||||
<?php else: ?>
|
||||
<?= substr($match['full_name'], 0, 1) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="match-name"><?= htmlspecialchars(explode(' ', $match['full_name'])[0]) ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tabs">
|
||||
<button class="tab-btn active" id="tab-swipe" onclick="setTab('swipe')">Swipe Mode</button>
|
||||
<button class="tab-btn" id="tab-browse" onclick="setTab('browse')">Browse Mode</button>
|
||||
</div>
|
||||
|
||||
<div id="swipe-view" class="swipe-container">
|
||||
<div class="card-stack" id="card-stack">
|
||||
<?php if (empty($swipeCandidates)): ?>
|
||||
<div style="text-align: center; color: var(--text-secondary); padding: 100px 0;">
|
||||
<i class="fas fa-search" style="font-size: 48px; margin-bottom: 20px; opacity: 0.3;"></i>
|
||||
<h3>Out of candidates!</h3>
|
||||
<p>Try switching to Browse Mode or check back later.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach (array_reverse($swipeCandidates) as $c): ?>
|
||||
<div class="swipe-card" data-id="<?= $c['id'] ?>">
|
||||
<div class="card-header-img">
|
||||
<?php if ($c['profile_photo']): ?>
|
||||
<img src="<?= htmlspecialchars($c['profile_photo']) ?>" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
<?php else: ?>
|
||||
<i class="fas fa-user-astronaut"></i>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="card-details">
|
||||
<div class="card-title"><?= htmlspecialchars($c['full_name']) ?></div>
|
||||
<div class="card-subtitle"><?= htmlspecialchars($c['university']) ?> • <?= htmlspecialchars($c['degree_program']) ?></div>
|
||||
<p class="card-bio"><?= htmlspecialchars($c['bio'] ?: 'A visionary founder looking for a like-minded partner.') ?></p>
|
||||
<div class="card-tags">
|
||||
<?php
|
||||
$skills = explode(',', $c['skills']);
|
||||
foreach (array_slice($skills, 0, 3) as $skill): if(empty(trim($skill))) continue; ?>
|
||||
<span class="card-tag"><?= htmlspecialchars(trim($skill)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!empty($swipeCandidates)): ?>
|
||||
<div class="swipe-actions">
|
||||
<button class="action-btn btn-dislike" onclick="handleSwipe('dislike')"><i class="fas fa-times"></i></button>
|
||||
<button class="action-btn btn-like" onclick="handleSwipe('like')"><i class="fas fa-heart"></i></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div id="browse-view" style="display: none;">
|
||||
<div style="margin-bottom: 30px;">
|
||||
<form method="GET" style="display: flex; gap: 10px; max-width: 600px; margin: 0 auto;">
|
||||
<input type="text" name="q" value="<?= htmlspecialchars($search) ?>" placeholder="Search by name, skill, university..." class="form-control" style="flex: 1; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; padding: 12px 20px; border-radius: 12px;">
|
||||
<button type="submit" class="btn btn-primary">Search</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="browse-container">
|
||||
<?php foreach ($browseCandidates as $c): ?>
|
||||
<div class="candidate-card" onclick="location.href='messages.php?user_id=<?= $c['id'] ?>'">
|
||||
<div class="candidate-header">
|
||||
<div class="candidate-avatar">
|
||||
<?php if ($c['profile_photo']): ?>
|
||||
<img src="<?= htmlspecialchars($c['profile_photo']) ?>" style="width: 100%; height: 100%; object-fit: cover; border-radius: 16px;">
|
||||
<?php else: ?>
|
||||
<?= substr($c['full_name'], 0, 1) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-weight: 700; font-size: 18px;"><?= htmlspecialchars($c['full_name']) ?></div>
|
||||
<div style="font-size: 13px; color: var(--accent-blue);"><?= htmlspecialchars($c['university']) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 15px; line-height: 1.5; height: 42px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
|
||||
<?= htmlspecialchars($c['bio'] ?: 'Looking for a co-founder to build something great.') ?>
|
||||
</p>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 6px;">
|
||||
<?php
|
||||
$skills = explode(',', $c['skills']);
|
||||
foreach (array_slice($skills, 0, 2) as $skill): if(empty(trim($skill))) continue; ?>
|
||||
<span style="font-size: 10px; padding: 3px 10px; background: rgba(255,255,255,0.05); border-radius: 20px; color: var(--text-secondary);"><?= htmlspecialchars(trim($skill)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div id="match-modal">
|
||||
<div class="match-popup">
|
||||
<h1 class="match-title">It's a Match!</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px; font-size: 18px;">You and this founder both swiped right. Ready to build the next big thing?</p>
|
||||
<button class="btn btn-primary" style="width: 100%; margin-bottom: 15px; padding: 15px;" onclick="location.href='messages.php'">Start a Conversation</button>
|
||||
<button class="btn btn-secondary" style="width: 100%; padding: 15px;" onclick="closeMatch()">Keep Exploring</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function setTab(tab) {
|
||||
document.getElementById('swipe-view').style.display = tab === 'swipe' ? 'flex' : 'none';
|
||||
document.getElementById('browse-view').style.display = tab === 'browse' ? 'block' : 'none';
|
||||
document.getElementById('tab-swipe').classList.toggle('active', tab === 'swipe');
|
||||
document.getElementById('tab-browse').classList.toggle('active', tab === 'browse');
|
||||
}
|
||||
|
||||
function handleSwipe(direction) {
|
||||
const stack = document.getElementById('card-stack');
|
||||
const cards = stack.querySelectorAll('.swipe-card');
|
||||
if (cards.length === 0) return;
|
||||
|
||||
const topCard = cards[cards.length - 1];
|
||||
const swipedId = topCard.getAttribute('data-id');
|
||||
|
||||
// Animation
|
||||
const rotate = direction === 'like' ? 30 : -30;
|
||||
const x = direction === 'like' ? 1000 : -1000;
|
||||
topCard.style.transform = `translateX(${x}px) rotate(${rotate}deg)`;
|
||||
topCard.style.opacity = '0';
|
||||
|
||||
// POST request
|
||||
const fd = new FormData();
|
||||
fd.append('action', 'swipe');
|
||||
fd.append('swiped_id', swipedId);
|
||||
fd.append('direction', direction);
|
||||
|
||||
fetch('partners.php', { method: 'POST', body: fd })
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
if (data.match) {
|
||||
document.getElementById('match-modal').style.display = 'flex';
|
||||
}
|
||||
setTimeout(() => {
|
||||
topCard.remove();
|
||||
if (stack.querySelectorAll('.swipe-card').length === 0) {
|
||||
location.reload();
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
function closeMatch() {
|
||||
document.getElementById('match-modal').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
.nav-links a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
margin: 0 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.nav-links a:hover, .nav-links a.active {
|
||||
color: #fff;
|
||||
}
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent-blue);
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -259,17 +259,18 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="discover.php">Find Partners</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="startups.php">Browse Startups</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@ -285,7 +286,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<div style="display: grid; grid-template-columns: 2fr 1.2fr; gap: 40px;">
|
||||
<div>
|
||||
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 30px;">
|
||||
<div style="width: 80px; height: 80px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: white; font-size: 32px; font-weight: 700;">
|
||||
<div style="width: 80px; height: 80px; background: var(--gradient-primary); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: white; font-size: 32px; font-weight: 700;">
|
||||
<?= substr($startup['name'], 0, 1) ?>
|
||||
</div>
|
||||
<div style="flex: 1;">
|
||||
@ -323,17 +324,17 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</div>
|
||||
|
||||
<?php if ($user['role'] === 'founder' && $startup['founder_id'] == $user_id): ?>
|
||||
<div id="postUpdateForm" style="display: none; background: #f8fafc; padding: 25px; border-radius: 15px; margin-bottom: 30px;">
|
||||
<div id="postUpdateForm" style="display: none; background: rgba(255,255,255,0.02); padding: 25px; border-radius: 15px; margin-bottom: 30px; border: 1px solid var(--border-color);">
|
||||
<h4 style="margin-top: 0;">New Progress Report</h4>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="post_update">
|
||||
<div class="form-group" style="margin-bottom: 15px;">
|
||||
<label>Title</label>
|
||||
<input type="text" name="update_title" class="form-control" placeholder="e.g. Prototype Finished!" required>
|
||||
<input type="text" name="update_title" class="form-control" placeholder="e.g. Prototype Finished!" required style="background: var(--surface-color); color: #fff; border: 1px solid var(--border-color);">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom: 15px;">
|
||||
<label>What's happening?</label>
|
||||
<textarea name="update_content" class="form-control" rows="5" placeholder="Share your progress with backers and followers..." required></textarea>
|
||||
<textarea name="update_content" class="form-control" rows="5" placeholder="Share your progress with backers and followers..." required style="background: var(--surface-color); color: #fff; border: 1px solid var(--border-color);"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Post & Notify Everyone</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="document.getElementById('postUpdateForm').style.display='none'">Cancel</button>
|
||||
@ -351,7 +352,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<p style="color: var(--text-secondary); font-style: italic;">No updates have been posted yet.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($updates as $upd): ?>
|
||||
<div style="border-bottom: 1px solid #eee; padding-bottom: 25px; margin-bottom: 25px;">
|
||||
<div style="border-bottom: 1px solid var(--border-color); padding-bottom: 25px; margin-bottom: 25px;">
|
||||
<h4 style="margin: 0 0 10px 0;"><?= htmlspecialchars($upd['title']) ?></h4>
|
||||
<div style="font-size: 13px; color: var(--text-secondary); margin-bottom: 15px;">
|
||||
<i class="fas fa-clock"></i> Posted on <?= date('M d, Y', strtotime($upd['created_at'])) ?>
|
||||
@ -363,13 +364,15 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</section>
|
||||
|
||||
<?php if ($activeRound): ?>
|
||||
<section class="card" style="border-left: 5px solid var(--primary);">
|
||||
<section class="card" style="border-left: 5px solid var(--accent-blue);">
|
||||
<h3 style="margin-top: 0;">Active Funding Round</h3>
|
||||
<div class="progress-container" style="margin: 20px 0;">
|
||||
<div style="margin: 20px 0;">
|
||||
<?php
|
||||
$percent = ($activeRound['funding_goal'] > 0) ? min(100, ($activeRound['funding_raised'] / $activeRound['funding_goal']) * 100) : 0;
|
||||
?>
|
||||
<div class="progress-bar" style="width: <?= $percent ?>%"></div>
|
||||
<div style="width: 100%; height: 10px; background: var(--border-color); border-radius: 5px; overflow: hidden;">
|
||||
<div style="width: <?= $percent ?>%; height: 100%; background: var(--gradient-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 20px;">
|
||||
<span style="font-size: 24px;">£<?= number_format($activeRound['funding_raised']) ?> raised</span>
|
||||
@ -386,15 +389,15 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<form method="POST" onsubmit="return confirm('CANCEL this round? All investors in this specific round will be automatically refunded. This cannot be undone.');">
|
||||
<input type="hidden" name="action" value="cancel_round">
|
||||
<input type="hidden" name="round_id" value="<?= $activeRound['id'] ?>">
|
||||
<button type="submit" class="btn btn-outline" style="color: #dc3545; border-color: #dc3545;">Cancel Round & Refund</button>
|
||||
<button type="submit" class="btn btn-outline" style="color: #ff3b30; border-color: #ff3b30;">Cancel Round & Refund</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php elseif ($user['role'] === 'investor'): ?>
|
||||
<form method="POST" style="background: #f8fafc; padding: 25px; border-radius: 15px; margin-top: 20px;">
|
||||
<form method="POST" style="background: rgba(255,255,255,0.02); padding: 25px; border-radius: 15px; margin-top: 20px; border: 1px solid var(--border-color);">
|
||||
<input type="hidden" name="action" value="invest">
|
||||
<label style="display: block; margin-bottom: 10px; font-weight: 600;">Investment Amount (£)</label>
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<input type="number" name="amount" min="50" step="10" value="100" class="form-control" style="flex: 1;">
|
||||
<input type="number" name="amount" min="50" step="10" value="100" class="form-control" style="flex: 1; background: var(--surface-color); color: #fff; border: 1px solid var(--border-color);">
|
||||
<button type="submit" class="btn btn-primary">Back this Venture</button>
|
||||
</div>
|
||||
<p style="margin-top: 10px; font-size: 14px; color: var(--text-secondary);">Minimum investment is £50. Your support helps students grow.</p>
|
||||
@ -402,7 +405,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php else: ?>
|
||||
<section class="card" style="background: #f8fafc; text-align: center; padding: 40px;">
|
||||
<section class="card" style="background: rgba(255,255,255,0.02); text-align: center; padding: 40px; border: 1px dashed var(--border-color);">
|
||||
<div style="font-size: 48px; color: var(--text-secondary); margin-bottom: 20px;"><i class="fas fa-lock"></i></div>
|
||||
<h3>No Active Funding Round</h3>
|
||||
<p style="color: var(--text-secondary);">This startup is not currently raising funds, or the previous round has closed.</p>
|
||||
@ -410,13 +413,13 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<?php if ($user['role'] === 'founder' && $startup['founder_id'] == $user_id): ?>
|
||||
<button class="btn btn-primary" style="margin-top: 20px;" onclick="document.getElementById('newRoundForm').style.display='block'">Launch New Funding Round</button>
|
||||
|
||||
<div id="newRoundForm" style="display: none; margin-top: 30px; text-align: left; background: white; padding: 25px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);">
|
||||
<div id="newRoundForm" style="display: none; margin-top: 30px; text-align: left; background: var(--surface-color); padding: 25px; border-radius: 15px; border: 1px solid var(--border-color);">
|
||||
<h4>Round Details</h4>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="start_new_round">
|
||||
<div class="form-group" style="margin-bottom: 20px;">
|
||||
<label>New Funding Target (£)</label>
|
||||
<input type="number" name="new_target" min="50" step="50" class="form-control" placeholder="e.g. 5000" required>
|
||||
<input type="number" name="new_target" min="50" step="50" class="form-control" placeholder="e.g. 5000" required style="background: var(--bg-color); color: #fff; border: 1px solid var(--border-color);">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Start Round</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="document.getElementById('newRoundForm').style.display='none'">Cancel</button>
|
||||
@ -431,8 +434,8 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<section class="card" style="margin-bottom: 30px;">
|
||||
<h3 style="margin-top: 0; margin-bottom: 20px;">Venture Stats</h3>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
|
||||
<div style="background: #f8fafc; padding: 15px; border-radius: 12px; text-align: center;">
|
||||
<div style="color: var(--text-secondary); font-size: 13px; text-transform: uppercase; margin-bottom: 5px;">Backers</div>
|
||||
<div style="background: rgba(255,255,255,0.02); padding: 15px; border-radius: 12px; text-align: center; border: 1px solid var(--border-color);">
|
||||
<div style="color: var(--text-secondary); font-size: 11px; text-transform: uppercase; margin-bottom: 5px; font-weight: 700;">Backers</div>
|
||||
<?php
|
||||
$stmt = db()->prepare("SELECT COUNT(DISTINCT investor_id) FROM investments WHERE startup_id = ? AND status = 'approved'");
|
||||
$stmt->execute([$startup_id]);
|
||||
@ -440,8 +443,8 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
?>
|
||||
<div style="font-size: 20px; font-weight: 700;"><?= $backerCount ?></div>
|
||||
</div>
|
||||
<div style="background: #f8fafc; padding: 15px; border-radius: 12px; text-align: center;">
|
||||
<div style="color: var(--text-secondary); font-size: 13px; text-transform: uppercase; margin-bottom: 5px;">Followers</div>
|
||||
<div style="background: rgba(255,255,255,0.02); padding: 15px; border-radius: 12px; text-align: center; border: 1px solid var(--border-color);">
|
||||
<div style="color: var(--text-secondary); font-size: 11px; text-transform: uppercase; margin-bottom: 5px; font-weight: 700;">Followers</div>
|
||||
<?php
|
||||
$stmt = db()->prepare("SELECT COUNT(*) FROM startup_followers WHERE startup_id = ?");
|
||||
$stmt->execute([$startup_id]);
|
||||
@ -461,11 +464,11 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
?>
|
||||
<?php if ($founder): ?>
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 20px;">
|
||||
<div style="width: 50px; height: 50px; border-radius: 50%; background: #eee; overflow: hidden;">
|
||||
<div style="width: 50px; height: 50px; border-radius: 50%; background: var(--surface-color); overflow: hidden;">
|
||||
<?php if ($founder['profile_photo']): ?>
|
||||
<img src="<?= htmlspecialchars($founder['profile_photo']) ?>" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
<?php else: ?>
|
||||
<div style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--primary); color: white;">
|
||||
<div style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--gradient-primary); color: white;">
|
||||
<?= substr($founder['full_name'], 0, 1) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -477,7 +480,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="messages.php?user_id=<?= $founder['id'] ?>" class="btn btn-outline" style="width: 100%; text-align: center; display: block;">Send Message</a>
|
||||
<a href="messages.php?user_id=<?= $founder['id'] ?>" class="btn btn-outline" style="width: 100%; text-align: center; display: block; border-radius: 12px; border: 1px solid var(--border-color);">Send Message</a>
|
||||
<?php else: ?>
|
||||
<div style="color: var(--text-secondary); font-style: italic;">Founder account deleted. Venture is community-managed.</div>
|
||||
<?php endif; ?>
|
||||
@ -486,11 +489,28 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer style="margin-top: 50px; padding: 40px 0; border-top: 1px solid #eee; text-align: center; color: var(--text-secondary);">
|
||||
<div class="container">
|
||||
<p>© <?= date('Y') ?> Gatsby — Built for Student Entrepreneurs.</p>
|
||||
</div>
|
||||
</footer>
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
.nav-links a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
margin: 0 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.nav-links a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
18
startups.php
18
startups.php
@ -112,23 +112,27 @@ if ($user['role'] === 'founder') {
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php" class="active">My Startups</a>
|
||||
<a href="discover.php">Find Partners</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discovery</a>
|
||||
<a href="startups.php" class="active">Browse Startups</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<a href="dashboard.php" style="color: var(--text-secondary);"><i class="fas fa-th-large"></i></a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<main class="container" style="padding-top: 50px; padding-bottom: 50px;">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 10%; right: -10%;"></div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<h1><?= $user['role'] === 'founder' ? 'My Startups' : 'Student Startups' ?></h1>
|
||||
@ -173,7 +177,7 @@ if ($user['role'] === 'founder') {
|
||||
<?= $startup['round_status'] === 'Active' ? 'Active Round' : 'No Active Round' ?>
|
||||
</span>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 25px; line-height: 1.6;">
|
||||
<p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 25px; line-height: 1.6; height: 42px; overflow: hidden;">
|
||||
<?= htmlspecialchars(substr($startup['description'], 0, 120)) ?>...
|
||||
</p>
|
||||
<div style="margin-bottom: 20px;">
|
||||
@ -204,7 +208,7 @@ if ($user['role'] === 'founder') {
|
||||
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 10, 0.8);
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
@ -226,4 +230,4 @@ if ($user['role'] === 'founder') {
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user