From b56a9a8592236e2b2422745cc0dc0bcfbe22c28a Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 15 Feb 2026 15:58:51 +0000 Subject: [PATCH] Autosave: 20260215-155851 --- api/export_labour.php | 17 ++++++++++++++--- assets/css/custom.css | 1 + expenses.php | 2 +- labour.php | 2 +- reports.php | 3 ++- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/api/export_labour.php b/api/export_labour.php index d967697..299fdb0 100644 --- a/api/export_labour.php +++ b/api/export_labour.php @@ -4,24 +4,35 @@ require_once __DIR__ . '/../db/config.php'; $tenant_id = 1; -$filter_project = (int)($_GET['project_id'] ?? 0); +$filter_project = $_GET['project_id'] ?? null; +$filter_projects = $_GET['projects'] ?? []; // Array from reports.php $filter_employee = (int)($_GET['employee_id'] ?? 0); -$filter_type = (int)($_GET['labour_type_id'] ?? 0); +$filter_type = (int)($_GET['labour_type_id'] ?? ($_GET['activity_type_id'] ?? 0)); $filter_evidence = (int)($_GET['evidence_type_id'] ?? 0); $filter_start = $_GET['start_date'] ?? ''; $filter_end = $_GET['end_date'] ?? ''; +$filter_team = (int)($_GET['team_id'] ?? 0); $where = ["le.tenant_id = ?"]; $params = [$tenant_id]; if ($filter_project) { $where[] = "le.project_id = ?"; - $params[] = $filter_project; + $params[] = (int)$filter_project; +} +if (!empty($filter_projects)) { + $placeholders = implode(',', array_fill(0, count($filter_projects), '?')); + $where[] = "le.project_id IN ($placeholders)"; + foreach ($filter_projects as $pid) $params[] = (int)$pid; } if ($filter_employee) { $where[] = "le.employee_id = ?"; $params[] = $filter_employee; } +if ($filter_team) { + $where[] = "le.employee_id IN (SELECT employee_id FROM employee_teams WHERE team_id = ?)"; + $params[] = $filter_team; +} if ($filter_type) { $where[] = "le.labour_type_id = ?"; $params[] = $filter_type; diff --git a/assets/css/custom.css b/assets/css/custom.css index 88952e8..ad03751 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -61,6 +61,7 @@ body { .btn-primary { background-color: #3b82f6; border-color: #3b82f6; + color: #ffffff !important; font-weight: 500; } diff --git a/expenses.php b/expenses.php index f340f8d..8129c27 100644 --- a/expenses.php +++ b/expenses.php @@ -107,7 +107,7 @@ include __DIR__ . '/includes/header.php';

Expenses

- Export to Excel + Export to Excel
diff --git a/labour.php b/labour.php index ee314cc..e28bb17 100644 --- a/labour.php +++ b/labour.php @@ -178,7 +178,7 @@ include __DIR__ . '/includes/header.php';

Labour Tracking

- Export to Excel + Export to Excel
diff --git a/reports.php b/reports.php index eaecc88..a592d34 100644 --- a/reports.php +++ b/reports.php @@ -193,7 +193,8 @@ include __DIR__ . '/includes/header.php';
Detailed Labour Records