Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
fc17aeb058
@ -232,7 +232,6 @@ $routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/
|
|||||||
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
||||||
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
$routes->post("employeeUpload", "EmployeeRestController::employeeUpload");
|
||||||
$routes->get("relationshipList", "EmployeeRestController::relationshipList");
|
$routes->get("relationshipList", "EmployeeRestController::relationshipList");
|
||||||
@ -245,6 +244,7 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
|||||||
$routes->get("deleteDependence", "EmployeeRestController::deleteDependence");
|
$routes->get("deleteDependence", "EmployeeRestController::deleteDependence");
|
||||||
$routes->get("getEmployeeAndDependenceByClientId", "EmployeeRestController::getEmployeeAndDependenceByClientId");
|
$routes->get("getEmployeeAndDependenceByClientId", "EmployeeRestController::getEmployeeAndDependenceByClientId");
|
||||||
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
|
$routes->get("getClientPolicy", "EmployeeRestController::getClientPolicy");
|
||||||
|
$routes->get("getClientDetails", "EmployeeRestController::getClientDetails");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
||||||
|
|||||||
@ -145,7 +145,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
$id = $item->id;
|
$id = $item->id;
|
||||||
$item->dob = $this->convertDateFormat($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$employee = $this->employeeModel->update($id, (array)$item);
|
$employee = $this->employeeModel->update($id, (array)$item);
|
||||||
if ($employee) {
|
if ($employee) {
|
||||||
$updatedCount++;
|
$updatedCount++;
|
||||||
@ -179,7 +179,7 @@ class EmployeeRestController extends AdminController
|
|||||||
//update old data
|
//update old data
|
||||||
$id = $item->id;
|
$id = $item->id;
|
||||||
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
||||||
$item->dob = $this->convertDateFormat($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$employee = $this->employeeModel->update($id, (array)$item);
|
$employee = $this->employeeModel->update($id, (array)$item);
|
||||||
if ($employee) {
|
if ($employee) {
|
||||||
$Count++;
|
$Count++;
|
||||||
@ -187,7 +187,7 @@ class EmployeeRestController extends AdminController
|
|||||||
}else{
|
}else{
|
||||||
//create new data
|
//create new data
|
||||||
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
$item->family_floater_key = $this->RelationshipMap($item->relationship);
|
||||||
$item->dob = $this->convertDateFormat($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$employee = $this->employeeModel->insert($item);
|
$employee = $this->employeeModel->insert($item);
|
||||||
if ($employee) {
|
if ($employee) {
|
||||||
$Count++;
|
$Count++;
|
||||||
@ -224,24 +224,32 @@ class EmployeeRestController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function convertDateFormat($dateString)
|
private function convertDateFormatYMD($dateString)
|
||||||
{
|
{
|
||||||
// Attempt to create a DateTime object from the provided date string
|
// Attempt to create a DateTime object from the provided date string
|
||||||
$dateTime = \DateTime::createFromFormat('d-m-Y', $dateString);
|
$dateTime = \DateTime::createFromFormat('d-m-Y', $dateString);
|
||||||
|
|
||||||
// Check if the conversion was successful and the date string is in the format dd-mm-yyyy
|
|
||||||
if ($dateTime instanceof \DateTime) {
|
if ($dateTime instanceof \DateTime) {
|
||||||
// Format the date to yyyy-mm-dd
|
|
||||||
return $dateTime->format('Y-m-d');
|
return $dateTime->format('Y-m-d');
|
||||||
} else {
|
} else {
|
||||||
// If the date string is not in the format dd-mm-yyyy, return null
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function convertDateFormatDMY($dateString)
|
||||||
|
{
|
||||||
|
// Attempt to create a DateTime object from the provided date string
|
||||||
|
$dateTime = \DateTime::createFromFormat('Y-m-d', $dateString);
|
||||||
|
|
||||||
|
if ($dateTime instanceof \DateTime) {
|
||||||
|
return $dateTime->format('d-m-Y');
|
||||||
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function deleteDependence()
|
public function deleteDependence()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
print_r($this->rquest);die;
|
|
||||||
if($this->request->getGet('id'))
|
if($this->request->getGet('id'))
|
||||||
{
|
{
|
||||||
$delete = $this->employeeModel->where('id', $this->request->getGet('id'))->delete();
|
$delete = $this->employeeModel->where('id', $this->request->getGet('id'))->delete();
|
||||||
@ -814,55 +822,71 @@ class EmployeeRestController extends AdminController
|
|||||||
public function getEmployeePolicy()
|
public function getEmployeePolicy()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$id = $this->request->getGet('id');
|
$id = $this->request->getGet('id');
|
||||||
$emp_code = $this->request->getGet('emp_code');
|
$emp_code = $this->request->getGet('emp_code');
|
||||||
|
|
||||||
|
// This is an array containing keys to be removed from the terms and conditions array
|
||||||
$keysToRemove = ["removable_keys"];
|
$keysToRemove = ["removable_keys"];
|
||||||
|
// Retrieve employee policy data by passing the employee primary key
|
||||||
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||||
|
// Retrieve employee and dependents data by passing the employee code
|
||||||
|
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('is_addon_value',0)->findAll();
|
||||||
|
|
||||||
|
|
||||||
$empData = $this->employeeModel->where('emp_code',$emp_code)->findAll();
|
|
||||||
// print_r($empData);die;
|
|
||||||
if ($empPolicy) {
|
if ($empPolicy) {
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($empPolicy as $array) {
|
foreach ($empPolicy as $array) {
|
||||||
|
// Reset employee array
|
||||||
|
$empData = $employeeData;
|
||||||
|
|
||||||
|
// Removes specific keys from the decoded array and assigns the result to $refusingData
|
||||||
$decodedArray = json_decode($array->Policy_Terms);
|
$decodedArray = json_decode($array->Policy_Terms);
|
||||||
$refusingData = (object) array_diff_key((array) $decodedArray, array_flip($keysToRemove));
|
$refusingData = (object) array_diff_key((array) $decodedArray, array_flip($keysToRemove));
|
||||||
|
|
||||||
|
|
||||||
$array->Policy_Terms = $refusingData;
|
$array->Policy_Terms = $refusingData;
|
||||||
|
|
||||||
|
// Retrieve slab rate and grid master data by passing the ClientPolicyId and ClientId
|
||||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array->ClientPolicyId,$array->ClientId);
|
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array->ClientPolicyId,$array->ClientId);
|
||||||
$array->SlabRates = $getSlabAndGridData['slab_rates'];
|
$array->SlabRates = $getSlabAndGridData['slab_rates'];
|
||||||
$array->GridMaster = $getSlabAndGridData['grid_master'];
|
$array->GridMaster = $getSlabAndGridData['grid_master'];
|
||||||
|
|
||||||
|
// Construct value for policy type GPA
|
||||||
if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){
|
if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){
|
||||||
|
|
||||||
$selfData = array_filter($empData, fn($arr) => $arr['family_floater_key'] === 'self');
|
// Filter employee data where the family_floater_key is 'self'
|
||||||
|
$selfData = array_filter($empData, fn($arr) => trim(strtolower($arr['family_floater_key'])) === 'self');
|
||||||
$self['is_value_exist'] = true;
|
$self['is_value_exist'] = true;
|
||||||
$self['data']['family_floater_key'] = 'self';
|
$self['data']['family_floater_key'] = 'self';
|
||||||
$self['data']['employee_id'] = $id;
|
$self['data']['employee_id'] = $id;
|
||||||
$self['data']['relationship'] = 'Self';
|
$self['data']['relationship'] = 'Self';
|
||||||
$self['data']['name'] = $selfData[0]['name'];
|
$self['data']['name'] = $selfData[0]['name'];
|
||||||
$self['data']['dob'] = $selfData[0]['dob'];
|
$self['data']['dob'] = $this->convertDateFormatDMY($selfData[0]['dob']);
|
||||||
|
$self['data']['mobile'] = $selfData[0]['mobile'];
|
||||||
$self['data']['client_policy_id'] = $array->ClientPolicyId;
|
$self['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||||
|
|
||||||
$array->mapped_family_floaters = $self;
|
$array->mapped_family_floaters = $self;
|
||||||
|
|
||||||
|
// Return result
|
||||||
if($this->request->getGet('policy') == 'GPA'){
|
if($this->request->getGet('policy') == 'GPA')
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' => $array], 200);
|
{
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => $array], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Construct value for policy type GMC
|
||||||
}else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC"){
|
}else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC"){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//map family floates array to employee and dependent
|
// Map family floaters that already exist in the employee table
|
||||||
$familyFloates = $array->Policy_Terms->family_floaters;
|
$familyFloates = $array->Policy_Terms->family_floaters;
|
||||||
|
// Generate Notes string based on familyFloates terms
|
||||||
|
$array->notes = $this->FloterNotesConvertion($familyFloates);
|
||||||
|
// Convert familyFloaters terms data to plain array
|
||||||
|
$floters = $this->FloterConvertion($familyFloates);
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($familyFloates as $familyFloatesValue) {
|
foreach ($floters as $familyFloatesValue) {
|
||||||
$dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
$dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
||||||
if(count($empData)){
|
if(count($empData)){
|
||||||
foreach ($empData as $key => $value) {
|
foreach ($empData as $key => $value) {
|
||||||
@ -872,29 +896,49 @@ public function getEmployeePolicy()
|
|||||||
$temp['data']['employee_id'] = $value['id'];
|
$temp['data']['employee_id'] = $value['id'];
|
||||||
$temp['data']['relationship'] = $value['relationship'];
|
$temp['data']['relationship'] = $value['relationship'];
|
||||||
$temp['data']['name'] = $value['name'];
|
$temp['data']['name'] = $value['name'];
|
||||||
$temp['data']['dob'] = $value['dob'];
|
$temp['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
|
||||||
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
|
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||||
|
$temp['data']['form_type'] = $dependent;
|
||||||
array_push($data,$temp);
|
array_push($data,$temp);
|
||||||
unset($empData[$key]);
|
unset($empData[$key]);
|
||||||
$familyFloates = array_diff($familyFloates, [$familyFloatesValue]);
|
$floters = array_diff($floters, [$familyFloatesValue]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($familyFloates as $familyFloatesValue) {
|
// Remove Unwanted floter key from floters array based on either-parents-pil term value
|
||||||
|
if($familyFloates->{'either-parents-pil'} == 1 && count($floters))
|
||||||
|
{
|
||||||
|
$count_parent = 0;
|
||||||
|
$count_parent_in_law = 0;
|
||||||
|
foreach ($floters as $value) {
|
||||||
|
if (preg_replace('/\d/', '', $value) == 'parent') { $count_parent++; }
|
||||||
|
if (preg_replace('/\d/', '', $value) == 'parent_in_law') {$count_parent_in_law++;}
|
||||||
|
}
|
||||||
|
if($count_parent != 2) {
|
||||||
|
$floters = array_filter($floters, fn($value) => strpos($value, 'parent_in_law') === false);
|
||||||
|
}
|
||||||
|
if($count_parent_in_law != 2) {
|
||||||
|
$floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false || strpos($value, 'parent_in_law') !== false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add family floter buttons placement data for FE validation
|
||||||
|
if(count($floters)){
|
||||||
|
foreach ($floters as $familyFloatesValue) {
|
||||||
|
|
||||||
$temp2['is_value_exist'] = false;
|
$temp2['is_value_exist'] = false;
|
||||||
$temp2['data']['family_floater_key'] = $familyFloatesValue;
|
$temp2['data']['family_floater_key'] = $familyFloatesValue;
|
||||||
$temp2['data']['client_policy_id'] = $array->ClientPolicyId;
|
$temp2['data']['client_policy_id'] = $array->ClientPolicyId;
|
||||||
$temp2['data']['button_name'] = 'Add '.ucfirst(preg_replace('/\d/', '', $familyFloatesValue));
|
$temp2['data']['button_name'] = 'Add '.ucfirst(str_replace('_', ' ', preg_replace('/\d/', '', $familyFloatesValue)));
|
||||||
$temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue);
|
$temp2['data']['form_type'] = preg_replace('/\d/', '', $familyFloatesValue);
|
||||||
|
|
||||||
array_push($data,$temp2);
|
array_push($data,$temp2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$array->mapped_family_floaters = $data;
|
$array->mapped_family_floaters = $data;
|
||||||
|
|
||||||
@ -908,7 +952,201 @@ public function getEmployeePolicy()
|
|||||||
|
|
||||||
$result[] = $array;
|
$result[] = $array;
|
||||||
}
|
}
|
||||||
//return $this->respond(['status' => 'success','code' => 200,'data' => $result], 200);
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function FloterConvertion($array){
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
foreach ($array as $key => $value) {
|
||||||
|
if ($value > 0) {
|
||||||
|
if ($value != 0 && $key === 'childrens') {
|
||||||
|
for ($i = 1; $i <= $value; $i++) {
|
||||||
|
$result[] = "child" . $i;
|
||||||
|
}
|
||||||
|
} else if($value != 0 && $key ==='parents') {
|
||||||
|
for ($i = 1; $i <= $value; $i++) {
|
||||||
|
$result[] = "parent" . $i;
|
||||||
|
}
|
||||||
|
}else if($value != 0 && $key ==='parents-in-law') {
|
||||||
|
for ($i = 1; $i <= $value; $i++) {
|
||||||
|
$result[] = "parent_in_law" . $i;
|
||||||
|
}
|
||||||
|
}else if($value != 0 && $key ==='either-parents-pil') {
|
||||||
|
for ($i = 1; $i <= 2; $i++) {
|
||||||
|
$result[] = "parent" . $i;
|
||||||
|
$result[] = "parent_in_law" . $i;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
$result[] = $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function FloterNotesConvertion($array){
|
||||||
|
|
||||||
|
$result = 'Can Add Self ';
|
||||||
|
foreach ($array as $key => $value) {
|
||||||
|
if ($value > 0) {
|
||||||
|
if($value != 0 && $key ==='either-parents-pil') {
|
||||||
|
$result .= ' + Either 2 Parents or 2 Parents in law';
|
||||||
|
}else if($value != 0 && $key ==='spouse') {
|
||||||
|
$string = str_replace('-', ' ', $key);
|
||||||
|
$string = ucwords($string);
|
||||||
|
$result .= ' + '.$string;
|
||||||
|
}else if($value != 0 && $key ==='self') {
|
||||||
|
}else{
|
||||||
|
$string = str_replace('-', ' ', $key);
|
||||||
|
$string = ucwords($string);
|
||||||
|
$result .= ' + '.$value.' '.$string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public function getClientDetails()
|
||||||
|
// {
|
||||||
|
// // try {
|
||||||
|
|
||||||
|
// $client = $this->clientModel->where('id',$this->request->getGet('client_id'))->first();
|
||||||
|
// // Retrieve employee and dependents data by passing the employee code
|
||||||
|
// $employeeData = $this->employeeModel->where('emp_code','EMP001-K1')->where('is_addon_value',0)->findAll();
|
||||||
|
// $addOnEmployeeData = $this->employeeModel->where('emp_code','EMP001-K1')->where('is_addon_value',1)->findAll();
|
||||||
|
// if($client) {
|
||||||
|
// $client['client_logo'] = base_url().'public/uploads/logo/'.$client['client_logo'];
|
||||||
|
// $clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
|
||||||
|
// $PolicyData = [];
|
||||||
|
// foreach ($clientPolicy as $key => $array) {
|
||||||
|
// // Reset employee array
|
||||||
|
// $empData = $employeeData;
|
||||||
|
|
||||||
|
// $decodedArray = json_decode($array['policy_terms']);
|
||||||
|
// $policy_terms = $decodedArray;
|
||||||
|
// $getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array['id'],$array['client_id']);
|
||||||
|
// // print_r($getSlabAndGridData);die;
|
||||||
|
// $data['SlabRates'] = $getSlabAndGridData['slab_rates'];
|
||||||
|
// $data['GridMaster'] = $getSlabAndGridData['grid_master'];
|
||||||
|
// $data['client_id'] = $array['client_id'];
|
||||||
|
// $data['client_policy_id'] = $array['id'];
|
||||||
|
// $data['is_addon'] = $array['is_addon'];
|
||||||
|
// $data['open_for_enrollment'] = $array['open_for_enrollment'];
|
||||||
|
// $data['policy_terms'] = $decodedArray;
|
||||||
|
|
||||||
|
// // Map family floaters that already exist in the employee table
|
||||||
|
// $familyFloates = $policy_terms->family_floaters;
|
||||||
|
// // Generate Notes string based on familyFloates terms
|
||||||
|
// $array['notes'] = $this->FloterNotesConvertion($familyFloates);
|
||||||
|
// // Convert familyFloaters terms data to plain array
|
||||||
|
// $floters = $this->FloterConvertion($familyFloates);
|
||||||
|
// print_r($familyFloates);
|
||||||
|
// print_r($floters);
|
||||||
|
|
||||||
|
// $data1 = [];
|
||||||
|
// foreach ($floters as $familyFloatesValue) {
|
||||||
|
// $dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
||||||
|
// if(count($addOnEmployeeData)){
|
||||||
|
// foreach ($addOnEmployeeData as $key => $value) {
|
||||||
|
// if ($value['family_floater_key'] === $dependent) {
|
||||||
|
// $temp['is_value_exist'] = true;
|
||||||
|
// $temp['data']['family_floater_key'] = $familyFloatesValue;
|
||||||
|
// $temp['data']['employee_id'] = $value['id'];
|
||||||
|
// $temp['data']['relationship'] = $value['relationship'];
|
||||||
|
// $temp['data']['name'] = $value['name'];
|
||||||
|
// $temp['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
|
||||||
|
// $temp['data']['client_policy_id'] = $array['id'];
|
||||||
|
// $temp['data']['form_type'] = $dependent;
|
||||||
|
// array_push($data1,$temp);
|
||||||
|
// unset($addOnEmployeeData[$key]);
|
||||||
|
// $floters = array_diff($floters, [$familyFloatesValue]);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// //Remove Unwanted floter key from floters array based on either-parents-pil term value
|
||||||
|
// if($familyFloates->{'either-parents-pil'} == 1 && count($floters))
|
||||||
|
// {
|
||||||
|
// if(count($addOnEmployeeData) == 0)
|
||||||
|
// {
|
||||||
|
// $GMCEmpData = $this->employeeModel->where('emp_code','EMP001-K1')
|
||||||
|
// ->where('is_addon_value',0)
|
||||||
|
// ->where('family_floater_key','parent')
|
||||||
|
// ->findAll();
|
||||||
|
// if(count($GMCEmpData)){
|
||||||
|
// $floters = array_diff($floters, [$familyFloatesValue]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// $count_parent = 0;
|
||||||
|
// $count_parent_in_law = 0;
|
||||||
|
// foreach ($floters as $value) {
|
||||||
|
// if (preg_replace('/\d/', '', $value) == 'parent') { $count_parent++; }
|
||||||
|
// if (preg_replace('/\d/', '', $value) == 'parent_in_law') {$count_parent_in_law++;}
|
||||||
|
// }
|
||||||
|
// if($count_parent != 2) {
|
||||||
|
// $floters = array_filter($floters, fn($value) => strpos($value, 'parent_in_law') === false);
|
||||||
|
// }
|
||||||
|
// if($count_parent_in_law != 2) {
|
||||||
|
// $floters = array_filter($floters, fn($value) => strpos($value, 'parent') === false || strpos($value, 'parent_in_law') !== false);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// print_r($floters);
|
||||||
|
// // Add family floter buttons placement data for FE validation
|
||||||
|
// if(count($floters)){
|
||||||
|
// foreach ($floters as $familyFloatesValue) {
|
||||||
|
|
||||||
|
// $temp2['is_value_exist'] = false;
|
||||||
|
// $temp2['data']['family_floater_key'] = $familyFloatesValue;
|
||||||
|
// $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);
|
||||||
|
|
||||||
|
// array_push($data1,$temp2);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $data['mapped_family_floaters'] = $data1;
|
||||||
|
|
||||||
|
// array_push($PolicyData, $data);
|
||||||
|
// return $this->respond(['status' => 'success','code' => 200,'data' => ['client'=>$client,'client_policy'=>$PolicyData]], 200);
|
||||||
|
// }
|
||||||
|
// return $this->respond(['status' => 'success','code' => 200,'data' => ['client'=>$client,'client_policy'=>$PolicyData]], 200);
|
||||||
|
|
||||||
|
// }else{
|
||||||
|
// return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||||
|
// }
|
||||||
|
// // } catch (\Exception $e) {
|
||||||
|
// // return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
|
||||||
|
public function getClientDetails()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$client = $this->clientModel->where('id',$this->request->getGet('client_id'))->first();
|
||||||
|
if($client) {
|
||||||
|
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll();
|
||||||
|
return $this->respond(['status' => 'success','code' => 200,'data' => ['client'=>$client,'client_policy'=>$clientPolicy]], 200);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,8 @@ class EmployeeModel extends Model
|
|||||||
"updated_by",
|
"updated_by",
|
||||||
"updated_at",
|
"updated_at",
|
||||||
"is_active",
|
"is_active",
|
||||||
"file_id"
|
"file_id",
|
||||||
|
"is_addon_value"
|
||||||
];
|
];
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
|
|||||||
@ -176,8 +176,6 @@
|
|||||||
|
|
||||||
$('.btnBack').click(function(){
|
$('.btnBack').click(function(){
|
||||||
$('#policy_form')[0].reset();
|
$('#policy_form')[0].reset();
|
||||||
$('#GMC').remove();
|
|
||||||
$('#GPA').remove();
|
|
||||||
$('#add_form').hide();
|
$('#add_form').hide();
|
||||||
$('#table_list').show();
|
$('#table_list').show();
|
||||||
$('.btnBack').hide();
|
$('.btnBack').hide();
|
||||||
@ -339,8 +337,8 @@
|
|||||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a href="#" data-id="${item.id}" class="dropdown-item btnPolicyMaster" data-toggle="modal" id="${search_term}"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||||
<a href="#" data-id="${item.id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
|
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
|
||||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
|
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user