<section class="content">
   <div class="box">	
<style>
.fa-usd{font-size:13px; padding-right:1px;}
th{vertical-align:top !important;}
small{ margin-top:3px; font-size:90%;}
</style> 	
<div class="box-header with-border">
		  <h3 class="box-title">Listing</h3>
		  <div class="box-tools pull-right">
			<a href="<?php echo base_url().$this->config->item('admin_directory_name').'/transactions/beneficiary';?>" class="btn btn-default" style="padding:4px 15px;"> Beneficiary Accounts</a>
			<a href="<?php echo base_url().$this->config->item('admin_directory_name').'/transactions/add';?>" class="btn btn-primary" style="padding:4px 15px; margin-left:3px;"> Add Transaction</a>
		  </div>
		</div>		   
  <div class="box-body row">
	<div class="col-xs-12 table-responsive">
	 <table class="table table-striped" id="table_recordtbl" style="font-size:15px;">
		<thead>
			<tr>
			  <th width="1%">#</th>
			  <th>Txn Id &amp; Date</th>
			  <th>Amount</th>
			  <th>Type</th>
			  <th>Fees</th>
			  <th>Cust. Name</th> 
			  <th>Beneficiary</th>
			  <th>Status</th>
			  <th>Action</th>
			</tr>
		</thead>
		<tbody>
		<?php $i=1; foreach($transactions_listing as $row) { ?>
			<tr>
				<td><?php echo $i;?></td>
				<td nowrap="nowrap" style="font-weight:600;"><a class="pro_name" id="td_txn_id_<?php echo $row->tid;?>" onclick="return transaction_details_modal('<?php echo $row->tid;?>');"><?php echo $row->txn_id;?></a>
				<?php if(isset($row->payment_due_date) && $row->payment_due_date!='' && $row->payment_due_date>0){?><small><?php echo date('d M Y',$row->payment_due_date);?></small><?php } ?>
				</td> 	
				<td><?php echo $this->config->item('amt_currencies_array_config')[$row->account_cur]['ad_csign'].number_format($row->total_trans_amt,2);?></td> 					
				<td style="font-weight:600;"><?php if($row->credit_debit_sts==1){echo '<label class="mstus accepted">Credit</label>';}else{echo '<label class="mstus rejected">Debit</label>';}?></td>
				<td style="letter-spacing:0.5px;"><?php if(isset($row->trans_fees) && $row->trans_fees!='' && $row->trans_fees>0){echo $this->config->item('amt_currencies_array_config')[$row->account_cur]['ad_csign'].$row->trans_fees;}else{echo '&ndash;';}?></td> 
				<td><?php echo $row->sender_user_name;?></td> 
				<td><?php if(isset($row->bef_account_name) && $row->bef_account_name!=''){ echo $row->bef_account_name; } if(isset($row->bef_iban_no) && $row->bef_iban_no!=''){ echo '<small>'.$row->bef_iban_no.'</small>'; }?></td> 
				<td>
				
				<?php if($row->action_sts==1){?>				
					<label class="mstus accepted">Success</label>
				<?php }else if($row->action_sts==2){?>
					<label class="mstus rejected">Refund</label>				
				<?php }else{ ?>
					<label class="mstus pending">Pending</label>	
				<?php } ?> &nbsp;
				
				
				
				<a data-toggle="tooltip" data-placement="top" title="Change Status" id="ch_sts_<?php echo $row->tid;?>" onclick="return change_status_model('<?php echo $row->tid;?>','<?php echo $row->action_sts;?>');"> <i class="fa fa-pencil-square-o"></i> </a>
				</td>	
				<td nowrap="nowrap">
				
				<a class="btn btn-danger btn-sm" href="<?php echo base_url().$this->config->item('admin_directory_name');?>/transactions/delete?id=<?php echo $row->tid; ?>" onclick="return confirm('Are you sure you want to delete it?');"><i class="fa fa-trash"></i></a>
				</td>			
			</tr>
		<?php  $i++; } ?>          
		</tbody>                  
	</table>
</div>      
</div>    
</div>
<?php include(APPPATH.'views/Backend/transactions/call_details_modal.php');?>
<div class="clearfix"></div>
</section>
