v2
This commit is contained in:
parent
7406216157
commit
21f3fc7eab
@ -1,302 +1,247 @@
|
||||
body {
|
||||
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
|
||||
background-size: 400% 400%;
|
||||
animation: gradient 15s ease infinite;
|
||||
color: #212529;
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
:root {
|
||||
--bg-color: #0a0a0f;
|
||||
--surface-color: #1a1a24;
|
||||
--accent-blue: #00f2ff;
|
||||
--accent-violet: #8a2be2;
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #a0a0b0;
|
||||
--gradient-primary: linear-gradient(135deg, #00f2ff 0%, #8a2be2 100%);
|
||||
--card-bg: rgba(26, 26, 36, 0.7);
|
||||
--border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.main-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@keyframes gradient {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
body {
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-primary);
|
||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
line-height: 1.6;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.chat-container {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 85vh;
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.2);
|
||||
backdrop-filter: blur(15px);
|
||||
-webkit-backdrop-filter: blur(15px);
|
||||
overflow: hidden;
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.chat-header {
|
||||
padding: 1.5rem;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
header {
|
||||
padding: 20px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.message {
|
||||
max-width: 85%;
|
||||
padding: 0.85rem 1.1rem;
|
||||
border-radius: 16px;
|
||||
line-height: 1.5;
|
||||
font-size: 0.95rem;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
||||
animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px) scale(0.95); }
|
||||
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||
}
|
||||
|
||||
.message.visitor {
|
||||
align-self: flex-end;
|
||||
background: linear-gradient(135deg, #212529 0%, #343a40 100%);
|
||||
color: #fff;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.message.bot {
|
||||
align-self: flex-start;
|
||||
background: #ffffff;
|
||||
color: #212529;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.chat-input-area {
|
||||
padding: 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.chat-input-area form {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.chat-input-area input {
|
||||
flex: 1;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem 1rem;
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area input:focus {
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.2);
|
||||
}
|
||||
|
||||
.chat-input-area button {
|
||||
background: #212529;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.chat-input-area button:hover {
|
||||
background: #000;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
/* Background Animations */
|
||||
.bg-animations {
|
||||
position: fixed;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 100;
|
||||
background: rgba(10, 10, 15, 0.8);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
background: var(--gradient-primary);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12px 24px;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, opacity 0.2s;
|
||||
border: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--gradient-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--surface-color);
|
||||
color: #fff;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
/* Hero Section */
|
||||
.hero {
|
||||
padding: 100px 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: 64px;
|
||||
font-weight: 800;
|
||||
margin-bottom: 20px;
|
||||
letter-spacing: -2px;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
font-size: 20px;
|
||||
color: var(--text-secondary);
|
||||
max-width: 700px;
|
||||
margin: 0 auto 40px;
|
||||
}
|
||||
|
||||
.hero-bg {
|
||||
position: absolute;
|
||||
top: -100px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
z-index: -1;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.blob {
|
||||
.hero-blob {
|
||||
position: absolute;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
animation: move 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
|
||||
}
|
||||
|
||||
.blob-1 {
|
||||
top: -10%;
|
||||
left: -10%;
|
||||
background: rgba(238, 119, 82, 0.4);
|
||||
}
|
||||
|
||||
.blob-2 {
|
||||
bottom: -10%;
|
||||
right: -10%;
|
||||
background: rgba(35, 166, 213, 0.4);
|
||||
animation-delay: -7s;
|
||||
width: 600px;
|
||||
height: 600px;
|
||||
background: radial-gradient(circle, rgba(0, 242, 255, 0.1) 0%, rgba(138, 43, 226, 0.1) 100%);
|
||||
filter: blur(100px);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.blob-3 {
|
||||
top: 40%;
|
||||
left: 30%;
|
||||
background: rgba(231, 60, 126, 0.3);
|
||||
animation-delay: -14s;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
/* Features Cards */
|
||||
.features {
|
||||
padding: 80px 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
@keyframes move {
|
||||
0% { transform: translate(0, 0) rotate(0deg) scale(1); }
|
||||
33% { transform: translate(150px, 100px) rotate(120deg) scale(1.1); }
|
||||
66% { transform: translate(-50px, 200px) rotate(240deg) scale(0.9); }
|
||||
100% { transform: translate(0, 0) rotate(360deg) scale(1); }
|
||||
}
|
||||
|
||||
.admin-link {
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.admin-link:hover {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Admin Styles */
|
||||
.admin-container {
|
||||
max-width: 900px;
|
||||
margin: 3rem auto;
|
||||
padding: 2.5rem;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
.card {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
padding: 40px;
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 20px 50px rgba(0,0,0,0.15);
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
transition: transform 0.3s, border-color 0.3s;
|
||||
}
|
||||
|
||||
.admin-container h1 {
|
||||
margin-top: 0;
|
||||
color: #212529;
|
||||
font-weight: 800;
|
||||
.card:hover {
|
||||
transform: translateY(-10px);
|
||||
border-color: rgba(0, 242, 255, 0.3);
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 8px;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.table th {
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 1rem;
|
||||
color: #6c757d;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.table td {
|
||||
background: #fff;
|
||||
padding: 1rem;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.table tr td:first-child { border-radius: 12px 0 0 12px; }
|
||||
.table tr td:last-child { border-radius: 0 12px 12px 0; }
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
.card-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
background: var(--surface-color);
|
||||
border-radius: 12px;
|
||||
background: #fff;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 24px;
|
||||
color: var(--accent-blue);
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
outline: none;
|
||||
border-color: #23a6d5;
|
||||
box-shadow: 0 0 0 3px rgba(35, 166, 213, 0.1);
|
||||
}
|
||||
.card h3 {
|
||||
margin-bottom: 16px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.card p {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* How it Works */
|
||||
.how-it-works {
|
||||
padding: 100px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.how-it-works h2 {
|
||||
font-size: 40px;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.step {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.step-number {
|
||||
font-size: 48px;
|
||||
font-weight: 800;
|
||||
opacity: 0.1;
|
||||
margin-bottom: -20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.step h4 {
|
||||
font-size: 24px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
footer {
|
||||
padding: 60px 0;
|
||||
border-top: 1px solid var(--border-color);
|
||||
margin-top: 100px;
|
||||
text-align: center;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 40px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.footer-links a:hover {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.hero h1 {
|
||||
font-size: 40px;
|
||||
}
|
||||
.nav-links {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
184
dashboard.php
Normal file
184
dashboard.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
// Check if profile is complete (e.g., bio or interests)
|
||||
if (empty($user['bio']) && empty($user['interests'])) {
|
||||
if ($user['role'] === 'investor') {
|
||||
header("Location: investor_onboarding.php");
|
||||
} else {
|
||||
header("Location: founder_onboarding.php");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
// Fetch user's data based on role
|
||||
$myStartups = [];
|
||||
$myInvestments = [];
|
||||
|
||||
if ($user['role'] === 'founder') {
|
||||
$stmt = db()->prepare("SELECT * FROM startups WHERE founder_id = ? ORDER BY created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$myStartups = $stmt->fetchAll();
|
||||
} else {
|
||||
$stmt = db()->prepare("SELECT i.*, s.name as startup_name FROM investments i JOIN startups s ON i.startup_id = s.id WHERE i.investor_id = ? ORDER BY i.created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$myInvestments = $stmt->fetchAll();
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Dashboard — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="messages.php">Messages</a>
|
||||
<a href="notifications.php">Notifications</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<span><?= htmlspecialchars($user['full_name']) ?> (<?= ucfirst($user['role']) ?>)</span>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<h1>Welcome, <?= htmlspecialchars($user['full_name']) ?>!</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Here is your startup ecosystem overview.</p>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 2fr 1fr; gap: 30px;">
|
||||
<div>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<div class="card" style="margin-bottom: 30px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h3 style="margin: 0;">My Startups</h3>
|
||||
<a href="start_funding.php" class="btn btn-primary" style="padding: 8px 16px; font-size: 14px;">+ List Startup</a>
|
||||
</div>
|
||||
|
||||
<?php if (empty($myStartups)): ?>
|
||||
<div style="text-align: center; padding: 40px 0;">
|
||||
<i class="fas fa-rocket" style="font-size: 48px; color: var(--accent-blue); opacity: 0.3; margin-bottom: 20px;"></i>
|
||||
<p>You haven't listed any startups yet.</p>
|
||||
<a href="start_funding.php" class="btn btn-primary" style="margin-top: 20px;">Start Funding Round</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="display: grid; grid-template-columns: 1fr; gap: 15px;">
|
||||
<?php foreach ($myStartups as $startup): ?>
|
||||
<div style="padding: 15px; background: var(--surface-color); border-radius: 12px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;">
|
||||
<div>
|
||||
<div style="font-weight: 600;"><?= htmlspecialchars($startup['name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);"><?= htmlspecialchars($startup['status']) ?> • Raising £<?= number_get_formatted($startup['funding_target']) ?></div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-size: 14px; font-weight: 600; color: var(--accent-blue);">£<?= number_get_formatted($startup['funding_raised']) ?> raised</div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">of £<?= number_get_formatted($startup['funding_target']) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card" style="margin-bottom: 30px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h3 style="margin: 0;">My Portfolio</h3>
|
||||
<a href="discover.php" class="btn btn-primary" style="padding: 8px 16px; font-size: 14px;">Explore Startups</a>
|
||||
</div>
|
||||
|
||||
<?php if (empty($myInvestments)): ?>
|
||||
<div style="text-align: center; padding: 40px 0;">
|
||||
<i class="fas fa-chart-pie" style="font-size: 48px; color: var(--accent-blue); opacity: 0.3; margin-bottom: 20px;"></i>
|
||||
<p>You haven't backed any student projects yet.</p>
|
||||
<a href="discover.php" class="btn btn-primary" style="margin-top: 20px;">Discover Startups</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="display: grid; grid-template-columns: 1fr; gap: 15px;">
|
||||
<?php foreach ($myInvestments as $inv): ?>
|
||||
<div style="padding: 15px; background: var(--surface-color); border-radius: 12px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;">
|
||||
<div>
|
||||
<div style="font-weight: 600;"><?= htmlspecialchars($inv['startup_name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">Invested on <?= date('M d, Y', strtotime($inv['created_at'])) ?></div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<div style="font-size: 16px; font-weight: 700; color: var(--accent-blue);">£<?= number_get_formatted($inv['amount']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);"><?= ucfirst($inv['status']) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<h3>Latest Network Activity</h3>
|
||||
<p style="color: var(--text-secondary);">Discover the latest student innovations and trends.</p>
|
||||
<div style="margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px;">
|
||||
<p style="color: var(--text-secondary); text-align: center;">No new activity in your network. Follow founders or startups to see updates.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="card" style="margin-bottom: 30px;">
|
||||
<h3>Your Profile</h3>
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 20px;">
|
||||
<div style="width: 60px; height: 60px; background: var(--surface-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--accent-blue); font-weight: bold; border: 1px solid var(--border-color);">
|
||||
<?= substr($user['full_name'], 0, 1) ?>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-weight: 600;"><?= htmlspecialchars($user['full_name']) ?></div>
|
||||
<div style="font-size: 14px; color: var(--text-secondary);"><?= htmlspecialchars($user['university']) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px; font-size: 14px; line-height: 1.5; color: var(--text-secondary);">
|
||||
<?= htmlspecialchars($user['bio'] ?? 'Tell the community about yourself.') ?>
|
||||
</div>
|
||||
<a href="edit_profile.php" class="btn btn-secondary" style="width: 100%; text-align: center;">Edit Profile</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>Networking</h3>
|
||||
<p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 20px;">Find the right people to build the future with.</p>
|
||||
<a href="partners.php" class="btn btn-secondary" style="width: 100%; text-align: center;">Find Partners</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php
|
||||
function number_get_formatted($num) {
|
||||
return number_format((float)$num, 0, '.', ',');
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,17 +1,22 @@
|
||||
<?php
|
||||
// Generated by setup_mariadb_project.sh — edit as needed.
|
||||
// Database configuration
|
||||
define('DB_HOST', '127.0.0.1');
|
||||
define('DB_NAME', 'app_38384');
|
||||
define('DB_USER', 'app_38384');
|
||||
define('DB_PASS', '5561099f-23a3-43d8-b1a2-54739c50721b');
|
||||
define('DB_NAME', 'app_38873');
|
||||
define('DB_USER', 'app_38873');
|
||||
define('DB_PASS', 'd2654632-5c87-4757-a602-36b9781cab66');
|
||||
define('PLATFORM_NAME', 'Gatsby');
|
||||
|
||||
function db() {
|
||||
static $pdo;
|
||||
if (!$pdo) {
|
||||
$pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4', DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
]);
|
||||
try {
|
||||
$pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4', DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
]);
|
||||
} catch (PDOException $e) {
|
||||
die("Connection failed: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
58
db/migrations/01_initial_schema.sql
Normal file
58
db/migrations/01_initial_schema.sql
Normal file
@ -0,0 +1,58 @@
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
full_name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
role ENUM('founder', 'investor') NOT NULL,
|
||||
university VARCHAR(255),
|
||||
graduation_year INT,
|
||||
bio TEXT,
|
||||
interests TEXT, -- Store as JSON or comma-separated tags
|
||||
investment_appetite VARCHAR(255),
|
||||
verified TINYINT(1) DEFAULT 0,
|
||||
verification_code VARCHAR(100),
|
||||
profile_photo VARCHAR(255),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS startups (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
founder_id INT NOT NULL,
|
||||
funding_target DECIMAL(15, 2),
|
||||
funding_raised DECIMAL(15, 2) DEFAULT 0.00,
|
||||
status ENUM('public', 'private') DEFAULT 'public',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (founder_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS investments (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
investor_id INT NOT NULL,
|
||||
startup_id INT NOT NULL,
|
||||
amount DECIMAL(15, 2) NOT NULL,
|
||||
status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (investor_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (startup_id) REFERENCES startups(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS messages (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
sender_id INT NOT NULL,
|
||||
receiver_id INT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (sender_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (receiver_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS notifications (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
is_read TINYINT(1) DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
162
discover.php
Normal file
162
discover.php
Normal file
@ -0,0 +1,162 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
// Fetch startups (mock or real)
|
||||
$stmt = db()->query("SELECT s.*, u.full_name as founder_name, u.university FROM startups s JOIN users u ON s.founder_id = u.id ORDER BY s.created_at DESC");
|
||||
$startups = $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>Discover Startups — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<a href="dashboard.php">Dashboard</a>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php" class="active">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="messages.php">Messages</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<span><?= htmlspecialchars($user['full_name']) ?></span>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<h1>Discover Startups</h1>
|
||||
<p style="color: var(--text-secondary);">Back the most ambitious student projects.</p>
|
||||
</div>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="start_funding.php" class="btn btn-primary">Start Funding Round</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (empty($startups)): ?>
|
||||
<div class="card" style="text-align: center; padding: 60px 0;">
|
||||
<i class="fas fa-search" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 20px;"></i>
|
||||
<h3>No startups found</h3>
|
||||
<p style="color: var(--text-secondary);">Be the first to list a startup or check back later.</p>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="start_funding.php" class="btn btn-primary" style="margin-top: 20px;">List My Startup</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Mock Data for demonstration if empty -->
|
||||
<h2 style="margin: 60px 0 30px;">Featured Startups (Mock)</h2>
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px;">
|
||||
<div class="card">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 20px;">
|
||||
<span style="background: rgba(0, 242, 255, 0.1); color: var(--accent-blue); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;">Fintech</span>
|
||||
<span style="color: var(--text-secondary); font-size: 12px;">Oxford University</span>
|
||||
</div>
|
||||
<h3>UniPay</h3>
|
||||
<p style="color: var(--text-secondary); font-size: 14px; margin-bottom: 20px;">A decentralized payment platform designed specifically for international students to avoid high exchange fees.</p>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px;">
|
||||
<span>Raised: £4,500</span>
|
||||
<span>Target: £10,000</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 6px; background: var(--surface-color); border-radius: 3px; overflow: hidden;">
|
||||
<div style="width: 45%; height: 100%; background: var(--gradient-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; font-weight: 500;">Min Invest: £50</span>
|
||||
<a href="#" class="btn btn-primary" style="padding: 8px 16px;">View Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 20px;">
|
||||
<span style="background: rgba(138, 43, 226, 0.1); color: var(--accent-violet); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;">Sustainability</span>
|
||||
<span style="color: var(--text-secondary); font-size: 12px;">LSE</span>
|
||||
</div>
|
||||
<h3>GreenCampus</h3>
|
||||
<p style="color: var(--text-secondary); font-size: 14px; margin-bottom: 20px;">AI-powered waste management system for university campuses to increase recycling rates by 40%.</p>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px;">
|
||||
<span>Raised: £1,200</span>
|
||||
<span>Target: £5,000</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 6px; background: var(--surface-color); border-radius: 3px; overflow: hidden;">
|
||||
<div style="width: 24%; height: 100%; background: var(--gradient-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; font-weight: 500;">Min Invest: £50</span>
|
||||
<a href="#" class="btn btn-primary" style="padding: 8px 16px;">View Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px;">
|
||||
<?php foreach ($startups as $startup): ?>
|
||||
<div class="card">
|
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 20px;">
|
||||
<span style="background: rgba(0, 242, 255, 0.1); color: var(--accent-blue); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;">Startup</span>
|
||||
<span style="color: var(--text-secondary); font-size: 12px;"><?= htmlspecialchars($startup['university']) ?></span>
|
||||
</div>
|
||||
<h3><?= htmlspecialchars($startup['name']) ?></h3>
|
||||
<p style="color: var(--text-secondary); font-size: 14px; margin-bottom: 20px;"><?= htmlspecialchars($startup['description']) ?></p>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px;">
|
||||
<span>Raised: £<?= number_format($startup['funding_raised'], 0) ?></span>
|
||||
<span>Target: £<?= number_format($startup['funding_target'], 0) ?></span>
|
||||
</div>
|
||||
<?php
|
||||
$percent = ($startup['funding_target'] > 0) ? ($startup['funding_raised'] / $startup['funding_target'] * 100) : 0;
|
||||
$percent = min(100, $percent);
|
||||
?>
|
||||
<div style="width: 100%; height: 6px; background: var(--surface-color); border-radius: 3px; overflow: hidden;">
|
||||
<div style="width: <?= $percent ?>%; height: 100%; background: var(--gradient-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; font-weight: 500;">Min Invest: £50</span>
|
||||
<a href="startup_details.php?id=<?= $startup['id'] ?>" class="btn btn-primary" style="padding: 8px 16px;">View Details</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.active {
|
||||
color: var(--text-primary) !important;
|
||||
border-bottom: 2px solid var(--accent-blue);
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
129
edit_profile.php
Normal file
129
edit_profile.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$full_name = trim($_POST['full_name'] ?? '');
|
||||
$bio = trim($_POST['bio'] ?? '');
|
||||
$interests = trim($_POST['interests'] ?? '');
|
||||
$investment_appetite = trim($_POST['investment_appetite'] ?? '');
|
||||
|
||||
if (empty($full_name)) {
|
||||
$error = "Name cannot be empty.";
|
||||
} else {
|
||||
$stmt = db()->prepare("UPDATE users SET full_name = ?, bio = ?, interests = ?, investment_appetite = ? WHERE id = ?");
|
||||
try {
|
||||
$stmt->execute([$full_name, $bio, $interests, $investment_appetite, $_SESSION['user_id']]);
|
||||
$success = "Profile updated successfully!";
|
||||
// Update session if name changed
|
||||
$_SESSION['full_name'] = $full_name;
|
||||
// Refresh user data
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
} catch (PDOException $e) {
|
||||
$error = "Update failed: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Edit Profile — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="padding-bottom: 60px;">
|
||||
|
||||
<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="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<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" class="btn btn-secondary" style="padding: 8px 16px;">Back to Dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<div style="max-width: 600px; margin: 0 auto;">
|
||||
<h1>Edit Profile</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Manage your public presence in the <?= htmlspecialchars($platformName) ?> community.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($success): ?>
|
||||
<div style="background: rgba(0, 255, 0, 0.1); border: 1px solid rgba(0, 255, 0, 0.3); color: #55ff55; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($success) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Full Name</label>
|
||||
<input type="text" name="full_name" value="<?= htmlspecialchars($user['full_name']) ?>" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">University</label>
|
||||
<input type="text" value="<?= htmlspecialchars($user['university']) ?>" disabled style="width: 100%; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-secondary);">
|
||||
<span style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">University status is verified and cannot be changed.</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Bio / Vision</label>
|
||||
<textarea name="bio" placeholder="What are you building or looking for?" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 120px; resize: none;"><?= htmlspecialchars($user['bio'] ?? '') ?></textarea>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Interests / Skills (Comma separated)</label>
|
||||
<input type="text" name="interests" value="<?= htmlspecialchars($user['interests'] ?? '') ?>" placeholder="Fintech, AI, Sustainable Fashion, Marketing" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<?php if ($user['role'] === 'investor'): ?>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Investment Appetite</label>
|
||||
<select name="investment_appetite" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<option value="Micro (£50 - £500)" <?= ($user['investment_appetite'] === 'Micro (£50 - £500)') ? 'selected' : '' ?>>Micro (£50 - £500)</option>
|
||||
<option value="Standard (£500 - £5k)" <?= ($user['investment_appetite'] === 'Standard (£500 - £5k)') ? 'selected' : '' ?>>Standard (£500 - £5k)</option>
|
||||
<option value="Angel (£5k+)" <?= ($user['investment_appetite'] === 'Angel (£5k+)') ? 'selected' : '' ?>>Angel (£5k+)</option>
|
||||
</select>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
88
founder_onboarding.php
Normal file
88
founder_onboarding.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$bio = trim($_POST['bio'] ?? '');
|
||||
$interests = isset($_POST['interests']) ? implode(',', $_POST['interests']) : '';
|
||||
|
||||
if (empty($bio) || empty($interests)) {
|
||||
$error = "Please fill in all required fields.";
|
||||
} else {
|
||||
$stmt = db()->prepare("UPDATE users SET bio = ?, interests = ? WHERE id = ?");
|
||||
try {
|
||||
$stmt->execute([$bio, $interests, $_SESSION['user_id']]);
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
} catch (PDOException $e) {
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
$skills_options = ['Frontend Development', 'Backend Development', 'Mobile App Development', 'UI/UX Design', 'Digital Marketing', 'Sales & Business Dev', 'Data Science', 'Operations', 'Finance', 'Legal'];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Founder Onboarding — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 600px;">
|
||||
<h2 style="margin-bottom: 10px;">Create Your Founder Profile</h2>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px;">Let people know what you're building and what skills you have.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Short Bio / Your Mission (Max 150 characters)</label>
|
||||
<textarea name="bio" required maxlength="150" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 100px; resize: none;"></textarea>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">What are your top skills?</label>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||
<?php foreach ($skills_options as $option): ?>
|
||||
<label style="cursor: pointer;">
|
||||
<input type="checkbox" name="interests[]" value="<?= $option ?>" style="display: none;" class="skill-checkbox">
|
||||
<div class="skill-tag" style="padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 30px; font-size: 14px; transition: all 0.2s;">
|
||||
<?= $option ?>
|
||||
</div>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Complete Profile</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.skill-checkbox:checked + .skill-tag {
|
||||
background: var(--gradient-primary);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
117
index.php
117
index.php
@ -1,14 +1,15 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Modern AI-ready Chat Assistant';
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Exclusive startup networking and micro-investment platform for students and graduates.';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
$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>Chat Assistant</title>
|
||||
<title><?= htmlspecialchars($platformName) ?> — Connect. Fund. Build.</title>
|
||||
<?php if ($projectDescription): ?>
|
||||
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>">
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>">
|
||||
@ -18,35 +19,97 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
<?php endif; ?>
|
||||
<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;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-animations">
|
||||
<div class="blob blob-1"></div>
|
||||
<div class="blob blob-2"></div>
|
||||
<div class="blob blob-3"></div>
|
||||
</div>
|
||||
<div class="main-wrapper">
|
||||
<div class="chat-container">
|
||||
<div class="chat-header">
|
||||
<span>Chat Assistant</span>
|
||||
<a href="admin.php" class="admin-link">Admin</a>
|
||||
</div>
|
||||
<div class="chat-messages" id="chat-messages">
|
||||
<div class="message bot">
|
||||
Hello! I'm your assistant. How can I help you today?
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-input-area">
|
||||
<form id="chat-form">
|
||||
<input type="text" id="chat-input" placeholder="Type your message..." autocomplete="off">
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
|
||||
<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="#how-it-works">How it works</a>
|
||||
<a href="#features">Features</a>
|
||||
<a href="login.php">Log In</a>
|
||||
</nav>
|
||||
<div>
|
||||
<a href="register.php" class="btn btn-primary">Get Started</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="hero">
|
||||
<div class="hero-bg">
|
||||
<div class="hero-blob" style="top: 10%; left: 20%;"></div>
|
||||
<div class="hero-blob" style="bottom: 10%; right: 20%; background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, rgba(0, 242, 255, 0.1) 100%);"></div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h1>Build the future, <br>funded by each other.</h1>
|
||||
<p>The exclusive platform for university students and graduates to connect as co-founders, share ideas, and micro-invest in the next big thing.</p>
|
||||
<div style="display: flex; gap: 20px; justify-content: center;">
|
||||
<a href="register.php" class="btn btn-primary">Join the Community</a>
|
||||
<a href="#how-it-works" class="btn btn-secondary">Learn More</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="features" class="container">
|
||||
<div class="features">
|
||||
<div class="card">
|
||||
<div class="card-icon"><i class="fas fa-user-shield"></i></div>
|
||||
<h3>Verify</h3>
|
||||
<p>Exclusive access for verified university students and recent graduates (up to 5 years). Safe, trusted, and high-quality network.</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon"><i class="fas fa-people-arrows"></i></div>
|
||||
<h3>Connect</h3>
|
||||
<p>Find your ideal co-founder or early team members using our intelligent matching questionnaire based on skills and vision.</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon"><i class="fas fa-chart-line"></i></div>
|
||||
<h3>Fund</h3>
|
||||
<p>Launch your startup to raise micro-investments starting from £50, or build your own portfolio by backing your peers.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="how-it-works" class="how-it-works container">
|
||||
<h2>How it works</h2>
|
||||
<div class="steps">
|
||||
<div class="step">
|
||||
<span class="step-number">01</span>
|
||||
<h4>Join & Verify</h4>
|
||||
<p>Sign up with your university email. We verify your status to keep the community exclusive.</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<span class="step-number">02</span>
|
||||
<h4>Choose Your Path</h4>
|
||||
<p>Identify as a Founder to build or an Investor to back. Tailor your profile to your goals.</p>
|
||||
</div>
|
||||
<div class="step">
|
||||
<span class="step-number">03</span>
|
||||
<h4>Launch & Scale</h4>
|
||||
<p>List your startup, find co-founders, or start investing in the most ambitious student projects.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="logo" style="margin-bottom: 30px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
<div class="footer-links">
|
||||
<a href="#">About Us</a>
|
||||
<a href="#">Terms of Service</a>
|
||||
<a href="#">Privacy Policy</a>
|
||||
<a href="#">Contact Support</a>
|
||||
</div>
|
||||
<p>© <?= date('Y') ?> <?= htmlspecialchars($platformName) ?>. All rights reserved.</p>
|
||||
<p style="font-size: 12px; margin-top: 10px; opacity: 0.5;">Powered by AppWizzy</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
94
investor_onboarding.php
Normal file
94
investor_onboarding.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'investor') {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$bio = trim($_POST['bio'] ?? '');
|
||||
$interests = isset($_POST['interests']) ? implode(',', $_POST['interests']) : '';
|
||||
$investment_appetite = trim($_POST['investment_appetite'] ?? '');
|
||||
|
||||
if (empty($bio) || empty($interests) || empty($investment_appetite)) {
|
||||
$error = "Please fill in all required fields.";
|
||||
} else {
|
||||
$stmt = db()->prepare("UPDATE users SET bio = ?, interests = ?, investment_appetite = ? WHERE id = ?");
|
||||
try {
|
||||
$stmt->execute([$bio, $interests, $investment_appetite, $_SESSION['user_id']]);
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
} catch (PDOException $e) {
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
$interests_options = ['Tech', 'Sustainability', 'Healthcare', 'Fintech', 'Education', 'Consumer', 'Social Impact', 'AI', 'SaaS', 'E-commerce'];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Investor Onboarding — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 600px;">
|
||||
<h2 style="margin-bottom: 10px;">Create Your Investor Profile</h2>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px;">Tell us about your investment preferences.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Short Bio (Max 150 characters)</label>
|
||||
<textarea name="bio" required maxlength="150" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 100px; resize: none;"></textarea>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Areas of Interest</label>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||
<?php foreach ($interests_options as $option): ?>
|
||||
<label style="cursor: pointer;">
|
||||
<input type="checkbox" name="interests[]" value="<?= $option ?>" style="display: none;" class="interest-checkbox">
|
||||
<div class="interest-tag" style="padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 30px; font-size: 14px; transition: all 0.2s;">
|
||||
<?= $option ?>
|
||||
</div>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 30px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Investment Appetite (e.g., £50 - £1,000)</label>
|
||||
<input type="text" name="investment_appetite" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;" placeholder="£100 - £500 per startup">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Complete Profile</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.interest-checkbox:checked + .interest-tag {
|
||||
background: var(--gradient-primary);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
71
login.php
Normal file
71
login.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
session_start();
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$email = trim($_POST['email'] ?? '');
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
if (empty($email) || empty($password)) {
|
||||
$error = "Email and password are required.";
|
||||
} else {
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['role'] = $user['role'];
|
||||
$_SESSION['full_name'] = $user['full_name'];
|
||||
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
} else {
|
||||
$error = "Invalid email or password.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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>Log In — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 400px;">
|
||||
<div class="logo" style="text-align: center; margin-bottom: 30px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
<h2 style="margin-bottom: 10px; text-align: center;">Welcome Back</h2>
|
||||
<p style="text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 14px;">Log in to access your startup network.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Email Address</label>
|
||||
<input type="email" name="email" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Password</label>
|
||||
<input type="password" name="password" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Log In</button>
|
||||
<p style="text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 14px;">Don't have an account? <a href="register.php" style="color: var(--accent-blue);">Sign Up</a></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
5
logout.php
Normal file
5
logout.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
session_destroy();
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
89
messages.php
Normal file
89
messages.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
$stmt = db()->prepare("SELECT m.*, u.full_name as other_user_name FROM messages m JOIN users u ON (m.sender_id = u.id OR m.receiver_id = u.id) WHERE (m.sender_id = ? OR m.receiver_id = ?) AND u.id != ? ORDER BY m.created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id'], $_SESSION['user_id'], $_SESSION['user_id']]);
|
||||
$messages = $stmt->fetchAll();
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Messages — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="messages.php" class="active">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>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<h1>Messages</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Communicate with founders and investors in the network.</p>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 350px 1fr; gap: 30px; height: 600px;">
|
||||
<div class="card" style="padding: 0; display: flex; flex-direction: column;">
|
||||
<div style="padding: 20px; border-bottom: 1px solid var(--border-color);">
|
||||
<input type="text" placeholder="Search conversations..." style="width: 100%; padding: 10px; border-radius: 8px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="flex: 1; overflow-y: auto;">
|
||||
<?php if (empty($messages)): ?>
|
||||
<div style="text-align: center; padding: 40px 20px; color: var(--text-secondary);">
|
||||
<p>No conversations yet.</p>
|
||||
<a href="discover.php" class="btn btn-secondary" style="margin-top: 20px;">Find people</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($messages as $msg): ?>
|
||||
<div style="padding: 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.2s;" onmouseover="this.style.background='var(--surface-color)'" onmouseout="this.style.background='transparent'">
|
||||
<div style="font-weight: 600; margin-bottom: 5px;"><?= htmlspecialchars($msg['other_user_name']) ?></div>
|
||||
<div style="font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
<?= htmlspecialchars($msg['content']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card" style="display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px;">
|
||||
<i class="fas fa-comments" style="font-size: 80px; color: var(--accent-blue); opacity: 0.1; margin-bottom: 40px;"></i>
|
||||
<h3>Select a conversation</h3>
|
||||
<p style="color: var(--text-secondary); max-width: 300px;">Choose a contact on the left to start messaging. Reach out to students, co-founders, or investors.</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
82
notifications.php
Normal file
82
notifications.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$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']]);
|
||||
$notifications = $stmt->fetchAll();
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Notifications — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="messages.php">Messages</a>
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<div style="max-width: 800px; margin: 0 auto;">
|
||||
<?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>
|
||||
<?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>
|
||||
<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 endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
105
partners.php
Normal file
105
partners.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
// Fetch other users with role 'founder' (potential partners)
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE role = 'founder' AND id != ? ORDER BY created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$partners = $stmt->fetchAll();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Find Partners — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<a href="dashboard.php">Dashboard</a>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="startups.php">My Startups</a>
|
||||
<a href="partners.php" class="active">Find Partners</a>
|
||||
<?php else: ?>
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<a href="messages.php">Messages</a>
|
||||
</nav>
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
<span><?= htmlspecialchars($user['full_name']) ?></span>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<h1>Find Co-Founders</h1>
|
||||
<p style="color: var(--text-secondary);">Connect with ambitious students building the future.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (empty($partners)): ?>
|
||||
<div class="card" style="text-align: center; padding: 60px 0;">
|
||||
<i class="fas fa-users-slash" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 20px;"></i>
|
||||
<h3>No potential partners found</h3>
|
||||
<p style="color: var(--text-secondary);">Be the first to list your profile or check back later.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;">
|
||||
<?php foreach ($partners as $partner): ?>
|
||||
<div class="card">
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 20px;">
|
||||
<div style="width: 50px; height: 50px; background: var(--surface-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 1px solid var(--border-color);">
|
||||
<?= substr($partner['full_name'], 0, 1) ?>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-weight: 600;"><?= htmlspecialchars($partner['full_name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);"><?= htmlspecialchars($partner['university']) ?> '<?= substr($partner['graduation_year'], -2) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<p style="color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; height: 60px; overflow: hidden;"><?= htmlspecialchars($partner['bio']) ?></p>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;">
|
||||
<?php if ($partner['interests']): ?>
|
||||
<?php foreach (explode(',', $partner['interests']) as $tag): ?>
|
||||
<span style="background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); padding: 2px 8px; border-radius: 4px; font-size: 10px;"><?= htmlspecialchars(trim($tag)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<a href="messages.php?to=<?= $partner['id'] ?>" class="btn btn-secondary" style="width: 100%; text-align: center;">Send Message</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.active {
|
||||
color: var(--text-primary) !important;
|
||||
border-bottom: 2px solid var(--accent-blue);
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
110
portfolio.php
Normal file
110
portfolio.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
$myInvestments = [];
|
||||
$stmt = db()->prepare("SELECT i.*, s.name as startup_name, s.description as startup_desc FROM investments i JOIN startups s ON i.startup_id = s.id WHERE i.investor_id = ? ORDER BY i.created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$myInvestments = $stmt->fetchAll();
|
||||
|
||||
$totalInvested = 0;
|
||||
foreach ($myInvestments as $inv) {
|
||||
if ($inv['status'] === 'approved') {
|
||||
$totalInvested += $inv['amount'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>My Portfolio — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<a href="discover.php">Discover</a>
|
||||
<a href="portfolio.php" class="active">Portfolio</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>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<h1>Investment Portfolio</h1>
|
||||
<p style="color: var(--text-secondary);">Manage your stakes in student-led startups.</p>
|
||||
</div>
|
||||
<div class="card" style="padding: 15px 30px; display: flex; align-items: center; gap: 20px;">
|
||||
<div>
|
||||
<div style="font-size: 10px; text-transform: uppercase; color: var(--text-secondary);">Total Invested</div>
|
||||
<div style="font-size: 24px; font-weight: 700; color: var(--accent-blue);">£<?= number_format($totalInvested, 0) ?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size: 10px; text-transform: uppercase; color: var(--text-secondary);">Startups</div>
|
||||
<div style="font-size: 24px; font-weight: 700; color: #fff;"><?= count($myInvestments) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: 1fr; gap: 20px;">
|
||||
<?php if (empty($myInvestments)): ?>
|
||||
<div class="card" style="text-align: center; padding: 60px 20px;">
|
||||
<i class="fas fa-chart-line" style="font-size: 64px; color: var(--accent-blue); opacity: 0.2; margin-bottom: 30px;"></i>
|
||||
<h3>No investments yet</h3>
|
||||
<p style="color: var(--text-secondary);">Start building your portfolio by discovering startups.</p>
|
||||
<a href="discover.php" class="btn btn-primary" style="margin-top: 25px;">Discover Startups</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($myInvestments as $inv): ?>
|
||||
<div class="card" style="display: flex; justify-content: space-between; align-items: center; padding: 25px;">
|
||||
<div>
|
||||
<div style="font-size: 10px; text-transform: uppercase; color: var(--accent-blue); margin-bottom: 5px;">Invested on <?= date('M d, Y', strtotime($inv['created_at'])) ?></div>
|
||||
<h3 style="margin-bottom: 5px;"><?= htmlspecialchars($inv['startup_name']) ?></h3>
|
||||
<p style="font-size: 14px; color: var(--text-secondary);"><?= htmlspecialchars(substr($inv['startup_desc'], 0, 80)) ?>...</p>
|
||||
</div>
|
||||
<div style="text-align: right; display: flex; align-items: center; gap: 40px;">
|
||||
<div>
|
||||
<div style="font-size: 10px; text-transform: uppercase; color: var(--text-secondary);">Amount</div>
|
||||
<div style="font-size: 20px; font-weight: 700; color: #fff;">£<?= number_format($inv['amount'], 0) ?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size: 10px; text-transform: uppercase; color: var(--text-secondary);">Status</div>
|
||||
<div style="font-weight: 600; color: <?= $inv['status'] === 'approved' ? '#55ff55' : ($inv['status'] === 'pending' ? '#ffaa00' : '#ff5555') ?>;">
|
||||
<?= ucfirst($inv['status']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<a href="startup_details.php?id=<?= $inv['startup_id'] ?>" class="btn btn-secondary" style="padding: 10px 20px;">View Startup</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
137
register.php
Normal file
137
register.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
require_once __DIR__ . '/mail/MailService.php';
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$full_name = trim($_POST['full_name'] ?? '');
|
||||
$email = trim($_POST['email'] ?? '');
|
||||
$password = $_POST['password'] ?? '';
|
||||
$role = $_POST['role'] ?? '';
|
||||
$university = trim($_POST['university'] ?? '');
|
||||
$graduation_year = (int)($_POST['graduation_year'] ?? 0);
|
||||
|
||||
// Simple validation
|
||||
if (empty($full_name) || empty($email) || empty($password) || empty($role) || empty($university) || empty($graduation_year)) {
|
||||
$error = "All fields are required.";
|
||||
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$error = "Invalid email format.";
|
||||
} elseif ($graduation_year < 1900 || $graduation_year > 2100) {
|
||||
$error = "Invalid graduation year.";
|
||||
} else {
|
||||
// Check if email already exists
|
||||
$stmt = db()->prepare("SELECT id FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
$error = "Email already registered.";
|
||||
} else {
|
||||
// Generate verification code
|
||||
$verification_code = bin2hex(random_bytes(16));
|
||||
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
|
||||
|
||||
// Insert user
|
||||
$stmt = db()->prepare("INSERT INTO users (full_name, email, password, role, university, graduation_year, verification_code) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||
try {
|
||||
$stmt->execute([$full_name, $email, $hashed_password, $role, $university, $graduation_year, $verification_code]);
|
||||
$success = "Registration successful! Please check your email to verify your account.";
|
||||
|
||||
// Send verification email
|
||||
// MailService::sendMail($email, "Verify your account", "Your verification code is: $verification_code", "Your verification code is: $verification_code");
|
||||
// For now, we'll just show the success message.
|
||||
} catch (PDOException $e) {
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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>Sign Up — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 500px;">
|
||||
<div class="logo" style="text-align: center; margin-bottom: 30px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
<h2 style="margin-bottom: 10px; text-align: center;">Join the Exclusive Network</h2>
|
||||
<p style="text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 14px;">Verify your student or graduate status to get started.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($success): ?>
|
||||
<div style="background: rgba(0, 255, 0, 0.1); border: 1px solid rgba(0, 255, 0, 0.3); color: #55ff55; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($success) ?>
|
||||
</div>
|
||||
<p style="text-align: center;"><a href="login.php" class="btn btn-primary" style="width: 100%;">Go to Log In</a></p>
|
||||
<?php else: ?>
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Full Name</label>
|
||||
<input type="text" name="full_name" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">University Email</label>
|
||||
<input type="email" name="email" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;" placeholder="you@university.ac.uk">
|
||||
<span style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">Only university/graduate emails accepted.</span>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">University</label>
|
||||
<input type="text" name="university" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Grad Year</label>
|
||||
<input type="number" name="graduation_year" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;" placeholder="2026">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Password</label>
|
||||
<input type="password" name="password" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">I want to be a:</label>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
|
||||
<label style="display: block; cursor: pointer;">
|
||||
<input type="radio" name="role" value="founder" required style="display: none;" class="role-radio">
|
||||
<div class="role-box" style="padding: 15px; border: 1px solid var(--border-color); border-radius: 12px; text-align: center; transition: all 0.2s;">
|
||||
Founder
|
||||
</div>
|
||||
</label>
|
||||
<label style="display: block; cursor: pointer;">
|
||||
<input type="radio" name="role" value="investor" required style="display: none;" class="role-radio">
|
||||
<div class="role-box" style="padding: 15px; border: 1px solid var(--border-color); border-radius: 12px; text-align: center; transition: all 0.2s;">
|
||||
Investor
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Create Account</button>
|
||||
<p style="text-align: center; margin-top: 20px; color: var(--text-secondary); font-size: 14px;">Already have an account? <a href="login.php" style="color: var(--accent-blue);">Log In</a></p>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.role-radio:checked + .role-box {
|
||||
background: var(--gradient-primary);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
89
start_funding.php
Normal file
89
start_funding.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$error = '';
|
||||
$success = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
$description = trim($_POST['description'] ?? '');
|
||||
$target = (float)($_POST['funding_target'] ?? 0);
|
||||
$status = $_POST['status'] ?? 'public';
|
||||
|
||||
if (empty($name) || empty($description) || $target < 50) {
|
||||
$error = "Please fill in all required fields. Minimum target is £50.";
|
||||
} else {
|
||||
$stmt = db()->prepare("INSERT INTO startups (name, description, founder_id, funding_target, status) VALUES (?, ?, ?, ?, ?)");
|
||||
try {
|
||||
$stmt->execute([$name, $description, $_SESSION['user_id'], $target, $status]);
|
||||
$success = "Startup listed successfully! Your funding round is now active.";
|
||||
header("refresh:2;url=dashboard.php");
|
||||
} catch (PDOException $e) {
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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>Start Funding Round — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body style="display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 20px;">
|
||||
|
||||
<div class="card" style="width: 100%; max-width: 600px;">
|
||||
<h2 style="margin-bottom: 10px;">List Your Startup</h2>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px;">Kickstart your project with micro-investments from peers.</p>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div style="background: rgba(255, 0, 0, 0.1); border: 1px solid rgba(255, 0, 0, 0.3); color: #ff5555; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($success): ?>
|
||||
<div style="background: rgba(0, 255, 0, 0.1); border: 1px solid rgba(0, 255, 0, 0.3); color: #55ff55; padding: 12px; border-radius: 8px; margin-bottom: 20px;">
|
||||
<?= htmlspecialchars($success) ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<form method="POST">
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Startup Name</label>
|
||||
<input type="text" name="name" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Description</label>
|
||||
<textarea name="description" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 120px; resize: none;"></textarea>
|
||||
</div>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Funding Target (£)</label>
|
||||
<input type="number" name="funding_target" min="50" step="50" required style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<span style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">Min investment per user will be £50.</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Listing Type</label>
|
||||
<select name="status" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;">
|
||||
<option value="public">Public (Visible to all investors)</option>
|
||||
<option value="private">Private (Invite-only)</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Launch Funding Round</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
121
startups.php
Normal file
121
startups.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$stmt = db()->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
|
||||
$myStartups = [];
|
||||
if ($user['role'] === 'founder') {
|
||||
$stmt = db()->prepare("SELECT * FROM startups WHERE founder_id = ? ORDER BY created_at DESC");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$myStartups = $stmt->fetchAll();
|
||||
} else {
|
||||
// Investors see all public startups
|
||||
$stmt = db()->prepare("SELECT * FROM startups WHERE status = 'public' ORDER BY created_at DESC");
|
||||
$stmt->execute();
|
||||
$myStartups = $stmt->fetchAll();
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>My Startups — <?= htmlspecialchars($platformName) ?></title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="container" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
|
||||
<div class="logo"><?= htmlspecialchars($platformName) ?></div>
|
||||
<nav class="nav-links">
|
||||
<?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="discover.php">Discover</a>
|
||||
<a href="portfolio.php">Portfolio</a>
|
||||
<?php endif; ?>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px;">
|
||||
<div>
|
||||
<h1><?= $user['role'] === 'founder' ? 'My Startups' : 'Student Startups' ?></h1>
|
||||
<p style="color: var(--text-secondary);">Manage and track your ventures.</p>
|
||||
</div>
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<a href="start_funding.php" class="btn btn-primary">List New Startup</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px;">
|
||||
<?php if (empty($myStartups)): ?>
|
||||
<div class="card" style="grid-column: 1 / -1; text-align: center; padding: 60px 20px;">
|
||||
<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="start_funding.php" class="btn btn-primary" style="margin-top: 25px;">Start Funding Round</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($myStartups as $startup): ?>
|
||||
<div class="card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px;">
|
||||
<h3 style="margin: 0;"><?= htmlspecialchars($startup['name']) ?></h3>
|
||||
<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);">
|
||||
<?= htmlspecialchars($startup['status']) ?>
|
||||
</span>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--text-secondary); margin-bottom: 25px; line-height: 1.6;">
|
||||
<?= htmlspecialchars(substr($startup['description'], 0, 120)) ?>...
|
||||
</p>
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div style="display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px;">
|
||||
<span>Progress</span>
|
||||
<span><?= round(($startup['funding_raised'] / $startup['funding_target']) * 100) ?>%</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden;">
|
||||
<div style="width: <?= min(100, ($startup['funding_raised'] / $startup['funding_target']) * 100) ?>%; height: 100%; background: var(--gradient-primary);"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 20px;">
|
||||
<div>
|
||||
<div style="font-size: 10px; color: var(--text-secondary); text-transform: uppercase;">Raised</div>
|
||||
<div style="font-weight: 700; color: #fff;">£<?= number_format($startup['funding_raised'], 0) ?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="font-size: 10px; color: var(--text-secondary); text-transform: uppercase;">Target</div>
|
||||
<div style="font-weight: 700; color: #fff;">£<?= number_format($startup['funding_target'], 0) ?></div>
|
||||
</div>
|
||||
<a href="startup_details.php?id=<?= $startup['id'] ?>" class="btn btn-secondary" style="padding: 8px 16px; font-size: 12px;">Manage</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user