// public/js/dashboard.js $(document).ready(function() { console.log(base_url); function fetchDashboardStats() { $.ajax({ url: base_url + '/api/dashboard/stats', method: 'GET', dataType: 'json', success: function(response) { // 1. Update the Grand Totals // toLocaleString() adds thousands separators for large numbers $('#grand-total').text(response.summary.total.toLocaleString()); $('#grand-active').text(response.summary.active.toLocaleString()); $('#grand-inactive').text(response.summary.inactive.toLocaleString()); // 2. Clear the loading spinner let container = $('#service-cards-container'); container.empty(); // 3. Generate Individual Service Cards if (response.services.length === 0) { container.html('