From a35ef025dc17643aa3428072e735ab9eecaf61b3 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 20 Jul 2026 18:25:44 -0400 Subject: [PATCH] Add Expiring in Filter Field to assets, licenses, domains and certificate and wire that into the dashboard as well --- agent/assets.php | 33 +++++++++++++++++++++++++++++++-- agent/certificates.php | 40 ++++++++++++++++++++++++++++++++++++---- agent/dashboard.php | 8 ++++---- agent/domains.php | 40 ++++++++++++++++++++++++++++++++++++---- agent/software.php | 40 ++++++++++++++++++++++++++++++++++++---- 5 files changed, 143 insertions(+), 18 deletions(-) diff --git a/agent/assets.php b/agent/assets.php index 80bfcdb4..bdc23b8f 100644 --- a/agent/assets.php +++ b/agent/assets.php @@ -90,6 +90,21 @@ if (isset($_GET['tags']) && is_array($_GET['tags']) && !empty($_GET['tags'])) { $tag_query = ''; } +// Expiring In Filter +if (isset($_GET['expire_days']) && !empty($_GET['expire_days'])) { + if ($_GET['expire_days'] == "expired") { + $expire_days = "expired"; + $expire_query = "AND (asset_warranty_expire IS NOT NULL AND asset_warranty_expire != '0000-00-00' AND asset_warranty_expire < CURDATE())"; + } else { + $expire_days = intval($_GET['expire_days']); + $expire_query = "AND (asset_warranty_expire IS NOT NULL AND asset_warranty_expire != '0000-00-00' AND asset_warranty_expire BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL $expire_days DAY))"; + } +} else { + // Default - any + $expire_days = ''; + $expire_query = ''; +} + //Get Asset Counts $row = mysqli_fetch_assoc(mysqli_query($mysqli, " SELECT @@ -148,6 +163,7 @@ $sql = mysqli_query( AND ($type_query) $access_permission_query $location_query + $expire_query $client_query GROUP BY asset_id ORDER BY $sort $order LIMIT $record_from, $record_to" @@ -226,7 +242,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
s">
@@ -313,6 +329,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
+
+
+ +
+
-
+ - -
- +
+ + + + + + + + +
+
+ + +
+ + +
"> diff --git a/agent/dashboard.php b/agent/dashboard.php index 5dae174f..c020f993 100644 --- a/agent/dashboard.php +++ b/agent/dashboard.php @@ -666,7 +666,7 @@ if ($user_config_dashboard_technical_enable == 1) {
- +

Expiring Domains 30 Day

@@ -679,7 +679,7 @@ if ($user_config_dashboard_technical_enable == 1) {
- +

Expiring Certificates30 Day

@@ -692,7 +692,7 @@ if ($user_config_dashboard_technical_enable == 1) {
- +

Expiring Licenses30 Day

@@ -705,7 +705,7 @@ if ($user_config_dashboard_technical_enable == 1) {
- -
- +
+ + + + + + + + +
+
+ + +
+ + +
- -
- +
+ + + + + + + + +
+
+ + +
+ + +