prepare("SELECT * FROM customers WHERE msp_id = ? ORDER BY name ASC"); $stmt->execute([$msp_id]); $customers = $stmt->fetchAll(); } catch (PDOException $e) { // Handle error } ?>
List of all customers and their current status.
| Customer Name | Status | Onboarding Progress | Actions | |
|---|---|---|---|---|
| No customers found. Add your first customer. | ||||
|
prepare("SELECT COUNT(*) as total, SUM(CASE WHEN is_completed = 1 THEN 1 ELSE 0 END) as completed FROM onboarding_tasks WHERE customer_id = ?");
$stmt->execute([$customer['id']]);
$row = $stmt->fetch();
if ($row && $row['total'] > 0) {
$progress = round(($row['completed'] / $row['total']) * 100);
}
} catch (PDOException $e) {}
?>
|
||||