<script src="assets/js/king-table.js"></script>
<div class="batchinfo">
					<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 Batch</h3><em> - View Batch records</em>
									<div class="btn-group widget-header-toolbar">
										<a class="btn-borderless btn-focus clickme" href="batch" title="Focus" ><i class="fa fa-plus"></i></a>
									</div>
								</div>
								<div class="widget-content">
<table id="datatable-data-export" class="table table-sorting table-striped table-hover table-bordered datatable">
	<thead>
		<tr>
			<th>User.</th>
			<th>Batch No.</th>
			<th>Shed Name</th>
			<th>DateTime<br>Day</th>
			<th>Strain of chicks</th>
			<th>Status</th>
			<th>Batch<br>Info</th>
		</tr>
	</thead>
	<tbody>
		@foreach($data['batchrecords'] as $arrbatchrecords)
		<tr>
			<td>{{$arrbatchrecords->usr_name}}({{$arrbatchrecords->usr_loginid}})</td>
			<td>{{$arrbatchrecords->bch_batchcode}}</td>
			<td>{{$arrbatchrecords->shd_name}}</td>
			<td><?php echo date("d-M-Y h:i A", strtotime($arrbatchrecords->bch_dttim)); ?><br><?php echo date("l", strtotime($arrbatchrecords->bch_dttim)); ?></td>
			<td>{{$arrbatchrecords->bch_strchicks}}</td>
			<td>{{$arrbatchrecords->bch_status}}</td>
			<td><button class="btn btn-default btn-xs print" onclick="viewbatchinfo(<?php echo $arrbatchrecords->bch_id; ?>)">View</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 viewbatchinfo(batch_id)
{
		$.ajax({
			url: 'BatchInfo',
				type: 'get',
				data:'&batch_id='+batch_id,
				success: function(data)
				{
					$('.batchinfo').html(data)
				}
		});		
}
</script>