<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 Purchase Record</h3>
									<div class="btn-group widget-header-toolbar">
									@if($data['create']=='1')
										<a class="btn-borderless btn-focus clickme" href="purchase" title="Focus" ><i class="fa fa-plus"></i></a>
										@endif
										<!--<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>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 -->
							<!-- WIDGET DONUT AND PIE CHART -->
							
							<!-- END WIDGET INLINE SPARKLINE -->
						</div>
					</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)
					{
						$('.PurchaseprintBill').html(data)
					}
			});		
	}
</script>