 $(document).ready(function () {
            // Function to get total sales
            function getTotalSales() {
                $.ajax({
                    url: '/dailysales.kts.php', // Your server-side script
                    method: 'GET',
                    data: { action: 'getTotalSales' }, // Add any additional parameters if needed
                    dataType: 'json',
                    success: function (response) {
                        // Update the span with the total sales
                        $('#daily-sales').text(response.totalSales);
                    },
                    error: function (xhr, status, error) {
                        console.error(xhr.responseText);
                    }
                });
            }

            // Call the function on document ready
            getTotalSales();
 });

$(document).ready(function () {
    // Fetch data using AJAX
    $.ajax({
        url: '../assets/accounting/dailyexpenses.kts.php',
        type: 'GET',
        dataType: 'json',
        success: function (response) {
            // Display the total in the span
            $('#daily-expense').text(response.totalDailyExpense);
        },
        error: function (xhr, status, error) {
            console.error(xhr.responseText);
        }
    });
});