<?php
    use Carbon\Carbon;
?>


<?php $__env->startSection('title', 'Update - Product'); ?>

<?php $__env->startPush('css'); ?>
   <!--select2-->
   <link href="<?php echo e(asset('admin/assets/plugins/select2/css/select2.css')); ?>" rel="stylesheet" type="text/css" />
   <link href="<?php echo e(asset('admin/assets/plugins/select2/css/select2-bootstrap.min.css')); ?>" rel="stylesheet" type="text/css" />


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

<?php $__env->startSection('content'); ?>
    <div class="page-bar">
        <div class="page-title-breadcrumb">

        </div>
    </div>
    <div class="row ">
        <div class="col-md-12 col-sm-12">
            <div class="card card-box">
                <div class="card-head text-white " style="background-color:#3FCC7E;">
                    <header>Update Product</header>
                </div>
                <div class="card-body" id="bar-parent">
                    <form method="post" action="<?php echo e(route('admin.product.update', $product)); ?>">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PATCH'); ?>
                        <div class="row">
                            <div class="col-md-6 col-sm-6">

                                
                                <div class="form-group">
                                    <label for="product_name">Name</label>
                                    <input type="text" name="product_name" class="form-control" id="product_name" value="<?php echo e($product->product_name); ?>">
                                </div>

                                
                                <div class="form-group">
                                    <label>Select SubCategory</label>
                                    <select name="sub_category" class="form-control  select2 " >
                                        <?php $__currentLoopData = $subCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subCategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option
                                            <?php echo e($product->subcategory_id === $subCategory->id ? 'selected':''); ?>

                                            value="<?php echo e($subCategory->id); ?>"><?php echo e($subCategory->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                                
                                <div class="form-group">
                                    <label>Select Company</label>
                                    <select name="company_id" class="form-control  select2 " >
                                        <?php $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option
                                                <?php echo e($product->comapny_id === $company->id ? 'selected':''); ?>

                                                value="<?php echo e($company->id); ?>"><?php echo e($company->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>

                                
                                <div class="form-group">
                                    <label for="sku">S.K.U</label>
                                    <input type="text" name="sku" class="form-control" id="sku" value="<?php echo e($product->sku); ?>">
                                </div>

                                
                                <div class="form-group">
                                    <label for="barcode">Generate Barcode</label>
                                    <input id="barcode" type="text" name="barcode" class="form-control" id="simpleFormEmail" value="<?php echo e($product->barcode); ?>" >
                                </div>

                            </div>


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

                                
                                <div class="form-group">
                                    <label for="unit_id">Base Unit ID</label>
                                    <input type="text" name="unit_id" class="form-control" id="unit_id" value="<?php echo e($product->base_unit_id); ?>">
                                </div>


                                
                                <div class="form-group">
                                    <label for="size">Size</label>
                                    <input type="text" name="size" class="form-control" id="size" placeholder="Enter alternativee phone number" value="<?php echo e($product->size); ?>">
                                </div>


                                
                                <div class="form-group">
                                    <label for="description">Description</label>
                                    <textarea name="description" id="description" class="form-control"><?php echo e($product->description); ?></textarea>
                                </div>



                            </div>
                        </div>

                        

                        

                        <a class="btn deepPink-bgcolor m-t-15 waves-effect" href="<?php echo e(route('admin.product.index')); ?>">BACK</a>
                        <button type="submit" class="btn btn-success m-t-15 waves-effect">UPDATE</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
    <!--select2-->
    <script src="<?php echo e(asset('admin/assets/plugins/select2/js/select2.js')); ?>" ></script>
    <script src="<?php echo e(asset('admin/assets/js/pages/select2/select2-init.js')); ?>" ></script>

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

<?php echo $__env->make('template.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/forazitradersbd/public_html/resources/views/admin/product/edit.blade.php ENDPATH**/ ?>