<?php $__env->startSection('styles'); ?>

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



<?php $__env->startSection('content'); ?>

<!-- ============================================================== -->

<!-- Start right Content here -->

<!-- ============================================================== -->


<div class="content-page">

    <!-- Start content -->

    <div class="content">

        <div class="container-fluid">

          <div class="row">

              <div class="col-sm-12">

                  <div class="page-title-box">

                      <div class="row align-items-center">

                          <div class="col-md-8">

                              <h4 class="page-title mb-0">Products</h4>

                              <ol class="breadcrumb m-0">

                                  <li class="breadcrumb-item"><a href="#">Dashboard</a></li>

                                  <li class="breadcrumb-item active" aria-current="page">Products</li>

                              </ol>

                          </div>

                          <div class="col-md-4">

                              <div class="float-right d-none d-md-block">

                                  <div class="dropdown">





                                  </div>

                              </div>

                          </div>

                      </div>



                  </div>

              </div>

          </div>

          <!-- end row -->

            <div class="row">

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

                    <div class="card">

                        <div class="card-body">
  <form method="post" action="<?php echo e(route('admin.editproducts')); ?>" enctype="multipart/form-data">
                          <div class="row">
                            <div class="col-md-12">
                              <label>Name</label>
                              <input type="text" name="name" required class="form-control" value="<?php echo e($product->name); ?>"/>
                              <input type="hidden" name="product_id" required class="form-control" value="<?php echo e($product->id); ?>"/>
                            </div>

                            <div class="col-md-12">
                              <label>Brand</label>
                              <select class="form-control" required name="brand_id">
                                <?php $__currentLoopData = $brands; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                  <option value="<?php echo e($b->id); ?>" <?php if($product->brand_id == $b->id): ?> selected <?php endif; ?>><?php echo e($b->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              </select>
                            </div>
                            <div class="col-md-12">
                              <label>Menu</label>
                              <select class="form-control" required name="menu_id">
                                <?php $__currentLoopData = $submenus; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                  <option value="<?php echo e($m->id); ?>" <?php if($product->submenu && $product->menu): ?> <?php if($product->submenu_id == $m->id): ?> selected <?php endif; ?> <?php endif; ?>> <?php if($m->menu): ?> <?php echo e($m->menu->name); ?>  ==> <?php echo e($m->name); ?> <?php endif; ?></option>

                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                              </select>
                            </div>


                            <div class="col-md-12">
                              <label>Actual Price</label>
                              <input type="number" name="actual_price" required class="form-control" value="<?php echo e($product->actual_price); ?>"/>
                            </div>


                            <div class="col-md-12">
                              <label>Sale %</label>
                              <input type="number" name="sale" required class="form-control" value="<?php echo e($product->sale); ?>"/>
                            </div>

                            <div class="col-md-12">
                              <label>Price</label>
                              <input type="number" name="price" required class="form-control" value="<?php echo e($product->price); ?>"/>
                            </div>



                            <div class="col-md-12">
                              <label>Details</label>
                              <input type="text" name="details" required class="form-control" value="<?php echo e($product->details); ?>"/>
                            </div>

                            <div class="col-md-12">
                              <label>Description</label>
                              <textarea type="text" name="description" required class="form-control"> <?php echo e($product->description); ?></textarea>
                            </div>


                            <div class="col-md-12">
                              <label>Image 1 (leave empty if not change)</label>
                              <input type="file" name="image1"  class="form-control"/>
                            </div>

                            <div class="col-md-12">
                              <label>Image 2 (leave empty if not change)</label>
                              <input type="file" name="image2"  class="form-control"/>
                            </div>

                            <div class="col-md-12">
                              <label>Image 3 (leave empty if not change)</label>
                              <input type="file" name="image3"  class="form-control"/>
                            </div>

                            <div class="col-md-12">
                              <label>Image 4 (leave empty if not change)</label>
                              <input type="file" name="image4"  class="form-control"/>
                            </div>


                            <div class="col-md-12">
                              <label>In Stock</label>
                              <select class="form-control" required name="stock">
                                  <option value="1" <?php if($product->stock == 1): ?> selected <?php endif; ?>>Yes</option>
                                  <option value="0"  <?php if($product->stock ==0): ?> selected <?php endif; ?>>No</option>
                              </select>
                            </div>

                            <div class="col-md-12">

                              <button type="submit" class="btn btn-primary">Save changes</button>
                            </div>
                            <?php echo e(csrf_field()); ?>

                            </form>

                          </div>

                        </div>

                    </div>

                </div>

            </div>

            <!-- end row -->


        </div> <!-- container-fluid -->



    </div> <!-- content -->



    <footer class="footer">

        © 2020 - 2021  Mommy Kloset

    </footer>

</div>





<!-- ============================================================== -->

<!-- End Right content here -->

<!-- ============================================================== -->

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



<?php $__env->startSection('scripts'); ?>


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

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\freelance\mommy\resources\views/admin/showproducts.blade.php ENDPATH**/ ?>