diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 84079452..50d080ee 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1049,6 +1049,9 @@ public function getEmployeePolicy() $temp2['data']['client_policy_id'] = $array->ClientPolicyId; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $decodedArray->age_ratio->$ageKey; array_push($data,$temp2); @@ -1214,7 +1217,9 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id) $temp2['data']['client_policy_id'] = $array->ClientPolicyId; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); - + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $array->Policy_Terms->age_ratio->$ageKey; array_push($data,$temp2); } @@ -1472,6 +1477,9 @@ public function getAddOnPolicy() $temp2['data']['client_policy_id'] = $array['id']; $temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue))); $temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue); + $ageKey = (preg_replace('/\d/', '', $familyFloatesValue) == 'parent' || preg_replace('/\d/', '', $familyFloatesValue) == 'parent_in_law') ? 'elders' : preg_replace('/\d/', '', $familyFloatesValue); + + $temp2['data']['age_validation'] = $decodedArray->age_ratio->$ageKey; array_push($data,$temp2);