Skip to content

Commit

Permalink
Show Red Badge Count next to client domains if Domain is expired or e…
Browse files Browse the repository at this point in the history
…xpires within 5 days
  • Loading branch information
johnnyq committed Aug 28, 2024
1 parent 3eb6ee5 commit a4a110f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client_side_nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 14 additions & 0 deletions inc_all_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a4a110f

Please sign in to comment.