<div class="udex-main" id="main">

    <script src="/js/validation.js"></script>
    
	<div class="container px-2 px-md-4 py-4">
	<h2>Transaction History</h2>
	<div class="card rounded shadow-sm mt-4">
		<div class="card-header">Activity</div>
		<div class="card-body">
		<?php
			    			foreach($bank->get_transaction(account_number, true) as $transact){
								if($transact['trans_status'] == 'success'){
									$payStats = '<div class="col-12 text-success"><i class="fas fa-check"></i> Successful</div>';
								}elseif($transact['trans_status'] == 'pending'){
									$payStats = '<div class="col-12 text-warning"><i class="fas fa-info"></i> Pending</div>';
								}else{
									$payStats = '<div class="col-12 text-danger"><i class="fas fa-times"></i> Failed</div>';
								}
								if($transact['trans_to'] == account_number){
									$payAmt = '<div class="col-6 col-md-3 font-weight-bold text-success text-right text-md-left">+'.$currency.number_format($transact['trans_amount'],2).'</div>';
								}else{
									$payAmt = '<div class="col-6 col-md-3 font-weight-bold text-danger text-right text-md-left">-'.$currency.number_format($transact['trans_amount'],2).'</div>';
								}
							?>
				<div class="row">
					<div class="col-6 col-md-3 font-weight-bold text-primary">Transaction<br><?php echo $payStats; ?></div>
					<?php echo $payAmt; ?>
					<div class="col-md-6 small text-black-50">
					    <?php echo $transact['trans_notes']; ?> 
					    <!--- REF: <?php //echo $transact['trans_ref']; ?>-->
					    <br>
					    <span class="text-black-50" style="font-size:1em !important"><?php echo format_d_date_full($transact['created_at']); ?></span>
					 </div>
					
					
				</div><hr />
				<?php } ?>
				</div><div class="card-footer"></div>
	</div>
	</div>	
</div>
    
