prepare("SELECT * FROM startups WHERE id = ? AND founder_id = ?"); $stmt->execute([$startup_id, $_SESSION['user_id']]); $startup = $stmt->fetch(); if (!$startup) { header("Location: dashboard.php"); exit; } // Check for existing active round $stmt = db()->prepare("SELECT id FROM funding_rounds WHERE startup_id = ? AND status = 'Active'"); $stmt->execute([$startup_id]); if ($stmt->fetch()) { header("Location: startup_details.php?id=" . $startup_id); exit; } $error = ''; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $goal = (float)($_POST['funding_goal'] ?? 0); $founder_rate = isset($_POST['founder_return_rate']) && $_POST['founder_return_rate'] !== '' ? (float)$_POST['founder_return_rate'] : null; $status = $_POST['listing_status'] ?? 'public'; if ($goal < 100) { $error = "Minimum funding goal is £100."; } if (!$error) { db()->beginTransaction(); try { // Update startup with round-specific settings // We also update funding_target so that general views show the current target $stmt = db()->prepare("UPDATE startups SET status = ?, founder_return_rate = ?, funding_target = ? WHERE id = ?"); $stmt->execute([$status, $founder_rate, $goal, $startup_id]); // Create the round $stmt = db()->prepare("INSERT INTO funding_rounds (startup_id, funding_goal, status) VALUES (?, ?, 'Active')"); $stmt->execute([$startup_id, $goal]); db()->commit(); $success = "Funding round launched successfully!"; header("refresh:2;url=startup_details.php?id=" . $startup_id); } catch (Exception $e) { db()->rollBack(); $error = "Error: " . $e->getMessage(); } } } $platformName = defined('PLATFORM_NAME') ? PLATFORM_NAME : 'Gatsby'; ?> Launch Funding Round — <?= htmlspecialchars($platformName) ?>

Launch Funding Round

Set your investment targets and return rates for .

AI Recommended Return Rate
%
Based on your company profile and historical financials.
This is the annual return rate you propose to investors. It will be displayed alongside the platform recommendation.
Cancel