<?php $__env->startSection('content'); ?>
<style>
label.error{
	color:red;
}
</style>
<div class="common-content">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Product details</h6>
                    </div>
                </div>
				
												<?php if($registerdetails->type=='approve'): ?>
													   <?php
														$pname  			= App\Helpers\CustomHelper::product_name($product_id);
													   ?>
													   <?php
														  $pdetails  			= App\Helpers\CustomHelper::vendorproduct_details($product_id);
														    $modelno 			= $pdetails->product_code;
                                $photo 			  = $pdetails->photo;
													   ?>
												 <?php else: ?>
													 <?php
													   $pname  			= App\Helpers\CustomHelper::product_existing_name($product_id);
													 ?>
													  <?php
													  $modelno 			= $solddetails->product_code_existing;
                            $photo 			  = '';
													 ?>
												 <?php endif; ?>
		
				
				
				
				
				

                <div class="dashboard-cnts">
				  
					<div class="row">
                        <div class="col-lg-12">
                            <div class="partner-box partner-box2 Register-partner-box">
							<div class="Register-product-logo">
								
								<div class="complaint-img">
                                    <?php if(!empty($photo)): ?>
                                        <img src="<?php echo e(url('product_files')); ?>/<?php echo e($photo); ?>">
                                    <?php else: ?>
                                        <img src="<?php echo e(url('assets/images/1200px-No-Image-Placeholder.svg.png')); ?>">
                                    <?php endif; ?>
                                </div>
								
							</div>
						<div class="partner-details Register-partner-details prdt-details-main">
							<h6  class="prdt-name"><?php echo e(ucfirst($pname)); ?></h6>
                            
                            <div class="prdt-specs">
                                <div class="right-panel">
                                <Span class="Tittle">Product Code</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($modelno); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Vendor</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value">
                                  <?php if($registerdetails->vendor_id==''): ?>
                                    <?php echo e($registerdetails->existing_vendor_name); ?>

                                  <?php else: ?>
                                    <?php echo e($vendordetails->name); ?>

                                  <?php endif; ?>
                                  
                                </Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Product warranty date</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($solddetails->warrenty); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Manufacturer serial number</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($solddetails->product_serial_no); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Invoice Number</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($registerdetails->invoice_number); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Product discard years</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($solddetails->product_discard_years); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Preventive maintenance frequency</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($solddetails->preventive_maintenance); ?></Span>
                            </div>
                            <div class="right-panel">
                                <Span class="Tittle">Criticality rating of the product</Span>
                                <Span class="Collon">:</Span>
                                <Span class="Value"><?php echo e($registerdetails->current_value); ?></Span>
                            </div>
                            </div>

						</div>
                             
					</div>
                        </div>
                    </div>


                </div>

	</div>


<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog barcodePopup" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">BARCODE</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>

      <div class="modal-body imageArea" id="demo">
        <img style="text-align: center;     padding: 48px 2px;   margin: 0 auto;display: block;" width="900" height="500" id="barcode" />
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal" id="closebar">Close</button>
        <button type="button" id="printBtn" class="btn btn-primary">Print</button>
      </div>
    </div>
  </div>
</div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
$(document).ready( function () {
    $('#table_id').DataTable();
} );

<?php if(Session::has('message')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('message')); ?>",
        type: "success",
        showCancelButton: false,
        dangerMode: false,
        confirmButtonText: 'OK',

    });
<?php endif; ?>
<?php if(Session::has('errormessage')): ?>
      swal({
        title: "",
        text: "<?php echo e(Session::get('errormessage')); ?>",
        type: "error",
        showCancelButton: false,
        dangerMode: true,
        confirmButtonText: 'OK',

    });
<?php endif; ?>


function generatebarcode(){
	var product =$("#product_existing option:selected").val();
	var Arr = product.split('_');
	var product_id  =Arr[0];
	var vendor_id   =Arr[1];
	$('#exampleModal').modal('show');

	var barcode='54321'+' '+product_id;
	$('#barcode').JsBarcode(barcode, {
	  width: 1,
	  height: 40
	});

	$("#barcode_existing").val(barcode);
}
function generatebarcode_new(product_id){
	
	$('#exampleModal').modal('show');

	var barcode='54321'+' '+product_id;
	$('#barcode').JsBarcode(barcode, {
	  width: 1,
	  height: 40
	});

	$("#barcode_new").val(barcode);
}

$("#printBtn").click(function(){
	var divToPrint=document.getElementById('demo');

  var newWin=window.open('','Print-Window');

  newWin.document.open();

  newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');

  newWin.document.close();

  setTimeout(function(){newWin.close();},10);


});


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

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