Skip to content

Commit

Permalink
Fixed Broken Link to all assets on the dashboard, added link for all …
Browse files Browse the repository at this point in the history
…domains, updated all domains report to highlight domains, expired and expiring
  • Loading branch information
johnnyq committed Sep 13, 2024
1 parent 07df444 commit 6975d6e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
<!-- ./col -->

<div class="col-lg-4 col-6">
<a class="small-box bg-info" href="/report_all_assets_by_client.php">
<a class="small-box bg-info" href="report_assets.php">
<div class="inner">
<h3><?php echo $assets_added; ?></h3>
<p>New Assets</p>
Expand All @@ -623,7 +623,7 @@
<!-- ./col -->

<div class="col-lg-4 col-6">
<a class="small-box bg-warning">
<a class="small-box bg-warning" href="domains.php">
<div class="inner">
<h3><?php echo $expiring_domains; ?></h3>
<p>Expiring Domains</p>
Expand Down
27 changes: 25 additions & 2 deletions domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,26 @@
$domain_name = nullable_htmlentities($row['domain_name']);
$domain_description = nullable_htmlentities($row['domain_description']);
$domain_expire = nullable_htmlentities($row['domain_expire']);

$domain_expire_ago = timeAgo($domain_expire);
// Convert the expiry date to a timestamp
$domain_expire_timestamp = strtotime($row['domain_expire']);
$current_timestamp = time(); // Get current timestamp

// Calculate the difference in days
$days_until_expiry = ($domain_expire_timestamp - $current_timestamp) / (60 * 60 * 24);

// Determine the class based on the number of days until expiry
if ($days_until_expiry <= 0) {
$tr_class = "table-secondary";
} elseif ($days_until_expiry <= 14) {
$tr_class = "table-danger";
} elseif ($days_until_expiry <= 90) {
$tr_class = "table-warning";
} else {
$tr_class = '';
}

$domain_registrar_name = nullable_htmlentities($row['registrar_name']);
if($domain_registrar_name) {
$domain_registrar_name_display = $domain_registrar_name;
Expand All @@ -120,7 +140,7 @@
$client_name = nullable_htmlentities($row['client_name']);

?>
<tr>
<tr class="<?php echo $tr_class; ?>">
<td class="pr-0">
<div class="form-check">
<input class="form-check-input bulk-select" type="checkbox" name="domain_ids[]" value="<?php echo $domain_id ?>">
Expand All @@ -142,7 +162,10 @@
<td><?php echo $domain_webhost_name_display; ?></td>
<td><?php echo $domain_dnshost_name_display; ?></td>
<td><?php echo $domain_mailhost_name_display; ?></td>
<td><?php echo $domain_expire; ?></td>
<td>
<div><?php echo $domain_expire; ?></div>
<div><small><?php echo $domain_expire_ago; ?></small></div>
</td>
<td><?php echo $client_name; ?></td>
<td>
<div class="dropdown dropleft text-center">
Expand Down

0 comments on commit 6975d6e

Please sign in to comment.