From 391aa91341ddf255cffbf317c47c463658cc5a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Tue, 2 Apr 2024 21:44:07 +0200 Subject: [PATCH] CIM37 - Country view --- api/v1/get/application.php | 10 + api/v1/post/equipments.php | 6 +- assets/functions.php | 50 +++ assets/leaflet.js | 6 + dashboard.php | 42 +++ equipment.php | 31 +- settings.php | 7 + style/leaflet.css | 640 +++++++++++++++++++++++++++++++++++++ 8 files changed, 786 insertions(+), 6 deletions(-) create mode 100644 assets/leaflet.js create mode 100644 style/leaflet.css diff --git a/api/v1/get/application.php b/api/v1/get/application.php index 38a7e9b..6d108c5 100644 --- a/api/v1/get/application.php +++ b/api/v1/get/application.php @@ -140,6 +140,12 @@ switch ($action) { break; + case 'geolocation': + + $sql = 'SELECT e.* FROM equipment e '.$whereclause.''; + + break; + default: # code... break; @@ -188,6 +194,10 @@ switch ($action) { case 'warrantyforecast': $messages = $stmt->fetchAll(PDO::FETCH_ASSOC); break; + + case 'geolocation': + $messages = $stmt->fetchAll(PDO::FETCH_ASSOC); + break; } diff --git a/api/v1/post/equipments.php b/api/v1/post/equipments.php index 5346c1c..85e1411 100644 --- a/api/v1/post/equipments.php +++ b/api/v1/post/equipments.php @@ -138,19 +138,19 @@ $accounthierarchy = json_encode($account, JSON_UNESCAPED_UNICODE); if ($command == 'update'){ //RESET WARRANTY AND SERVICE DATES WHEN STATUS IS CHANGED TO SEND(3) - if ($post_content['status'] == 3 && $equipment_data['status'] != 3) + if (isset($post_content['status']) && $post_content['status'] == 3 && $equipment_data['status'] != 3) { $post_content['service_date'] = $date; $post_content['warranty_date'] = $date; } //UPDATE CHANGELOG BASED ON STATUS CHANGE - if ($post_content['status'] != $equipment_data['status']) + if (isset($post_content['status']) && $post_content['status'] != $equipment_data['status']) { changelog($dbname,'equipment',$equipment_data['rowID'],'status',$post_content['status'],$username); } //UPDATE CHANGELOG BASED ON ORDER_REF change - if ($post_content['order_ref'] != $equipment_data['order_ref']) + if (isset($post_content['order_ref']) && $post_content['order_ref'] != $equipment_data['order_ref']) { changelog($dbname,'equipment',$equipment_data['rowID'],'order_ref',$post_content['order_ref'],$username); } diff --git a/assets/functions.php b/assets/functions.php index a298f7d..775ed5a 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -229,7 +229,9 @@ echo <<$title + +