diff --git a/assets.php b/assets.php index 925ec95c..f758e5ef 100644 --- a/assets.php +++ b/assets.php @@ -259,7 +259,7 @@ if (mysqli_num_rows($os_sql) > 0) { SELECT DISTINCT client_id, client_name FROM clients JOIN assets ON asset_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/certificates.php b/certificates.php index 97d80525..b72c1768 100644 --- a/certificates.php +++ b/certificates.php @@ -106,7 +106,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN certificates ON certificate_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/contacts.php b/contacts.php index 08ca9070..c50fc9af 100644 --- a/contacts.php +++ b/contacts.php @@ -192,7 +192,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN contacts ON contact_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/credentials.php b/credentials.php index 6373078d..818fe579 100644 --- a/credentials.php +++ b/credentials.php @@ -12,10 +12,10 @@ if (isset($_GET['client_id'])) { // Overide Filter Header Archived if (isset($_GET['archived']) && $_GET['archived'] == 1) { $archived = 1; - $archive_query = "c.credential_archived_at IS NOT NULL"; + $archive_query = "credential_archived_at IS NOT NULL"; } else { $archived = 0; - $archive_query = "c.credential_archived_at IS NULL"; + $archive_query = "credential_archived_at IS NULL"; } // Log when users load the Credentials page @@ -28,10 +28,10 @@ if (isset($_GET['client_id'])) { // Overide Filter Header Archived if (isset($_GET['archived']) && $_GET['archived'] == 1) { $archived = 1; - $archive_query = "(client_archived_at IS NOT NULL OR c.credential_archived_at IS NOT NULL)"; + $archive_query = "(client_archived_at IS NOT NULL OR credential_archived_at IS NOT NULL)"; } else { $archived = 0; - $archive_query = "(client_archived_at IS NULL AND c.credential_archived_at IS NULL)"; + $archive_query = "(client_archived_at IS NULL AND credential_archived_at IS NULL)"; } // Log when users load the Credentials page logAction("Credential", "View", "$session_name viewed the All Credentials page"); @@ -132,6 +132,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); +
@@ -200,7 +201,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN credentials ON credential_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/domains.php b/domains.php index ea151d2b..fd39c9b3 100644 --- a/domains.php +++ b/domains.php @@ -94,6 +94,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); +
@@ -117,7 +118,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN domains ON domain_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/locations.php b/locations.php index 165245d2..abd4e6e0 100644 --- a/locations.php +++ b/locations.php @@ -151,7 +151,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN locations ON location_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/networks.php b/networks.php index 96437c38..083dfae0 100644 --- a/networks.php +++ b/networks.php @@ -147,7 +147,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN networks ON network_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC "); diff --git a/software.php b/software.php index ef51d134..1370e58f 100644 --- a/software.php +++ b/software.php @@ -114,7 +114,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); SELECT DISTINCT client_id, client_name FROM clients JOIN software ON software_client_id = client_id - WHERE client_archived_at IS NULL + WHERE $archive_query $access_permission_query ORDER BY client_name ASC ");