<?php $__env->startSection('content'); ?>
<div class="common-content" style="overflow-x: hidden;">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Place your bid</h6>
                    </div>
                </div>
                <div class="boxings">
                <form method="POST" id="add_bid" action="<?php echo e(url('vendors/addbids')); ?>" 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>Product Name<sup>*</sup></label>
                                        <select class="form-control js-example-disabled-results"  id="product_id" name="product_id" required>
                                        <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 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>Category</label>
                                        <?php $__currentLoopData = $category_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($category->category_id == $quote_details->category_id): ?>
                                        <input type="text" class="form-control" value="<?php echo e($category->category); ?>" readonly>
                                         <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        
                                      </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>Master Product Name</label>
                                        <input type="text" class="form-control" value="<?php echo e($quote_details->ProductName); ?>" readonly>
                                        
                                      </div>
                                </div>
                              </div>
                              
                          <?php if(Auth::user()->user_type == '2'): ?>
                          <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <div class="form-inputs">
                                <div class="form-group">
                                    <label>Manufacturer</label>
                                    <input type="text" id="manufacturer" class="form-control" value="" readonly>
                                   </div>
                            </div>
                          </div>		
                          
                           
                          <?php endif; ?>

                          <input type="hidden" id="buyerid" name="buyerid" class="form-control" value="<?php echo e($buyerid); ?>" readonly>
                              
                           
				

                              <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                                <div class="form-inputs">
                                     <div class="form-group">
                                        <label>Model Number</label>
                                        <input type="text" id="product_code" class="form-control" value="" readonly>
                                        <input type="hidden" class="form-control" name="quoteId" value="<?php echo e($quote_details->quoteId); ?>" readonly>
                                      </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>Warranty year<sup>*</sup></label>
											
											<select class="form-control selectmanufacturer" id="product_warranty" name="product_warranty">
											  <option value="">Select</option>
											  <?php $i=1;?>
											  <?php for($i=1;$i<=25;$i++){?>
												<option value="<?php echo e($i); ?>" ><?php echo e($i); ?></option>
											  <?php }?>
											</select>
											
											
											
											
											<!-- <input type="text" class="form-control" value="<?php echo e($quote_details->product_warranty); ?>" readonly> -->
										  </div>
									</div>
                </div>


                <?php if(Auth::user()->user_type == '2'): ?>
                  
                <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
									<div class="form-inputs">
										 <div class="form-group">
											<label>Bid percentage<sup>*</sup></label>
											
											<select class="form-control selectmanufacturer" id="bid_percentage" name="bid_percentage">
                        <option value=" ">Select</option>
											  <option value="10" >10%</option>
                          <option value="20">20%</option>
                          <option value="30">30%</option>
                          <option value="40" >40%</option>
                          <option value="50" >50%</option>
                          <option value="60" >60%</option>
                          <option value="70" >70%</option>
                          <option value="80" >80%</option>
                          <option value="90" >90%</option>
                          <option value="100">100%</option>
											</select>
										
											<!-- <input type="text" class="form-control" value="<?php echo e($quote_details->product_warranty); ?>" readonly> -->
										  </div>
									</div>
                </div>
                <?php endif; ?>




								 <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
									<div class="form-inputs">
										 <div class="form-group">
											<label>Expected date of delivery<sup>*</sup></label>
											<input id="datepicker1" type="text" class="form-control" data-zdp_readonly_element="false" name="expected_delivery" value="">
											<!-- <input type="text" class="form-control" value="<?php echo e($quote_details->product_warranty); ?>" readonly> -->
										  </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>Price (INR)<sup>*</sup></label>
                                        <input type="text"  class="form-control <?php $__errorArgs = ['quote_price'];
$__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="quote_price" id="quote_price" value="<?php echo e(old('quote_price')); ?>" required autocomplete="quote_price" autofocus>
                                       
                                        <?php $__errorArgs = ['quote_price'];
$__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>Tax</label><label class="right2" >%<sup>*</sup></label>
                                        <input type="text"  class="form-control <?php $__errorArgs = ['quote_tax'];
$__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="quote_tax" id="quote_tax" value="12" required autocomplete="quote_tax" autofocus>
                                        
                                        <?php $__errorArgs = ['quote_tax'];
$__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>Catalogue<sup>*</sup></label>
                                        <div class="custom-file">                                     
                                        
                                                <!--<button type= "button" class="choosefile">Browse...</button>-->
                                                <input id="productcatalouge" class="form-control" name="productcatalouge" type="file" required />
                                                <!--<?php if(!empty($quote_details->catalogue)): ?>-->
                                                <!--<span ><?php echo e($quote_details->catalogue); ?></span>-->
                                                <!-- <?php else: ?>-->
                                                <!-- <span class="fileuploadspan">No file selected</span>-->
                                                <!-- <?php endif; ?>-->
                                        
                                            
                                          </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 Certificates<sup>*</sup></label>
                                        <div class="custom-file">
                                                <!--<button type= "button" class="choosefilecertificate">Browse...</button>-->
                                                <input id="productcertificate" class="form-control" name="productcertificate" type="file" required />
                                                <!--<?php if(!empty($quote_details->certificate)): ?>-->
                                                <!--<span ><?php echo e($quote_details->certificate); ?></span>-->
                                                <!-- <?php else: ?>-->
                                                <!-- <span class="fileuploadspancertificate">No file selected</span>-->
                                                <!-- <?php endif; ?>-->
                                           
                                          </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>Order Copies</label>
                                        <div class="custom-file">
                                            <input type="file" class="custom-file-input" id="customFile">
                                            <label >Browse</label>
                                          </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>Performance Report</label>
                                       <div class="custom-file">
                                       
                                                <!--<button type= "button" class="choosefilereport">Browse...</button>-->
                                                <input id="productperformancereport" class="form-control" name="productperformancereport" type="file"  />
                                                <!--<?php if(!empty($quote_details->performancereport)): ?>-->
                                                <!--<span ><?php echo e($quote_details->performancereport); ?></span>-->
                                                <!-- <?php else: ?>-->
                                                <!-- <span class="fileuploadspanreport">No file selected</span>-->
                                                <!-- <?php endif; ?>-->
                                          </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>Attach Quotation</label>
                                        <div class="custom-file">
                                            <input type="file" class="form-control" id="ordercopies" name="ordercopies">
                                            <!-- <label>Browse</label> -->
                                          </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">
                                        <label>Product Description<sup>*</sup></label>
                                        <textarea style="height: 100px;" class="form-control" id="product_description" name="product_description">
                                         </textarea>
                                      </div>
                                </div>
                              </div>
                          </div>
                        <div class="row">
                         <div class="col-12">
                            <div class="green-button">
                                <button id="create">Submit</button>
                             </div> 
                         </div>
                      </div>
                    </div>
                </div>
                </form>
                </div>
 </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
<script>  
$('.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);
// });

 $('#product_id').on('change', function() {
      var productid = this.value;
      if(productid != ""){
      var APP_URL = <?php echo json_encode(url('/getvendorproductdetails')); ?> ;
      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_code').val(res.product_code);
              $('#product_description').val(res.product_description);
              $('#datepicker').val(res.product_warranty);
              $("#manufacturer").val(res.name);
            }
            });
      }else{
             $('#product_code').val('');
              $('#product_description').val('');
              $('#datepicker').val('');
              $("#manufacturer").val('');
      }    
    });
</script>
<script>
$("#create").click(function(){
   // alert("bbbb");
	$("#add_bid").validate({
        rules: {
            
			"product_warranty": {
                required: true
               
            },
			"expected_delivery": {
                required: true
               
            },
            "bid_percentage": {
                required: true
               
            },
            "quote_price": {
                required: true
               
            },
            "quote_tax": {
                required: true
               
            },
            "product_id": {
                required: true
               
            },
            
            "product_description": {
                required: true
               
            },
            
            "productcatalouge": {
                required: true
               
            },
        },
        submitHandler: function(form, e) {
             $(".pageloader").show();
            $(".pageloader").delay(5000).fadeOut("slow");
		   form.submit();
        }
    });
});
$(function(){
    $('#add_bid').on('submit', function(event){
        event.preventDefault();
       
    });
});

</script>
<script>
var $disabledResults = $(".js-example-disabled-results");
$disabledResults.select2();
</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/acceptbid.blade.php ENDPATH**/ ?>