

<?php
$selLang = \App\Language::where('code', request()->input('language'))->first();
?>
<?php if(!empty($selLang) && $selLang->rtl == 1): ?>
<?php $__env->startSection('styles'); ?>
<style>
    form:not(.modal-form) input,
    form:not(.modal-form) textarea,
    form:not(.modal-form) select,
    select[name='language'] {
        direction: rtl;
    }
    form:not(.modal-form) .note-editor.note-frame .note-editing-area .note-editable {
        direction: rtl;
        text-align: right;
    }
</style>
<?php $__env->stopSection(); ?>
<?php endif; ?>

<?php $__env->startSection('content'); ?>
  <div class="page-header">
    <h4 class="page-title">Products</h4>
    <ul class="breadcrumbs">
      <li class="nav-home">
        <a href="<?php echo e(route('admin.dashboard')); ?>">
          <i class="flaticon-home"></i>
        </a>
      </li>
      <li class="separator">
        <i class="flaticon-right-arrow"></i>
      </li>
      <li class="nav-item">
        <a href="#">Shop Management</a>
      </li>
      <li class="separator">
        <i class="flaticon-right-arrow"></i>
      </li>
      <li class="nav-item">
        <a href="#">Manage Products</a>
      </li>
      <li class="separator">
        <i class="flaticon-right-arrow"></i>
      </li>
      <li class="nav-item">
        <a href="#">Products</a>
      </li>
    </ul>
  </div>
  <div class="row">
    <div class="col-md-12">

      <div class="card">
        <div class="card-header">
            <div class="row">
                <div class="col-lg-4">
                    <div class="card-title d-inline-block">Products</div>
                </div>
                <div class="col-lg-3">
                    <?php if(!empty($langs)): ?>
                        <select name="language" class="form-control" onchange="window.location='<?php echo e(url()->current() . '?language='); ?>'+this.value">
                            <option value="" selected disabled>Select a Language</option>
                            <?php $__currentLoopData = $langs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($lang->code); ?>" <?php echo e($lang->code == request()->input('language') ? 'selected' : ''); ?>><?php echo e($lang->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    <?php endif; ?>
                </div>
                <div class="col-lg-4 offset-lg-1 mt-2 mt-lg-0">
                    <a href="<?php echo e(route('admin.product.type')); ?>" class="btn btn-primary float-right btn-sm"><i class="fas fa-plus"></i> Add Product</a>
                    <button class="btn btn-danger float-right btn-sm mr-2 d-none bulk-delete" data-href="<?php echo e(route('admin.product.bulk.delete')); ?>"><i class="flaticon-interface-5"></i> Delete</button>
                </div>
            </div>
        </div>
        <div class="card-body">
          <div class="row">
            <div class="col-lg-12">
              <?php if(count($products) == 0): ?>
                <h3 class="text-center">NO Products FOUND</h3>
              <?php else: ?>
                <div class="table-responsive">
                  <table class="table table-striped mt-3" id="basic-datatables">
                    <thead>
                      <tr>
                        <th scope="col">
                            <input type="checkbox" class="bulk-check" data-val="all">
                        </th>
                        <th scope="col">Title</th>
                        <?php if($bex->catalog_mode == 0): ?>
                            <th>Price (<?php echo e($bex->base_currency_text); ?>)</th>
                        <?php endif; ?>
                        <th scope="col">Type</th>
                        <th scope="col">Category</th>
                        <?php if($be->theme_version == 'ecommerce'): ?>
                            <th>Featured</th>
                        <?php endif; ?>
                        <th scope="col">Actions</th>
                      </tr>
                    </thead>
                    <tbody>
                      <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                          <td>
                            <input type="checkbox" class="bulk-check" data-val="<?php echo e($product->id); ?>">
                          </td>
                          <td>
                              <?php echo e(strlen($product->title) > 30 ? mb_substr($product->title,0,30,'utf-8') . '...' : $product->title); ?>

                          </td>
                            <?php if($bex->catalog_mode == 0): ?>
                                <td><?php echo e($product->current_price); ?></td>
                            <?php endif; ?>
                          <td class="text-capitalize"><?php echo e($product->type); ?></td>
                          <td>
                            <?php if(!empty($product->category)): ?>
                            <?php echo e(convertUtf8($product->category ? $product->category->name : '')); ?>

                            <?php endif; ?>
                          </td>

                          <?php if($be->theme_version == 'ecommerce'): ?>
                          <td>
                            <form class="d-inline-block" action="<?php echo e(route('admin.product.feature')); ?>" id="featureForm<?php echo e($product->id); ?>" method="POST">
                              <?php echo csrf_field(); ?>
                              <input type="hidden" name="product_id" value="<?php echo e($product->id); ?>">
                              <select name="is_feature" id="" class="form-control form-control-sm 
                              <?php if($product->is_feature == 1): ?>
                              bg-success
                              <?php else: ?>
                              bg-danger
                              <?php endif; ?>
                              " onchange="document.getElementById('featureForm<?php echo e($product->id); ?>').submit();">
                                <option value="1" <?php echo e($product->is_feature == 1 ? 'selected' : ''); ?>>Yes</option>
                                <option value="0"  <?php echo e($product->is_feature == 0 ? 'selected' : ''); ?>>No</option>
                              </select>
                            </form>
                          </td>
                          <?php endif; ?>

                          <td>
                            <a class="btn btn-secondary btn-sm" href="<?php echo e(route('admin.product.edit', $product->id) . '?language=' . request()->input('language')); ?>">
                            <span class="btn-label">
                              <i class="fas fa-edit"></i>
                            </span>
                            </a>
                            <form class="deleteform d-inline-block" action="<?php echo e(route('admin.product.delete')); ?>" method="post">
                              <?php echo csrf_field(); ?>
                              <input type="hidden" name="product_id" value="<?php echo e($product->id); ?>">
                              <button type="submit" class="btn btn-danger btn-sm deletebtn">
                                <span class="btn-label">
                                  <i class="fas fa-trash"></i>
                                </span>
                              </button>
                            </form>
                          </td>
                        </tr>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                  </table>
                </div>
              <?php endif; ?>
            </div>
          </div>
        </div>

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

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


<?php echo $__env->make('admin.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp\htdocs\plusagency\without-license\plusagency-3.2\core\resources\views/admin/product/index.blade.php ENDPATH**/ ?>