<link rel="stylesheet" type="text/css" href="<?php echo e(url('dropzone/dist/min/dropzone.min.css')); ?>">
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
<style>              
.img-prew{
width: 100px;
height: 100px;
margin-top: -95px;
border-radius: 50%;
margin-left: -5px;
       }
.post-imgPrw{
height: 75px;
margin-left: 10px;
width: 100px;
margin-top: 0px;
       }   
       

.invalid-feedback {
  display:block;
}
.image img {
    width: 247px;
    height: 271px;
    object-fit: cover;
}
</style>
<?php $__env->startSection('content'); ?>
<div class="common-content">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Add Vendors</h6>
                    </div>
                </div>
                <form method="POST" id="add_vendor" action="<?php echo e(url('admin/createvendor')); ?>"  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>GST/VAT No</label>
                                       <input type="text" id="gst_no" class="form-control <?php $__errorArgs = ['gst_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="gst_no" value="<?php echo e(old('gst_no')); ?>"  autocomplete="gst_no" autofocus>
                                       <?php $__errorArgs = ['gst_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="invalid-feedback" role="alert">
                                        <strong><?php echo e($message); ?></strong>
                                    </span>
                                      <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Email<sup>*</sup></label>
                                        <input type="text" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="email" name="email" value="<?php echo e(old('email')); ?>" required autocomplete="email" autofocus>
                                        <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Name<sup>*</sup></label>
                                        <input type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="name" id="name" value="<?php echo e(old('name')); ?>" required autocomplete="name" autofocus>
                                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Password<sup>*</sup></label>
                                        <input type="text" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="password" name="password" value="<?php echo e(old('password')); ?>" required autocomplete="password" autofocus>
                                        <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Address<sup>*</sup></label>
                                        <input type="text" class="form-control <?php $__errorArgs = ['address'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="address" name="address" value="<?php echo e(old('address')); ?>" required autocomplete="address" autofocus>
                                        <?php $__errorArgs = ['address'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Country<sup>*</sup></label>
                                        <select class="form-control <?php $__errorArgs = ['state'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="country" name="state">
                                        <option>Select</option>
                                        <option value="101">India</option>
                                      </select>
                                        <?php $__errorArgs = ['state'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>State<sup>*</sup></label>
                                        <select class="form-control" id="state" name="city">
                                        <option value="">Select</option>
                                        </select>
                                        <?php $__errorArgs = ['city'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Zipcode<sup>*</sup></label>
                                        <input type="number" class="form-control <?php $__errorArgs = ['zipcode'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="zipcode" name="zipcode" value="<?php echo e(old('zipcode')); ?>" required autocomplete="zipcode" autofocus>
                                        <?php $__errorArgs = ['zipcode'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Phone No<sup>*</sup></label>
                                        <input type="number" class="form-control <?php $__errorArgs = ['phone_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="phone_no" name="phone_no" value="<?php echo e(old('phone_no')); ?>" required autocomplete="phone_no" autofocus>
                                        <?php $__errorArgs = ['phone_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Contact Person Name<sup>*</sup></label>
                                        <input type="text" class="form-control <?php $__errorArgs = ['contact_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="contact_name" name="contact_name" value="<?php echo e(old('contact_name')); ?>" required autocomplete="contact_name" autofocus>
                                        <?php $__errorArgs = ['contact_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Contact Person Phone No<sup>*</sup></label>
                                        <input type="number" class="form-control <?php $__errorArgs = ['contact_phone_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="contact_phone_no" name="contact_phone_no" value="<?php echo e(old('contact_phone_no')); ?>" required autocomplete="contact_phone_no" autofocus>
                                        <?php $__errorArgs = ['contact_phone_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                            <span class="invalid-feedback" role="alert">
                                                <strong><?php echo e($message); ?></strong>
                                            </span>
                                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Vendor Type<sup>*</sup></label>
                                        <select id="vendor_type" class="form-control <?php $__errorArgs = ['vendor_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="sel1" name="vendor_type" value="<?php echo e(old('vendor_type')); ?>" required autocomplete="vendor_type" autofocus>
                                        <option value="">Select</option>
                                        <option value="Dealer">Dealer</option>
                                        <option value="Manufacturer">Manufacturer</option>         
                                      </select>
                                      <?php $__errorArgs = ['vendor_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="invalid-feedback" role="alert">
                                        <strong><?php echo e($message); ?></strong>
                                    </span>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Manufacturer<sup>*</sup></label>                                       
                                       <select id="manufacturer" class="form-control <?php $__errorArgs = ['manufacturer'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> js-example-basic-multiple" id="sel1" name="manufacturer[]" value=""  autocomplete="manufacturer" autofocus  multiple="multiple">
                                        <option value="">Select</option>
                                        <?php $__currentLoopData = $manufacturers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $manufacturer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($manufacturer->id); ?>"><?php echo e($manufacturer->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                      </select>
                                      <?php $__errorArgs = ['manufacturer'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="invalid-feedback" role="alert">
                                        <strong><?php echo e($message); ?></strong>
                                    </span>
                                      <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Buyer Phone No</label>
                                       <input type="number" id="buyer_ph_no" class="form-control <?php $__errorArgs = ['buyer_ph_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="buyer_ph_no" value="<?php echo e(old('buyer_ph_no')); ?>" required autocomplete="buyer_ph_no" autofocus>
                                       <?php $__errorArgs = ['buyer_ph_no'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="invalid-feedback" role="alert">
                                        <strong><?php echo e($message); ?></strong>
                                    </span>
                                      <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                      </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>Image<sup>*</sup></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;">
                                              <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-12 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                     <div class="form-group rs-form-group">
                                        <label>Description<sup>*</sup></label>
                                        <textarea rows="5" name="description" required=""></textarea>
                                      </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>
<?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 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_imagereport').html(filename);
        
        }  
       });
    }
$('#country').on('change', function() {
      var countryid = this.value;
      var APP_URL = <?php echo json_encode(url('/getstates1')); ?> ;
      var saveData = $.ajax({
            type: 'GET',
            url: APP_URL+'/'+countryid,
            data: { countryid: countryid, _token: '<?php echo e(csrf_token()); ?>' },
            dataType: "text",
            success: function(resultData) { 
              $("#state").html(resultData);
            }
            });
            
    });

</script>
<script type="text/javascript">
$(".js-example-basic-multiple").select2({
  placeholder: "Select a Manufacturer"
});
</script>

 <script>
$("#create").click(function(){
    //alert("bbbb");
	$("#add_vendor").validate({
		ignore: [],
        rules: {
            "name": {
                required: true
               
            },
			"email": {
                required: true
               
            },
			"password": {
                required: true,
                minlength: 8
               
            },
            "address": {
                required: true
               
            },
            "state": {
                required: true
               
            },
            "city": {
                required: true
               
            },
            "zipcode": {
                required: true
               
            },
            "phone_no": {
                required: true
               
            },
             "contact_name": {
                required: true
               
            },
             "contact_phone_no": {
                required: true
               
            }, 
            "vendor_type": {
                required: true
               
            },
            
            
            "description": {
                required: true
               
            },
        },
        submitHandler: function(form, e) {
             $(".pageloader").show();
            $(".pageloader").delay(5000).fadeOut("slow");
		   form.submit();
        }
    });
});
$(function(){
    $('#add_vendor').on('submit', function(event){
        event.preventDefault();
       
    });
});
</script>
<script>
    $(document).ready(function() {
   $('#gst_no').focusout(function() {
        var gst_no = $('#gst_no').val();
        if($('#gst_no').val() != ""){     
                var gst_no = $('#gst_no').val();
                var APP_URL = <?php echo json_encode(url('/getmanufacturedetails')); ?> ;
                var saveData = $.ajax({
                    type: 'GET',
                    url: APP_URL+'/'+gst_no,
                    data: { gst_no: gst_no, _token: '<?php echo e(csrf_token()); ?>' },
                    dataType: "text",
                        success: function(resultData) {
                            console.log(resultData);
                            var res = JSON.parse(resultData);
                            if(res !== null && res !== ''){
                                if(res.user_type == '1'){
                                    alert('This Gst No is already registered as a buyer.');
                                }else if(res.user_type == '2'){
                                    alert('This Gst No is already registered as a Vendor.');
                                }else if(res.user_type == '3'){
                                     alert('This Gst No is already registered as a Manufacturer.');
                                }
                                
                            }else{
                                var gst = $('#gst_no').val();
                                var APP_URL = <?php echo json_encode(url('/getgstdetails')); ?> ;
                                var saveData = $.ajax({
                                    type: 'GET',
                                    url: APP_URL+'/'+gst,
                                    data: { gst_no: gst_no, _token: '<?php echo e(csrf_token()); ?>' },
                                    dataType: "text",
                                        success: function(resultData) { 
                                        var res = JSON.parse(resultData);
                                        var name= res.taxpayerInfo.tradeNam;
                                        var dno = res.taxpayerInfo.pradr.addr.bno;
                                        var bnm = res.taxpayerInfo.pradr.addr.bnm;
                                        var st = res.taxpayerInfo.pradr.addr.st;
                                        var loc = res.taxpayerInfo.pradr.addr.loc;
                                        var dst = res.taxpayerInfo.pradr.addr.dst;
                                        var stcd = res.taxpayerInfo.pradr.addr.stcd;
                                        var pncd = res.taxpayerInfo.pradr.addr.pncd;
                                        var address =dno+','+bnm+','+st+','+loc+','+dst+','+stcd+','+pncd;
                                        $('#name').val(name);
                                        $('#address').val(address);
                                        $('#zipcode').val(pncd);
                                    }
                                });    
                            }
                        
                        
                    }
                });
                $(".pageloader").show();
                $(".pageloader").delay(5000).fadeOut("slow");
        }
    });
});
</script>


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

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