<div class="widget widget-table">
	<div class="widget-header">
		<h3><i class="fa fa-table"></i> Purchase</h3>
	</div>
	<div class="widget-content">
	<table id="datatable-data-export" class="table table-sorting table-striped table-hover table-bordered datatable">
			<thead>
				<tr>
					<th>SL. No. </th>
					<th>Date</th>
					<th>Item</th>
					<th>Quantity</th>
					<th>Rate</th>		
					<th>Amount</th>						
				</tr>
			</thead>
			<tbody>	
			<?php
			$total =0;
			$totqty = 0;
			$i=1;
			foreach($data['purchaserecords'] as $Item)
			{
			?>
				<tr>
					<td><?php echo $i; ?></td>
					<td><?php echo $Item->bil_date; ?></td>
					<td><?php echo $Item->itm_name; ?></td>
					<td><?php echo $Item->bit_qty; ?></td>
					<td>Rs. <?php echo $Item->bit_cost; ?></td>	
					<td>Rs. <?php echo  $Item->bit_qty * $Item->bit_cost; ?></td>									
				</tr>
			<?php
				$totqty = $totqty + $Item->bit_qty;
				$total = $total + ($Item->bit_qty * $Item->bit_cost);
				$i++;
			}
			?>
			</tbody>
			<tfoot>	
				<tr>
					<th>TOTAL </th>
					<th></th>
					<th></th>
					<th><?php echo $totqty; ?></th>
					<th></th>		
					<th>Rs. <?php echo $total; ?></th>						
				</tr>
			</tfoot>
		</table>
	</div>
</div>