diff --git a/agent/client_overview.php b/agent/client_overview.php index 062df3196..77d662dc3 100644 --- a/agent/client_overview.php +++ b/agent/client_overview.php @@ -1,830 +1,542 @@ CURRENT_DATE - AND domain_expire < CURRENT_DATE + INTERVAL 45 DAY - ORDER BY domain_expire ASC" -); - -// Get Certificates Expiring -$sql_certificates_expiring = mysqli_query( - $mysqli, - "SELECT certificate_expire, certificate_id, certificate_name FROM certificates - WHERE certificate_client_id = $client_id - AND certificate_expire IS NOT NULL - AND certificate_archived_at IS NULL - AND certificate_expire > CURRENT_DATE - AND certificate_expire < CURRENT_DATE + INTERVAL 45 DAY - ORDER BY certificate_expire ASC" -); - -// Get Licenses Expiring -$sql_licenses_expiring = mysqli_query( - $mysqli, - "SELECT software_expire, software_id, software_name FROM software - WHERE software_client_id = $client_id - AND software_expire IS NOT NULL - AND software_archived_at IS NULL - AND software_expire > CURRENT_DATE - AND software_expire < CURRENT_DATE + INTERVAL 45 DAY - ORDER BY software_expire ASC" -); - -// Get Asset Warranties Expiring -$sql_asset_warranties_expiring = mysqli_query( - $mysqli, - "SELECT asset_id, asset_name, asset_warranty_expire FROM assets - WHERE asset_client_id = $client_id - AND asset_warranty_expire IS NOT NULL - AND asset_archived_at IS NULL - AND asset_warranty_expire > CURRENT_DATE - AND asset_warranty_expire < CURRENT_DATE + INTERVAL 45 DAY - ORDER BY asset_warranty_expire ASC" -); - -// Get Assets Retiring 7 Year -$sql_asset_retire = mysqli_query( - $mysqli, - "SELECT asset_id, asset_install_date, asset_name FROM assets - WHERE asset_client_id = $client_id - AND asset_install_date IS NOT NULL - AND asset_archived_at IS NULL - AND asset_install_date + INTERVAL 7 YEAR > CURRENT_DATE - AND asset_install_date + INTERVAL 7 YEAR <= CURRENT_DATE + INTERVAL 45 DAY - ORDER BY asset_install_date ASC" -); - -/* - * EXPIRED ITEMS - */ - -// Get Domains Expired -$sql_domains_expired = mysqli_query( - $mysqli, - "SELECT domain_expire, domain_id, domain_name FROM domains - WHERE domain_client_id = $client_id - AND domain_expire IS NOT NULL - AND domain_archived_at IS NULL - AND domain_expire < CURRENT_DATE - ORDER BY domain_expire ASC" -); - -// Get Certificates Expired -$sql_certificates_expired = mysqli_query( - $mysqli, - "SELECT certificate_expire, certificate_id, certificate_name FROM certificates - WHERE certificate_client_id = $client_id - AND certificate_expire IS NOT NULL - AND certificate_archived_at IS NULL - AND certificate_expire < CURRENT_DATE - ORDER BY certificate_expire ASC" -); - -// Get Licenses Expired -$sql_licenses_expired = mysqli_query( - $mysqli, - "SELECT software_expire, software_id, software_name FROM software - WHERE software_client_id = $client_id - AND software_expire IS NOT NULL - AND software_archived_at IS NULL - AND software_expire < CURRENT_DATE - ORDER BY software_expire ASC" -); - -// Get Asset Warranties Expired -$sql_asset_warranties_expired = mysqli_query( - $mysqli, - "SELECT asset_id, asset_name, asset_warranty_expire FROM assets - WHERE asset_client_id = $client_id - AND asset_warranty_expire IS NOT NULL - AND asset_archived_at IS NULL - AND asset_warranty_expire < CURRENT_DATE - ORDER BY asset_warranty_expire ASC" -); - -// Get Retired Assets -$sql_asset_retired = mysqli_query( - $mysqli, - "SELECT asset_id, asset_install_date, asset_name FROM assets - WHERE asset_client_id = $client_id - AND asset_install_date IS NOT NULL - AND asset_archived_at IS NULL - AND asset_install_date + INTERVAL 7 YEAR < CURRENT_DATE -- Assets retired (installed more than 7 years ago) - ORDER BY asset_install_date ASC" -); +$chart_data = []; +if ($access['financial']) { + $chart_data['monthly'] = clientOverviewMonthly($client_id); + $chart_data['currency'] = $client_currency_code ?: $session_company_currency; +} +$priority_colors = ['Urgent' => 'dark', 'High' => 'danger', 'Medium' => 'warning', 'Low' => 'info']; +$tone_text = ['danger' => 'text-danger-emphasis', 'warning' => 'text-warning-emphasis', 'info' => 'text-info-emphasis', 'secondary' => 'text-body']; +$money_format = function ($amount) use ($currency_format, $client_currency_code, $session_company_currency) { + return numfmt_format_currency($currency_format, floatval($amount), $client_currency_code ?: $session_company_currency); +}; ?> -
|
-
-
-
-
-
+
-
- = $contact_name ?>
- = $contact_title ?>
- = $contact_primary_display ?>
-
-
- = $contact_tags_display ?>
-
-
-
+
+
+
+
+
+
+ Open tickets+ = $open_tickets['opened_30'] ?> opened, = $open_tickets['resolved_30'] ?> resolved in the last 30 days + View all = $open_tickets['total'] ?> + |
-
-
- = " $contact_phone $contact_extension" ?>
-
-
- - = "$contact_mobile" ?>
-
- |
-
| - - = $asset_name ?> - - | -
- = "$asset_make $asset_model"; ?>
- |
-
| - - = $credential_name ?> - - | -= $credential_username_display ?> | -
-
- = $otp_display ?>
- |
-
-
| - = $item_name ?> - | -
- Views: = $item_views ?>
- = $item_recipient ?>
- |
- Expires = $item_expire_at_human ?> | -- - - - | -
- - Domain: = $domain_name ?> - -- = $domain_expire ?> (= $domain_expire_human ?>) -
- - - -- - Certificate: = $certificate_name ?> - -- = $certificate_expire ?> (= $certificate_expire_human ?>) -
- - - -- - Asset Warranty: = $asset_name ?> - -- = $asset_warranty_expire ?> (= $asset_warranty_expire_human ?>) -
- - - - - -- - Asset Retire: = $asset_name ?> - -- = $asset_install_date ?> (= $asset_install_date_human ?>) -
- - - - -- - License: = $software_name ?> - -- = $software_expire ?> (= $software_expire_human ?>) -
- - - -- - Domain: = $domain_name ?> - -- = $domain_expire ?> (= $domain_expire_human ?>) -
- - - -- - Certificate: = $certificate_name ?> - -- = $certificate_expire ?> (= $certificate_expire_human ?>) -
- - - -- Asset Warranty: - = $asset_name ?> - -- = $asset_warranty_expire ?> (= $asset_warranty_expire_human ?>) -
- - - - - -- - Asset Retire: = $asset_name ?> - -- = $asset_install_date ?> (= $asset_install_date_human ?>) -
- - - - -- - Software: = $software_name ?> - -- = $software_expire ?> (= $software_expire_human ?>) -
- - - -| = "$ticket_prefix$ticket_number" ?> | -= $ticket_subject ?> | -= $ticket_created_at_human ?> = $ticket_created_at ?> | -
| = $log_created_at_time_ago ?> | -= $log_description ?> | -