From a4a110f1e7c464f23dc2d094c0d62a6f998ceb6e Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 27 Aug 2024 20:40:12 -0400 Subject: [PATCH] Show Red Badge Count next to client domains if Domain is expired or expires within 5 days --- client_side_nav.php | 2 +- inc_all_client.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client_side_nav.php b/client_side_nav.php index 8b9e9182a..3cc934fb4 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -203,7 +203,7 @@ 0) { ?> - +

diff --git a/inc_all_client.php b/inc_all_client.php index 5ae324e3e..15b2b6de9 100644 --- a/inc_all_client.php +++ b/inc_all_client.php @@ -223,6 +223,20 @@ )); $num_domains_expiring = intval($row['num']); + // Count Domains Expired or within 5 days + $row = mysqli_fetch_assoc(mysqli_query( + $mysqli, + "SELECT COUNT('domain_id') AS num FROM domains + WHERE domain_client_id = $client_id + AND domain_expire IS NOT NULL + AND ( + domain_expire < CURRENT_DATE + OR domain_expire < CURRENT_DATE + INTERVAL 5 DAY + ) + AND domain_archived_at IS NULL" + )); + $num_domains_expired = intval($row['num']); + // Count Certificates Expiring within 30 Days $row = mysqli_fetch_assoc(mysqli_query( $mysqli,