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


<div class="row">
    <?php for($i = 1; $i < 13 ; $i++): ?>
        <?php if(array_key_exists($i, $monthVisitCounts)): ?>
            <?php continue; ?>
        <?php endif; ?>
        <?php $monthVisitCounts[$i] = 0; ?>
    <?php endfor; ?>

    <?php ksort($monthVisitCounts); ?>



    <?php $__currentLoopData = $monthVisitCounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $month => $count): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <input type="hidden" name="<?php echo e($month); ?>" value="<?php echo e($count); ?>" class="monthVisitCounts">
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>



    <!-- ------------ line chart ------------- -->
    <input type="hidden" value="<?php echo e($allVisitorCounts); ?>" class="allVisitorCounts">
    <div class="col-lg-12">
        <h5 class="text-uppercase font-weight-bold">Site views this year</h5>
        <canvas class="border-item lineChart" width="400" height="150"></canvas>
    </div>














 <div class="col-lg-12">
<section class="general-report mt-5">
    <div class="row">                


        <div class="col-lg-4">
            <div class="items">
                <div class="top mb-3">
                    <span class="icon alert alert-warning m-0">
                        <i class="fas fa-chart-line"></i>
                    </span>
                    
                </div>

                <div class="bottom">
                    <div>
                        <p><?php echo e(__('dashboard.year_count')); ?></p>
                        <h2 class="counter mb-0 mt-1 fnt_rpt"><?php echo e($allVisitorCounts); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="items">
                <div class="top mb-3">
                    <span class="icon alert alert-warning m-0">
                      <i class="fas fa-chart-bar"></i>
                    </span>
                    
                </div>

                <div class="bottom">
                    <div>
                        <p><?php echo e(__('dashboard.month_count')); ?></p>
                        <h2 class="counter mb-0 mt-1 fnt_rpt"><?php echo e($monthWebsiteVisitors); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="items">
                <div class="top mb-3">
                    <span class="icon alert alert-warning m-0">
                        <i class="far fa-chart-bar"></i>
                    </span>
                    
                </div>

                <div class="bottom">
                    <div>
                        <p><?php echo e(__('dashboard.week_count')); ?></p>
                        <h2 class="counter mb-0 mt-1 fnt_rpt"><?php echo e($weekVisitorCounts); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="items">
                <div class="top mb-3">
                    <span class="icon alert alert-warning m-0">
                        <i class="fas fa-chart-area"></i>
                    </span>
                    
                </div>

                <div class="bottom">
                    <div>
                        <p><?php echo e(__('dashboard.day_count')); ?></p>
                        <h2 class="counter mb-0 mt-1 fnt_rpt"><?php echo e($dayVisitCounts); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="col-lg-4">
            <div class="items">
                <div class="top mb-3">
                    <span class="icon alert alert-warning m-0">
                        <i class="fas fa-users"></i>
                    </span>
                    
                </div>
                <div class="bottom">
                    <div>
                        <p><?php echo e(__('dashboard.current_count')); ?></p>
                        <h2 class="counter mb-0 mt-1 fnt_rpt"><?php echo e($active); ?></h2>
                    </div>
                </div>
            </div>
        </div>
         
    </div>
</section>
</div>
    

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

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

<script src="<?php echo e(asset('assets/admin/js/lib/Chart.min.js')); ?>"></script>
<script>
    $(document).ready(function () {
        let months = [],
            month_visits = [],
            allVisitorCounts = $('.allVisitorCounts').val(),
            ChartHtml = $('.lineChart').html('2d');

        $('.monthVisitCounts').each(function () {
            months.push($(this).attr('name'));
            month_visits.push($(this).val());
        });

        month_visits.push(allVisitorCounts);

        new Chart(ChartHtml, {
            type: 'line',
            data: {
                labels: months,
                datasets: [{
                    label: ' people',
                    data: month_visits,
                    backgroundColor: [
                        'rgba(255, 99, 132, 0.2)',
                        'rgba(54, 162, 235, 0.2)',
                        'rgba(255, 206, 86, 0.2)',
                        'rgba(75, 192, 192, 0.2)',
                        'rgba(153, 102, 255, 0.2)',
                        'rgba(255, 159, 64, 0.2)'
                    ],
                    borderColor: [
                        'rgba(255, 99, 132, 1)',
                        'rgba(54, 162, 235, 1)',
                        'rgba(255, 206, 86, 1)',
                        'rgba(75, 192, 192, 1)',
                        'rgba(153, 102, 255, 1)',
                        'rgba(255, 159, 64, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                }
            }
        });
    })
</script>
















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

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