Your IP : 216.73.216.79


Current Path : /var/www/html/dev/reddsis-dev/storage/framework/views/
Upload File :
Current File : /var/www/html/dev/reddsis-dev/storage/framework/views/8e7636ba1453dd72074d7fe0641593e8.php

<?php $__env->startSection('title', \App\Http\Helpers\MenuHelper::getPageTitle()); ?>

<?php $__env->startSection('content'); ?>
    <div x-data="{ pageName: <?php echo \Illuminate\Support\Js::from(\App\Http\Helpers\MenuHelper::getPageTitle())->toHtml() ?> }" class="mb-6">
        <div class="mb-6 flex flex-wrap items-center justify-between gap-3">
            <h2 class="text-xl font-semibold text-gray-800 dark:text-white/90" x-text="pageName"></h2>
            <nav>
                <ol class="flex items-center gap-1.5">
                    <li>
                        <a class="inline-flex items-center gap-1.5 text-sm text-gray-500 dark:text-gray-400"
                            href="<?php echo e(route('admin.dashboard')); ?>">
                            Home
                            <svg class="stroke-current" width="17" height="16" viewBox="0 0 17 16" fill="none"
                                xmlns="http://www.w3.org/2000/svg">
                                <path d="M6.0765 12.667L10.2432 8.50033L6.0765 4.33366" stroke="" stroke-width="1.2"
                                    stroke-linecap="round" stroke-linejoin="round" />
                            </svg>
                        </a>
                    </li>
                    <li class="text-sm text-gray-800 dark:text-white/90" x-text="pageName"></li>
                </ol>
            </nav>
        </div>
    </div>

    <div class="space-y-5 sm:space-y-6">
        <div class="rounded-2xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-white/[0.03]">
            <div class="px-5 py-4 sm:px-6 sm:py-5">
                <div class="mb-6 flex flex-wrap items-center justify-between gap-3">
                    <h3 class="text-lg font-semibold text-gray-800 dark:text-white/90">Visitor Statistics</h3>
                    <div class="flex items-center gap-3">
                        <form action="<?php echo e(route('visitor.toggle')); ?>" method="POST" id="toggleForm">
                            <?php echo csrf_field(); ?>
                            <div x-data="{ switcherToggle: <?php echo e($setting->is_active ? 'true' : 'false'); ?> }">
                                <label
                                    @click.prevent="switcherToggle = !switcherToggle; $nextTick(() => document.getElementById('toggleForm').submit())"
                                    class="flex cursor-pointer items-center gap-2 text-sm font-medium text-gray-700 select-none dark:text-gray-400">
                                    <div class="relative">
                                        <div class="block h-6 w-11 rounded-full bg-gray-700 dark:bg-white/10"
                                            :class="switcherToggle ? 'bg-gray-700 dark:bg-white/10' : 'bg-gray-200 dark:bg-gray-800'">
                                        </div>
                                        <div class="absolute left-0.5 top-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-white transition"
                                            :class="switcherToggle ? 'translate-x-full' : ''">
                                            <span :class="switcherToggle ? 'block' : 'hidden'" class="text-brand-500 dark:text-brand-500">
                                                <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                                                    <path d="M11.6666 3.5L5.24992 9.91667L2.33325 7" stroke="currentColor" stroke-width="1.94437" stroke-linecap="round" stroke-linejoin="round"/>
                                                </svg>
                                            </span>
                                            <span :class="switcherToggle ? 'hidden' : 'block'" class="text-gray-400 dark:text-gray-500">
                                                <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                                                    <path d="M4 4L10 10M10 4L4 10" stroke="currentColor" stroke-width="1.94437" stroke-linecap="round"/>
                                                </svg>
                                            </span>
                                        </div>
                                    </div>
                                    <span :class="switcherToggle ? 'text-green-600 dark:text-green-400' : 'text-gray-500 dark:text-gray-400'" x-text="switcherToggle ? 'Active' : 'Deactive'"></span>
                                </label>
                            </div>
                        </form>
                        <form action="<?php echo e(route('visitor.clear')); ?>" method="POST" class="inline delete-form">
                            <?php echo csrf_field(); ?>
                            <button type="submit"
                                class="inline-flex items-center gap-2 rounded-lg border border-error-300 bg-white px-4 py-2.5 text-sm font-medium text-error-600 shadow-theme-xs hover:bg-error-50 dark:border-error-500/30 dark:bg-error-500/10 dark:text-error-400 dark:hover:bg-error-500/20">
                                Clear All
                            </button>
                        </form>
                    </div>
                </div>

                <div class="grid grid-cols-1 gap-6 md:grid-cols-3">
                    <div class="rounded-lg border border-gray-100 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-800/30">
                        <p class="text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">Total Visits</p>
                        <p class="mt-2 text-3xl font-bold text-gray-800 dark:text-white/90"><?php echo e(number_format($totalVisits)); ?></p>
                    </div>
                    <div class="rounded-lg border border-gray-100 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-800/30">
                        <p class="text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">Unique IPs</p>
                        <p class="mt-2 text-3xl font-bold text-gray-800 dark:text-white/90"><?php echo e(number_format($uniqueIps)); ?></p>
                    </div>
                    <div class="rounded-lg border border-gray-100 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-800/30">
                        <p class="text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-400">Today Visits</p>
                        <p class="mt-2 text-3xl font-bold text-gray-800 dark:text-white/90"><?php echo e(number_format($todayVisits)); ?></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            document.querySelectorAll('.delete-form').forEach(form => {
                form.addEventListener('submit', function (e) {
                    e.preventDefault();

                    Swal.fire({
                        title: 'Clear All Visitor Logs?',
                        text: "All visitor data will be permanently deleted. This action cannot be undone!",
                        icon: 'warning',
                        showCancelButton: true,
                        confirmButtonColor: '#ef4444',
                        cancelButtonColor: '#6b7280',
                        confirmButtonText: 'Yes, clear all!',
                        width: '380px',
                        padding: '1.25em',
                        customClass: {
                            title: 'text-lg font-semibold',
                            htmlContainer: 'text-sm',
                            actions: 'text-sm'
                        }
                    }).then((result) => {
                        if (result.isConfirmed) {
                            form.submit();
                        }
                    });
                });
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\dynaweb4\reddsis-dev\resources\views/backend/module/visitor/index.blade.php ENDPATH**/ ?>