38873-vm/founder_onboarding.php
Flatlogic Bot 21f3fc7eab v2
2026-02-28 15:08:46 +00:00

89 lines
3.8 KiB
PHP

<?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>