v35
This commit is contained in:
parent
93e195d19b
commit
eb6f8a216e
@ -3,7 +3,7 @@ session_start();
|
||||
require_once 'db/config.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');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ function number_get_formatted($num) {
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
@ -212,14 +212,14 @@ function number_get_formatted($num) {
|
||||
<div class="card" style="margin-bottom: 40px; padding: 35px;">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<?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 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>
|
||||
<a href="startups.php" class="btn btn-primary">Start Investing</a>
|
||||
<a href="funding_rounds.php" class="btn btn-primary">Start Investing</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="display: grid; grid-template-columns: 1fr; gap: 20px;">
|
||||
@ -304,4 +304,4 @@ function number_get_formatted($num) {
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
30
discover.php
30
discover.php
@ -37,9 +37,9 @@ $stmt = db()->query("
|
||||
");
|
||||
$mostFunded = $stmt->fetchAll();
|
||||
|
||||
// General Browse
|
||||
// General Browse - ONLY Founding Rounds (Active)
|
||||
$q = $_GET['q'] ?? '';
|
||||
$where = "u.onboarding_completed = 1";
|
||||
$where = "fr.status = 'Active'";
|
||||
$params = [];
|
||||
if ($q) {
|
||||
$where .= " AND (s.name LIKE ? OR s.description LIKE ? OR s.industry LIKE ?)";
|
||||
@ -49,11 +49,12 @@ if ($q) {
|
||||
}
|
||||
|
||||
$stmt = db()->prepare("
|
||||
SELECT s.*, u.full_name as founder_name
|
||||
FROM startups s
|
||||
SELECT s.*, u.full_name as founder_name, fr.funding_goal as active_goal, fr.funding_raised as active_raised
|
||||
FROM funding_rounds fr
|
||||
JOIN startups s ON fr.startup_id = s.id
|
||||
JOIN users u ON s.founder_id = u.id
|
||||
WHERE $where
|
||||
ORDER BY s.created_at DESC
|
||||
ORDER BY fr.created_at DESC
|
||||
LIMIT 12
|
||||
");
|
||||
$stmt->execute($params);
|
||||
@ -98,14 +99,9 @@ $browseStartups = $stmt->fetchAll();
|
||||
<span class="logo-text"><?= htmlspecialchars($platformName) ?></span>
|
||||
</a>
|
||||
<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="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="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php" class="active">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
@ -164,9 +160,9 @@ $browseStartups = $stmt->fetchAll();
|
||||
</div>
|
||||
|
||||
<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;">
|
||||
<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>
|
||||
</form>
|
||||
</div>
|
||||
@ -190,7 +186,7 @@ $browseStartups = $stmt->fetchAll();
|
||||
<?php if (!empty($s['industry'])): ?>
|
||||
<span class="badge" style="font-size: 10px;"><?= htmlspecialchars($s['industry']) ?></span>
|
||||
<?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>
|
||||
<?php endforeach; ?>
|
||||
@ -209,4 +205,4 @@ $browseStartups = $stmt->fetchAll();
|
||||
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@ -78,7 +78,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -35,7 +35,7 @@ $activeRounds = $stmt->fetchAll();
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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.gstatic.com" crossorigin>
|
||||
<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>
|
||||
</a>
|
||||
<nav class="nav-links">
|
||||
<a href="startups.php">Browse Startups</a>
|
||||
<a href="funding_rounds.php" class="active">Funding Rounds</a>
|
||||
<a href="funding_rounds.php" class="active">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
@ -75,7 +74,7 @@ $activeRounds = $stmt->fetchAll();
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@ -84,8 +83,7 @@ $activeRounds = $stmt->fetchAll();
|
||||
<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>
|
||||
<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>
|
||||
<a href="startups.php" class="btn btn-primary" style="margin-top: 25px;">Browse Startups</a>
|
||||
<p style="color: var(--text-secondary);">Check back soon for new opportunities.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($activeRounds as $round):
|
||||
@ -143,4 +141,4 @@ $activeRounds = $stmt->fetchAll();
|
||||
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@ -138,7 +138,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content']) && $active
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -46,7 +46,7 @@ $notifications = $stmt->fetchAll();
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -123,7 +123,7 @@ if (!$search) { usort($browseCandidates, function($a, $b) { return $b['score'] <
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php" class="active">Find Partners</a>
|
||||
<?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="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -56,7 +56,7 @@ foreach ($myInvestments as $inv) {
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php" class="active">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@ -140,7 +140,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<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="funding_rounds.php">Funding Rounds</a>
|
||||
<a href="funding_rounds.php">Founding Rounds</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<a href="discover.php">Discovery Hub</a>
|
||||
<?php endif; ?>
|
||||
|
||||
70
startups.php
70
startups.php
@ -12,6 +12,11 @@ if (!$user) { header('Location: login.php'); exit; }
|
||||
|
||||
$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
|
||||
$stmt = db()->prepare("
|
||||
SELECT id
|
||||
@ -22,35 +27,22 @@ $stmt = db()->prepare("
|
||||
$stmt->execute();
|
||||
$trendingIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
if ($user['role'] === 'founder') {
|
||||
$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
|
||||
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
|
||||
WHERE s.founder_id = ?
|
||||
ORDER BY s.created_at DESC
|
||||
");
|
||||
$stmt->execute([$user_id]);
|
||||
$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();
|
||||
}
|
||||
$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
|
||||
LEFT JOIN funding_rounds fr ON s.id = fr.startup_id AND fr.status = 'Active'
|
||||
WHERE s.founder_id = ?
|
||||
ORDER BY s.created_at DESC
|
||||
");
|
||||
$stmt->execute([$user_id]);
|
||||
$myStartups = $stmt->fetchAll();
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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.gstatic.com" crossorigin>
|
||||
<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>
|
||||
</a>
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php" class="active">My Startups</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="startups.php" class="active">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<a href="messages.php">Messages</a>
|
||||
</nav>
|
||||
<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>
|
||||
<h1><?= $user['role'] === 'founder' ? 'My Startups' : 'Student 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>
|
||||
<h1>My Startups</h1>
|
||||
<p style="color: var(--text-secondary);">Manage and track your ventures.</p>
|
||||
</div>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="founder_onboarding.php" class="btn btn-primary">List New Startup</a>
|
||||
<?php endif; ?>
|
||||
<a href="create_startup.php" class="btn btn-primary">List New Startup</a>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<h3>No startups found</h3>
|
||||
<p style="color: var(--text-secondary);">Start your journey by listing your first startup or idea.</p>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="founder_onboarding.php" class="btn btn-primary" style="margin-top: 25px;">Start Funding Round</a>
|
||||
<?php endif; ?>
|
||||
<a href="create_startup.php" class="btn btn-primary" style="margin-top: 25px;">Start Funding Round</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?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>
|
||||
<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>
|
||||
<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' ?>
|
||||
@ -178,9 +156,7 @@ if ($user['role'] === 'founder') {
|
||||
</div>
|
||||
<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>
|
||||
<?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>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@ -200,4 +176,4 @@ if ($user['role'] === 'founder') {
|
||||
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user