<!-- include -->



<div class="page-header">
	<h3 class="page-title">
		<span class="page-title-icon bg-gradient-primary text-white mr-2">
			<i class="mdi mdi-details"></i>
		</span>
		Transfer History
	</h3>
</div>

<div class="row justify-content-center">

	<div class="col-12 grid-margin">

		<div class="card shadow border10">

			<div class="card-body">
				<h4 class="m-2 p-2">Receiving  Blance</h4>

				<div class="table-responsive">
					<table id="datatable" class="table display">
						<thead>
						<tr>
							<th>
								#
							</th>
							<th>
								From Merchant
							</th>
							<th>
								Note
							</th>
							<th>
								Time
							</th>
							<th>
								Transfer Amount
							</th>

						</tr>
						</thead>
						<tbody>
						<?php $serial=1;$total_transaction=0; foreach($receivings as $receive):?>
							<tr>
								<?php $total_transaction+=$receive->amount?>
								<td><?= $serial++ ?></td>
								<td><?=$receive->username?></td>
								<td><?=$receive->note?></td>
								<td><?= date('Y-m-d h:i A', strtotime($receive->created_at)) ?></td>
								<td>৳ <?=number_format($receive->amount,2)?></td>
							</tr>

						<?php endforeach?>

						</tbody>
						<tr>
							<td></td>
							<td></td>
							<td></td>

							<td>Total Receive Amount</td>
							<td>৳ <?=number_format($total_transaction,2)?></td>

						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<script>

	$(document).ready(function() {
		$('#datatable_print').DataTable({
			dom: 'Bfrtip',
			buttons: [{
				extend: 'print',
				className: 'btn btn-inverse-info btn-rounded btn-sm'
			}]
		});
	});
	$(document).ready(function() {
		$('.dataTable').DataTable();
	});


</script>
