<?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.total_order_count')); ?></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.total_order_count')); ?> </h6>
                        </div>

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

                            </span>
                        </div>
                    </div>
                </div>
                <?php $__currentLoopData = $orders_statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold"><?php echo e($row['status']); ?> </h6>
                            </div>

                            <div class="items">
                            <span class="number text-primary">
                                <?php echo e($row['count']); ?>

                            </span>
                            </div>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                
                <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.products_count')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($products_count) ? $products_count : 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.new_products_count')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($pending_products) ? count($pending_products->where('is_new', 1)) : 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.edit_products_count')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($pending_products) ? count($pending_products->where('is_new', 0)) : 0); ?>

                            </span>
                        </div>
                    </div>
                </div>
                 <div class="col-lg-6"></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.avg_rate')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($rate) ? $rate : 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.rate_count')); ?>  </h6>
                        </div>

                        <div class="items">
                            <span class="number text-primary">
                                <?php echo e(!empty($rate_count) ? $rate_count : 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.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(__('products.category_id')); ?></th>
                                    <th scope="col"><?php echo e(__('products.sub_category_id')); ?></th>
                                    <th scope="col"><?php echo e(__('dashboard.user_order')); ?></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->category?->currentDescription->title); ?></td>
                                    <td><?php echo e($row->subCategory?->currentDescription->title ?? ' - '); ?></td>
                                    <td class="text-center"><?php echo e($row->count ?? '0'); ?></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.user_orders')); ?> </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.user')); ?></th>
                                    <th scope="col"><?php echo e(__('dashboard.user_order')); ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $__currentLoopData = $user_orders; $__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->name); ?></td>
                                        <td class="text-center"><?php echo e($row->count); ?></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("store.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/store_chart.js')); ?>"></script>

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

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