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 + +