<style type="text/css">
	.report-font{
		font-size: 12pt;
	}

	.horizontal-line{
		width: 100%;
    	border-top: 4px solid #444;
    	margin: 10px 0 0;
	}
	
	.h-line{
		width: 100%;
    	border-top: 4px solid #444;
    	margin: 10px 0 0;
	}

	@media print{
		.horizontal-line{
    	page-break-after: always;
		}
	}

	@page {
       @bottom-left {
            content: counter(page) "/" counter(pages);
        }
     }

</style>
<header>
	<div class="row">
		<div class="col-12">
			<div class="t-corp pull-left">
				<div class="t-corp-logo">
					<img src="<?php echo base_url().'assets/images/logo/salihin-logo.png'; ?>" alt="company logo" />
				</div>
				<div class="t-corp-name"><b>SPS</b> | HR SYSTEM</div>
			</div>
			<div class="report-title pull-right">
				<h4> STAFF INFORMATION AS AT <?php echo $date ?></h4>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-12">
			<table class="company">
				<tr>
					<td class="divider">
						<span class="line">&nbsp;</span>
					</td>
					<td class="details">
						<span><b>SALIHIN (AF 1426)</b></span>
						<span>555, Jalan Samudra Utara 1, Taman Samudra, Batu Caves,</span>
						<span>68100, Batu Caves, Selangor</span>
						<span>Phone: 03-6185 9970 &nbsp;&nbsp; Fax: 03-6185 9970</span>
						<span>Website: salihin.com.my</span>
					</td>
					<td class="divider">
						<span class="line">&nbsp;</span>
					</td>
				</tr>
			</table>
		</div>
	</div>
</header>

<div class="container">

	<?php if ($mode == 1): ?>
		<h4>ADDRESS</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>ADDRESS TYPE</th>
					<th>ADDRESS</th>
					<th>POSTCODE</th>
					<th>CITY</th>
					<th>STATE</th>
					<th>COUNTRY</th>
					<th>CONTACT NO</th>
				</tr>
			</thead>
			<tbody>
			<?php if($actions) foreach ($actions as $key => $action): ?>
						<?php if($action->address) foreach ($action->address as $key => $address): ?>
							<tr>
								<td><?php echo ($address->action_type)?strtoupper($address->action_type).'<br/>'.strtoupper(mysql_to_date_format($address->action_efective_date)):''; ?></td>
								<td>
									<?php 
										if ($address->type == 1) {
											echo strtoupper('permanent residence');
										}elseif ($address->type == 2) {
											echo strtoupper('temporary residence');
										}elseif ($address->type == 3) {
											echo strtoupper('correspondence residence');
										}
									?>
								</td>
								<td><?php echo ($address->address)?strtoupper($address->address):''; ?></td>
								<td><?php echo ($address->postcode)?strtoupper($address->postcode):''; ?></td>
								<td><?php echo ($address->city)?strtoupper($address->city):''; ?></td>
								<td><?php echo ($address->state_name)?strtoupper($address->state_name):''; ?></td>
								<td><?php echo ($address->country_name)?strtoupper($address->country_name):''; ?></td>
								<td><?php echo ($address->contact_no)?strtoupper($address->contact_no):''; ?></td>
							</tr>
						<?php endforeach ?>
			<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 2): ?>
		<h4>FAMILY INFORMATION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAIL</th>
					<th>STATUS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
						<?php if($action->family_info) foreach ($action->family_info as $key_inner => $family_info): ?>
							<tr>
								<!-- <td><?php echo ($actions[$key])?strtoupper($actions[$key]->type).'<br/>'.strtoupper(date('d-F-Y',strtotime($actions[$key]->action_efective_date))):'N/A'; ?></td> -->
								<td><?php echo ($actions[$key])?strtoupper($actions[$key]->type).'<br/>'.strtoupper(mysql_to_date_format($actions[$key]->action_efective_date)):'N/A'; ?></td>
								<td>
									<b>NAME : </b><?php echo ($family_info->name)?strtoupper($family_info->name):'N/A'; ?><br>
									<b>NRIC : </b><?php echo ($family_info->ic_no)?strtoupper($family_info->ic_no):'N/A'; ?> <br>
									<b>RELATION : </b><?php echo ($family_info->relations)?strtoupper($family_info->relations):'N/A'; ?><br>
									<!-- <b>BIRTHDATE : </b><?php echo ($family_info->birthdate)?strtoupper(date('d-F-Y',strtotime($family_info->birthdate))):'N/A'; ?><br> -->
									<b>BIRTHDATE : </b><?php echo (!empty(mysql_to_date_format($family_info->birthdate)))?strtoupper(mysql_to_date_format($family_info->birthdate)):'N/A'; ?><br>

									<b>OCCUPATION : </b><?php echo ($family_info->occupation)?strtoupper($family_info->occupation):'N/A'; ?><br>
									<b>EMAIL : </b><?php echo ($family_info->email)?strtoupper($family_info->email):'N/A'; ?><br>
									<b>CONTACT NO : </b><?php echo ($family_info->phone_no)?strtoupper($family_info->phone_no):'N/A'; ?><br>
									<b>ADDRESS : </b><?php echo ($family_info->address)?strtoupper($family_info->address):'N/A'; ?><br>
									<b>ACADEMIC LEVEL : </b><?php echo ($family_info->level_academic)?strtoupper($family_info->level_academic):'N/A'; ?><br>
									<b>ACADEMIC INSTITUTION : </b><?php echo ($family_info->academic_institution)?strtoupper($family_info->academic_institution):'N/A'; ?><br>
								</td>
								<td>
									<b>OKU STATUS : </b><?php echo ($family_info->oku_status == 0)?strtoupper('YES'):strtoupper('NO'); ?><br>
									<b>STUDENT STATUS : </b><?php echo ($family_info->study_status == 0)?strtoupper('YES'):strtoupper('NO'); ?><br>
								</td>
							</tr>
						<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 3): ?>
		<h4>ACADEMIC EDUCATION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>LEVEL</th>
					<th>PROGRAM</th>
					<th>UNIVERSITY / INSTITUTION</th>
					<th>YEAR GRADUATED</th>
					<th>FINAL RESULTS / CGPA</th>
					<th>ATTACHMENTS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->academic_qualification) foreach ($action->academic_qualification as $key_inner => $academic): ?>
						<tr>
							<!-- <td><?php echo ($actions[$key])?$actions[$key]->type.'<br/>'.date('d-F-Y',strtotime($actions[$key]->action_efective_date)):'N/A'; ?></td> -->
							<td><?php echo ($actions[$key])?$actions[$key]->type.'<br/>'.mysql_to_date_format($actions[$key]->action_efective_date):'N/A'; ?></td>

							<td><?php echo ($academic->academic_level)?strtoupper($academic->academic_level):'N/A'; ?></td>
							<td><?php echo ($academic->program)?strtoupper($academic->program):'N/A'; ?></td>
							<td><?php echo ($academic->institution)?strtoupper($academic->institution):'N/A'; ?></td>
							<td><?php echo ($academic->year)?strtoupper($academic->year):'N/A'; ?></td>
							<td><?php echo ($academic->cgpa)?strtoupper($academic->cgpa):'N/A'; ?></td>
							<td><?php echo ($academic->attachment_name)?strtoupper($academic->attachment_name):'N/A'; ?></td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 4): ?>
		<h4>ADDITIONAL PERSONAL DATA</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION</th>
					<th>DETAIL</th>
					<th>DESCRIPTION</th>
					<th>ATTACHMENTS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->additional_personal_data) foreach ($action->additional_personal_data as $key => $additional_personal_data): ?>
						<tr>
							<td>
								<!-- <?php echo ($additional_personal_data->action_type)?$additional_personal_data->action_type.'<br/>'.date('d-F-Y',strtotime($additional_personal_data->action_efective_date)):'N/A'; ?> -->
								<?php echo ($additional_personal_data->action_type)?$additional_personal_data->action_type.'<br/>'.mysql_to_date_format($additional_personal_data->action_efective_date):'N/A'; ?>
							</td>
							<td>
								<?php echo ($additional_personal_data->detail)?$additional_personal_data->detail:'N/A';?>
							</td>
							<td>
								<?php echo ($additional_personal_data->description)?$additional_personal_data->description:'N/A'; ?>
							</td>
							<td>
								<?php echo ($additional_personal_data->attachment_name)?$additional_personal_data->attachment_name:'N/A'; ?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>				
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 5): ?>
		<h4>PREVIOUS EMPLOYMENT DETAILS</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->previous_employment_history) foreach ($action->previous_employment_history as $key_inner => $history): ?>
						<tr>
							<!-- <td><?php echo ($history->action_type)?$history->action_type.'<br/>'.date('d-F-Y',strtotime($history->action_efective_date)):''; ?></td> -->
							<td><?php echo ($history->action_type)?$history->action_type.'<br/>'.mysql_to_date_format($history->action_efective_date):''; ?></td>							
							<td>
								<label><b>EMPLOYER NAME </b></label> : <?php echo ($history->employer_name)?$history->employer_name:'N/A'; ?> <br/>
								<label><b>EMPLOYER ADDRESS </b></label> : <?php echo ($history->employer_address)?$history->employer_address:'N/A'; ?> <br/>
								<label><b>POSITION </b></label> : <?php echo ($history->position)?$history->position:'N/A'; ?> <br/>
								<label><b>LENGTH OF SERVICE </b></label> : <?php echo ($history->length_of_service)?$history->length_of_service:'N/A'; ?> <br/>
								<!-- <label><b>DATE JOIN</b></label> : <?php echo ($history->date_enter)?$history->date_enter:'N/A'; ?> <br/> -->
								<label><b>DATE JOIN</b></label> : <?php echo (!empty(mysql_to_date_format($history->date_enter)))?mysql_to_date_format($history->date_enter):'N/A'; ?> <br/>

								<!-- <label><b>DATE TO</b></label> : <?php echo ($history->date_exit)?$history->date_exit:'N/A'; ?> <br/> -->
								<label><b>DATE TO</b></label> : <?php echo (!empty(mysql_to_date_format($history->date_exit)))?mysql_to_date_format($history->date_exit):'N/A'; ?> <br/>

								<label><b>DESCRIPTION</b></label> : <?php echo ($history->description)?$history->description:'N/A'; ?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 6): ?>
		<h4>PROFESSIONAL MEMBERSHIP</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>
						ACTION TYPE
					</th>
					<th>
						DETAIL
					</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->professional_membership) foreach ($action->professional_membership as $key => $professional_membership): ?>
						<tr>
							<td><?php echo ($professional_membership->action_type)?strtoupper($professional_membership->action_type).'<br/>'.mysql_to_date_format($professional_membership->action_efective_date):'N/A';?></td>
							<td>
								<b>PROFESSIONAL BODY : </b><?php echo ($professional_membership->professional_body)? strtoupper($professional_membership->professional_body):'N/A'; ?><br>
								<b>NAME OF MEMBERSHIP : </b><?php echo ($professional_membership->certificate)? strtoupper($professional_membership->professional_body):'N/A'; ?><br>
								<b>TYPE OF MEMBERSHIP : </b><?php echo ($professional_membership->membership)? strtoupper($professional_membership->membership):'N/A'; ?><br>
								<b>MEMBERSHIP NUMBER : </b><?php echo ($professional_membership->membership_no)? strtoupper($professional_membership->membership_no):'N/A'; ?><br>
								<b>YEAR : </b><?php echo ($professional_membership->year)? strtoupper($professional_membership->year):'N/A'; ?><br>
								<b>ATTACHMENTS : </b> <?php echo ($professional_membership->attachment_name)?strtoupper($professional_membership->attachment_name):'N/A'; ?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 7): ?>
		<h4>PROFESSIONAL LICENSE</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>NAME OF LICENSE</th>
					<th>LICENSE NUMBER</th>
					<th>LICENSE BODY/AUTHORITY</th>
					<th>REGISTER DATE</th>
					<th>LATEST RENEWED DATE</th>
					<th>NEXT RENEWAL DATE</th>
					<th>ATTACHMENT</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->professional_license) foreach ($action->professional_license as $key_inner => $professional_license): ?>
						<tr>
							<!-- <td><?php echo ($professional_license->action_type)?strtoupper($professional_license->action_type).'<br/>'.strtoupper(date('d-F-Y',strtotime($professional_license->action_efective_date))):'N/A'; ?></td> -->
							<td><?php echo ($professional_license->action_type)?strtoupper($professional_license->action_type).'<br/>'.strtoupper(mysql_to_date_format($professional_license->action_efective_date)):'N/A'; ?></td>
							<td><?php echo ($professional_license->profession)?strtoupper($professional_license->profession):'N/A'; ?></td>
							<td><?php echo ($professional_license->license_no)?strtoupper($professional_license->license_no):'N/A'; ?></td>
							<td><?php echo ($professional_license->license_body_authority)?strtoupper($professional_license->license_body_authority):'N/A'; ?></td>

							<!-- <td><?php echo ($professional_license->register_date)?strtoupper(date('d-F-Y',strtotime($professional_license->register_date))):'N/A'; ?></td> -->
							<td><?php echo ($professional_license->register_date)?strtoupper(mysql_to_date_format($professional_license->register_date)):'N/A'; ?></td>

							<!-- <td><?php echo ($professional_license->renewal_date)?strtoupper(date('d-F-Y',strtotime($professional_license->renewal_date))):'N/A'; ?></td> -->
							<td><?php echo ($professional_license->renewal_date)?strtoupper(mysql_to_date_format($professional_license->renewal_date)):'N/A'; ?></td>
							<td><?php echo ($professional_license->next_renewal_date)?strtoupper(mysql_to_date_format($professional_license->next_renewal_date)):'N/A'; ?></td>

							<td><?php echo ($professional_license->attachment_name)?strtoupper($professional_license->attachment_name):'N/A'; ?></td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 8): ?>
		<h4>RECOGNITION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>ACHIEVEMENT</th>
					<th>AWARD</th>
					<th>YEAR</th>
					<th>ATTACHMENT</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->recognition) foreach ($action->recognition as $key => $recognition): ?>
						<tr>
							<!-- <td><?php echo ($recognition->action_type)?strtoupper($recognition->action_type).'<br/>'.date('d-F-Y',strtotime($recognition->action_efective_date)):''; ?></td> -->
							<td><?php echo ($recognition->action_type)?strtoupper($recognition->action_type).'<br/>'.mysql_to_date_format($recognition->action_efective_date):''; ?></td>
							
							<td><?php echo ($recognition->achievement)?strtoupper($recognition->achievement):'N/A'; ?></td>
							<td><?php echo ($recognition->award)?strtoupper($recognition->award):'N/A'; ?></td>
							<td><?php echo ($recognition->year)?strtoupper($recognition->year):'N/A'; ?></td>
							<td><?php echo ($recognition->attachment_name)?strtoupper($recognition->attachment_name):'N/A'; ?></td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 9): ?>
		<h4>CONTRACT ELEMENT</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if ($action->contract_element): ?>
							<tr>
								<td>
									<!-- <?php echo ($action->contract_element->action_type)?strtoupper($action->contract_element->action_type).'<br/>'.strtoupper(date('d-F-Y',strtotime($action->contract_element->action_efective_date))):'N/A'; ?> -->
									<?php echo ($action->contract_element->action_type)?strtoupper($action->contract_element->action_type).'<br/>'.strtoupper(mysql_to_date_format($action->contract_element->action_efective_date)):'N/A'; ?>
								</td>
								<td>
									<b><?php echo strtoupper('contract type :'); ?></b> 
									<?php 
										echo ($action->contract_element->contract_type)?strtoupper($action->contract_element->contract_type):'N/A';
									?>
									<br>
									<b><?php echo strtoupper('confirmation : '); ?></b>
									<?php 
										echo ($action->contract_element->confirmation_type)?strtoupper($action->contract_element->confirmation_type):'N/A';
									?>
									<br>
									<b><?php echo strtoupper('confirmation date : '); ?></b>
									<?php 
										// echo ($action->contract_element->confirmation_date)?strtoupper(date('d-F-Y',strtotime($action->contract_element->confirmation_date))):'';
										echo ($action->contract_element->confirmation_date)?strtoupper(mysql_to_date_format($action->contract_element->confirmation_date)):'';
									?>
									<br>
									<b><?php echo strtoupper('probationary period : '); ?></b> 
									<?php 
										if (!empty($action->contract_element->probation ) && !empty($action->contract_element->probation_duration)) {
											echo $action->contract_element->probation;
											if($action->contract_element->probation_duration == 0){
												echo strtoupper(' Days');
											}elseif ($action->contract_element->probation_duration == 1) {
												echo strtoupper(' Weeks');
											}elseif ($action->contract_element->probation_duration == 2) {
												echo strtoupper(' Months');
											}elseif ($action->contract_element->probation_duration == 3) {
												echo strtoupper(' Year');
											}
										}else{
											echo 'N/A';
										}
									?>
									<br>
									<b><?php echo strtoupper('employer notice period : '); ?></b>
									<?php 
										if (!empty($action->contract_element->er_notice ) && !empty($action->contract_element->er_notice_duration)) {
											echo $action->contract_element->er_notice;

											if ($action->contract_element->er_notice_duration == 0) {
												echo strtoupper(' Days');
											}elseif ($action->contract_element->er_notice_duration == 1) {
												echo strtoupper(' Weeks');
											}elseif ($action->contract_element->er_notice_duration == 2) {
												echo strtoupper(' Months');
											}elseif ($action->contract_element->er_notice_duration == 3) {
												echo strtoupper(' Years');
											}
										}else{
											echo 'N/A';
										}
									?>
									<br>
									<b><?php echo strtoupper('employee notice period : ') ?></b> 
									<?php 
										if (!empty($action->contract_element->ee_notice) && !empty($action->contract_element->ee_notice_duration)) {
											echo $action->contract_element->ee_notice;

											if($action->contract_element->ee_notice_duration == 0){
												echo strtoupper(' days');
											}elseif ($action->contract_element->ee_notice_duration == 1) {
												echo strtoupper(' Weeks');
											}elseif ($action->contract_element->ee_notice_duration == 2) {
												echo strtoupper(' months');
											}elseif ($action->contract_element->ee_notice_duration == 3) {
												echo strtoupper(' years');
											}

										}else{
											echo 'N/A';
										}
									?>
									<br>
									<b><?php echo strtoupper('resign date :'); ?></b> 
									<?php 
										echo ($action->contract_element->resign_date)?strtoupper(mysql_to_date_format($action->contract_element->resign_date)):'N/A';
									?>
									<br>
									<b><?php echo strtoupper('last working date :'); ?></b> 
									<?php 
										echo ($action->contract_element->last_working_date)?strtoupper(mysql_to_date_format($action->contract_element->last_working_date)):'N/A';
									?>
									<br>
									<b><?php echo strtoupper('physical last working date :'); ?></b> 
									<?php 
										echo ($action->contract_element->phy_last_working_date)?strtoupper(mysql_to_date_format($action->contract_element->phy_last_working_date)):'N/A';
									?>
									<br>
								</td>
							</tr>
					<?php endif ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 10): ?>
		<h4>BASIC PAY</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAIL</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if ($action->basic_pay): ?>
						<tr>
							<td><?php echo ($action->basic_pay->action_type)?strtoupper($action->basic_pay->action_type).'<br/>'.strtoupper(mysql_to_date_format($action->basic_pay->action_efective_date)):'N/A';?></td>
							<td>
								<b><?php echo strtoupper('pay scale group (grade) : '); ?></b>
								<?php 
									echo ($action->basic_pay->scale_group)?strtoupper($action->basic_pay->scale_group):'N/A';
								?>
								<br>
								<b><?php echo strtoupper('basic pay amount (rm) : '); ?></b> 
								<?php 
									echo ($action->basic_pay->amount)?number_format($action->basic_pay->amount,2):number_format(0,2);
								?>
								<br>
								<b><?php echo strtoupper('start date : '); ?></b>
								<?php 
									// echo ($action->basic_pay->start_date)?strtoupper(date('d-F-Y',strtotime($action->basic_pay->start_date))):'N/A';
									echo (!empty(mysql_to_date_format($action->basic_pay->start_date)))?strtoupper(mysql_to_date_format($action->basic_pay->start_date)):'N/A';

								?>
								<br>
								<b><?php echo strtoupper('end date : '); ?></b> 
								<?php 
									// echo ($action->basic_pay->end_date)?strtoupper(date('d-F-Y',strtotime($action->basic_pay->end_date))):'N/A';
									echo (mysql_to_date_format($action->basic_pay->end_date))?strtoupper(mysql_to_date_format($action->basic_pay->end_date)):'N/A';
								?>
								<br>
								<b><?php echo strtoupper('reason : '); ?></b> 
								<?php 
									echo ($action->basic_pay->reason)?strtoupper($action->basic_pay->reason):'N/A';
								?>
								<br>
								<b><?php echo strtoupper('status : '); ?></b>
								<?php 
									echo (!empty($action->basic_pay->status))?'ACTIVE':'INACTIVE';
								?>
							</td>
						</tr>
					<?php endif ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 11): ?>
		<h4>BANK DETAILS</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION</th>
					<th>BANK NAME</th>
					<th>BRANCH</th>
					<th>ACC NO</th>
					<th>STATUS</th>
					<th>ATTACHMENT</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->bank_details) foreach ($action->bank_details as $key => $bank_detail): ?>
						<tr>
							<!-- <td><?php echo ($bank_detail->action_type)?strtoupper($bank_detail->action_type).'<br/>'.date('d-F-Y',strtotime($bank_detail->action_efective_date)):'N/A'; ?></td> -->
							<td><?php echo ($bank_detail->action_type)?strtoupper($bank_detail->action_type).'<br/>'.date(mysql_to_date_format($bank_detail->action_efective_date)):'N/A'; ?></td>
							<td><?php echo ($bank_detail->name)?strtoupper($bank_detail->name):'N/A'; ?></td>
							<td><?php echo ($bank_detail->branch)?strtoupper($bank_detail->branch):'N/A'; ?></td>
							<td><?php echo ($bank_detail->acc_no)? strtoupper($bank_detail->acc_no):'N/A'; ?></td>
							<td><?php echo ($bank_detail->status)?strtoupper($bank_detail->status):'N/A'; ?></td>
							<td>
								<?php
									$list = explode('/',$bank_detail->location);
									$length = sizeof($list);
									if($length > 0)
									{
										echo strtoupper($list[$length-1]);
									}else{
										echo 'N/A';
									}
								?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 12): ?>
		<h4>STATUTORY DETAILS</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAIL</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if ($action->statutory_details): ?>
						<tr>
							<td>
								<?php echo ($action->statutory_details->action_type)?strtoupper($action->statutory_details->action_type).'<br/>'.strtoupper(mysql_to_date_format($action->statutory_details->action_efective_date)):'N/A'; ?>
							</td>
							<td>
								<b><?php echo strtoupper('employee epf number : '); ?></b> 
								<?php echo ($action->statutory_details->action_type)?strtoupper($action->statutory_details->action_type):'N/A'; ?><br>
								<b><?php echo strtoupper('employee socso no : '); ?></b> 
								<?php echo ($action->statutory_details->ee_socso)?strtoupper($action->statutory_details->ee_socso):'N/A'; ?><br>
								<b><?php echo strtoupper('income tax no :'); ?></b> 
								<?php echo ($action->statutory_details->ee_income_tax)?strtoupper($action->statutory_details->ee_income_tax):'N/A'; ?>
								<br>
								<b><?php echo strtoupper('pcb deduction (RM): '); ?></b> 
								<?php echo ($action->statutory_details->ee_pcb_deduction)?strtoupper($action->statutory_details->ee_pcb_deduction):'N/A'; ?>
								<br>
								<b><?php echo strtoupper('zakat deduction (RM): '); ?></b> 
								<?php echo ($action->statutory_details->ee_zakat_deduction)?strtoupper($action->statutory_details->ee_zakat_deduction):'N/A';  ?>
								<br>
								<b><?php echo strtoupper('employer rate (percentage) : '); ?></b> 
								<?php
								if ($action->statutory_details->er_rate == 0) {
									echo strtoupper('statutory rate');
								}elseif ($action->statutory_details->er_rate == 1) {
									echo strtoupper('company rate');
								}elseif ($action->statutory_details->er_rate == 2) {
									echo strtoupper('personal rate');
								}
								?>  
								<?php echo ($action->statutory_details->er_percent)?'('.strtoupper($action->statutory_details->er_percent).'%)':'N/A'; ?>
								<br>
								<b><?php echo strtoupper('employee rate (percentage) : ') ?></b>
								<?php
								if ($action->statutory_details->ee_rate == 0) {
									echo strtoupper('statutory rate');
								}elseif ($action->statutory_details->ee_rate == 1) {
									echo strtoupper('company rate');
								}elseif ($action->statutory_details->ee_rate == 2) {
									echo strtoupper('personal rate');
								}
								?> 
								<?php echo ($action->statutory_details->ee_percent)?'('.strtoupper($action->statutory_details->ee_percent).'%)':'N/A'; ?>
								<br>
								<b><?php echo strtoupper('status : '); ?></b>
								<?php echo (!empty($action->statutory_details->status))?'ACTIVE':'INACTIVE'; ?>
								<br>
								<b><?php echo strtoupper('year : '); ?></b>
								<?php echo (!empty($action->statutory_details->year))?$action->statutory_details->year:'N/A'; ?>
							</td>
						</tr>
					<?php endif ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 13 || $mode == 14): ?>
		<h4>RECURRING PAY</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>TYPE</th>
					<th>START DATE</th>
					<th>END DATE</th>
					<th>AMOUNT (RM)</th>
					<th>STATUS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->recurring_payment) foreach ($action->recurring_payment as $inner_key => $recurring): ?>
						<tr>
							<td>
								<?php echo ($actions[$key]->type)?strtoupper($actions[$key]->type):'N/A'; ?>
								<br>
								<?php 
									// echo ($actions[$key]->action_efective_date)?strtoupper(date('d-F-Y',strtotime($actions[$key]->action_efective_date))):'N/A'; 
									echo (!empty(mysql_to_date_format($actions[$key]->action_efective_date)))?strtoupper(mysql_to_date_format($actions[$key]->action_efective_date)):'N/A'; 
								?>
							</td>
							<td><?php echo ($recurring->type)?strtoupper($recurring->type):'N/A'; ?></td>
							<td>
								<?php 
									// echo ($recurring->date_start)?strtoupper(date('d-F-Y',strtotime($recurring->date_start))):'N/A'; 
									echo (!empty(mysql_to_date_format($recurring->date_start)))?strtoupper(mysql_to_date_format($recurring->date_start)):'N/A'; 
								?>
							</td>
							<td>
								<?php 
									// echo ($recurring->date_end)?strtoupper(date('d-F-Y',strtotime($recurring->date_end))):'N/A'; 
									echo (!empty(mysql_to_date_format($recurring->date_end)))?strtoupper(mysql_to_date_format($recurring->date_end)):'N/A';
								?>
							</td>
							<td>
								<?php echo ($recurring->amount)?strtoupper($recurring->amount):'N/A'; ?>
							</td>
							<td>
								<?php 
									if ($recurring->status == 0){
										echo strtoupper('ongoing');
									}else{
										echo strtoupper('end');
									}
								?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
				
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 14 || $mode == 13): ?>
		<h4>RECURRING DEDUCTION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>TYPE</th>
					<th>START DATE</th>
					<th>END DATE</th>
					<th>AMOUNT (RM)</th>
					<th>STATUS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->recurring_deduct) foreach ($action->recurring_deduct as $inner_key => $recurring): ?>
						<tr>
							<td>
								<?php echo ($actions[$key]->type)?$actions[$key]->type:'N/A'; ?>
								<br>
								<?php 
									// echo ($actions[$key]->action_efective_date)?date('d-F-Y',strtotime($actions[$key]->action_efective_date)):'N/A';
									echo (!empty(mysql_to_date_format($actions[$key]->action_efective_date)))?mysql_to_date_format($actions[$key]->action_efective_date):'N/A';									
								?>
							</td>
							<td>
								<?php echo ($recurring->type)?strtoupper($recurring->type):'N/A'; ?>
							</td>
							<td>
								<?php 
									// echo ($recurring->date_start)?date('d-F-Y',strtotime($recurring->date_start)):'N/A'; 
									echo (!empty(mysql_to_date_format($recurring->date_start)))?mysql_to_date_format($recurring->date_start):'N/A'; 									
								?>
							</td>
							<td>
								<?php 
									// echo ($recurring->date_end)?date('d-F-Y',strtotime($recurring->date_end)):'N/A'; 
									echo (!empty(mysql_to_date_format($recurring->date_end)))?mysql_to_date_format($recurring->date_end):'N/A'; 									
								?>
							</td>
							<td>
								<?php echo ($recurring->amount)?$recurring->amount:'N/A'; ?>
							</td>
							<td>
								<?php 
									if ($recurring->status == 0){
										echo strtoupper('ongoing');
									}else{
										echo strtoupper('end');
									}
								?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 15): ?>
		<h4>THIRD PARTY PAYMENT</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->third_party) foreach ($action->third_party as $key => $third_party): ?>
						<tr>
							<td>
								<?php 
									// echo ($third_party->action_type)?strtoupper($third_party->action_type).'<br/>'.strtoupper(date('d-F-Y',strtotime($third_party->action_efective_date))):'N/A'; 
									echo (!empty($third_party->action_type))?strtoupper($third_party->action_type).'<br/>'.strtoupper(mysql_to_date_format($third_party->action_efective_date)):'N/A'; 									
								?>
							</td>
							<td>
								<!-- <b>DATE FROM : </b> <?php echo ($third_party->date_start)?strtoupper(date('d-F-Y',strtotime($third_party->date_start))):'N/A'; ?><br> -->
								<b>DATE FROM : </b> <?php echo (!empty(mysql_to_date_format($third_party->date_start)))?strtoupper(mysql_to_date_format($third_party->date_start)):'N/A'; ?><br>

								<!-- <b>DATE END : </b> <?php echo ($third_party->date_end)?strtoupper(date('d-F-Y',strtotime($third_party->date_end))):'N/A'; ?><br> -->
								<b>DATE END : </b> <?php echo (!empty(mysql_to_date_format($third_party->date_end)))?strtoupper(mysql_to_date_format($third_party->date_end)):'N/A'; ?><br>

								<b>THIRD PARTY INSTITUTION / ORGANISATION  : </b> <?php echo ($third_party->type)?strtoupper($third_party->type):'N/A'; ?><br>
								<b>STATUS : </b> <?php echo ($third_party->status == 0)?strtoupper('ongoing'):strtoupper('end'); ?><br>
								<b>AMOUNT (RM) : </b> <?php echo ($third_party->amount)?number_format($third_party->amount,2):'N/A'; ?><br>
							</td>
						</tr>			
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 16): ?>
		<h4>PCB CONSIDERATION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>NAME</th>
					<th>NRIC</th>
					<th>RESPONSIBILITY</th>
					<th>STATUS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->pcb_consideration) foreach ($action->pcb_consideration as $key_inner => $pcb_consideration): ?>
							<tr>
								<td><?php echo ($actions[$key]->type)?strtoupper($actions[$key]->type).'<br/>'.strtoupper(mysql_to_date_format($actions[$key]->action_efective_date)):'N/A';?></td>
								<td><?php echo ($pcb_consideration->name)?strtoupper($pcb_consideration->name):'N/A'; ?></td>
								<td><?php echo ($pcb_consideration->ic_no)?strtoupper($pcb_consideration->ic_no):'N/A'; ?></td>
								<td>
									<?php 
										if ($pcb_consideration->responsible_id == 0) {
											echo strtoupper('employee');
										}elseif ($pcb_consideration->responsible_id == 1) {
											echo strtoupper('spouse');
										}
									?>
								</td>
								<td>
									<label><b>OKU STATUS : </b></label>
									<?php
										//oku status 
										if ($pcb_consideration->oku_status == 0) {
											echo strtoupper('YES');
										}elseif ($pcb_consideration->oku_status == 1) {
											echo strtoupper('NO');
										}
									?>
									<br>
									<label><b>STUDENT STATUS : </b></label>
									<?php
										//study status
										if($pcb_consideration->study_status == 0){
											echo strtoupper('yes');
										}elseif ($pcb_consideration->study_status == 1) {
											echo strtoupper('no');
										}
									?>
								</td>
							</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 17): ?>
		<h4>EMPLOYMENT DETAIL</h4>
		<?php if($actions) foreach ($actions as $key => $action): ?>
			<?php if($action->joining_group) foreach ($action->joining_group as $key => $joining_group): ?>
					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>ACTION TYPE</b>
								</div>
								<div class="col">
									<p>: <?php echo ($action->type)?strtoupper($action->type):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>EFFECTIVE DATE</b>
								</div>
								<div class="col">
									<p>: <?php echo (!empty(mysql_to_date_format($action->action_efective_date)))?strtoupper(mysql_to_date_format($action->action_efective_date)):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>REASON</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->reason)?strtoupper($joining_group->reason):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>POSITION</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->position_hiring)?strtoupper($joining_group->position_hiring):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>DESIGNATION</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->designation)?strtoupper($joining_group->designation):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>EMPLOYEE GRADE</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->employee_grade)?$joining_group->employee_grade:'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col-3">
									<b>REPORTING TO</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->user_reporting_name)?strtoupper($joining_group->user_reporting_name):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>BUSINESS ENTITY</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->business_entity)?strtoupper($joining_group->business_entity):'N/A';?> </p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>BRANCH</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->branch)?strtoupper($joining_group->branch):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>PERSONNEL AREA</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->personnel_area)?strtoupper($joining_group->personnel_area):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>PERSONAL SUBAREA</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->personal_subarea)?strtoupper($joining_group->personal_subarea):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>EMPLOYEE GROUP</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->employee_group)?strtoupper($joining_group->employee_group):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>CONTRACT ELEMENT</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->contract_element)?strtoupper($joining_group->contract_element):'N/A'; ?></p>
								</div>
							</div>
						</div>
					</div>

					<div class="row">
						<div class="col">
							<div class="row">
								<div class="col">
									<b>EMPLOYEE SUBGROUP</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->employee_subgroup_indicator)?strtoupper($joining_group->employee_subgroup_indicator):'N/A'; ?> - <?php echo ($joining_group->employee_subgroup_designation)?strtoupper($joining_group->employee_subgroup_designation):'N/A'; ?></p>
								</div>
							</div>
						</div>
						<div class="col">
							<div class="row">
								<div class="col">
									<b>EMPLOYEMENT STATUS</b>
								</div>
								<div class="col">
									<p>: <?php echo ($joining_group->is_active == 1)?strtoupper('ACTIVE'):strtoupper('INACTIVE'); ?></p>
								</div>
							</div>
						</div>
					</div>
					<hr>
			<?php endforeach ?>
		<?php endforeach ?>
	<?php endif ?>

	<?php if ($mode == 18): ?>
		<h4>EXPERIENCE IN SALIHIN</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DATE</th>
					<th>TASK DESCRIPTION</th>
					<th>NATURE OF ENGAGEMENT</th>
					<th>ENGAGEMENT PERIOD</th>
				</tr>
			</thead>
			<tbody>
			<?php if($actions) foreach ($actions as $key => $action): ?>
				<?php if($action->working_experience) foreach ($action->working_experience as $key => $wp): 
					$date_from	= new DateTime(($wp->engagement_period_from > 0)?date('Y-m-d H:i:s',strtotime($wp->engagement_period_from)):'0000-00-00 00:00:00');
					$date_to	= new DateTime(($wp->engagement_period_to > 0)?date('Y-m-d H:i:s',strtotime($wp->engagement_period_to)):'0000-00-00 00:00:00');
					$engagement_diff = $date_to->diff($date_from)->format('%a');

					$years 	= floor(($engagement_diff / 365)); // days / 365 days
					$months = floor(($engagement_diff % 365) / 30);
					$days  	= ($engagement_diff % 365) % 30;

					$year_text = ($years > 0)?$years.' year ':'';
					$month_text = ($months > 0)?$months.' month ':'';
					$day_text = ($days > 0)?$days.' day ':'';
				?>
					<tr>
						<td><?php echo $wp->action_type.' <br/><b>('.$wp->action_efective_date.')</b>'; ?></td>
						<td><?php echo date('d-m-Y',strtotime($wp->date_from)).' - '.date('d-m-Y',strtotime($wp->date_to)); ?></td>
						<td><?php echo nl2br($wp->experience); ?></td>
						<td><?php echo nl2br($wp->nature_engagement); ?></td>
						<td><?php echo $year_text.$month_text.$day_text; ?></td>
					</tr>
				<?php endforeach ?>
			<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == '19_0'): ?>
		<h4>PROFESSIONAL EDUCACATION</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
			<?php if($actions) foreach ($actions as $key => $action): ?>
				<?php if($action->professional_education) foreach ($action->professional_education as $key => $row): ?>
					<tr>
						<td><?php echo $row->action_type.' <br/><b>('.$row->action_efective_date.')</b>'; ?></td>
						<td>
							<?php
							echo '<b>Level : </b>'.$row->level
							.'<br><b>Name of Professional Association : </b>'.$row->associate_name
							.'<br/><b>Name of Course Study : </b>'.$row->program
							.'<br/><b>Date Graduated : </b>'.$row->date_finish
							.'<br/><b>Final Result : </b>'.$row->result
							.'<br/><b>Attachment : </b>';
							?>
							<a href="<?php echo base_url('hr/myprofile/openAttachment/'.$row->mask_id.'/6')?>" target="_blank"><?php echo $row->attachment_name; ?></a>
						</td>
					</tr>
				<?php endforeach ?>
			<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == '19_1'): ?>
		<h4>PROFESSIONAL CERTIFICATE</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
			<?php if($actions) foreach ($actions as $key => $action): ?>
				<?php if($action->professional_certificate) foreach ($action->professional_certificate as $key => $row): ?>
					<tr>
						<td><?php echo $row->action_type.' <br/><b>('.$row->action_efective_date.')</b>'; ?></td>
						<td>
							<?php
							echo '<b>Name of Certification Body : </b>'.$row->associate_name
							.'<br/><b>Name of Certification Programme : </b>'.$row->program
							.'<br/><b>Date Finish : </b>'.$row->date_finish
							.'<br/><b>Result : </b>'.$row->result
							.'<br/><b>Attachment : </b>';
							?>
							<a href="<?php echo base_url('hr/myprofile/openAttachment/'.$row->mask_id.'/6')?>" target="_blank"><?php echo $row->attachment_name; ?></a>
						</td>
					</tr>
				<?php endforeach ?>
			<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 20): ?>
		<h4>EDUCATION IN PROGRESS</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->pursuing_study) foreach ($action->pursuing_study as $key_inner => $pursuing): ?>
						<tr>
							<td>
								<?php echo $pursuing->action_type.'<br><b>( '.date('d-F-Y',strtotime($pursuing->action_efective_date)).' )</b>'; ?>
							</td>

							<td>
								<?php
									$status = ($pursuing->status == 1)?'Completed':'On Going';
									echo '<b>Program : </b>'.$pursuing->program
										.'<br/><b>University / Institution : </b>'.$pursuing->institution
										.'<br/><b>Start Date : </b>'.date('d-m-Y',strtotime($pursuing->date_start))
										.'<br/><b>Expected Date of Completion : </b>'.date('d-m-Y',strtotime($pursuing->date_end))
										.'<br/><b>Progress Paper In Hand : </b>'.$pursuing->progress
										.'<br/><b>Status : </b>'.$status;
								?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>

	<?php if ($mode == 21): ?>
		<h4>EMERGENCY CONTACT</h4>
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>ACTION TYPE</th>
					<th>DETAILS</th>
				</tr>
			</thead>
			<tbody>
				<?php if($actions) foreach ($actions as $key => $action): ?>
					<?php if($action->emergency_contact) foreach ($action->emergency_contact as $key_inner => $emergency): ?>
						<tr>
							<td scope="row">
								<?php
									echo $emergency->action_type.'<br><b>( '.date('d-F-Y',strtotime($emergency->action_efective_date)).' )</b>';
								?>
							</td>
							<td>
								<?php
									echo '<b>Name : </b>'.$emergency->name
										.'<br/><b>Relation : </b>'.$emergency->relation
										.'<br/><b>Contact Number : </b>'.$emergency->phone_no
										.'<br/><b>Address : </b>'.$emergency->address
								?>
							</td>
						</tr>
					<?php endforeach ?>
				<?php endforeach ?>
			</tbody>
		</table>
	<?php endif ?>
</div>

