diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 02ad65bc..49bd9a77 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1272,7 +1272,7 @@ public function getAddOnPolicy() try { $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',1)->findAll(); - $GMCEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',0)->findAll(); + $clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id')) @@ -1327,7 +1327,7 @@ public function getAddOnPolicy() } - if($array['is_addon'] == 3) + if($array['is_addon'] == 3)//dependent add on policy { @@ -1437,14 +1437,21 @@ public function getAddOnPolicy() } //array_push($PolicyData, $responce); - }else if($array['is_addon'] == 2){ + + }else if($array['is_addon'] == 2)//Topup policy + { + $getAddOnType = $this->clientPolicyModel->where('id',$array['base_policy'])->where('policy_status', 1)->get()->getRow(); + $basePolicyAddOnType = $getAddOnType->is_addon; + // if is_addon value is 1 it is GMC if not it is one of the Add On policy + if($basePolicyAddOnType == 1){ $is_addon_value = 0; }else{ $is_addon_value = 1; } $only_si_array = []; $only_si_value = 0; $only_si_premium_value = 0; $only_si_gst_value = 0; - foreach ($GMCEmployeeData as $key => $value) { + $BasePolicyEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',$is_addon_value)->findAll(); + foreach ($BasePolicyEmployeeData as $key => $value) { $employee_policy = $this->employeePolicyModel->where('employee_id',$value['id'])->where('client_policy_id',$array['id'])->where('is_active', 1 )->get()->getRow(); if(isset($employee_policy->basic_cover_si)){ $only_si_value = $employee_policy->basic_cover_si; } diff --git a/app/Views/layout/header.php b/app/Views/layout/header.php index dc06d7c0..f07176f8 100644 --- a/app/Views/layout/header.php +++ b/app/Views/layout/header.php @@ -607,7 +607,7 @@ $currentUrl = base_url(); $parsedUrl = parse_url($currentUrl); $baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/'; - $redirectUrl = $baseUrl . 'nhanceTicket/staff/login_done?' . http_build_query(['token' => $sessionData]); + $redirectUrl = $baseUrl . 'Ticketing/nhance_login?' . http_build_query(['token' => $sessionData]); ?>