diff --git a/dashboard.php b/dashboard.php index 9f0ca1ae..02f6ca70 100644 --- a/dashboard.php +++ b/dashboard.php @@ -597,7 +597,7 @@ if ($user_config_dashboard_technical_enable == 1) {
New Assets
@@ -623,7 +623,7 @@ if ($user_config_dashboard_technical_enable == 1) {Expiring Domains
diff --git a/domains.php b/domains.php index 862d33e6..ce34ecbc 100644 --- a/domains.php +++ b/domains.php @@ -101,6 +101,26 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $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; @@ -120,7 +140,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $client_name = nullable_htmlentities($row['client_name']); ?> -