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

    <div class="dashbord_home">
        <div class="row">

            <div class="row col-12  mb-5">
                <div class="col-12">
                    <div class="row">
                        <div class="col-lg-8">
                            <h5 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.all_visits')); ?></h5>
                        </div>
                        <div class="col-lg-4">
                            <select name="state_year" id="state_year" class="state_year form-control">
                                <?php for($i = date('Y'); $i >= 2024; $i--): ?>
                                    <option value="<?php echo e($i); ?>"> <?php echo e($i); ?> </option>
                                <?php endfor; ?>
                            </select>
                        </div>
                    </div>
                    <br />
                    <canvas class="border-item lineChart" width="400" height="150"></canvas>
                </div>
            </div>

            <div class="row col-12  mb-5">
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.website_visits')); ?></h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e($allUsersCounts); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.visits_this_year')); ?> (<?php echo e(date('Y')); ?>)</h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e($yearUsers); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"> <?php echo e(__('dashboard.month_visits')); ?> (<?php echo e(__('web.'.date('F'))); ?>) </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e($monthUsers); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.day_visits')); ?> (<?php echo e(__('web.'.date('l'))); ?>) </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($dayUsers) ? $dayUsers : 0); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.now_visits')); ?> </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($nowUsersCounts) ? $nowUsersCounts : 0); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.count_members')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($members) ? $members : 0); ?>

                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.orders_total')); ?> </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($orders) ? $orders : 0); ?>

                            </span>
                        </div>
                    </div>
                </div>

                <div class="col-lg-12">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.categories_visits')); ?> </h6>
                        </div>
                        <div class="items">
                            <table class="table justify-content-center table-striped">
                                <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col"><?php echo e(__('dashboard.category')); ?></th>
                                    <th scope="col"><?php echo e(__('dashboard.visits')); ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $__currentLoopData = $categories_visits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th scope="row"><?php echo e($key+1); ?></th>
                                    <td><?php echo e($row->currentDescription->title); ?></td>
                                    <td><?php echo e($row->visits); ?></td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.categories_total')); ?> </h6>
                        </div>
                        <div class="items">
                            <table class="table justify-content-center table-striped">
                                <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col"><?php echo e(__('dashboard.category')); ?></th>
                                    <th scope="col"><?php echo e(__('dashboard.total')); ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th scope="row"><?php echo e($key+1); ?></th>
                                    <td><?php echo e($row->currentDescription->title); ?></td>
                                    <td><?php echo e($row->count ?? '0'); ?> <?php echo e(__('web.sar')); ?></td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="col-lg-12">
                    <div class="new-users border-item">
                        <div class="datatitle">
                            <h6 class="text-uppercase font-weight-bold"><?php echo e(__('dashboard.products_total')); ?> </h6>
                        </div>
                        <div class="items">
                            <table class="table justify-content-center table-striped">
                                <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col"><?php echo e(__('dashboard.product')); ?></th>
                                    <th scope="col"><?php echo e(__('dashboard.total')); ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th scope="row"><?php echo e($key+1); ?></th>
                                    <td><?php echo e($row->currentDescription->title); ?></td>
                                    <td><?php echo e($row->count ?? '0'); ?> <?php echo e(__('web.sar')); ?></td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>


            </div>

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

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

<script>
    const state_route= '<?php echo e(route("dashboard.stats")); ?>'
</script>
<script src="<?php echo e(asset('assets/admin/js/lib/Chart.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/admin/js/charts.js')); ?>"></script>

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

<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/modern/resources/views/admin/index.blade.php ENDPATH**/ ?>