Show Red Badge Count next to client domains if Domain is expired or expires within 5 days

This commit is contained in:
johnnyq 2024-08-27 20:40:12 -04:00
parent 3eb6ee57fb
commit a4a110f1e7
2 changed files with 15 additions and 1 deletions

View File

@ -203,7 +203,7 @@
<?php
if ($num_domains > 0) { ?>
<span class="right badge <?php if ($num_domains_expiring > 0) { ?> badge-warning text-dark<?php } ?> text-light"><?php echo $num_domains; ?></span>
<span class="right badge <?php if ($num_domains_expiring > 0) { ?> badge-warning text-dark<?php } ?> <?php if ($num_domains_expired > 0) { ?> badge-danger <?php } ?> text-white"><?php echo $num_domains; ?></span>
<?php } ?>
</p>
</a>

View File

@ -223,6 +223,20 @@ if (isset($_GET['client_id'])) {
));
$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,