From 22abeb605677d9604025cede9d30b979884496df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”>
Date: Tue, 11 Jun 2024 12:21:01 +0200
Subject: [PATCH] Add createdby on servicereport lists
---
assets/functions.php | 74 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 72 insertions(+), 2 deletions(-)
diff --git a/assets/functions.php b/assets/functions.php
index b5339ae..4cd7437 100644
--- a/assets/functions.php
+++ b/assets/functions.php
@@ -851,6 +851,7 @@ function serviceEvents ($messages,$page){
'.$equipment_label8.' |
'.$equipment_label9.' |
'.$equipment_label3.' |
+ '.$general_createdby.' |
'.$view_asset_actions.' |
@@ -896,6 +897,7 @@ function serviceEvents ($messages,$page){
'.$service_date.' |
'.$service_renewal_date.' |
'.$service_status.' |
+ '.$message->createdby.' |
'.$general_view.' |
PDF |
';
@@ -1929,7 +1931,7 @@ function geolocationUpdate($token){
$warranty = json_decode($message['description']);
//API URL OSM
- $api_url = 'https://nominatim.openstreetmap.org/search?format=json&city='.$warranty->city.'&country='.$warranty->country;
+ $api_url = 'https://nominatim.openstreetmap.org/search?format=json&city='.urlencode($warranty->city).'&country='.urlencode($warranty->country);
$api_url = str_replace(' ','%20',$api_url);
//BUILD UP FILESTREAM
@@ -1948,7 +1950,7 @@ function geolocationUpdate($token){
if ($lat == 0){
//CHECK FOR COUNTRY
- $api_url = 'https://nominatim.openstreetmap.org/search?format=json&country='.$warranty->country;
+ $api_url = 'https://nominatim.openstreetmap.org/search?format=json&country='.urlencode($warranty->country);
$api_url = str_replace(' ','%20',$api_url);
$streamContext = stream_context_create($httpOptions);
$geo_feedback = file_get_contents($api_url, false, $streamContext);
@@ -1970,4 +1972,72 @@ function geolocationUpdate($token){
}
}
+}
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// getQuestions
+// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+function getQuestions($type){
+
+ switch ($type) {
+ case 'cartest':
+ include './settings/systemcartest.php';
+ $arrayQuestions = $arrayQuestions_cartest;
+ break;
+
+ default:
+ $arrayQuestions = '';
+ break;
+ }
+
+ if ($arrayQuestions !=''){
+ foreach($arrayQuestions as $group){
+
+ //CREATE GROUP_ID
+ $group_id = 'group'.$group['Group_sequence'];
+
+ $view .= ''.$group['Group'].' ▽
+ ';
+
+ foreach($group['Questions_in_group'] as $question){
+
+ $view .= '
';
+
+ switch ($question['Type']) {
+ case 'Dropdown':
+ $view .= '
';
+ break;
+
+ case 'Checkbox':
+ $view .= '
';
+ break;
+
+ case 'slider':
+ //CREATE SLIDER FOR DISTANCE
+ $view .= '
+
+
+
+
+
';
+
+ break;
+ }
+ }
+ $view .= '
';
+ }
+ }
}
\ No newline at end of file