<?php echo $__env->make('admin::layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
use App\Models\Categories;
use App\Models\Supliers;
use App\Models\Brands;
use App\Models\GRNProducts;
use App\Models\GRNS;
?>
<main id="main-container">
        <!-- Hero -->
        <div class="bg-body-light">
          <div class="content content-full">
            <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
              <h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">Product Overview</h1>
              <nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item">Dashboard</li>
                  <li class="breadcrumb-item">Product</li>
                  <li class="breadcrumb-item active" aria-current="page">Product Overview</li>
                </ol>
              </nav>
            </div>
          </div>
        </div>
        <!-- END Hero -->

        <!-- Page Content -->
        <div class="content">
          <!-- Your Block -->
          <div class="block block-rounded">
            <div class="block-header block-header-default">
              <h3 class="block-title">Product Overview</h3>
            </div>
            <div class="block-content">
            <?php if(Session::has('success')): ?> <div class="alert alert-success mt-2 mb-2"><?php echo e(Session::get('success')); ?></div><?php endif; ?>
            <?php if(Session::has('fail')): ?> <div class="alert alert-danger mt-2 mb-2"><?php echo e(Session::get('fail')); ?></div><?php endif; ?>
            <table  id="example" class="custom-datatable-no-export display responsive nowrap" style="width:100%">
                <thead>
                  <tr>
                  <th>Featured Image</th>
                  <th>Product Name</th>
                  <th>Product Code</th>
                  <th>Batchs</th>
                  </tr>
                </thead>
                <tbody>
                <?php foreach($products as $product) {
                $grns = GRNProducts::where('product', $product->id)->get();
                ?>
                  <tr>
                  <td class="fw-semibold">
                  <img src="<?php echo e(asset('db_files/product_images/'.$product->featured_image.'')); ?>"  class="img-avatar img-avatar96 img-avatar-thumb">
                    </td>
                    <td class="fw-semibold">
                    <?php echo e($product->product_name); ?>

                    </td>
                    <td class="fw-semibold">
                    <?php echo e($product->product_code); ?>

                    </td>
                    <td class="fw-semibold">
                    <?php if($grns->isEmpty()){ ?>
                    No batch
                   <?php  } else{ 
                    echo "<ol>";
                    foreach($grns as $grn){
                    ?>
                    <li>Batch - <?php echo e(GRNS::where('id', $grn->grn_id)->value('grn_number')); ?> | Quantity - <?php echo e($grn->quantity); ?></li>
                   <?php }
                    echo "</ol>";
                   } ?>
                    </td>
                  </tr>
                <?php } ?>
                </tbody>
              </table>
            </div>
          </div>
          <!-- END Your Block -->
        </div>
        <!-- END Page Content -->
</main>
<!-- END Main Container -->
<?php echo $__env->make('admin::layouts.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u446954234/domains/orionerp.xyz/public_html/cus118-napaskitchen/Modules/Admin/resources/views/product/product_overview.blade.php ENDPATH**/ ?>