<?php echo $__env->make('admin::layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php
use App\Models\Categories;
?>
<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">Select Web Categories</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">Select Web Categories</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">Select Web Categories</h3>
            </div>
            
            <div class="block-content">
            <form action="" method="POST" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
             <?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 class="table table-bordered table-striped table-vcenter js-dataTable-buttons">
                <thead>
                  <tr>
                  <th>Parent Category</th>
                  <th>Category Name</th>
                  <th>Select</th>
                  </tr>
                </thead>
                <tbody>
                <?php foreach($categories as $category) {
                    if($category->is_web == "yes"){
                        $check = "checked";
                    }
                    else{
                        $check = "";
                    }
                ?>
                  <tr>
                    <td class="fw-semibold">
                    <?php if($category->parent_category == "none") { ?>
                      None
                    <?php } else { ?>
                    <?php echo e(Categories::where('id', $category->parent_category)->value('category_name')); ?>

                    <?php } ?>
                    </td>
                    <td class="fw-semibold">
                    <?php echo e($category->category_name); ?>

                    </td>
                    <td class="fw-semibold">
                    <div class="form-check">
                          <input class="form-check-input" type="checkbox" value="<?php echo e($category->id); ?>" id="example-checkbox-default1" name="check_category[]" <?php echo e($check); ?>>
                    </div>
                    </td>
                  </tr>
                <?php } ?>
                </tbody>
              </table>
               <button type="submit" class="btn btn-success mt-4">Save Selected</button>
               </form>
            </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 /var/www/erpadmin_fer_usr/data/www/erpadmin.ferolis.com/Modules/Admin/resources/views/product/select_web_categories.blade.php ENDPATH**/ ?>