<?php $__env->startSection('content'); ?>
    <div class="home_boxes w-100">
            <div class="row">
                <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5>عدد الأخبار </h5>
                            <h2><?php echo e($products); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/mobile-marketing-animate.svg')); ?>" alt="">
                            
                        </div>
                    </a>
                </div>
                <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5>عدد الأقسام </h5>
                            <h2><?php echo e($categories); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/grid-design-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5><?php echo e(__('products.count') .' '.__('products.messages')); ?>   </h5>
                            <h2><?php echo e($contacts); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/new-message-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5><?php echo e(__('products.count') .' '.__('products.comments')); ?>     </h5>
                            <h2><?php echo e($comments); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                  <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5><?php echo e(__('products.count') .' '.__('products.visitors')); ?>   </h5>
                            <h2><?php echo e($visitors); ?></h2>
                        </div>
                        <div class="img">
                           <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                 <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5><?php echo e(__('products.count') .' '.__('products.users')); ?>   </h5>
                            <h2><?php echo e($users); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                <?php if(!is_null($category)): ?>
                 <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5>الأكثر زيارة : <?php echo e(categoryname($category->id)); ?>   </h5>
                            <h2><?php echo e($category->counter); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                <?php endif; ?>
                 <?php if(!is_null($product)): ?>
                <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5>الأكثر زيارة : <?php echo e(productname($product->id)); ?>   </h5>
                            <h2><?php echo e($product->visit_counts); ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                <?php endif; ?>
                 <div class="col-lg-6">
                    <a href="#" class="items">
                        <div class="info">
                            <h5><?php echo e(__('products.download_day') .' '. date('Y-m-d')); ?>   </h5>
                            <h2><?php if(is_null($day)): ?> 0 <?php else: ?> <?php echo e($day->counter); ?> <?php endif; ?></h2>
                        </div>
                        <div class="img">
                            <img src="<?php echo e(asset('/assets/admin/images/status-update-animate.svg')); ?>" alt="">
                        </div>
                    </a>
                </div>
                
                
                
                
                
            </div>
        </div>
<div class="col-lg-12"> <br><br>
        <h5 class="text-uppercase font-weight-bold">الأقسام</h5>
        <div class="new-users border-item">
   
        <table class="table table-bordered table-hover" style="text-align:center">
            <thead>
                <th>#</th>
                <th><?php echo e(__('products.category')); ?></th>
                <th>عدد الأخبار</th>
            </thead>
            
            <tbody  >
                <?php $__currentLoopData = $allCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr data-target="#exampleModal" data-toggle="modal">
                <td><?php echo e($key+1); ?></td>
                <td><?php echo e(categoryname($row->id)); ?></td>
                <td><?php echo e(categorynews($row->id)); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
            </tbody>
        </table>
    </div>
    </div>
<!--<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-6 mb-3">-->
    <!--    <div class="new-users border-item">-->
            

    <!--        <div class="items">-->
    <!--            <span class="number text-primary">-->
    <!--                <?php echo e($products); ?>-->
    <!--            </span>-->
    <!--            <div class="progress-item">-->
    <!--                <p class="info"> <?php echo e(__('products.product')); ?> </p>-->
                   
    <!--            </div>-->
    <!--        </div>-->
    <!--    </div>-->
    <!--</div>-->
    <!--<div class="col-lg-6 mb-3">-->
    <!--    <div class="new-users border-item">-->
            

    <!--        <div class="items">-->
    <!--            <span class="number text-primary">-->
    <!--                <?php echo e($categories); ?>-->
    <!--            </span>-->
    <!--            <div class="progress-item">-->
    <!--                <p class="info"> <?php echo e(__('categories.category')); ?> </p>-->
                   
    <!--            </div>-->
    <!--        </div>-->
    <!--    </div>-->
    <!--</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/app3alriyadh/public_html/resources/views/admin/index.blade.php ENDPATH**/ ?>