<div class="col-lg-12">
	
	
		<ul class="breadcrumb">
			<li><i class="fa fa-home"></i><a href="/home" class="home">Home</a></li>
			<!--<li><a href="#">Forms</a></li>-->
			<li class="active">View Sales</li>
		</ul>
	</div><br>
	<script src="assets/js/king-table.js"></script>
					<div class="row">
						<div class="col-md-12">
							<!-- WIDGET TABLE -->
							<div class="widget widget-table">
								<div class="widget-header">
									<h3><i class="fa fa-user"></i> View Sale Record</h3>
									<div class="btn-group widget-header-toolbar">
										<!--<a class="btn-borderless btn-focus clickme" href="purchase" title="Focus" ><i class="fa fa-plus"></i></a>-->
										<!--<a href="#" title="Expand/Collapse" class="btn-borderless btn-toggle-expand"><i class="fa fa-chevron-up"></i></a>
										<a href="#" title="Remove" class="btn-borderless btn-remove"><i class="fa fa-times"></i></a>-->
									</div>
									<!--<div class="btn-group widget-header-toolbar">
										<div class="control-inline toolbar-item-group">
											<span class="control-title">New Visits:</span>
											<div class="label label-success"><i class="fa fa-caret-up"></i> 3.5%</div>
										</div>
									</div>-->
								</div>
								<div class="widget-content">
									<table id="visit-stat-table" class="table table-sorting table-striped table-hover datatable">
										<thead>
											<tr>
										<th>Bill No.</th>
										<th>Bill date</th>
										<th>Company</th>
										<th>Seller</th>
										<th>Total Cost</th>
										<th>Action</th>
											</tr>
										</thead>
										<tbody>
											<?php $__currentLoopData = $salesView['View']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sale): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<tr>
											<td><?php echo e($sale->bil_no); ?></td>
											<td><?php echo e($sale->bil_date); ?></td>
											<td><?php echo e($sale->cmp_name); ?></td>
											<td><?php echo e($sale->cst_name); ?></td>
											<td><?php echo e($sale->Bill_amount); ?></td>
											<td><button class="btn btn-default btn-xs print" onclick="print(<?php echo e($sale->bil_no); ?>)">Print</button></td>
											</tr>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</tbody>
									</table>
								</div>
							</div>
							<!-- END WIDGET TABLE -->
							<!-- WIDGET DONUT AND PIE CHART -->
							
							<!-- END WIDGET INLINE SPARKLINE -->
						</div>
					</div>
					<script>
					$('.clickme').click(function(e)
					{
						e.preventDefault();
                        $('#sideMenu').load($(this).attr('href'));
					});
					
					function print(Billno)
	{
		$.ajax({
			url: 'PurchaseprintBill',
			type: 'get',
			data: '&Billno='+Billno,
			success: function(data) 
			{
				//$('.print').html(data)
				var divContents = data;
				
				var printWindow = window.open(divContents, '', 'height=400,width=800');
				printWindow.document.write('<html><head><title>LARAVEL</title>');
				printWindow.document.write('</head><body >');
				printWindow.document.write(divContents);
				//printWindow.print();
				printWindow.document.write('</body></html>');
				printWindow.document.close();
				printWindow.onload=function()
				{
					printWindow.print();
				}
				
				return false;
			}
		});
		
	}
					</script>