diff --git a/client_assets.php b/client_assets.php index bf17b6e2..e2a95e57 100644 --- a/client_assets.php +++ b/client_assets.php @@ -51,6 +51,15 @@ if (isset($_GET['type']) && ($_GET['type']) == 'workstation') { $_GET['type'] = ''; } +// Location Filter +if (isset($_GET['location']) & !empty($_GET['location'])) { + $location_query = 'AND (asset_location_id = ' . intval($_GET['location']) . ')'; + $location = intval($_GET['location']); +} else { + // Default - any + $location_query = ''; +} + //Rebuild URL $url_query_strings_sort = http_build_query($get_copy); @@ -63,6 +72,7 @@ $sql = mysqli_query( AND asset_$archive_query AND (asset_name LIKE '%$q%' OR asset_description LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial LIKE '%$q%' OR asset_os LIKE '%$q%' OR contact_name LIKE '%$q%' OR location_name LIKE '%$q%') AND ($type_query) + $location_query ORDER BY $sort $order LIMIT $record_from, $record_to" ); @@ -106,7 +116,26 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); -
+
+
+ +
+
+