<div class="collapse" id="collapseBank">
	<div class="card card-body">
		<h4 class="card-title">Bank Details</h4>
		<hr>
		
		<div class="container">
			<?php if ($role == 'admin'): ?>
				<div class="row">
					<div class="btn-group ml-auto">
						<a class="btn btn-info btn-sm" style="margin-bottom:15px; width: 200px;" href="<?php echo base_url('hr/StaffProfile/actionReport/'.$staff_id.'/11'); ?>" target="_blank">
							<i class="fa fa-print"></i> Print
						</a>
					</div>
				</div>
			<?php endif ?>
		</div>
		<div class="table-responsive">
			<table id="table_bank" class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>Action type (effective date)</th>
						<th>Bank Name</th>
						<th>Branch</th>
						<th>Acc No</th>
						<th>Status</th>
						<th>Attachment</th>
						<th>Created At</th>
						<!-- <?php if($role == 'admin'): ?>
						<th>Action</th>
						<?php endif ?> -->
					</tr>
				</thead>
				<tbody>

					<?php if($staff_bank) foreach ($staff_bank as $key => $bank): ?>
						<tr class="link-row" data-id="" >
								<td scope="row">
									<?php
										echo $bank->action_type.'<br/><b>( '.date('d-F-Y',strtotime($bank->action_efective_date)).' )</b>';
									?>
								</td>
								<td><?php echo $bank->name; ?></td>
								<td><?php echo $bank->branch; ?></td>
								<td><?php echo $bank->acc_no; ?></td>
								<td><?php echo $bank->status; ?></td>
								<td>
								<a href="<?php echo base_url('hr/StaffProfile/openAttachment/'.$bank->mask_id.'/5'); ?>" target="_blank">
									<?php 
									 $link = [];
									 $link = explode('/',$bank->location);
									 $length = sizeof($link);
									 echo $link[$length-1];
									?>
								</a>
								</td>
								<td><?php echo $bank->created_at; ?></td>
								<?php if($role == 'admin'): ?>
								<!-- <td class="text-center">
									<div class="btn-group">
										<button onclick="btnEditBank(this)" data-content="<?php //echo base64_encode(json_encode($bank))?>" class="btn btn-success btn-sm" data-toggle="modal" data-target="#bankModal"><i class="fas fa-edit"></i></button>
										<button onclick="btnRemoveBank(<?php //echo $bank->id; ?>)" class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></button>
									</div>
								</td> -->
								<?php endif ?>
							</tr>
					<?php endforeach ?>
				</tbody>
			</table>
		</div>
	</div><br>
</div>

<div class="modal fade" id="bankModal">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="racks-modal-title">Edit Bank Details</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>

			<form action="<?php echo base_url('/hr/StaffProfile/createBanks/'.$staff_id); ?>" method="POST" class="form-horizontal" id="mdl-bank-form" enctype="multipart/form-data">
				<div class="modal-body">
					<input type="hidden" class="form-control" name="id" id="mdl-bank-id">
					<div class="form-group">
						<label for="bank_name">Bank Name</label>
						<select class="form-control" name="bank_id" id="mdl-bankdetail-bank_id">
							<?php foreach ($banks as $key => $bank): ?>
								<option value="<?php echo $bank->id; ?>" ><?php echo $bank->name; ?></option>
							<?php endforeach ?>
						</select>
					</div>	
					<div class="form-group">
						<label>Branch</label>
						<input type="text" class=" form-control" placeholder="Enter Branch" name="branch" id="mdl-bankdetail-branch">
					</div>	
					<div class="form-group">
						<label>Acc No</label>
						<input type="text" class=" form-control" placeholder="Enter Acc No" name="acc_no" id="mdl-bankdetail-acc_no">			
					</div>
					<div class="form-group">
						<label>Status</label>
						<input type="text" class="form-control" placeholder="Enter Status" name="status" id="mdl-bankdetail-status">
					</div>
					<div class="form-group">
						<label>Attachment</label>
						<input type="file" class="form-control" placeholder="upload new file" name="file" id="mdl-bankdetail-attachment">
					</div>	
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-danger btn-sm" style="margin-bottom:15px; width: 200px;" data-dismiss="modal"><i class="fa fa-ban"></i> Cancel</button>
					<button type="submit" class="btn btn-success btn-sm" style="margin-bottom:15px; width: 200px;"><i class="fa fa-save"></i> Submit</button>
				</div>
			</form>
		</div>
	</div>
</div>