Client Overview - Enhance Recently Updated section

- Move the asset warranty expiring and stale ticket queries out of inc_all_client.php and into client_overview.php, there is no need to load this data on every page load - just for the overview
- Show recently updated documents (in addition to contacts/vendors)
- General tidy
This commit is contained in:
Marcus Hill
2023-06-03 21:58:34 +01:00
parent acbc935519
commit d86b5d8992
2 changed files with 329 additions and 276 deletions

View File

@@ -213,38 +213,6 @@ if (isset($_GET['client_id'])) {
));
$num_certs_expiring = intval($row['num']);
// Get Asset Warranties Expiring
$sql_asset_warranties_expiring = mysqli_query(
$mysqli,
"SELECT * 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 + INTERVAL 90 DAY
ORDER BY asset_warranty_expire DESC"
);
// Get Assets Retiring
$sql_asset_retire = mysqli_query(
$mysqli,
"SELECT * 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 + INTERVAL 90 DAY
ORDER BY asset_install_date DESC"
);
// Get Stale Tickets
$sql_tickets_stale = mysqli_query(
$mysqli,
"SELECT * FROM tickets
WHERE ticket_client_id = $client_id
AND ticket_created_at < CURRENT_DATE - INTERVAL 14 DAY
AND ticket_status != 'Closed'
ORDER BY ticket_created_at DESC"
);
}
}