<div class="collapse" id="collapseRecognition">
	<div class="card card-body">
		<h4 class="card-title">Recognition</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.'/8'); ?>" target="_blank">
							<i class="fa fa-print"></i> Print
						</a>
					</div>
				</div>
			<?php endif ?>
		</div>
		
		<div class="table-responsive">
			<table id="table_recognition" class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>Action type ( effective date )</th>
						<th>Details</th>
						<th>Attachment</th>
						<th>Created At</th>
						<!-- <?php if($role == 'admin'): ?>
						<th>Action</th>
						<?php endif ?> -->
					</tr>
				</thead>
				<tbody>
					<?php if($recognitions) foreach ($recognitions as $key => $award): ?>
					<tr class="link-row" data-id="" >
						<td scope="row">
							<?php
								echo $award->action_type.'<br/><b>( '.date('d-F-Y',strtotime($award->action_efective_date)).' )</b>';
							?>
						</td>
						<td>
							<?php
								echo '<b>Achievement : </b>'.$award->achievement
									.'<br/><b>Award : </b>'.$award->award
									.'<br/><b>Year : </b>'.$award->year;
							?>
						</td>
						
						<td><a href="<?php echo base_url('hr/staffProfile/openAttachment/'.$award->mask_id.'/4'); ?>" target="_blank"><?php echo $award->attachment_name; ?></a></td>							
						<td><?php echo $award->created_at; ?></td>
						<?php if($role == 'admin'): ?>
						<!-- <td class="text-center">
							<div class="btn-group">
								<button onclick="btnEditRecognition(this)" class="btn btn-success btn-sm" data-content="<?php //echo base64_encode(json_encode($award)); ?>" data-toggle="modal" data-target="#recognitionModal"><i class="fas fa-edit"></i></button>
								<button onclick="btnRemoveRecognition(<?php //echo $award->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="recognitionModal">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="racks-modal-title">Edit Recognition</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/createRecognition/'.$staff_id); ?>" method="POST" class="form-horizontal" id="mdl-recognition-form" enctype="multipart/form-data">
				<div class="modal-body">
					<input type="hidden" class="form-control" name="attachmentID" id="mdl-recognition-attachment-id">
					<input type="hidden" class="form-control" name="id" id="mdl-recognition-id" />

					<div class="form-group">
						<label>Achievement</label>
						<input type="text" class=" form-control" name="achievement" placeholder="Enter Achievement" id="mdl-recognition-achievement">
					</div>	
					<div class="form-group">
						<label>Award</label>
						<input type="text" class=" form-control" name="award" placeholder="Enter Award" id="mdl-recognition-award">
					</div>	
					<div class="form-group">
						<label>Year</label>
						<input type="number" class=" form-control" name="year" placeholder="Enter Year" id="mdl-recognition-year">
					</div>
					<div class="form-group">
						<label>Attachment</label>
						<input type="file" class="form-control" 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" 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>