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()")); +