diff --git a/public/index.php b/public/index.php index 120a95f..dee38a2 100644 --- a/public/index.php +++ b/public/index.php @@ -192,7 +192,7 @@ if ($route === 'client_history') { $stmt = db()->prepare('SELECT h.id, j.client_id, j.reference_no, h.from_status, h.to_status, h.changed_at, u.name AS changed_by_name FROM jobcard_status_history h JOIN jobcards j ON j.id = h.jobcard_id LEFT JOIN users u ON u.id = h.changed_by WHERE j.client_id = :client ORDER BY h.changed_at ASC, h.id ASC'); $stmt->execute(['client' => $clientId]); $history = (new \App\Domain\Reporting\ClientHistoryReport($filters))->build($stmt->fetchAll(), 'client'); if (scalar_input($_GET['format'] ?? null) === 'print') { header('Content-Type: text/html; charset=UTF-8'); echo (new \PrintReportRenderer())->render('Client history', ['Reference', 'From', 'To', 'Changed'], array_map(static fn (array $row): array => [$row['reference_no'], $row['from_status'], $row['to_status'], $row['changed_at']], $history)); exit; } - render_header('Client history'); echo '
| Jobcard | From | To | Changed |
|---|---|---|---|
| ' . e($row['reference_no']) . ' | ' . e($row['from_status']) . ' | ' . e($row['to_status']) . ' | ' . e($row['changed_at']) . ' |
| Jobcard | From | To | Changed |
|---|---|---|---|
| ' . e($row['reference_no']) . ' | ' . e($row['from_status']) . ' | ' . e($row['to_status']) . ' | ' . e($row['changed_at']) . ' |
Internal hours summary by client.
Internal hours summary by client.
| Client | Jobcards | Hours |
|---|---|---|
| No report data available. | ||
| ' . e($row['client_name']) . ' | ' . (int)$row['jobcards'] . ' | ' . e(number_format((float)$row['hours'], 2)) . ' |