This commit is contained in:
Flatlogic Bot 2026-02-28 20:07:53 +00:00
parent 93e195d19b
commit eb6f8a216e
11 changed files with 52 additions and 82 deletions

View File

@ -3,7 +3,7 @@ session_start();
require_once 'db/config.php'; require_once 'db/config.php';
require_once 'ai/LocalAIApi.php'; require_once 'ai/LocalAIApi.php';
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'founder') { if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
header('Location: login.php'); header('Location: login.php');
exit; exit;
} }

View File

@ -124,7 +124,7 @@ function number_get_formatted($num) {
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>
@ -212,14 +212,14 @@ function number_get_formatted($num) {
<div class="card" style="margin-bottom: 40px; padding: 35px;"> <div class="card" style="margin-bottom: 40px; padding: 35px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;"> <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;">
<h3 style="margin: 0; font-size: 24px; font-weight: 800;">Portfolio Overview</h3> <h3 style="margin: 0; font-size: 24px; font-weight: 800;">Portfolio Overview</h3>
<a href="startups.php" class="btn btn-primary" style="padding: 12px 24px; font-size: 14px;">Find New Deals</a> <a href="funding_rounds.php" class="btn btn-primary" style="padding: 12px 24px; font-size: 14px;">Find New Deals</a>
</div> </div>
<?php if (empty($myInvestments)): ?> <?php if (empty($myInvestments)): ?>
<div style="text-align: center; padding: 60px 0; background: rgba(255,255,255,0.02); border-radius: 32px; border: 1px dashed var(--border-color);"> <div style="text-align: center; padding: 60px 0; background: rgba(255,255,255,0.02); border-radius: 32px; border: 1px dashed var(--border-color);">
<div class="card-icon" style="margin: 0 auto 20px; background: rgba(0, 242, 255, 0.1);"><i class="fas fa-chart-line"></i></div> <div class="card-icon" style="margin: 0 auto 20px; background: rgba(0, 242, 255, 0.1);"><i class="fas fa-chart-line"></i></div>
<p style="color: var(--text-secondary); margin-bottom: 25px; font-size: 18px;">Start backing the next generation of founders.</p> <p style="color: var(--text-secondary); margin-bottom: 25px; font-size: 18px;">Start backing the next generation of founders.</p>
<a href="startups.php" class="btn btn-primary">Start Investing</a> <a href="funding_rounds.php" class="btn btn-primary">Start Investing</a>
</div> </div>
<?php else: ?> <?php else: ?>
<div style="display: grid; grid-template-columns: 1fr; gap: 20px;"> <div style="display: grid; grid-template-columns: 1fr; gap: 20px;">

View File

@ -37,9 +37,9 @@ $stmt = db()->query("
"); ");
$mostFunded = $stmt->fetchAll(); $mostFunded = $stmt->fetchAll();
// General Browse // General Browse - ONLY Founding Rounds (Active)
$q = $_GET['q'] ?? ''; $q = $_GET['q'] ?? '';
$where = "u.onboarding_completed = 1"; $where = "fr.status = 'Active'";
$params = []; $params = [];
if ($q) { if ($q) {
$where .= " AND (s.name LIKE ? OR s.description LIKE ? OR s.industry LIKE ?)"; $where .= " AND (s.name LIKE ? OR s.description LIKE ? OR s.industry LIKE ?)";
@ -49,11 +49,12 @@ if ($q) {
} }
$stmt = db()->prepare(" $stmt = db()->prepare("
SELECT s.*, u.full_name as founder_name SELECT s.*, u.full_name as founder_name, fr.funding_goal as active_goal, fr.funding_raised as active_raised
FROM startups s FROM funding_rounds fr
JOIN startups s ON fr.startup_id = s.id
JOIN users u ON s.founder_id = u.id JOIN users u ON s.founder_id = u.id
WHERE $where WHERE $where
ORDER BY s.created_at DESC ORDER BY fr.created_at DESC
LIMIT 12 LIMIT 12
"); ");
$stmt->execute($params); $stmt->execute($params);
@ -98,14 +99,9 @@ $browseStartups = $stmt->fetchAll();
<span class="logo-text"><?= htmlspecialchars($platformName) ?></span> <span class="logo-text"><?= htmlspecialchars($platformName) ?></span>
</a> </a>
<nav class="nav-links"> <nav class="nav-links">
<?php if ($user_role === 'founder'): ?> <a href="funding_rounds.php">Founding Rounds</a>
<a href="startups.php">My Startups</a> <a href="portfolio.php">Portfolio</a>
<a href="partners.php">Find Partners</a> <a href="discover.php" class="active">Discovery Hub</a>
<?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a>
<a href="portfolio.php">Portfolio</a>
<a href="discover.php" class="active">Discovery Hub</a>
<?php endif; ?>
<a href="messages.php">Messages</a> <a href="messages.php">Messages</a>
</nav> </nav>
<div style="display: flex; align-items: center; gap: 15px;"> <div style="display: flex; align-items: center; gap: 15px;">
@ -164,9 +160,9 @@ $browseStartups = $stmt->fetchAll();
</div> </div>
<div style="margin-bottom: 40px; text-align: center;"> <div style="margin-bottom: 40px; text-align: center;">
<h2 style="margin-bottom: 25px;">Browse All Startups</h2> <h2 style="margin-bottom: 25px;">Founding Rounds</h2>
<form method="GET" style="display: flex; gap: 10px; max-width: 600px; margin: 0 auto;"> <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;"> <input type="text" name="q" value="<?= htmlspecialchars($q) ?>" placeholder="Search founding rounds..." 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> <button type="submit" class="btn btn-primary">Filter</button>
</form> </form>
</div> </div>
@ -190,7 +186,7 @@ $browseStartups = $stmt->fetchAll();
<?php if (!empty($s['industry'])): ?> <?php if (!empty($s['industry'])): ?>
<span class="badge" style="font-size: 10px;"><?= htmlspecialchars($s['industry']) ?></span> <span class="badge" style="font-size: 10px;"><?= htmlspecialchars($s['industry']) ?></span>
<?php endif; ?> <?php endif; ?>
<span style="font-weight: 700; color: var(--accent-blue);">£<?= number_format($s['funding_raised']) ?></span> <span style="font-weight: 700; color: var(--accent-blue);">£<?= number_format($s['active_raised']) ?></span>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -78,7 +78,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -35,7 +35,7 @@ $activeRounds = $stmt->fetchAll();
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Active Funding Rounds <?= htmlspecialchars($platformName) ?></title> <title>Founding Rounds <?= htmlspecialchars($platformName) ?></title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
@ -51,8 +51,7 @@ $activeRounds = $stmt->fetchAll();
<span class="logo-text"><?= htmlspecialchars($platformName) ?></span> <span class="logo-text"><?= htmlspecialchars($platformName) ?></span>
</a> </a>
<nav class="nav-links"> <nav class="nav-links">
<a href="startups.php">Browse Startups</a> <a href="funding_rounds.php" class="active">Founding Rounds</a>
<a href="funding_rounds.php" class="active">Funding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<a href="messages.php">Messages</a> <a href="messages.php">Messages</a>
@ -75,7 +74,7 @@ $activeRounds = $stmt->fetchAll();
</div> </div>
<div style="margin-bottom: 40px;"> <div style="margin-bottom: 40px;">
<h1>Active Funding Rounds</h1> <h1>Active Founding Rounds</h1>
<p style="color: var(--text-secondary);">Direct access to the most promising student startups seeking capital right now.</p> <p style="color: var(--text-secondary);">Direct access to the most promising student startups seeking capital right now.</p>
</div> </div>
@ -84,8 +83,7 @@ $activeRounds = $stmt->fetchAll();
<div class="card" style="grid-column: 1 / -1; text-align: center; padding: 80px 20px;"> <div class="card" style="grid-column: 1 / -1; text-align: center; padding: 80px 20px;">
<i class="fas fa-coins" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 30px;"></i> <i class="fas fa-coins" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 30px;"></i>
<h3>No active rounds at the moment</h3> <h3>No active rounds at the moment</h3>
<p style="color: var(--text-secondary);">Check back soon for new opportunities or browse all startups.</p> <p style="color: var(--text-secondary);">Check back soon for new opportunities.</p>
<a href="startups.php" class="btn btn-primary" style="margin-top: 25px;">Browse Startups</a>
</div> </div>
<?php else: ?> <?php else: ?>
<?php foreach ($activeRounds as $round): <?php foreach ($activeRounds as $round):

View File

@ -138,7 +138,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content']) && $active
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -46,7 +46,7 @@ $notifications = $stmt->fetchAll();
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -123,7 +123,7 @@ if (!$search) { usort($browseCandidates, function($a, $b) { return $b['score'] <
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php" class="active">Find Partners</a> <a href="partners.php" class="active">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -56,7 +56,7 @@ foreach ($myInvestments as $inv) {
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php" class="active">Portfolio</a> <a href="portfolio.php" class="active">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -140,7 +140,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
<a href="startups.php">My Startups</a> <a href="startups.php">My Startups</a>
<a href="partners.php">Find Partners</a> <a href="partners.php">Find Partners</a>
<?php else: ?> <?php else: ?>
<a href="startups.php">Browse Startups</a><a href="funding_rounds.php">Funding Rounds</a> <a href="funding_rounds.php">Founding Rounds</a>
<a href="portfolio.php">Portfolio</a> <a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a> <a href="discover.php">Discovery Hub</a>
<?php endif; ?> <?php endif; ?>

View File

@ -12,6 +12,11 @@ if (!$user) { header('Location: login.php'); exit; }
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
if ($user['role'] !== 'founder') {
header('Location: funding_rounds.php');
exit;
}
// Fetch Trending Startups based on total funding raised // Fetch Trending Startups based on total funding raised
$stmt = db()->prepare(" $stmt = db()->prepare("
SELECT id SELECT id
@ -22,35 +27,22 @@ $stmt = db()->prepare("
$stmt->execute(); $stmt->execute();
$trendingIds = $stmt->fetchAll(PDO::FETCH_COLUMN); $trendingIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
if ($user['role'] === 'founder') { $stmt = db()->prepare("
$stmt = db()->prepare(" SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status
SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status FROM startups s
FROM startups s LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active' WHERE s.founder_id = ?
WHERE s.founder_id = ? ORDER BY s.created_at DESC
ORDER BY s.created_at DESC ");
"); $stmt->execute([$user_id]);
$stmt->execute([$user_id]); $myStartups = $stmt->fetchAll();
$myStartups = $stmt->fetchAll();
} else {
// Browse all startups for investors
$stmt = db()->prepare("
SELECT s.*, fr.funding_goal as active_goal, fr.funding_raised as active_raised, fr.status as round_status, u.full_name as founder_name
FROM startups s
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
LEFT JOIN users u ON s.founder_id = u.id
ORDER BY s.funding_raised DESC, s.created_at DESC
");
$stmt->execute();
$myStartups = $stmt->fetchAll();
}
?> ?>
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= $user['role'] === 'founder' ? 'My Startups' : 'Student Startups' ?> — <?= htmlspecialchars($platformName) ?></title> <title>My Startups <?= htmlspecialchars($platformName) ?></title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
@ -91,15 +83,8 @@ if ($user['role'] === 'founder') {
<span class="logo-text"><?= htmlspecialchars($platformName) ?></span> <span class="logo-text"><?= htmlspecialchars($platformName) ?></span>
</a> </a>
<nav class="nav-links"> <nav class="nav-links">
<?php if ($user['role'] === 'founder'): ?> <a href="startups.php" class="active">My Startups</a>
<a href="startups.php" class="active">My Startups</a> <a href="partners.php">Find Partners</a>
<a href="partners.php">Find Partners</a>
<?php else: ?>
<a href="startups.php" class="active">Browse Startups</a>
<a href="funding_rounds.php">Funding Rounds</a>
<a href="portfolio.php">Portfolio</a>
<a href="discover.php">Discovery Hub</a>
<?php endif; ?>
<a href="messages.php">Messages</a> <a href="messages.php">Messages</a>
</nav> </nav>
<div style="display: flex; align-items: center; gap: 15px;"> <div style="display: flex; align-items: center; gap: 15px;">
@ -124,12 +109,10 @@ if ($user['role'] === 'founder') {
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;"> <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
<div> <div>
<h1><?= $user['role'] === 'founder' ? 'My Startups' : 'Student Startups' ?></h1> <h1>My Startups</h1>
<p style="color: var(--text-secondary);"><?= $user['role'] === 'founder' ? 'Manage and track your ventures.' : 'Discover the next generation of student-led innovation.' ?></p> <p style="color: var(--text-secondary);">Manage and track your ventures.</p>
</div> </div>
<?php if ($user['role'] === 'founder'): ?> <a href="create_startup.php" class="btn btn-primary">List New Startup</a>
<a href="founder_onboarding.php" class="btn btn-primary">List New Startup</a>
<?php endif; ?>
</div> </div>
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px;"> <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px;">
@ -138,9 +121,7 @@ if ($user['role'] === 'founder') {
<i class="fas fa-rocket" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 30px;"></i> <i class="fas fa-rocket" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 30px;"></i>
<h3>No startups found</h3> <h3>No startups found</h3>
<p style="color: var(--text-secondary);">Start your journey by listing your first startup or idea.</p> <p style="color: var(--text-secondary);">Start your journey by listing your first startup or idea.</p>
<?php if ($user['role'] === 'founder'): ?> <a href="create_startup.php" class="btn btn-primary" style="margin-top: 25px;">Start Funding Round</a>
<a href="founder_onboarding.php" class="btn btn-primary" style="margin-top: 25px;">Start Funding Round</a>
<?php endif; ?>
</div> </div>
<?php else: ?> <?php else: ?>
<?php foreach ($myStartups as $startup): <?php foreach ($myStartups as $startup):
@ -158,9 +139,6 @@ if ($user['role'] === 'founder') {
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;"> <div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;">
<div> <div>
<h3 style="margin: 0;"><?= htmlspecialchars($startup['name']) ?></h3> <h3 style="margin: 0;"><?= htmlspecialchars($startup['name']) ?></h3>
<?php if ($user['role'] === 'investor'): ?>
<div style="font-size: 12px; color: var(--text-secondary); margin-top: 4px;">by <?= $startup['founder_name'] ? htmlspecialchars($startup['founder_name']) : 'Account Deleted' ?></div>
<?php endif; ?>
</div> </div>
<span style="font-size: 10px; text-transform: uppercase; padding: 4px 8px; background: rgba(0, 242, 255, 0.1); color: var(--accent-blue); border-radius: 4px; border: 1px solid rgba(0, 242, 255, 0.3);"> <span style="font-size: 10px; text-transform: uppercase; padding: 4px 8px; background: rgba(0, 242, 255, 0.1); color: var(--accent-blue); border-radius: 4px; border: 1px solid rgba(0, 242, 255, 0.3);">
<?= $startup['round_status'] === 'Active' ? 'Active Round' : 'No Active Round' ?> <?= $startup['round_status'] === 'Active' ? 'Active Round' : 'No Active Round' ?>
@ -178,9 +156,7 @@ if ($user['role'] === 'founder') {
</div> </div>
<div style="display: flex; gap: 10px;"> <div style="display: flex; gap: 10px;">
<a href="startup_details.php?id=<?= $startup['id'] ?>" class="btn btn-outline" style="flex: 1; padding: 10px; font-size: 13px;">View Details</a> <a href="startup_details.php?id=<?= $startup['id'] ?>" class="btn btn-outline" style="flex: 1; padding: 10px; font-size: 13px;">View Details</a>
<?php if ($user['role'] === 'founder'): ?> <a href="create_startup.php?id=<?= $startup['id'] ?>" class="btn btn-secondary" style="padding: 10px; font-size: 13px;"><i class="fas fa-edit"></i></a>
<a href="create_startup.php?id=<?= $startup['id'] ?>" class="btn btn-secondary" style="padding: 10px; font-size: 13px;"><i class="fas fa-edit"></i></a>
<?php endif; ?>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>