<?php $__env->startSection('content'); ?>
    <div class="customer-list">
        <div class="customer-list-header">
            <div class="flex-align gap-3">
                <p class="fw-medium text--dark"><?php echo e(__($pageTitle)); ?></p>
                <p class="fs-14"><?php echo app('translator')->get('Total Count'); ?> : <span class="text--dark"><?php echo e($userCount); ?></span></p>
            </div>

            <div class="flex-end gap-3 customer-list-header-action">
                <div class="flex-align gap-3 flex-1 justify-content-lg-end">
                    <div class="customer-search">
                        <span class="icon">
                            <i class="fa-solid fa-magnifying-glass"></i>
                        </span>
                        <input class="customer-search-input customerSearch" type="text" value="<?php echo e(request()->search); ?>" placeholder="<?php echo app('translator')->get('Search'); ?>">
                    </div>
                    <div class="datepicker-inner d-none d-sm-flex">
                        <input type="text" placeholder="mm dd, yyyy" value="<?php echo e(request()->date); ?>" class="date-picker-input datepicker2a dateFilter">
                    </div>
                </div>
                <div class="flex-align gap-3">
                    <a href="<?php echo e(route('admin.customer.add')); ?>" class="btn btn--base btn--sm"><?php echo app('translator')->get('Add Customer'); ?>
                        <span class="icon">
                            <i class="fa-solid fa-plus"></i>
                        </span>
                    </a>
                    <div class="layout-view-action-inner">
                        <button class="layout-view-action-btn list-view" data-key="customer">
                            <?php echo $__env->make('admin.partials.svg.list_view', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

                        </button>
                        <button class="layout-view-action-btn grid-view" data-key="customer">
                            <?php echo $__env->make('admin.partials.svg.grid_view', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <div class="customer-card-wrapper">

            <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="customer-card customerDetails" data-key="customer" data-customer="<?php echo e($user->id); ?>">
                    <div class="customer-card-thumb">
                        <img src="<?php echo e(getImage(getFilePath('userProfile') . '/' . $user->image, getFileSize('userProfile'), true)); ?>" alt="customer">
                    </div>
                    <div class="customer-card-content">
                        <div class="customer-card-info">
                            <a href="<?php echo e(route('admin.customer.overview', $user->id)); ?>" class="name"><?php echo e($user->fullname); ?></a>
                            <p class="email"><?php echo e($user->email); ?></p>
                        </div>
                        <div class="flex-align gap-1 list-view-none">
                            <p class="fs-12"><?php echo app('translator')->get('Total Tickets'); ?>: <span class="text--dark"><?php echo e($user->total_tickets); ?></span></p>
                            <p class="fs-12"><?php echo app('translator')->get('Open Tickets'); ?>: <span class="text--dark"><?php echo e($user->open_tickets); ?></span></p>
                        </div>
                        <div class="customer-card-text grid-view-none">
                            <?php echo app('translator')->get('Total Tickets'); ?>: <span class="text--dark"><?php echo e($user->total_tickets); ?></span>
                        </div>
                        <div class="customer-card-text grid-view-none">
                            <?php echo app('translator')->get('Open Tickets'); ?>: <span class="text--dark"><?php echo e($user->open_tickets); ?></span>
                        </div>
                        <div class="customer-card-text grid-view-none">
                            <?php echo app('translator')->get('Created Time'); ?>: <span class="text--dark"><?php echo e(showDateTime($user->created_at)); ?></span>
                        </div>
                        <div class="customer-card-action">
                            <a class="action-btn" href="<?php echo e(route('admin.ticket.add')); ?>?user=<?php echo e($user->id); ?>" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('Add Ticket'); ?>">
                                <?php echo $__env->make('admin.partials.svg.ticket', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </a>
                            <a class="action-btn" href="<?php echo e(route('admin.customer.edit', $user->id)); ?>" data-bs-toggle="tooltip" data-bs-placement="top" title="<?php echo app('translator')->get('Edit'); ?>">
                                <?php echo $__env->make('admin.partials.svg.edit', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </a>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <?php if (isset($component)) { $__componentOriginal785b8965d65806a202a14875024d2012 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal785b8965d65806a202a14875024d2012 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.empty-message','data' => ['message' => 'No customer found']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('empty-message'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['message' => 'No customer found']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal785b8965d65806a202a14875024d2012)): ?>
<?php $attributes = $__attributesOriginal785b8965d65806a202a14875024d2012; ?>
<?php unset($__attributesOriginal785b8965d65806a202a14875024d2012); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal785b8965d65806a202a14875024d2012)): ?>
<?php $component = $__componentOriginal785b8965d65806a202a14875024d2012; ?>
<?php unset($__componentOriginal785b8965d65806a202a14875024d2012); ?>
<?php endif; ?>
            <?php endif; ?>
        </div>

        <?php if($users->hasPages()): ?>
            <div class="pagination-wrapper">
                <?php echo e(paginateLinks($users)); ?>

            </div>
        <?php endif; ?>

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

<?php $__env->startPush('style'); ?>
    <style>
        .customerDetails {
            cursor: pointer;
        }

        .pagination-wrapper {
            margin-top: auto;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        (function($) {
            "use strict";

            function redirectWithParams() {
                var search = $('.customerSearch').val().trim();
                var date = $('.dateFilter').val().trim();
                var params = [];
                if (search) params.push('search=' + encodeURIComponent(search));
                if (date) params.push('date=' + encodeURIComponent(date));
                var url = "<?php echo e(route('admin.customer.list')); ?>";
                if (params.length) url += '?' + params.join('&');
                window.location.href = url;
            }

            $('.customerSearch').on('keydown', function(e) {
                if (e.key === 'Enter') {
                    redirectWithParams();
                }
            });

            $(".dateFilter").flatpickr({
                mode: "range",
                dateFormat: "M j, Y",
                disableMobile: true,
                locale: {
                    rangeSeparator: "-"
                },
                onClose: function() {
                    redirectWithParams();
                }
            });

            let route = `<?php echo e(route('admin.customer.overview', '')); ?>`;

            $('.customerDetails').on('click', function(e) {
                if ($(e.target).closest('.action-col').length) {
                    return;
                }
                let customer = $(this).data('customer');
                window.location.href = route + '/' + customer;
            });

        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\projects\custom_viserdesk\Files\core\resources\views/admin/customer/list.blade.php ENDPATH**/ ?>