CIM37 -Allow geolocation update in equipment_manage

This commit is contained in:
“VeLiTi”
2024-04-04 10:41:41 +02:00
parent fce587ff91
commit a657daa1de
2 changed files with 14 additions and 3 deletions

View File

@@ -143,9 +143,9 @@ switch ($action) {
case 'geolocation':
if ($whereclause == ''){
$whereclause = 'WHERE geolocation is not null';
$whereclause = 'WHERE geolocation is not null OR geolocation != "["",""]"';
} else {
$whereclause .= ' AND geolocation is not null';
$whereclause .= ' AND geolocation is not null OR geolocation != "["",""]';
}
$sql = 'SELECT distinct(geolocation) FROM equipment e '.$whereclause.'';

View File

@@ -216,6 +216,16 @@ $view .= '
$changelog = showlog('equipment',$equipment_ID)?? '';
//GEOLOCATION
$geo_details = $equipment['geolocation'] ?? '';
if (is_array($geo_details)) {
$geodetails_lat = $geo_details[0];
$geodetails_lon = $geo_details[1];
} else{
$geodetails_lat = '';
$geodetails_lon = '';
}
$view .= '<div class="content-block tab-content">
<div class="form responsive-width-100">
<label for="productcode">'.$general_created.'</label>
@@ -225,7 +235,8 @@ $view .= '<div class="content-block tab-content">
<label for="productcode">'.$equipment_label11.'</label>
<input id="name" type="text" name="order_ref" placeholder="'.$equipment_label11.'" value="'.$equipment['order_ref'].'">
<label for="productcode">'.$equipment_label12.'</label>
<input id="name" type="text" name="geolocation" placeholder="'.$equipment_label12.'" value="'.$equipment['geolocation'].'">
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lat.'">
<input id="name" type="text" name="geolocation[]" placeholder="'.$equipment_label12.'" value="'.$geodetails_lon.'">
'.($update_allowed_special==1? $changelog:'').'
</div>
</div>';