<style>
    .form-inputs.f-adj .form-group {
        display: flex;
        flex-direction: column;
    }
    .form-inputs.f-adj .form-group label.error {
        order: 2;
    }
</style>

<?php $__env->startSection('content'); ?>
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6><?php echo e($title); ?></h6>
                </div>
            </div>
            <input type="hidden" id="token_medd" name="_tokens" value="<?php echo e(csrf_token()); ?>">


            <form method="POST" id="saveManufactureproducts" action="<?php echo e(url('/saveManufactureproducts')); ?>"
                enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="dashboard-cnts">
                    <div class="bid-stats bidplace">
                        <div class="row">

                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                    <div class="form-group">
                                        <label class="label">Manufacturer<sup>*</sup></label>
                                        <select id="manufacturer"
                                            class="form-control invoiceselect changemanufacture"
                                            id="manufacturer" name="manufacturer" >
                                            <option value="">Select</option>
                                            <?php $__currentLoopData = $dealers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dealer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                               
                                                   
                                                        <option value="<?php echo e($dealer->id); ?>">
                                                            <?php echo e(ucfirst($dealer->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 f-adj">
                                    <div class="form-group">
                                        <label class="label">Category<sup>*</sup></label>
                                        <select id="category_id" class="form-control invoiceselect" id="category_id"
                                            name="category_id"
                                            autocomplete="category_id" autofocus>
                                            <option value="">Select</option>
                                           

                                            
                                            
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs f-adj">
                                    <div class="form-group">
                                        <label class="label">Master Products<sup>*</sup></label>
                                        <select id="master_product"
                                            class="form-control invoiceselect"
                                            id="master_product" name="master_product"  >
                                            <option value="">Select</option>
                                        </select>
                                    </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 class="label">Product Description<sup>*</sup></label>
                                        <textarea rows='5' id="product_description" name="product_description" readonly></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs f-adj">
                                    <div class="form-group">
                                        <label class="label">Product Names<sup>*</sup></label>
                                        <select id="manu_products"
                                            class="form-control invoiceselect"
                                            id="manu_products" name="manu_products">
                                           
                                        </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 class="label">Product Code<sup>*</sup></label>
                                        <input type="text" class="form-control" id="product_code" name="product_code"
                                            value="" readonly>
                                    </div>
                                </div>
                            </div>
                           <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12 product-details-vew"  id="links">
                               
                            </div>
                             
                         
                         
                        </div>
                        <input type="hidden" name="resultvalue" id="resultvalue" value="">
                        <div class="row" style="padding-top: 20px;">
                            <div class="col-12">
                                <div class="green-button green-button2 d-flex justify-content-center">
                                    <button id="create">Submit</button>
                                </div>
                            </div>
                        </div>
                    </div>
            </form>
        </div>
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('scripts'); ?>    
    <script src="<?php echo e(url('assets/js/common.js')); ?>"></script>
    <script>

    $('#category_id').on('change', function() {
        $(".pageloader").show();
        var catid = this.value;

        if(catid!=''){

        var APP_URL = <?php echo json_encode(url('/getproducts')); ?>;
        var saveData = $.ajax({
            type: 'GET',
            url: APP_URL + '/' + catid,
            data: {
                catid: catid,
                manu_id:$("#manufacturer").val(),
                _token: '<?php echo e(csrf_token()); ?>',

            },
            dataType: "text",
            success: function(resultData) {
                $("#master_product").html(resultData);
                $(".pageloader").hide();
            }
        });
    }
    else{
        $(".pageloader").hide();
    }
    });

    </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/vendor_addproducts.blade.php ENDPATH**/ ?>