v3
This commit is contained in:
parent
21f3fc7eab
commit
392dc73382
163
dashboard.php
163
dashboard.php
@ -11,13 +11,22 @@ $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");
|
||||
}
|
||||
if (!$user) {
|
||||
session_destroy();
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Security: Check if verified
|
||||
if ($user['verified'] == 0) {
|
||||
session_destroy();
|
||||
header("Location: login.php?error=not_verified");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Check if onboarding is complete
|
||||
if ($user['role'] === 'founder' && $user['onboarding_completed'] == 0) {
|
||||
header("Location: founder_onboarding.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -36,6 +45,10 @@ if ($user['role'] === 'founder') {
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$myInvestments = $stmt->fetchAll();
|
||||
}
|
||||
|
||||
function number_get_formatted($num) {
|
||||
return number_format((float)$num, 0, '.', ',');
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
@ -64,42 +77,45 @@ if ($user['role'] === 'founder') {
|
||||
<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>
|
||||
<span style="font-size: 14px; font-weight: 500;"><?= htmlspecialchars($user['full_name']) ?> <span style="opacity: 0.6; font-weight: 400;">(<?= ucfirst($user['role']) ?>)</span></span>
|
||||
<a href="logout.php" class="btn btn-secondary" style="padding: 8px 16px; font-size: 13px;">Log Out</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container" style="padding-top: 50px;">
|
||||
<h1>Welcome, <?= htmlspecialchars($user['full_name']) ?>!</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Here is your startup ecosystem overview.</p>
|
||||
<main class="container" style="padding-top: 50px; padding-bottom: 50px;">
|
||||
<h1>Welcome, <?= htmlspecialchars(explode(' ', $user['full_name'])[0]) ?>!</h1>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 40px;">Manage your projects and network from one place.</p>
|
||||
|
||||
<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 style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px;">
|
||||
<h3 style="margin: 0;">My Ventures</h3>
|
||||
<a href="start_funding.php" class="btn btn-primary" style="padding: 10px 20px; font-size: 14px;">+ Launch Round</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 style="text-align: center; padding: 50px 0; background: rgba(255,255,255,0.02); border-radius: 16px; border: 1px dashed var(--border-color);">
|
||||
<i class="fas fa-rocket" style="font-size: 40px; color: var(--accent-blue); opacity: 0.5; margin-bottom: 15px;"></i>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 20px;">Ready to share your vision with the world?</p>
|
||||
<a href="start_funding.php" class="btn btn-primary">Start Your First 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 style="padding: 20px; background: var(--surface-color); border-radius: 16px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; cursor: pointer;" onclick="window.location.href='startup_details.php?id=<?= $startup['id'] ?>'">
|
||||
<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 style="font-weight: 600; font-size: 18px; margin-bottom: 4px;"><?= htmlspecialchars($startup['name']) ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 10px;">
|
||||
<span style="padding: 2px 8px; background: rgba(0, 122, 255, 0.1); color: var(--accent-blue); border-radius: 4px; font-weight: 600;"><?= strtoupper($startup['status']) ?></span>
|
||||
<span>Target: £<?= number_get_formatted($startup['funding_target']) ?></span>
|
||||
</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 style="font-size: 18px; font-weight: 700; color: #fff;">£<?= number_get_formatted($startup['funding_raised']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">Raised so far</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@ -108,28 +124,30 @@ if ($user['role'] === 'founder') {
|
||||
</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 style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px;">
|
||||
<h3 style="margin: 0;">Portfolio Overview</h3>
|
||||
<a href="discover.php" class="btn btn-primary" style="padding: 10px 20px; font-size: 14px;">Find New Deals</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 style="text-align: center; padding: 50px 0; background: rgba(255,255,255,0.02); border-radius: 16px; border: 1px dashed var(--border-color);">
|
||||
<i class="fas fa-chart-line" style="font-size: 40px; color: var(--accent-blue); opacity: 0.5; margin-bottom: 15px;"></i>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 20px;">Browse the next generation of student-led innovation.</p>
|
||||
<a href="discover.php" class="btn btn-primary">Start Investing</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 style="padding: 20px; background: var(--surface-color); border-radius: 16px; 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 style="font-weight: 600; font-size: 18px; margin-bottom: 4px;"><?= htmlspecialchars($inv['startup_name']) ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary);">Committed 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 style="font-size: 18px; font-weight: 700; color: var(--accent-blue);">£<?= number_get_formatted($inv['amount']) ?></div>
|
||||
<div style="font-size: 12px; font-weight: 600; color: <?= $inv['status'] === 'approved' ? '#4cd964' : ($inv['status'] === 'rejected' ? '#ff3b30' : '#ffcc00') ?>;">
|
||||
<?= strtoupper($inv['status']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@ -139,46 +157,75 @@ if ($user['role'] === 'founder') {
|
||||
<?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>
|
||||
<h3>Insights & Activity</h3>
|
||||
<div style="padding: 30px; text-align: center; color: var(--text-secondary);">
|
||||
<p>Coming soon: Real-time insights from your network and matching suggestions based on your profile.</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);">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h3 style="margin: 0;">My Profile</h3>
|
||||
<a href="edit_profile.php" style="color: var(--accent-blue); font-size: 14px; text-decoration: none;">Edit</a>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 15px; margin-bottom: 25px;">
|
||||
<div style="width: 64px; height: 64px; background: var(--gradient-primary); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; font-weight: 700; box-shadow: 0 10px 20px rgba(0, 122, 255, 0.2);">
|
||||
<?= 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 style="font-weight: 700; font-size: 18px;"><?= htmlspecialchars($user['full_name']) ?></div>
|
||||
<div style="font-size: 13px; color: var(--text-secondary);"><?= htmlspecialchars($user['university']) ?> '<?= substr($user['graduation_year'], -2) ?></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 style="margin-bottom: 25px; font-size: 14px; line-height: 1.6; color: var(--text-secondary);">
|
||||
<?= htmlspecialchars($user['bio'] ?: 'No bio provided yet.') ?>
|
||||
</div>
|
||||
<a href="edit_profile.php" class="btn btn-secondary" style="width: 100%; text-align: center;">Edit Profile</a>
|
||||
|
||||
<?php if ($user['role'] === 'founder'): ?>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
|
||||
<?php
|
||||
$skills = explode(',', $user['skills'] ?? '');
|
||||
foreach (array_slice($skills, 0, 3) as $skill): if(empty($skill)) continue; ?>
|
||||
<span style="font-size: 11px; padding: 4px 10px; background: rgba(255,255,255,0.05); border-radius: 20px; border: 1px solid var(--border-color);"><?= htmlspecialchars(trim($skill)) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</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 class="card" style="background: var(--gradient-primary); color: #fff; border: none;">
|
||||
<h3 style="color: #fff; margin-bottom: 10px;">Gatsby Pro</h3>
|
||||
<p style="font-size: 14px; opacity: 0.9; margin-bottom: 20px;">Get advanced analytics and direct intros to top-tier VC scouts.</p>
|
||||
<button class="btn" style="width: 100%; background: #fff; color: var(--accent-blue); font-weight: 700;">Learn More</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php
|
||||
function number_get_formatted($num) {
|
||||
return number_format((float)$num, 0, '.', ',');
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
header {
|
||||
background: rgba(10, 10, 10, 0.8);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 15px 0;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
.nav-links a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
margin: 0 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.nav-links a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
15
db/migrations/02_onboarding_fields.sql
Normal file
15
db/migrations/02_onboarding_fields.sql
Normal file
@ -0,0 +1,15 @@
|
||||
-- Add detailed founder onboarding fields to users table
|
||||
ALTER TABLE users
|
||||
ADD COLUMN degree_program VARCHAR(255) AFTER university,
|
||||
ADD COLUMN country VARCHAR(100) AFTER graduation_year,
|
||||
ADD COLUMN skills TEXT AFTER interests,
|
||||
ADD COLUMN years_experience INT DEFAULT 0,
|
||||
ADD COLUMN previous_startup_exp TINYINT(1) DEFAULT 0,
|
||||
ADD COLUMN previous_startup_desc TEXT,
|
||||
ADD COLUMN startup_industries TEXT,
|
||||
ADD COLUMN preferred_stage ENUM('Idea', 'MVP', 'Early traction', 'Scaling'),
|
||||
ADD COLUMN commitment_level ENUM('part-time', 'full-time'),
|
||||
ADD COLUMN risk_tolerance ENUM('low', 'medium', 'high'),
|
||||
ADD COLUMN equity_expectations TEXT,
|
||||
ADD COLUMN preferred_co_founder_skills TEXT,
|
||||
ADD COLUMN onboarding_completed TINYINT(1) DEFAULT 0;
|
||||
@ -7,18 +7,70 @@ if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
// Check if already completed
|
||||
$stmt = db()->prepare("SELECT onboarding_completed, full_name, university, graduation_year FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user['onboarding_completed']) {
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$degree_program = trim($_POST['degree_program'] ?? '');
|
||||
$country = trim($_POST['country'] ?? '');
|
||||
$skills = isset($_POST['skills']) ? implode(',', $_POST['skills']) : '';
|
||||
$years_experience = (int)($_POST['years_experience'] ?? 0);
|
||||
$previous_startup_exp = isset($_POST['previous_startup_exp']) ? 1 : 0;
|
||||
$previous_startup_desc = trim($_POST['previous_startup_desc'] ?? '');
|
||||
$startup_industries = isset($_POST['startup_industries']) ? implode(',', $_POST['startup_industries']) : '';
|
||||
$preferred_stage = $_POST['preferred_stage'] ?? 'Idea';
|
||||
$commitment_level = $_POST['commitment_level'] ?? 'part-time';
|
||||
$risk_tolerance = $_POST['risk_tolerance'] ?? 'medium';
|
||||
$equity_expectations = trim($_POST['equity_expectations'] ?? '');
|
||||
$preferred_co_founder_skills = isset($_POST['preferred_co_founder_skills']) ? implode(',', $_POST['preferred_co_founder_skills']) : '';
|
||||
$bio = trim($_POST['bio'] ?? '');
|
||||
$interests = isset($_POST['interests']) ? implode(',', $_POST['interests']) : '';
|
||||
|
||||
if (empty($bio) || empty($interests)) {
|
||||
$error = "Please fill in all required fields.";
|
||||
|
||||
if (empty($degree_program) || empty($country) || empty($skills) || empty($bio)) {
|
||||
$error = "Please fill in all mandatory fields.";
|
||||
} else {
|
||||
$stmt = db()->prepare("UPDATE users SET bio = ?, interests = ? WHERE id = ?");
|
||||
$stmt = db()->prepare("UPDATE users SET
|
||||
degree_program = ?,
|
||||
country = ?,
|
||||
skills = ?,
|
||||
years_experience = ?,
|
||||
previous_startup_exp = ?,
|
||||
previous_startup_desc = ?,
|
||||
startup_industries = ?,
|
||||
preferred_stage = ?,
|
||||
commitment_level = ?,
|
||||
risk_tolerance = ?,
|
||||
equity_expectations = ?,
|
||||
preferred_co_founder_skills = ?,
|
||||
bio = ?,
|
||||
onboarding_completed = 1
|
||||
WHERE id = ?");
|
||||
|
||||
try {
|
||||
$stmt->execute([$bio, $interests, $_SESSION['user_id']]);
|
||||
$stmt->execute([
|
||||
$degree_program,
|
||||
$country,
|
||||
$skills,
|
||||
$years_experience,
|
||||
$previous_startup_exp,
|
||||
$previous_startup_desc,
|
||||
$startup_industries,
|
||||
$preferred_stage,
|
||||
$commitment_level,
|
||||
$risk_tolerance,
|
||||
$equity_expectations,
|
||||
$preferred_co_founder_skills,
|
||||
$bio,
|
||||
$_SESSION['user_id']
|
||||
]);
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
} catch (PDOException $e) {
|
||||
@ -28,7 +80,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
|
||||
$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'];
|
||||
|
||||
$all_skills = ['Technical (Full-stack)', 'Technical (AI/ML)', 'Technical (Mobile)', 'Product Management', 'UI/UX Design', 'Marketing & Growth', 'Sales & Biz Dev', 'Finance', 'Operations', 'Legal'];
|
||||
$all_industries = ['AI & Machine Learning', 'Fintech', 'SaaS', 'Climate Tech', 'Health Tech', 'Marketplaces', 'E-commerce', 'EdTech', 'Web3 & Crypto', 'Hardware'];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
@ -39,12 +93,53 @@ $skills_options = ['Frontend Development', 'Backend Development', 'Mobile App De
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
.step { display: none; }
|
||||
.step.active { display: block; }
|
||||
.skill-checkbox, .industry-checkbox { display: none; }
|
||||
.tag-label {
|
||||
display: inline-block;
|
||||
padding: 8px 16px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 30px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.skill-checkbox:checked + .tag-label, .industry-checkbox:checked + .tag-label {
|
||||
background: var(--gradient-primary);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
.form-group { margin-bottom: 20px; }
|
||||
label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; }
|
||||
input[type="text"], input[type="number"], select, textarea {
|
||||
width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff;
|
||||
}
|
||||
.step-indicator {
|
||||
display: flex; justify-content: space-between; margin-bottom: 30px;
|
||||
}
|
||||
.step-dot {
|
||||
width: 10px; height: 10px; border-radius: 50%; background: var(--border-color);
|
||||
}
|
||||
.step-dot.active { background: var(--accent-blue); }
|
||||
</style>
|
||||
</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>
|
||||
<div class="card" style="width: 100%; max-width: 700px;">
|
||||
<div class="logo" style="text-align: center; margin-bottom: 20px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
<h2 style="margin-bottom: 10px; text-align: center;">Welcome, <?= htmlspecialchars($user['full_name']) ?></h2>
|
||||
<p style="text-align: center; color: var(--text-secondary); margin-bottom: 30px;">Tell us about your background and interests to help us find the best matches.</p>
|
||||
|
||||
<div class="step-indicator">
|
||||
<div class="step-dot active" id="dot-1"></div>
|
||||
<div class="step-dot" id="dot-2"></div>
|
||||
<div class="step-dot" id="dot-3"></div>
|
||||
<div class="step-dot" id="dot-4"></div>
|
||||
</div>
|
||||
|
||||
<?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;">
|
||||
@ -52,37 +147,146 @@ $skills_options = ['Frontend Development', 'Backend Development', 'Mobile App De
|
||||
</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; ?>
|
||||
<form method="POST" id="onboardingForm">
|
||||
<!-- Step 1: Basic Information -->
|
||||
<div class="step active" id="step-1">
|
||||
<h3 style="margin-bottom: 20px;">1. Basic Information</h3>
|
||||
<div class="form-group">
|
||||
<label>Degree Program</label>
|
||||
<input type="text" name="degree_program" placeholder="e.g. Computer Science, MBA" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Country of Residence</label>
|
||||
<input type="text" name="country" placeholder="e.g. United Kingdom" required>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: 30px;">
|
||||
<button type="button" class="btn btn-primary" onclick="nextStep(2)">Next: Professional Info</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Complete Profile</button>
|
||||
<!-- Step 2: Professional Information -->
|
||||
<div class="step" id="step-2">
|
||||
<h3 style="margin-bottom: 20px;">2. Professional Information</h3>
|
||||
<div class="form-group">
|
||||
<label>What are your core skills?</label>
|
||||
<div style="display: flex; flex-wrap: wrap;">
|
||||
<?php foreach ($all_skills as $skill): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="skills[]" value="<?= $skill ?>" class="skill-checkbox">
|
||||
<span class="tag-label"><?= $skill ?></span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Years of Professional Experience</label>
|
||||
<input type="number" name="years_experience" value="0" min="0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||
<input type="checkbox" name="previous_startup_exp" style="margin-right: 10px;" id="prevExp">
|
||||
Have you founded or worked in a startup before?
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group" id="descGroup" style="display: none;">
|
||||
<label>Briefly describe your previous experience</label>
|
||||
<textarea name="previous_startup_desc" placeholder="Role, company, outcome..."></textarea>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 30px;">
|
||||
<button type="button" class="btn" style="border: 1px solid var(--border-color);" onclick="nextStep(1)">Back</button>
|
||||
<button type="button" class="btn btn-primary" onclick="nextStep(3)">Next: Startup Interests</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 3: Startup Interests -->
|
||||
<div class="step" id="step-3">
|
||||
<h3 style="margin-bottom: 20px;">3. Startup Interests</h3>
|
||||
<div class="form-group">
|
||||
<label>Industries of interest</label>
|
||||
<div style="display: flex; flex-wrap: wrap;">
|
||||
<?php foreach ($all_industries as $industry): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="startup_industries[]" value="<?= $industry ?>" class="industry-checkbox">
|
||||
<span class="tag-label"><?= $industry ?></span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Preferred startup stage</label>
|
||||
<select name="preferred_stage">
|
||||
<option value="Idea">Idea</option>
|
||||
<option value="MVP">MVP</option>
|
||||
<option value="Early traction">Early traction</option>
|
||||
<option value="Scaling">Scaling</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 30px;">
|
||||
<button type="button" class="btn" style="border: 1px solid var(--border-color);" onclick="nextStep(2)">Back</button>
|
||||
<button type="button" class="btn btn-primary" onclick="nextStep(4)">Next: Founder Preferences</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 4: Founder Preferences -->
|
||||
<div class="step" id="step-4">
|
||||
<h3 style="margin-bottom: 20px;">4. Founder Preferences</h3>
|
||||
<div class="form-group">
|
||||
<label>Commitment level</label>
|
||||
<select name="commitment_level">
|
||||
<option value="part-time">Part-time</option>
|
||||
<option value="full-time">Full-time</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Risk tolerance</label>
|
||||
<select name="risk_tolerance">
|
||||
<option value="low">Low</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="high">High</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Equity expectations</label>
|
||||
<input type="text" name="equity_expectations" placeholder="e.g. 50/50, negotiable">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Preferred co-founder skills</label>
|
||||
<div style="display: flex; flex-wrap: wrap;">
|
||||
<?php foreach ($all_skills as $skill): ?>
|
||||
<label>
|
||||
<input type="checkbox" name="preferred_co_founder_skills[]" value="<?= $skill ?>" class="skill-checkbox">
|
||||
<span class="tag-label"><?= $skill ?></span>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Your Personal Bio / Mission</label>
|
||||
<textarea name="bio" required maxlength="500" placeholder="A short blurb about who you are and what drives you." style="height: 100px;"></textarea>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 30px;">
|
||||
<button type="button" class="btn" style="border: 1px solid var(--border-color);" onclick="nextStep(3)">Back</button>
|
||||
<button type="submit" class="btn btn-primary">Complete Onboarding</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.skill-checkbox:checked + .skill-tag {
|
||||
background: var(--gradient-primary);
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
<script>
|
||||
function nextStep(step) {
|
||||
document.querySelectorAll('.step').forEach(s => s.classList.remove('active'));
|
||||
document.getElementById('step-' + step).classList.add('active');
|
||||
|
||||
document.querySelectorAll('.step-dot').forEach(d => d.classList.remove('active'));
|
||||
for (let i = 1; i <= step; i++) {
|
||||
document.getElementById('dot-' + i).classList.add('active');
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
document.getElementById('prevExp').addEventListener('change', function() {
|
||||
document.getElementById('descGroup').style.display = this.checked ? 'block' : 'none';
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@ -7,6 +7,16 @@ if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'investor') {
|
||||
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
// Check if already completed
|
||||
$stmt = db()->prepare("SELECT onboarding_completed FROM users WHERE id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user['onboarding_completed']) {
|
||||
header("Location: dashboard.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
@ -17,7 +27,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
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 = ?");
|
||||
$stmt = db()->prepare("UPDATE users SET bio = ?, interests = ?, investment_appetite = ?, onboarding_completed = 1 WHERE id = ?");
|
||||
try {
|
||||
$stmt->execute([$bio, $interests, $investment_appetite, $_SESSION['user_id']]);
|
||||
header("Location: dashboard.php");
|
||||
@ -44,6 +54,7 @@ $interests_options = ['Tech', 'Sustainability', 'Healthcare', 'Fintech', 'Educat
|
||||
<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;">
|
||||
<div class="logo" style="text-align: center; margin-bottom: 20px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
<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>
|
||||
|
||||
@ -55,12 +66,12 @@ $interests_options = ['Tech', 'Sustainability', 'Healthcare', 'Fintech', 'Educat
|
||||
|
||||
<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>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Investment Bio (Max 250 characters)</label>
|
||||
<textarea name="bio" required maxlength="250" style="width: 100%; padding: 12px; border-radius: 12px; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; height: 120px; resize: none;" placeholder="E.g. Angel investor focused on climate tech and early-stage SaaS..."></textarea>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px;">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Areas of Interest</label>
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Industries of Interest</label>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 10px;">
|
||||
<?php foreach ($interests_options as $option): ?>
|
||||
<label style="cursor: pointer;">
|
||||
@ -74,11 +85,11 @@ $interests_options = ['Tech', 'Sustainability', 'Healthcare', 'Fintech', 'Educat
|
||||
</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">
|
||||
<label style="display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500;">Investment Appetite (Avg. check size)</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="e.g. £500 - £5,000 per startup">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Complete Profile</button>
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 15px;">Complete Investor Profile</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -91,4 +102,4 @@ $interests_options = ['Tech', 'Sustainability', 'Healthcare', 'Fintech', 'Educat
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
23
login.php
23
login.php
@ -16,12 +16,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$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;
|
||||
if ($user['verified'] == 0) {
|
||||
$error = "Your account is not verified. Please check your email for the verification link.";
|
||||
} else {
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['role'] = $user['role'];
|
||||
$_SESSION['full_name'] = $user['full_name'];
|
||||
|
||||
// Check if onboarding is completed
|
||||
if ($user['role'] === 'founder' && $user['onboarding_completed'] == 0) {
|
||||
header("Location: founder_onboarding.php");
|
||||
} else {
|
||||
header("Location: dashboard.php");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error = "Invalid email or password.";
|
||||
}
|
||||
@ -68,4 +77,4 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
58
register.php
58
register.php
@ -5,6 +5,23 @@ require_once __DIR__ . '/mail/MailService.php';
|
||||
$error = '';
|
||||
$success = '';
|
||||
|
||||
function isUniversityEmail($email) {
|
||||
$parts = explode('@', $email);
|
||||
if (count($parts) !== 2) return false;
|
||||
$domain = strtolower($parts[1]);
|
||||
|
||||
// Whitelist for university domains
|
||||
$university_suffixes = ['.edu', '.ac.uk', '.edu.cn', '.edu.au', '.edu.in', '.edu.pk', '.edu.br', '.ac.jp', '.ac.kr', '.edu.za', '.ac.il', '.edu.mx', '.edu.ar', '.edu.co', '.edu.ph', '.edu.my', '.edu.sg'];
|
||||
|
||||
foreach ($university_suffixes as $suffix) {
|
||||
if (str_ends_with($domain, $suffix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$full_name = trim($_POST['full_name'] ?? '');
|
||||
$email = trim($_POST['email'] ?? '');
|
||||
@ -18,6 +35,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$error = "All fields are required.";
|
||||
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$error = "Invalid email format.";
|
||||
} elseif ($role === 'founder' && !isUniversityEmail($email)) {
|
||||
$error = "Founders must use a valid university email address (e.g. .edu, .ac.uk).";
|
||||
} elseif ($graduation_year < 1900 || $graduation_year > 2100) {
|
||||
$error = "Invalid graduation year.";
|
||||
} else {
|
||||
@ -32,14 +51,26 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$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 (?, ?, ?, ?, ?, ?, ?)");
|
||||
$stmt = db()->prepare("INSERT INTO users (full_name, email, password, role, university, graduation_year, verification_code, verified) 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.";
|
||||
// Investors are verified by default as they don't need student verification
|
||||
$is_verified = ($role === 'investor') ? 1 : 0;
|
||||
$stmt->execute([$full_name, $email, $hashed_password, $role, $university, $graduation_year, $verification_code, $is_verified]);
|
||||
|
||||
// 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.
|
||||
if ($role === 'founder') {
|
||||
$success = "Registration successful! A verification link has been sent to $email. Please verify your account before logging in.";
|
||||
|
||||
// Send verification email
|
||||
$baseUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'];
|
||||
$verifyUrl = "$baseUrl/verify.php?code=$verification_code";
|
||||
$subject = "Verify your " . PLATFORM_NAME . " account";
|
||||
$html = "<h1>Welcome to " . PLATFORM_NAME . "!</h1><p>Please click the link below to verify your student status:</p><p><a href='$verifyUrl'>$verifyUrl</a></p>";
|
||||
$text = "Welcome to " . PLATFORM_NAME . "!\n\nPlease visit the following URL to verify your account:\n$verifyUrl";
|
||||
|
||||
MailService::sendMail($email, $subject, $html, $text);
|
||||
} else {
|
||||
$success = "Registration successful! You can now log in to your investor account.";
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
$error = "Database error: " . $e->getMessage();
|
||||
}
|
||||
@ -86,7 +117,7 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<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>
|
||||
<span id="founder-hint" style="font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: block;">Only university/graduate emails (.edu, etc.) accepted for founders.</span>
|
||||
</div>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;">
|
||||
<div>
|
||||
@ -106,13 +137,13 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<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">
|
||||
<input type="radio" name="role" value="founder" required style="display: none;" class="role-radio" onchange="toggleHint()">
|
||||
<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">
|
||||
<input type="radio" name="role" value="investor" required style="display: none;" class="role-radio" onchange="toggleHint()">
|
||||
<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>
|
||||
@ -125,6 +156,13 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleHint() {
|
||||
const isFounder = document.querySelector('input[name="role"]:checked').value === 'founder';
|
||||
document.getElementById('founder-hint').style.display = isFounder ? 'block' : 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.role-radio:checked + .role-box {
|
||||
background: var(--gradient-primary);
|
||||
@ -134,4 +172,4 @@ $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
52
verify.php
Normal file
52
verify.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$message = '';
|
||||
$status = 'error';
|
||||
|
||||
if (isset($_GET['code'])) {
|
||||
$code = $_GET['code'];
|
||||
|
||||
$stmt = db()->prepare("SELECT id FROM users WHERE verification_code = ? AND verified = 0");
|
||||
$stmt->execute([$code]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user) {
|
||||
$update = db()->prepare("UPDATE users SET verified = 1, verification_code = NULL WHERE id = ?");
|
||||
if ($update->execute([$user['id']])) {
|
||||
$message = "Email verified successfully! You can now log in.";
|
||||
$status = 'success';
|
||||
} else {
|
||||
$message = "Something went wrong. Please try again later.";
|
||||
}
|
||||
} else {
|
||||
$message = "Invalid or expired verification link.";
|
||||
}
|
||||
} else {
|
||||
$message = "No verification code provided.";
|
||||
}
|
||||
|
||||
$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>Email Verification — <?= 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(); ?>">
|
||||
</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; text-align: center;">
|
||||
<div class="logo" style="margin-bottom: 30px;"><?= htmlspecialchars($platformName) ?></div>
|
||||
|
||||
<h2 style="margin-bottom: 20px;"><?= $status === 'success' ? 'Verification Successful' : 'Verification Failed' ?></h2>
|
||||
<p style="color: var(--text-secondary); margin-bottom: 30px;"><?= htmlspecialchars($message) ?></p>
|
||||
|
||||
<a href="login.php" class="btn btn-primary" style="width: 100%; padding: 15px;">Go to Log In</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user