<div class="PurchaseprintBill">
	<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 Record</h3>
									@if($data['create']=='1')
										<div class="btn-group widget-header-toolbar">
											<a class="btn-borderless btn-focus clickme" href="salesBill" title="Focus" ><i class="fa fa-plus"></i></a>
										</div>
									@endif
								</div>
								<div class="widget-content">
									<table id="visit-stat-table" class="table table-sorting table-striped table-hover table-bordered datatable dataTable no-footer">
										<thead>
											<tr>
										<th>Bill No.</th>
										<th>Bill date</th>
										<th>Company</th>
										<th>Seller</th>
										<th>Shed</th>
										<th>Batch</th>
										<th>Total Cost</th>
										<th>Action</th>
											</tr>
										</thead>
										<tbody>
											@foreach($data['billNo'] as $bills)
											<?php $date=$bills->bil_date; $date1=explode('-',$date); $year=$date1[0]; $month=$date1[1];$dat=$date1[2];  $todates=$dat.'/'.$month.'/'.$year?>
											<tr>
											<td>{{$bills->bil_no}}</td>
											<td>{{$bills->bil_date}}</td>
											<td>{{$bills->cmp_name}}</td>
											<td>{{$bills->cst_name}}</td>
											<td>{{$bills->shd_name}}</td>
											<td>{{$bills->bch_batchcode}}</td>
											<td>{{$bills->trn_amt}}</td>
											<td><button class="btn btn-default btn-xs print" onclick="print({{$bills->bil_id}})">Print</button></td>
											</tr>
											@endforeach
										</tbody>
									</table>
								</div>
							</div>
							<!-- END WIDGET TABLE -->
						</div>
					</div>
</div>					
<script>
	$('.clickme').click(function(e)
	{
		e.preventDefault();
		$('#sideMenu').load($(this).attr('href'));
	});

	function print(Billno)
	{
			$.ajax({
				url: 'salesBillprint',
					type: 'get',
					data:'&Billno='+Billno,
					success: function(data)
					{
						$('.PurchaseprintBill').html(data)
					}
			});		
	}
</script>