diff --git a/assets.php b/assets.php index 4684cf0d..66cc5a59 100644 --- a/assets.php +++ b/assets.php @@ -53,7 +53,7 @@ if ($client_url && isset($_GET['location']) && !empty($_GET['location'])) { } else { // Default - any $location_query = ''; - $location_filter = ''; + $location_filter = 0; } //Get Asset Counts @@ -216,7 +216,7 @@ if (mysqli_num_rows($os_sql) > 0) { LEFT JOIN assets ON asset_location_id = location_id WHERE location_client_id = $client_id AND location_archived_at IS NULL - AND asset_location_id != 0 + AND (asset_location_id != 0 OR location_id = $location_filter) ORDER BY location_name ASC "); while ($row = mysqli_fetch_array($sql_locations_filter)) { diff --git a/contacts.php b/contacts.php index 80cc817b..a16851cf 100644 --- a/contacts.php +++ b/contacts.php @@ -50,7 +50,7 @@ if ($client_url && isset($_GET['location']) && !empty($_GET['location'])) { } else { // Default - any $location_query = ''; - $location_filter = ''; + $location_filter = 0; } $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS contacts.*, clients.*, locations.*, users.*, GROUP_CONCAT(tags.tag_name) FROM contacts @@ -152,7 +152,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); LEFT JOIN contacts ON contact_location_id = location_id WHERE location_client_id = $client_id AND location_archived_at IS NULL - AND contact_location_id != 0 + AND (contact_location_id != 0 OR location_id = $location_filter) ORDER BY location_name ASC "); while ($row = mysqli_fetch_array($sql_locations_filter)) { diff --git a/networks.php b/networks.php index 4b128f50..221c1b0c 100644 --- a/networks.php +++ b/networks.php @@ -37,7 +37,7 @@ if ($client_url && isset($_GET['location']) && !empty($_GET['location'])) { } else { // Default - any $location_query = ''; - $location_filter = ''; + $location_filter = 0; } $sql = mysqli_query( @@ -104,7 +104,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); LEFT JOIN networks ON network_location_id = location_id WHERE location_client_id = $client_id AND location_archived_at IS NULL - AND network_location_id != 0 + AND (network_location_id != 0 OR location_id = $location_filter) ORDER BY location_name ASC "); while ($row = mysqli_fetch_array($sql_locations_filter)) {