diff --git a/service_view_modal.php b/service_view_modal.php
index 28b49958..3f8e886b 100644
--- a/service_view_modal.php
+++ b/service_view_modal.php
@@ -78,23 +78,35 @@
}
?>
-
+
-
Locations
-
- $row[location_name]";
- }
+ // Reset the $sql_assets pointer to the start - as we've already cycled through once
+ mysqli_data_seek($sql_assets, 0);
+
+ // Get locations linked to assets - push their name and vlan to arrays
+ while($row = mysqli_fetch_array($sql_assets)){
+ if(!empty($row['location_name'])){
+ array_push($location_names, $row['location_name']);
}
- ?>
+ }
+
+ // Remove duplicates
+ $location_names = array_unique($location_names);
+
+ // Display
+ if(!empty($location_names)){ ?>
+ Locations
+