<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-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>Image</th>
			  <th>Name</th>
			  <th>IBAN / Acct. #</th>
			  <th>BIC / Swift Code</th>
			  <th>Bank Name</th>
			  <th>Bank Address</th>
			  <th>Upload</th>
			</tr>
		</thead>
		<tbody>
		<?php $i=1; foreach($beneficiary_listing as $row) { ?>
			<tr>
				<td><?php echo $i;?></td>
				<td>
				<?php if(isset($row->bef_image) && $row->bef_image!=''){?>
				<img style="width:50px; height:50px;" src="<?php echo base_url().'assets/upload/bef_images/'.$row->bef_image;?>" alt="" />
				<?php } ?>
				</td>
				<td nowrap="nowrap" style="font-weight:600;" id="td_bef_name<?php echo $row->bef_iban_no;?>"><?php echo $row->bef_account_name;?></td>				 	
				<td><?php echo $row->bef_iban_no;?></td> 					
				<td><?php echo $row->bef_bank_btc;?></td> 	
				<td><?php echo $row->bef_bank_name_address;?></td> 	
				<td><?php echo $row->bef_bank_address;?></td> 				 	
				<td nowrap="nowrap">
					<a class="btn btn-default btn-sm" id="img_<?php echo $row->tid;?>" onclick="return upload_image('<?php echo $row->bef_iban_no;?>','<?php echo $row->bef_image;?>');">Edit Image</a>					
				</td>			
			</tr>
		<?php  $i++; } ?>          
		</tbody>                  
	</table>
</div>      
</div>    
</div>
<script>
function upload_image(bef_iban_no, bef_image){
	if(bef_iban_no!=''){ 
		$('#h_bef_iban_no').val(bef_iban_no);
		$('#old_upload_doc').val(bef_image);
		var befName = $('#td_bef_name'+bef_iban_no).html();
		$('#csPopBefName').html(befName);
 		jQuery("#upload_image_modal").modal('show');		
	}
}
</script>
<div class="modal fade" id="upload_image_modal" tabindex="-1" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<form method="post" id="updateStsFrm" action="<?php echo base_url().$this->config->item('admin_directory_name').'/';?>transactions/update_bef_image_entry" enctype="multipart/form-data">
				<input type="hidden" id="h_bef_iban_no" name="h_bef_iban_no" value="0" />
				<input type="hidden" id="old_upload_doc" name="old_upload_doc" value="" />
				<div class="modal-header">
					<h4 class="modal-title" style="display: inline-block;">Update Image for <span id="csPopBefName"></span></h4>
					<button type="button" class="close" data-dismiss="modal">&times;</button>
				  </div>
				<div class="modal-body" id="popup_update_sts_body">
					<div class="form-group">
						<input type="file" id="befImg" name="befImg" />
					</div>
				</div>
				<div class="modal-footer">
					<button type="submit" id="updateBtn" class="btn btn-primary">Update Now!</button>
				</div>
			</form>
		</div>
	</div>
</div>
<div class="clearfix"></div>
</section>
