321 lines
15 KiB
PHP
321 lines
15 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'founder') {
|
|
header("Location: login.php");
|
|
exit;
|
|
}
|
|
|
|
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 = '';
|
|
$countries = require 'includes/countries.php';
|
|
|
|
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';
|
|
$preferred_working_style = $_POST['preferred_working_style'] ?? 'hybrid';
|
|
$availability = trim($_POST['availability'] ?? '');
|
|
$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'] ?? '');
|
|
|
|
if (empty($degree_program) || empty($country) || empty($skills) || empty($bio)) {
|
|
$error = "Please fill in all mandatory fields.";
|
|
} else {
|
|
$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 = ?,
|
|
preferred_working_style = ?,
|
|
availability = ?,
|
|
equity_expectations = ?,
|
|
preferred_co_founder_skills = ?,
|
|
bio = ?,
|
|
onboarding_completed = 1
|
|
WHERE id = ?");
|
|
|
|
try {
|
|
$stmt->execute([
|
|
$degree_program,
|
|
$country,
|
|
$skills,
|
|
$years_experience,
|
|
$previous_startup_exp,
|
|
$previous_startup_desc,
|
|
$startup_industries,
|
|
$preferred_stage,
|
|
$commitment_level,
|
|
$risk_tolerance,
|
|
$preferred_working_style,
|
|
$availability,
|
|
$equity_expectations,
|
|
$preferred_co_founder_skills,
|
|
$bio,
|
|
$_SESSION['user_id']
|
|
]);
|
|
header("Location: dashboard.php");
|
|
exit;
|
|
} catch (PDOException $e) {
|
|
$error = "Database error: " . $e->getMessage();
|
|
}
|
|
}
|
|
}
|
|
|
|
$platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby';
|
|
|
|
$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">
|
|
<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">
|
|
<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: 700px;">
|
|
<div class="logo" style="text-align: center; margin-bottom: 20px;"><?= htmlspecialchars($platformName) ?></div>
|
|
<h2 style="margin-bottom: 10px; text-align: center;">Partner Questionnaire</h2>
|
|
<p style="text-align: center; color: var(--text-secondary); margin-bottom: 30px;">Tell us about your background to help us find the best co-founder 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;">
|
|
<?= htmlspecialchars($error) ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<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>
|
|
<select name="country" required>
|
|
<option value="">Select a country...</option>
|
|
<?php foreach ($countries as $c): ?>
|
|
<option value="<?= htmlspecialchars($c) ?>"><?= htmlspecialchars($c) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</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>
|
|
|
|
<!-- 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 style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
|
<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>
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
|
<div class="form-group">
|
|
<label>Working Style</label>
|
|
<select name="preferred_working_style">
|
|
<option value="hybrid">Hybrid</option>
|
|
<option value="remote">Remote</option>
|
|
<option value="in-person">In-person</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Availability</label>
|
|
<input type="text" name="availability" placeholder="e.g. Weeknights & Weekends">
|
|
</div>
|
|
</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 Questionnaire</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<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');
|
|
}
|
|
window.scrollTo(0, 0);
|
|
}
|
|
|
|
document.getElementById('prevExp').addEventListener('change', function() {
|
|
document.getElementById('descGroup').style.display = this.checked ? 'block' : 'none';
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|