<?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>Add 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="" style="color: white">Back</span>

        </a>

    </div>

</div>

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

              <form action="<?php echo e(route('addproduct.store')); ?>" method="POST" class="form-sample" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>

                <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(old('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(old('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(old('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="number" class="form-control" name="hsn_code" value="<?php echo e(old('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->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->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(old('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(old('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(old('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(old('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(old('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 <span class="text-danger">*</span></label>

                        <input type="file" class="form-control" name="image" id="image">

                        <img id="preview-image-before-upload" height="100" class="mt-2">

                        <span class="text-danger"> <?php $__errorArgs = ['image'];
$__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>

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

              </form>

            </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>

 <script type="text/javascript">

 $(document).ready(function (e) {

    $('#preview-image-before-upload').hide();

    $('#image').change(function(){

     $('#preview-image-before-upload').show();

     let reader = new FileReader();

     reader.onload = (e) => {

       $('#preview-image-before-upload').attr('src', e.target.result);
     }

     reader.readAsDataURL(this.files[0]);

    });

 });

 </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/Company/resources/views/product/create.blade.php ENDPATH**/ ?>