<?php $__env->startSection('main-container'); ?>
<main id="main" class="main">
<?php echo $__env->make('cdn', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div class="row page-titles mx-0">

    <div class="col-sm-6 p-md-0">

        <div class="breadcrumb-range-picker">

             <h3>Edit Product</h3>

        </div>

    </div>

    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">

         <a href="<?php echo e(route('products')); ?>" class="btns primary-btn ml-4">

            <span class="btn-icon-left" style="color: white">Back</span>

        </a>

    </div>

</div>



<div class="content-wrapper" style="margin-top: 15px">

    <?php echo $__env->make('flash_msg', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <div class="row">

        <div class="col-12">

            <div class="card">

                <div class="card-body">

                        <form action="<?php echo e(route('products.update',$product->id)); ?>" method="POST" enctype="multipart/form-data">
                            <?php echo e(csrf_field()); ?>


                        <!-- Modal body -->
                        <div class="row">
                            <div class="form-group col-lg-6">
                                <label> Product Name <span class="text-danger">*</span></label>
                                   <input type="text" class="form-control" name="name" value="<?php echo e($product->name); ?>" placeholder="Name">
                                <span class="text-danger"> <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>Part No<span class="text-danger">*</span></label>
                                   <input type="text" class="form-control" name="part_no" value="<?php echo e($product->part_no); ?>" placeholder="Part No">
                                <span class="text-danger"> <?php $__errorArgs = ['part_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>Unit <span class="text-danger">*</span></label>
                                   <input type="text" class="form-control" name="unit" value="<?php echo e($product->unit); ?>" placeholder="Unit">
                                <span class="text-danger"> <?php $__errorArgs = ['unit'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>HSN Code<span class="text-danger">*</span></label>
                                <div class="input-group mb-2">
                                    <input type="text" class="form-control" name="hsn_code" value="<?php echo e($product->hsn_code); ?>" placeholder="hsn_code" >
                                </div>
                                <span class="text-danger"> <?php $__errorArgs = ['hsn_code'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>


                            <div class="form-group col-lg-6">
                                <label>Group <span class="text-danger">*</span></label>
                                <select class=" form-control dropdown-toggle" name="group" type="button" data-toggle="dropdown">
                                    <option value="">Select Group</option>
                                     <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                     <option value="<?php echo e($group->id); ?>" <?php echo e($group->id==$product->group?'selected':''); ?>><?php echo e($group->name); ?></option>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <span class="text-danger"><?php $__errorArgs = ['group'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?></span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>Category <span class="text-danger">*</span></label>
                                <select class=" form-control dropdown-toggle" name="category" type="button" data-toggle="dropdown">
                                    <option value="">Select Category</option>
                                     <?php $__currentLoopData = $categies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                     <option value="<?php echo e($category->id); ?>" <?php echo e($category->id==$product->category?'selected':''); ?>><?php echo e($category->name); ?></option>
                                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <span class="text-danger"><?php $__errorArgs = ['category'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?></span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>Stock quatity (optional) <span class="text-danger">*</span></label>
                                <input type="text" class="form-control" name="stock_qty" value="<?php echo e($product->stock_qty); ?>" placeholder="Enter Stock Quatity">
                                <span class="text-danger"> <?php $__errorArgs = ['stock_qty'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>

                            </div>

                            <div class="form-group col-lg-6">
                                <label>MRP <span class="text-danger">*</span></label>
                                   <input type="text" class="form-control" name="sale_price" value="<?php echo e($product->sale_price); ?>" placeholder="Enter MRP">
                                <span class="text-danger"> <?php $__errorArgs = ['sale_price'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>

                            <div class="form-group col-lg-6">

                                <label>Model (optional) <span class="text-danger"></span></label>

                                <input type="text" class="form-control" name="model" value="<?php echo e($product->model); ?>" placeholder="Enter Model Number">

                            </div>

                            <div class="form-group col-lg-6">

                                <label>OEM (optional) <span class="text-danger"></span></label>

                                <input type="text" class="form-control" name="oem" value="<?php echo e($product->oem); ?>" placeholder="Enter MRP">

                            </div>

                            <div class="form-group col-lg-6">
                                <label>Opening Stock (optional) <span class="text-danger">*</span></label>
                                   <input type="text" class="form-control" name="opening_stock" value="<?php echo e($product->opening_stock); ?>" placeholder="Opening Stock">
                                <span class="text-danger"> <?php $__errorArgs = ['opening_stock'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><?php echo e($message); ?><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> </span>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>Image</label>
                                <input type="file" class="form-control" name="image" id="image">
                                <?php if($product->image): ?>
                                <img src="<?php echo e(url('/uploads/product/'.$product->image)); ?>" id="preview-image-before-upload" class="mt-2" height="100">
                                <?php else: ?>
                                <img id="preview-image-before-upload" height="100" class="mt-2">
                                <?php endif; ?>
                            </div>

                        </div>

                        <div class="text-center">

                            <button type="submit" class="btns primary-btn">Submit</button>

                        </div>

                    </form>

                </div>

            </div>

        </div>

    </div>

      </div>
</main><!-- End #main -->
 <?php $__env->stopSection(); ?>

 <script src="//cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script>
 <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>


<?php echo $__env->make('frontend.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vinecork/public_html/webdev/DATA/resources/views/product/edit.blade.php ENDPATH**/ ?>