query("SELECT * FROM customers ORDER BY name ASC"); $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) {} ?> % | ||||