From b2b4ac2124680ae3ef00bac0b94d5f7729e714fc Mon Sep 17 00:00:00 2001 From: Bruno Eckhardt Date: Tue, 19 May 2026 15:13:53 +0200 Subject: [PATCH] new endpoint for workreports and moved reports to schoolreports --- .../api/v2/{reports.php => schoolReports.php} | 4 +-- WEBROOT/api/v2/workReports.php | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) rename WEBROOT/api/v2/{reports.php => schoolReports.php} (74%) create mode 100644 WEBROOT/api/v2/workReports.php diff --git a/WEBROOT/api/v2/reports.php b/WEBROOT/api/v2/schoolReports.php similarity index 74% rename from WEBROOT/api/v2/reports.php rename to WEBROOT/api/v2/schoolReports.php index 5b7403a..34530ce 100644 --- a/WEBROOT/api/v2/reports.php +++ b/WEBROOT/api/v2/schoolReports.php @@ -32,6 +32,6 @@ if ($api->urlAuth($_GET['token']) == true ) { } /** - * http://localhost:9000/api/v2/reports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3 - * http://localhost:9000/api/v2/reports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3&date=2025-09-09 + * http://localhost:9000/api/v2/schoolReports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3 + * http://localhost:9000/api/v2/schoolReports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3&date=2025-09-09 */ \ No newline at end of file diff --git a/WEBROOT/api/v2/workReports.php b/WEBROOT/api/v2/workReports.php new file mode 100644 index 0000000..8737443 --- /dev/null +++ b/WEBROOT/api/v2/workReports.php @@ -0,0 +1,36 @@ +urlAuth($_GET['token']) == true ) { + + if (isset($_GET['date'])) { + + $date = $_GET['date']; + + $data = DatabaseShow( + "Firmenberichte", + "DATUM, PROZESS_1, PROZESS_2, PROZESS_3, PROZESS_4, BEGINN, ENDE_PUBLIC", + "DATUM = ?", + $date + ); + } else { + $data = DatabaseShow( + "Firmenberichte", + "DATUM, PROZESS_1, PROZESS_2, PROZESS_3, PROZESS_4, BEGINN, ENDE_PUBLIC", + ); + } + echo $api->jsonSuccess($data); + $api->requestSave(); +} + +/** + * http://localhost:9000/api/v2/workReports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3 + * http://localhost:9000/api/v2/workReports.php?token=f3a50684d7f0cc2d9b21601798ea48242fab7481a0d0407a2b8683b0b74a79e3&date=2025-09-09 + */ \ No newline at end of file