<div class="PurchaseOrderPrint">
<div class="print">
	<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 Sales Order Records</h3>
					<?php if($data['create']=='1'): ?>
					<div class="btn-group widget-header-toolbar">
						<a class="btn-borderless btn-focus clickme" href="salesOrderCreate" title="Focus" ><i class="fa fa-plus"></i></a>
					</div>
					<?php endif; ?>
					</div>
				<div class="widget-content">
					<table id="visit-stat-table" class="table table-sorting table-striped table-hover datatable table-bordered">
						<thead>
							<tr>    
								<th>Purchase Order No.</th>
								<th>Date</th>
								<th>Company</th>
								<th>Seller</th>										
								<th>Status</th>
								<th>Action</th>
							</tr>
						</thead>
						<tbody>
							<?php $__currentLoopData = $data['ViewPurchase']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Purchase): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
								<tr>									
									<?php $date=$Purchase->bil_date; $date1=explode('-',$date); $year=$date1[0]; $month=$date1[1];$dat=$date1[2];  $todates=$dat.'/'.$month.'/'.$year?>									
									<td><?php echo e($Purchase->bil_no); ?></td>
									<td><?php echo e($todates); ?></td>
									<td><?php echo e($Purchase->cmp_name); ?></td>
									<td><?php echo e($Purchase->cst_name); ?></td>
									<td><?php echo e($Purchase->bil_status); ?></td>
									<td><button class="btn btn-default btn-xs print" onclick="print(<?php echo e($Purchase->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>
</div>
</div>
<script>
	$('.clickme').click(function(e)
	{
		e.preventDefault();
		$('#sideMenu').load($(this).attr('href'));
	});
	function print(Billno)
	{
			$.ajax({
				url: 'printBill',
					type: 'get',
					data:'&Billno='+Billno,
					success: function(data)
					{
						$('.salesOrderPrint').html(data)
					}
			});		
	}
</script>