<?php
    use App\Helpers\PermissionHelper;

    $title = __('Customers List');
?>



<?php $__env->startSection('content'); ?>

    <?php if (isset($component)) { $__componentOriginal522a3c8aadb4ccbcc229d59265244da1 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal522a3c8aadb4ccbcc229d59265244da1 = $attributes; } ?>
<?php $component = App\View\Components\PageHeader::resolve(['title' => $title,'breadcrumbs' => [
            ['name' => __('Home'), 'url' => route('dashboard.index')],
        ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('page-header'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\PageHeader::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal522a3c8aadb4ccbcc229d59265244da1)): ?>
<?php $attributes = $__attributesOriginal522a3c8aadb4ccbcc229d59265244da1; ?>
<?php unset($__attributesOriginal522a3c8aadb4ccbcc229d59265244da1); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal522a3c8aadb4ccbcc229d59265244da1)): ?>
<?php $component = $__componentOriginal522a3c8aadb4ccbcc229d59265244da1; ?>
<?php unset($__componentOriginal522a3c8aadb4ccbcc229d59265244da1); ?>
<?php endif; ?>

    <?php
        $stats = [
            [
                'title' => __('Total Customers'),
                'id'    => 'stat-total',
                'color' => 'bg-info',
                'icon'  => 'bx bx-user'
            ],
            [
                'title' => __('Active Customers'),
                'id'    => 'stat-active',
                'color' => 'bg-success',
                'icon'  => 'bx bx-check-circle'
            ],
            [
                'title' => __('Inactive Customers'),
                'id'    => 'stat-inactive',
                'color' => 'bg-danger',
                'icon'  => 'bx bx-x-circle'
            ],
            [
                'title' => __('New Customers Today'),
                'id'    => 'stat-today',
                'color' => 'bg-warning',
                'icon'  => 'bx bx-time'
            ],
        ];
    ?>

    <?php if (isset($component)) { $__componentOriginalfb0d8498de66958208c028b442e10dc8 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalfb0d8498de66958208c028b442e10dc8 = $attributes; } ?>
<?php $component = App\View\Components\StatsCards::resolve(['stats' => $stats] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('stats-cards'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\StatsCards::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalfb0d8498de66958208c028b442e10dc8)): ?>
<?php $attributes = $__attributesOriginalfb0d8498de66958208c028b442e10dc8; ?>
<?php unset($__attributesOriginalfb0d8498de66958208c028b442e10dc8); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalfb0d8498de66958208c028b442e10dc8)): ?>
<?php $component = $__componentOriginalfb0d8498de66958208c028b442e10dc8; ?>
<?php unset($__componentOriginalfb0d8498de66958208c028b442e10dc8); ?>
<?php endif; ?>

    <?php if (isset($component)) { $__componentOriginal740c66ff9bbfcb19a96a45ba2fa42d64 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal740c66ff9bbfcb19a96a45ba2fa42d64 = $attributes; } ?>
<?php $component = App\View\Components\Card::resolve(['header' => false] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Card::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

        <?php if (isset($component)) { $__componentOriginalffd2277b0bb7a50bea5f877e34266c78 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalffd2277b0bb7a50bea5f877e34266c78 = $attributes; } ?>
<?php $component = App\View\Components\Row::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('row'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Row::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

            <?php if (isset($component)) { $__componentOriginal56b43a9bcf2d305970c255b91d692680 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal56b43a9bcf2d305970c255b91d692680 = $attributes; } ?>
<?php $component = App\View\Components\Col::resolve(['size' => '4'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('col'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Col::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

                <div class="search-box me-2 mb-2 d-inline-block">
                    <div class="position-relative">
                        <?php if (isset($component)) { $__componentOriginal967bdc6f044358de111e8173f0c9c426 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal967bdc6f044358de111e8173f0c9c426 = $attributes; } ?>
<?php $component = App\View\Components\FormInput::resolve(['type' => 'text','class' => 'f_search','placeholder' => ''.e(__('Search')).''] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('form-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\FormInput::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['style' => 'max-width: 300px; width: 300px;']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal967bdc6f044358de111e8173f0c9c426)): ?>
<?php $attributes = $__attributesOriginal967bdc6f044358de111e8173f0c9c426; ?>
<?php unset($__attributesOriginal967bdc6f044358de111e8173f0c9c426); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal967bdc6f044358de111e8173f0c9c426)): ?>
<?php $component = $__componentOriginal967bdc6f044358de111e8173f0c9c426; ?>
<?php unset($__componentOriginal967bdc6f044358de111e8173f0c9c426); ?>
<?php endif; ?>
                        <i class="bx bx-search-alt search-icon"></i>
                    </div>
                </div>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal56b43a9bcf2d305970c255b91d692680)): ?>
<?php $attributes = $__attributesOriginal56b43a9bcf2d305970c255b91d692680; ?>
<?php unset($__attributesOriginal56b43a9bcf2d305970c255b91d692680); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal56b43a9bcf2d305970c255b91d692680)): ?>
<?php $component = $__componentOriginal56b43a9bcf2d305970c255b91d692680; ?>
<?php unset($__componentOriginal56b43a9bcf2d305970c255b91d692680); ?>
<?php endif; ?>

            <?php if (isset($component)) { $__componentOriginal56b43a9bcf2d305970c255b91d692680 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal56b43a9bcf2d305970c255b91d692680 = $attributes; } ?>
<?php $component = App\View\Components\Col::resolve(['size' => '8','class' => 'text-sm-end'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('col'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Col::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

                <?php if (isset($component)) { $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $attributes; } ?>
<?php $component = App\View\Components\Link::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Link::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'btn-outline-primary button-filter','data-bs-toggle' => 'modal','data-bs-target' => '#modal-filters']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

                    <i class="fas fa-filter"></i> <?php echo e(__('Filters')); ?>

                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $attributes = $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $component = $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
                <?php if (isset($component)) { $__componentOriginal5ba89fa1ccc7d5cc716202be179f2414 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal5ba89fa1ccc7d5cc716202be179f2414 = $attributes; } ?>
<?php $component = App\View\Components\ToggleStatus::resolve(['label' => 'Change Status','hidden' => true,'buttonClass' => 'btn-primary','enableText' => 'Activate','disableText' => 'Deactivate','condition' => PermissionHelper::can('customers.edit')] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('toggle-status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\ToggleStatus::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal5ba89fa1ccc7d5cc716202be179f2414)): ?>
<?php $attributes = $__attributesOriginal5ba89fa1ccc7d5cc716202be179f2414; ?>
<?php unset($__attributesOriginal5ba89fa1ccc7d5cc716202be179f2414); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal5ba89fa1ccc7d5cc716202be179f2414)): ?>
<?php $component = $__componentOriginal5ba89fa1ccc7d5cc716202be179f2414; ?>
<?php unset($__componentOriginal5ba89fa1ccc7d5cc716202be179f2414); ?>
<?php endif; ?>
                <?php if (isset($component)) { $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $attributes; } ?>
<?php $component = App\View\Components\Link::resolve(['condition' => PermissionHelper::can('customers.delete')] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Link::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'btn-danger destroy-selector d-none']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>
<?php echo e(__('Delete selector')); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $attributes = $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $component = $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
                <?php if (isset($component)) { $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97 = $attributes; } ?>
<?php $component = App\View\Components\Link::resolve(['href' => ''.e(route('customers.create')).'','condition' => PermissionHelper::can('customers.create')] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Link::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'btn-primary button-create']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>
<?php echo e(__('New Customer')); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $attributes = $__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__attributesOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97)): ?>
<?php $component = $__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97; ?>
<?php unset($__componentOriginal6768a8abc6dec1bd6c8b1a9d996e6c97); ?>
<?php endif; ?>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal56b43a9bcf2d305970c255b91d692680)): ?>
<?php $attributes = $__attributesOriginal56b43a9bcf2d305970c255b91d692680; ?>
<?php unset($__attributesOriginal56b43a9bcf2d305970c255b91d692680); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal56b43a9bcf2d305970c255b91d692680)): ?>
<?php $component = $__componentOriginal56b43a9bcf2d305970c255b91d692680; ?>
<?php unset($__componentOriginal56b43a9bcf2d305970c255b91d692680); ?>
<?php endif; ?>
         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalffd2277b0bb7a50bea5f877e34266c78)): ?>
<?php $attributes = $__attributesOriginalffd2277b0bb7a50bea5f877e34266c78; ?>
<?php unset($__attributesOriginalffd2277b0bb7a50bea5f877e34266c78); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalffd2277b0bb7a50bea5f877e34266c78)): ?>
<?php $component = $__componentOriginalffd2277b0bb7a50bea5f877e34266c78; ?>
<?php unset($__componentOriginalffd2277b0bb7a50bea5f877e34266c78); ?>
<?php endif; ?>

        <?php if (isset($component)) { $__componentOriginalb539fdd4bceece4a667dd360eb69c7ae = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb539fdd4bceece4a667dd360eb69c7ae = $attributes; } ?>
<?php $component = App\View\Components\DataTable::resolve(['columns' => [
                ['label' => 'ID', 'width' => '40px'],
                ['label' => __('Customer'), 'width' => '350px'],
                ['label' => __('Gender')],
                ['label' => __('Nationality')],
                ['label' => __('National ID')],
                ['label' => __('Mobile')],
                ['label' => __('Age')],
                ['label' => __('Coach')],
                ['label' => __('Balance')],
                ['label' => __('Audit Info')],
                ['label' => __('Status')],
                ['label' => __('Actions'), 'width' => '100px'],
            ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('data-table'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\DataTable::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb539fdd4bceece4a667dd360eb69c7ae)): ?>
<?php $attributes = $__attributesOriginalb539fdd4bceece4a667dd360eb69c7ae; ?>
<?php unset($__attributesOriginalb539fdd4bceece4a667dd360eb69c7ae); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb539fdd4bceece4a667dd360eb69c7ae)): ?>
<?php $component = $__componentOriginalb539fdd4bceece4a667dd360eb69c7ae; ?>
<?php unset($__componentOriginalb539fdd4bceece4a667dd360eb69c7ae); ?>
<?php endif; ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal740c66ff9bbfcb19a96a45ba2fa42d64)): ?>
<?php $attributes = $__attributesOriginal740c66ff9bbfcb19a96a45ba2fa42d64; ?>
<?php unset($__attributesOriginal740c66ff9bbfcb19a96a45ba2fa42d64); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal740c66ff9bbfcb19a96a45ba2fa42d64)): ?>
<?php $component = $__componentOriginal740c66ff9bbfcb19a96a45ba2fa42d64; ?>
<?php unset($__componentOriginal740c66ff9bbfcb19a96a45ba2fa42d64); ?>
<?php endif; ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
    $(document).ready(() => {
        let inputs = {
            search: $(".f_search"),
        };

        const table = initServerTable({
            order: [[1, 'desc']],
            locale: `<?php echo e($locale); ?>`,
            ajax: {
                url: '<?php echo e(route('customers.yajra')); ?>',
                type: 'GET',
                data: data => {
                    data.search = inputs.search.val();
                },
            },
            columns: [
                {data: 'checkbox', sortable: false, orderable: false},
                {data: 'id'},
                {data: 'customer'},
                {data: 'gender'},
                {data: 'nationality'},
                {data: 'national_id'},
                {data: 'mobile'},
                {data: 'age'},
                {data: 'coach'},
                {data: 'balance'},
                {data: 'audit_info'},
                {data: 'status'},
                {data: 'actions', sortable: false, orderable: false},
            ]
        });

        inputs.search.on("input", () => table.draw());
        table.draw();

        setInterval(() => {
            table.draw()
        }, 30000);

        let routes = {
            updateStatus: `<?php echo e(route_ID_('customers.update-status')); ?>`,
            updateStatusSelector: `<?php echo e(route_ID_('customers.update-status-selector')); ?>`,

            destroy: `<?php echo e(route_ID_('customers.destroy')); ?>`,
            destroySelector: `<?php echo e(route_ID_('customers.destroy-selector')); ?>`,
        };

        handleUpdateStatus(routes.updateStatus, table);
        handleUpdateStatusSelector(routes.updateStatusSelector, table);

        handleDelete(routes.destroy, table);
        handledestroySelector(routes.destroySelector, table);

    });

    document.addEventListener('DOMContentLoaded', function() {
        fetchStatistics();
        setInterval(fetchStatistics, 25000);
    });

    function fetchStatistics() {
        fetch('<?php echo e(route('customers.statics')); ?>')
            .then(response => response.json())
            .then(data => {
                console.log(data)
                if (data.success) {
                    updateStats(data.stats);
                }
            })
            .catch(error => {
                console.error('Error fetching statistics:', error);
            });
    }

    function updateStats(stats) {
        document.getElementById('stat-total').textContent = stats.total || 0;
        document.getElementById('stat-active').textContent = stats.active || 0;
        document.getElementById('stat-inactive').textContent = stats.inactive || 0;
        document.getElementById('stat-today').textContent = stats.new_today || 0;
    }

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', [
    $title
], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH E:\xamp\htdocs\Gym Management System\resources\views/customers//index.blade.php ENDPATH**/ ?>