<?php $__env->startSection('content'); ?>
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6>Edit Products</h6>
                </div>
            </div>
            <form method="POST" id="add_vendor_product" action="<?php echo e(url('vendors/updatevendorproducts')); ?>"
                enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="dashboard-cnts boxings">
                    <div class="bid-stats bidplace" style="    padding: 0;">
                        <div class="row">
                            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Category</label>
                                        <select id="category_id" class="form-control invoiceselect1" id="sel1"
                                            name="category_id" value="<?php echo e(old('category_id')); ?>" required
                                            autocomplete="category_id" autofocus>
                                            <option value="">Select</option>
                                            <?php $__currentLoopData = $category_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($category->category_id); ?>"
                                                    <?php if($get_product->category == $category->category_id){ ?>Selected<?php } ?>><?php echo e($category->category); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Master Products</label>
                                        <select id="master_product" class="form-control invoiceselect" id="sel1"
                                            name="master_product" value="<?php echo e(old('master_product')); ?>" required
                                            autocomplete="master_product" autofocus>
                                            <option value="">Select</option>
                                            <?php $__currentLoopData = $product_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $products): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($products->product_id); ?>"
                                                    <?php if($get_product->master_product_id == $products->product_id){ ?>Selected<?php } ?>>
                                                    <?php echo e($products->product_name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Name</label>
                                        <input type="text" class="form-control" name="product_name"
                                            value="<?php echo e($get_product->product_name); ?>" required>
                                        <input type="hidden" class="form-control" name="product_id"
                                            value="<?php echo e($get_product->product_id); ?>" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Code</label>
                                        <input type="text" class="form-control" id="product_code" name="product_code"
                                            value="<?php echo e($get_product->product_code); ?>" required>
                                        <input type="hidden" class="form-control" id="product_id" name="product_id"
                                            value="<?php echo e($get_product->product_id); ?>" required>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-12 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group rs-form-group">
                                        <label>Product Description</label>
                                        <textarea rows='5' id="product_description" name="product_description" required><?php echo e($get_product->product_description); ?></textarea>
                                    </div>
                                </div>
                            </div>
                            <?php if(Auth::user()->user_type == '2'): ?>
                                <div class="col-lg-12 col-md-6 col-sm-12 col-xs-12">
                                    <div class="form-inputs">
                                        <div class="form-group">
                                            <label>Manufacturer</label>
                                            <select id="manufacturer" class="form-control invoiceselect" id="sel1"
                                                name="manufacturer" value="<?php echo e(old('manufacturer')); ?>" required
                                                autocomplete="manufacturer" autofocus>
                                                <option value="">Select</option>
                                                <?php $__currentLoopData = $dealers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dealer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php $__currentLoopData = $manufacturers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $manufacture): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($manufacture->id == $dealer->manufacture_id): ?>
                                                            <option value="<?php echo e($dealer->manufacture_id); ?>"
                                                                <?php if($dealer->manufacture_id == $get_product->manufacturer){ ?>Selected<?php } ?>>
                                                                <?php echo e($manufacture->name); ?></option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="row row23">
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Image</label>
                                        <div class="custom-file">
                                            <!-- <input type="file" class="custom-file-input" id="customFile" name="productcatalouge">
                                                    <label class="custom-file-label" for="customFile">Browse</label> -->
                                            <div class="dropzone dz-clickable Dz-box happy-box" id="dropzonewidget"
                                                onClick="changePicimage()" style="width: 120px;">
                                                <?php if(!empty($get_product->photo)): ?>
                                                    <img src="<?php echo e(url('product_files')); ?>/<?php echo e($get_product->photo); ?>"
                                                        title="Click here to upload" id="uploadimageimage"
                                                        style="border-style: outset;height: 75px;width: 100px;margin-top: 0px;cursor: pointer;">
                                                <?php else: ?>
                                                    <img src="<?php echo e(url('assets/images/upload.png')); ?>"
                                                        title="Click here to upload" id="uploadimageimage"
                                                        style="border: 1px solid #ddd;width: 50px;height: 50px;cursor: pointer;">
                                                <?php endif; ?>
                                                <!-- <img src="<?php echo e(url('assets/images/upload.png')); ?>" title="Click here to upload"  id="uploadimageimage" style="border-style: outset;width: 50px;height: 50px;cursor: pointer;"> -->
                                                <input type="file" name="productimage" id="post_imageimage"
                                                    onchange="readURLimage(this);" style="display:none">
                                                <img id="blahimage" src="#" class="post-imgPrw"
                                                    style="display:none" />
                                                <iframe id="blah1image" class="post-imgPrw" style="display:none"
                                                    src="#">
                                                </iframe>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Catalogue</label>
                                        <div class="custom-file editPage">
                                            <label for="fileInput" class="custom-file">Choose file</label>
                                            <button type="button" class="choosefile chBts"
                                                style="cursor: pointer;">Browse...</button>
                                            <input id="productcatalouge" name="productcatalouge" type="file"
                                                style="display:none" />
                                           
                                            <div class="d-flex catalogue">
                                                 <?php if(!empty($get_product->catalogue)): ?>
                                                <span class="filename"><?php echo e($get_product->catalogue); ?></span>
                                                <?php else: ?>
                                                <span class="filename">No file selected</span>
                                            <?php endif; ?>
                                            <?php if(!empty($get_product->catalogue)): ?>
                                            <div class="custom-file newLeft">
                                                <div class="dropzone dz-clickable Dz-box happy-box">
                                                    <a style="margin: 4px 0px 0;" target="_blank" class="eye"
                                                        href="<?php echo e(url('product_files')); ?>/<?php echo e($get_product->catalogue); ?>"><i
                                                            class="fa fa-eye" aria-hidden="true"></i> View</a>
                                                </div>
                                            </div>
                                            <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label>Product Certificate</label>
                                        <div class="custom-file editPage">
                                            <label for="fileInput" class="custom-file">Choose file</label>
                                            <button type="button" class="chBts choosefilecertificate"
                                                style="cursor: pointer;">Browse...</button>
                                            <input id="productcertificate" name="productcertificate" type="file"
                                                style="display:none" />
                                            
                                            
                                            <div class="d-flex catalogue">
                                            <?php if(!empty($get_product->certificate)): ?>
                                                <span
                                                    class="filename"><?php echo e($get_product->certificate); ?></span>
                                            <?php else: ?>
                                                <span class="filename">No file selected</span>
                                            <?php endif; ?>
                                                 <?php if(!empty($get_product->certificate)): ?>
                                    <div class="custom-file newLeft">
                                        <div class="dropzone dz-clickable Dz-box happy-box">
                                            <a style="margin: 4px 0px 0;"  target="_blank" class="eye"
                                                href="<?php echo e(url('product_files')); ?>/<?php echo e($get_product->certificate); ?>"><i
                                                    class="fa fa-eye" aria-hidden="true"></i> View</a>
                                        </div>
                                    </div>
                                <?php endif; ?>
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                               
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label style="margin-top: 20px;">Performance Report</label>
                                        <div class="custom-file editPage">
                                            <label for="fileInput" class="custom-file">Choose file</label>
                                            <button type="button" class="chBts choosefilereport"
                                                style="cursor: pointer;">Browse...</button>
                                            <input id="productperformancereport" name="productperformancereport"
                                                type="file" style="display:none" />
                                            
                                            
                                            <div class="d-flex catalogue">
                                            <?php if(!empty($get_product->performancereport)): ?>
                                                <span
                                                    class="filename"><?php echo e($get_product->performancereport); ?></span>
                                            <?php else: ?>
                                                <span class="filename">No file selected</span>
                                            <?php endif; ?>
                                                 <?php if(!empty($get_product->performancereport)): ?>
                                                <div class="custom-file newLeft">
                                                    <div class="dropzone dz-clickable Dz-box happy-box">
                                                        <a style="margin: 4px 0px 0;"  target="_blank" class="eye"
                                                            href="<?php echo e(url('product_files')); ?>/<?php echo e($get_product->performancereport); ?>"><i
                                                                class="fa fa-eye" aria-hidden="true"></i> View</a>
                                                    </div>
                                                </div>
                                            <?php endif; ?>
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                               
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label style="margin-top: 20px;">Product Video</label>
                                        <div class="custom-file editPage">
                                            <label for="fileInput" class="custom-file">Choose file</label>
                                            <button type="button" class="chBts choosefileproductvideo"
                                                style="cursor: pointer;">Browse...</button>
                                            <input id="product_video" name="product_video"
                                                type="file" style="display:none" />
                                            
                                            <div class="d-flex catalogue">
                                            <?php if(!empty($get_product->product_video)): ?>
                                                <span
                                                    class="filename"><?php echo e($get_product->product_video); ?></span>
                                            <?php else: ?>
                                                <span class="filename">No file selected</span>
                                            <?php endif; ?>
                                                 <?php if(!empty($get_product->product_video)): ?>
                                                    <div class="custom-file newLeft">
                                                        <div class="dropzone dz-clickable Dz-box happy-box">
                                                            <a  style="margin: 4px 0px 0;" target="_blank" class="eye"
                                                                href="<?php echo e(url('product_files')); ?>/<?php echo e($get_product->product_video); ?>"><i
                                                                    class="fa fa-eye" aria-hidden="true"></i> View</a>
                                                        </div>
                                                    </div>
                                                <?php endif; ?>
                                            </div>   
                                        </div>
                                    </div>
                                </div>
                               
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-12">
                                <div class="green-button green-button2">
                                    <button id="create">Submit</button>
                                </div>
                            </div>
                        </div>
                    </div>
            </form>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(url('dropzone/dist/min/dropzone.min.js')); ?>" type="text/javascript"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
    <script>
        $(function() {
            $(".invoiceselect").select2();
            $(".invoiceselect1").select2();
        });

        function readURL(input) {
            if (input.files && input.files[0]) {
                var file = input.files[0];
                var fileType = file["type"];
                var validImageTypes = ["image/png", "image/jpeg", "image/png"];
                if ($.inArray(fileType, validImageTypes) < 0) {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah1')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                } else {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        }

        function changePic() {
            document.getElementById('post_image').click();
            $('#post_image').change(function() {
                var filename = $('#post_image').val();
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif'];
                var fileExtension1 = ['pptx', 'ppt'];
                if ($.inArray(filename.split('.').pop().toLowerCase(), fileExtension) == -1) {
                    if (filename) {
                        $('#blah').hide();
                        $('#blah1').show();
                        $('#uploadimage').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_image').html(filename);
                } else {
                    if (filename) {
                        $('#blah1').hide();
                        $('#blah').show();
                        $('#uploadimage').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_image').html(filename);
                }
            });
        }
        //aert
        function uploadtrigger() {
            myDropzone.processQueue();
        }
    </script>
    <script>
        function readURLcer(input) {
            if (input.files && input.files[0]) {
                var file = input.files[0];
                var fileType = file["type"];
                var validImageTypes = ["image/png", "image/jpeg", "image/png"];
                if ($.inArray(fileType, validImageTypes) < 0) {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah1cer')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                } else {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blahcer')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        }

        function changePiccer() {
            document.getElementById('post_imagecer').click();
            $('#post_imagecer').change(function() {
                var filename = $('#post_imagecer').val();
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif'];
                if ($.inArray(filename.split('.').pop().toLowerCase(), fileExtension) == -1) {
                    if (filename) {
                        $('#blahcer').hide();
                        $('#blah1cer').show();
                        $('#uploadimagecer').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imagecer').html(filename);
                } else {
                    if (filename) {
                        $('#blah1cer').hide();
                        $('#blahcer').show();
                        $('#uploadimagecer').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imagecer').html(filename);
                }
            });
        }
    </script>
    <script>
        function readURLorder(input) {
            if (input.files && input.files[0]) {
                var file = input.files[0];
                var fileType = file["type"];
                var validImageTypes = ["image/png", "image/jpeg", "image/png"];
                if ($.inArray(fileType, validImageTypes) < 0) {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah1order')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                } else {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blahorder')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        }

        function changePicorder() {
            document.getElementById('post_imageorder').click();
            $('#post_imageorder').change(function() {
                var filename = $('#post_imageorder').val();
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif'];
                if ($.inArray(filename.split('.').pop().toLowerCase(), fileExtension) == -1) {
                    if (filename) {
                        $('#blahorder').hide();
                        $('#blah1order').show();
                        $('#uploadimageorder').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imageorder').html(filename);
                } else {
                    if (filename) {
                        $('#blah1order').hide();
                        $('#blahorder').show();
                        $('#uploadimageorder').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imageorder').html(filename);
                }
            });
        }
    </script>
    <script>
        function readURLreport(input) {
            if (input.files && input.files[0]) {
                var file = input.files[0];
                var fileType = file["type"];
                var validImageTypes = ["image/png", "image/jpeg", "image/png"];
                if ($.inArray(fileType, validImageTypes) < 0) {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah1report')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                } else {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blahreport')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        }

        function changePicreport() {
            document.getElementById('post_imagereport').click();
            $('#post_imagereport').change(function() {
                var filename = $('#post_imagereport').val();
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif'];
                if ($.inArray(filename.split('.').pop().toLowerCase(), fileExtension) == -1) {
                    if (filename) {
                        $('#blahreport').hide();
                        $('#blah1report').show();
                        $('#uploadimagereport').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imagereport').html(filename);
                } else {
                    if (filename) {
                        $('#blah1report').hide();
                        $('#blahreport').show();
                        $('#uploadimagereport').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imagereport').html(filename);
                }
            });
        }
    </script>
    <script>
        function readURLimage(input) {
            if (input.files && input.files[0]) {
                var file = input.files[0];
                var fileType = file["type"];
                var validImageTypes = ["image/png", "image/jpeg", "image/png"];
                if ($.inArray(fileType, validImageTypes) < 0) {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blah1image')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                } else {
                    var reader = new FileReader();
                    reader.onload = function(e) {
                        $('#blahimage')
                            .attr('src', e.target.result)
                    };
                    reader.readAsDataURL(input.files[0]);
                }
            }
        }

        function changePicimage() {
            document.getElementById('post_imageimage').click();
            $('#post_imageimage').change(function() {
                var filename = $('#post_imageimage').val();
                var fileExtension = ['jpeg', 'jpg', 'png', 'gif'];
                if ($.inArray(filename.split('.').pop().toLowerCase(), fileExtension) == -1) {
                    if (filename) {
                        $('#blahimage').hide();
                        $('#blah1image').show();
                        $('#uploadimageimage').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imageimage').html(filename);
                } else {
                    if (filename) {
                        $('#blah1image').hide();
                        $('#blahimage').show();
                        $('#uploadimageimage').hide();
                        $(".invalid-feedback").css("display", "none");
                    }
                    $('#post_imageimage').html(filename);
                }
            });
        }
        $('.choosefile').click(function() {
            $('#productcatalouge').click();
        });
        $('#productcatalouge').change(function(e) {
            var filename = this.files[0].name;
            $('.fileuploadspan').text(filename);
        });
        $('.choosefilecertificate').click(function() {
            $('#productcertificate').click();
        });
        $('#productcertificate').change(function(e) {
            var filename = this.files[0].name;
            $('.fileuploadspancertificate').text(filename);
        });
        $('.choosefilereport').click(function() {
            $('#productperformancereport').click();
        });
        $('#productperformancereport').change(function(e) {
            var filename = this.files[0].name;
            $('.fileuploadspanreport').text(filename);
        });
        $('.choosefileproductvideo').click(function() {
            $('#product_video').click();
        });
        $('#product_video').change(function(e) {
            var filename = this.files[0].name;
            $('.fileuploadspanproductvideo').text(filename);
        });
        $('#vendors').on('change', function() {
            var vendorid = this.value;
            var APP_URL = <?php echo json_encode(url('/getmanufacturers')); ?>;
            var saveData = $.ajax({
                type: 'GET',
                url: APP_URL + '/' + vendorid,
                data: {
                    vendorid: vendorid,
                    _token: '<?php echo e(csrf_token()); ?>'
                },
                dataType: "text",
                success: function(resultData) {
                    $("#manufacturer").html(resultData);
                }
            });
        });
        $('#category_id').on('change', function() {
            var catid = this.value;
            var APP_URL = <?php echo json_encode(url('/getproducts')); ?>;
            var saveData = $.ajax({
                type: 'GET',
                url: APP_URL + '/' + catid,
                data: {
                    catid: catid,
                    _token: '<?php echo e(csrf_token()); ?>'
                },
                dataType: "text",
                success: function(resultData) {
                    $("#master_product").html(resultData);
                }
            });
        });
        $('#master_product').on('change', function() {
            var productid = this.value;
            var APP_URL = <?php echo json_encode(url('/getproductdetails')); ?>;
            var saveData = $.ajax({
                type: 'GET',
                url: APP_URL + '/' + productid,
                data: {
                    productid: productid,
                    _token: '<?php echo e(csrf_token()); ?>'
                },
                dataType: "text",
                success: function(resultData) {
                    var res = JSON.parse(resultData);
                    //console.log(res);
                    $('#product_description').val(res.product_description);
                    //$('#datepicker').val(res.product_warranty);
                    //$("#manufacturer").html(resultData);
                }
            });
        });
    </script>
    <script>
        $("#create").click(function() {
            //alert("bbbb");
            $("#add_vendor_product").validate({
                ignore: [],
                rules: {
                    "master_product": {
                        required: true
                    },
                    "product_name": {
                        required: true
                    },
                    "product_code": {
                        required: true
                    },
                    "product_description": {
                        required: true
                    },
                    "manufacturer": {
                        required: true
                    },
                },
                submitHandler: function(form, e) {
                    $(".pageloader").show();
                    $(".pageloader").delay(5000).fadeOut("slow");
                    form.submit();
                }
            });
        });
        $(function() {
            $('#add_buyer').on('submit', function(event) {
                event.preventDefault();
            });
        });
    </script>
    <script>
        var $disabledResults = $(".js-example-disabled-results");
        $disabledResults.select2();
    </script>
    <script>
        $(document).ready(function() {
            $('#product_code').focusout(function() {
                var product_code = $('#product_code').val();
                if ($('#product_code').val() != "") {
                    var product_code = $('#product_code').val();
                    var product_id = $('#product_id').val();
                    var APP_URL = <?php echo json_encode(url('/checkproductcode')); ?>;
                    var saveData = $.ajax({
                        type: 'GET',
                        url: APP_URL + '/' + product_code + '/' + product_id,
                        data: {
                            product_code: product_code,
                            product_id: product_id,
                            _token: '<?php echo e(csrf_token()); ?>'
                        },
                        dataType: "text",
                        success: function(resultData) {
                            console.log(resultData);
                            var res = JSON.parse(resultData);
                            if (res > '0') {
                                alert('Product code already in use for other Product');
                                $('#product_code').val('');
                            }
                        }
                    });
                }
            });
        });
    </script>
<?php $__env->stopSection(); ?>

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