<div class="collapse" id="collapseAdditional">
	<div class="card card-body">
		<h4 class="card-title">Additional Personal Data</h4>
		<hr>
		<div class="container">
			<div class="row">
				<div class="btn-group ml-auto">
					<?php if ($role == 'admin'): ?>
						<a class="btn btn-info btn-sm" style="margin-bottom:15px; width: 200px;" href="<?php echo base_url('/hr/StaffProfile/actionReport/'.$staff_id.'/4'); ?>" target="_blank">
							<i class="fa fa-print"></i> Print
						</a> 
					<?php endif ?>
				</div>
			</div>
		</div>
		<div class="table-responsive">
			<table id="table_additional" class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>
							Action type ( Effective date )
						</th>
						<th>Detail</th>
						<th>Description</th>	
						<th>Attachment</th>
						<th>Created At</th>
						<!-- <?php if($role == 'admin'): ?>
						<th>Action</th>
						<?php endif ?> -->

					</tr>
				</thead>
				<tbody>
					<?php if (!empty($additional_personal_data)): ?>
						<?php foreach ($additional_personal_data as $key => $attach): ?>
							<tr class="link-row" id="contact_list" data-id="" data-contact="" data-href="">
								<td scope="row">
									<?php echo $attach->action_type.'<br/><b>( '.$attach->action_efective_date.' )</b>'?>
								</td>
								<td><?php echo $attach->detail; ?></td>
								<td><?php echo $attach->description; ?></td>
								<td>
									<a href="<?php echo base_url('hr/staffProfile/openAttachment/'.$attach->mask_id); ?>" target="_blank"><?php echo $attach->attachment_name; ?></a>
								</td>
								<td><?php echo $attach->created_at; ?></td>
								<?php if($role == 'admin'): ?>
								<!-- <td class="text-center" >
									<div class="btn-group">
										<button class="btn btn-success btn-sm" data-content="<?php //echo base64_encode(json_encode($attach)); ?>" onclick="editAttachment(this)" data-toggle="modal" data-target="#additionalModal"><i class="fas fa-edit"></i></button>
										<button class="btn btn-danger btn-sm" onclick="deleteAttachment(<?php //echo $attach->id; ?>)" ><i class="fas fa-trash"></i></button>
									</div>
								</td> -->
								<?php endif ?>
							</tr>
						<?php endforeach ?>
					<?php endif ?>
				</tbody>
			</table>
		</div>
	</div><br>
</div>

<div class="modal fade" id="additionalModal">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="racks-modal-title">Edit Additional Personal Data</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<form id="userForm" action="<?php echo base_url('hr/StaffProfile/createAdditionalAttachment/'.$staff_id); ?>" method="POST" class="form-horizontal" enctype="multipart/form-data">
				<input type="hidden" class="form-control" id="mdl_additional_id" name="id">
				<div class="modal-body">					
					<div class="form-group">
						<label >Detail</label>
						<input type="text" class="form-control" id="mdl_additional_detail"  placeholder="Enter Detail" name="detail">
					</div>
					<div class="form-group">
						<label >Description</label>
						<input type="text" class="form-control" id="mdl_additional_description" placeholder="Enter Description" name="description">
					</div>	
					<div class="form-group">
						<label class="col-form-label-sm">Attachment</label>
						<input type="file" id="mdl_additional_attachment" class="form-control form-control-sm" name="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" id="saveButtonBank" 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>