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 = ''; $countries = require 'includes/countries.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $bio = trim($_POST['bio'] ?? ''); $interests = isset($_POST['interests']) ? implode(',', $_POST['interests']) : ''; $investment_appetite = trim($_POST['investment_appetite'] ?? ''); $country = $_POST['country'] ?? ''; if (empty($bio) || empty($interests) || empty($investment_appetite) || empty($country)) { $error = "Please fill in all required fields."; } else { $stmt = db()->prepare("UPDATE users SET bio = ?, interests = ?, investment_appetite = ?, country = ?, onboarding_completed = 1 WHERE id = ?"); try { $stmt->execute([$bio, $interests, $investment_appetite, $country, $_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']; ?> Investor Onboarding — <?= htmlspecialchars($platformName) ?>

Create Your Investor Profile

Tell us about your investment preferences.