
<?php $__env->startSection('content'); ?>
    <div class="pagetitle">
        <h1>Dashboard</h1>
        <nav>
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item">Dashboard</li>
                <li class="breadcrumb-item active"><?php echo e($PageTitle); ?></li>
            </ol>
        </nav>
    </div><!-- End Page Title -->

    <section class="section dashboard">

        <div class="row">
            <div class="col-lg-12">

                <div class="card">
                    <div class="card-body mt-3">
                        <a href="<?php echo e(route('admin.product.create')); ?>"><button type="button" class="btn btn-primary mb-5">Add
                                Product</button></a>
                        <!-- Table with stripped rows -->
                        <table class="table datatable mt-3">
                            <thead>
                                <tr>
                                    <th scope="col">#</th>
                                    <th scope="col">Name</th>
                                    <th scope="col">Price</th>
                                    <th scope="col">Stock</th>
                                    <th scope="col">Status</th>
                                    <th scope="col">Product Code</th>
                                    <th scope="col">Total Sell</th>
                                    <th scope="col">Product Variants</th>
                                    <th scope="col">Image</th>
                                    <th scope="col">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <th scope="row"><?php echo e($loop->iteration); ?></th>
                                    <td><?php echo e($product->name); ?></td>
                                    <td><?php echo e($product->price); ?></td>
                                    <td><?php echo e($product->stock); ?></td>
                                    <td><?php echo e($product->status); ?></td>
                                    <td><?php echo e($product->product_code); ?></td>
                                    <td><?php echo e($product->sold_count); ?></td>
                                    <td>
                                        <?php $__currentLoopData = $product->variants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div
                                                class="d-flex justify-content-between align-items-center border-bottom my-2">
                                                <p class="p-0 m-0"><?php echo e($item->size); ?></p>
                                                <p class="p-0 m-0"><?php echo e($item->stock); ?></p>
                                            </div>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </td>

                                    <td>
                                        <img src="<?php echo e(asset('storage/' . $product->thumbnail)); ?>" alt=""
                                            width="100" height="100">
                                    </td>
                                    <td>
                                        <a href="<?php echo e(route('admin.product.edit', $product->id)); ?>" class="mr-1"
                                            title="Edit">
                                            <img src="<?php echo e(asset('assets/img/edit.png')); ?>" alt="">
                                        </a>

                                        <a href="#" class="ms-2 deleteItem"
                                            data-formid="delete_row_form_<?php echo e($product->id); ?>">
                                            <img src="<?php echo e(asset('assets/img/trash.png')); ?>" alt="">
                                        </a>
                                        <form action="<?php echo e(route('admin.product.destroy', $product->id)); ?>"
                                            method="post" id="delete_row_form_<?php echo e($product->id); ?>">
                                            <?php echo csrf_field(); ?>
                                            <?php echo e(method_field('DELETE')); ?>

                                            <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                                        </form>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </tbody>
                        </table>
                        <!-- End Table with stripped rows -->

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

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

<?php echo $__env->make('backend.admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/brainbo1/sefcard.com/resources/views/backend/product/index.blade.php ENDPATH**/ ?>