prepare("SELECT c.*, m.name as msp_name FROM customers c JOIN msps m ON c.msp_id = m.id WHERE c.id = ?"); $stmt->execute([$customer_id]); $customer = $stmt->fetch(); if (!$customer || !$customer['template_id']) { die("No onboarding template assigned to this customer."); } // Fetch steps $stmt = db()->prepare("SELECT * FROM onboarding_template_steps WHERE template_id = ? ORDER BY order_index ASC"); $stmt->execute([$customer['template_id']]); $steps = $stmt->fetchAll(); if (empty($steps)) { die("This onboarding flow has no steps."); } $current_step = $steps[$step_index] ?? null; if (!$current_step) { $step_index = 0; $current_step = $steps[0]; } // Fetch fields for current step $stmt = db()->prepare("SELECT * FROM onboarding_template_fields WHERE step_id = ? ORDER BY order_index ASC"); $stmt->execute([$current_step['id']]); $fields = $stmt->fetchAll(); $is_last_step = ($step_index === count($steps) - 1); include 'header.php'; // We use the same header for simplicity, but we could make a "customer header" ?>
Welcome to

Customer Onboarding

$step): ?>

>
Please download and review this document.
Download
>
0): ?> Back