MERGE_UAT_DISCUSSIONS_FIX_1
@ -218,11 +218,12 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("init-Emp-onboard/(:any)", "EmployeeController::initiateManualEmployeesOnboardProcess/$1");
|
||||
$routes->get("full-excel-error-file/(:any)", "EmployeeController::downloadFullExcelErrorFile/$1");
|
||||
$routes->get("id-card", "EmployeeController::viewECard/$1");
|
||||
$routes->get("preview-card/(:any)", "EmployeeController::previewTemplate/$1");
|
||||
});
|
||||
|
||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||
$routes->cli('cli/processjobs', 'JobWorker::processJobs');
|
||||
|
||||
$routes->get("processjob", "JobWorker::processJob");
|
||||
|
||||
|
||||
//Employee login api's
|
||||
@ -271,6 +272,8 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
||||
$routes->get("removeEmpAndEmpPolicyData", "EmployeeRestController::removeEmpAndEmpPolicyData");
|
||||
|
||||
$routes->post("calculatePremium", "EmployeeRestController::calculatePremium");
|
||||
|
||||
$routes->get("getEmployeeOldPolicy", "EmployeeRestController::getEmployeeOldPolicy");
|
||||
});
|
||||
|
||||
$routes->post("sendEmail", "EmployeeRestController::send_email");
|
||||
|
||||
@ -264,20 +264,20 @@ class ClientController extends AdminController
|
||||
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
||||
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||
|
||||
// dd('Hi');
|
||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
||||
|
||||
foreach ($clientPoliceData as $key => $value) {
|
||||
// dd($this->clientPolicyModel->getLastQuery());
|
||||
// foreach ($clientPoliceData as $key => $value) {
|
||||
|
||||
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||
}
|
||||
// $clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||
// $clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||
// }
|
||||
|
||||
$editData['client_policy'] = $clientPoliceData;
|
||||
|
||||
|
||||
// echo "<pre>";
|
||||
// dd($editData); die;
|
||||
// dd($clientPoliceData); die;
|
||||
|
||||
echo view('layout/header', $headerData);
|
||||
echo view('client_onboarding', $editData);
|
||||
@ -609,28 +609,33 @@ class ClientController extends AdminController
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||
$data['policy_status'] = 1;
|
||||
$data['inception_type'] = $this->request->getPost('inception_type') ? 1 : 2;
|
||||
|
||||
|
||||
|
||||
|
||||
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
||||
|
||||
if ( $this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
||||
if ($this->request->getPost('is_addon') == 2 || $this->request->getPost('is_addon') == 3) {
|
||||
|
||||
if ($this->request->getPost('is_addon') == 3) {
|
||||
$policyTerm = $policy_terms['policy_terms'];
|
||||
$decoded_policyTerm = json_decode($policyTerm, true);
|
||||
$decoded_policyTerm['family_floater'] =0;
|
||||
$decoded_policyTerm['family_floaters']['self'] =0;
|
||||
$decoded_policyTerm['family_floaters']['spouse'] =0;
|
||||
$decoded_policyTerm['family_floaters']['childrens'] =0;
|
||||
$decoded_policyTerm['family_floaters']['parents'] =0;
|
||||
$decoded_policyTerm['family_floaters']['parents-in-law'] =0;
|
||||
$decoded_policyTerm['family_floaters']['either-parents-pil'] =0;
|
||||
$decoded_policyTerm['family_floater'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['self'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['spouse'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['childrens'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['parents'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['parents-in-law'] = 0;
|
||||
$decoded_policyTerm['family_floaters']['either-parents-pil'] = 0;
|
||||
|
||||
$data['policy_terms'] = json_encode($decoded_policyTerm);
|
||||
}else{
|
||||
$data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
} else {
|
||||
|
||||
if ($this->request->getPost('policy_type_id') != 3) {
|
||||
|
||||
$data['policy_terms'] = $policy_terms['policy_terms'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,6 +701,8 @@ class ClientController extends AdminController
|
||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||
$data['policy_status'] = 1;
|
||||
$data['inception_type'] = $this->request->getPost('inception_type') ? 1 : 2;
|
||||
|
||||
|
||||
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
||||
|
||||
@ -747,12 +754,19 @@ class ClientController extends AdminController
|
||||
$policy_type = $this->request->getPost('policy_type');
|
||||
$client_id = $this->request->getPost('client_id');
|
||||
$client_policy_id = $this->request->getPost('client_policy_id');
|
||||
$premium_type = $this->request->getPost('premium_type');
|
||||
// $premium_type = $this->request->getPost('premium_type');
|
||||
if (!empty($client_id) && $client_id != null) {
|
||||
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
$client_id = $client_policy_data['client_id'];
|
||||
}
|
||||
$policy_grid_id = $this->request->getPost('policy_grid_id');
|
||||
|
||||
if($policy_grid_id == 10 || $policy_grid_id == 11){
|
||||
$premium_type = 1;
|
||||
}else{
|
||||
$premium_type = 2;
|
||||
}
|
||||
|
||||
$si_or_bp = $this->request->getPost('si_or_bp');
|
||||
$basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier'));
|
||||
$premium_multiplier = str_replace(',', '', $this->request->getPost('premium_multiplier'));
|
||||
@ -776,10 +790,14 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
if ($policy_grid_id == '1') {
|
||||
|
||||
|
||||
if ($si_or_bp == '1') {
|
||||
|
||||
$premium = str_replace(',', '', $this->request->getPost('gpa_sum_premium[]'));
|
||||
$sum_insure = str_replace(',', '', $this->request->getPost('gpa_sum_si[]'));
|
||||
$multiplier = $this->request->getPost('gpa_sum_multiplier');
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['si'] = $sum_insure[$i];
|
||||
$data['premium'] = $premium[$i];
|
||||
@ -788,7 +806,26 @@ class ClientController extends AdminController
|
||||
|
||||
$policyPremium = $this->policyPremium1Model->insert($data);
|
||||
}
|
||||
} else {
|
||||
|
||||
} else if ($si_or_bp == '3') {
|
||||
|
||||
$premium = str_replace(',', '', $this->request->getPost('gpa_sum_premium2[]'));
|
||||
$sum_insure = str_replace(',', '', $this->request->getPost('gpa_sum_si2[]'));
|
||||
$multiplier = $this->request->getPost('gpa_sum_multiplier2');
|
||||
$grade = $this->request->getPost('gpa_band[]');
|
||||
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['si'] = $sum_insure[$i];
|
||||
$data['premium'] = $premium[$i];
|
||||
$data['grade'] = $grade[$i];
|
||||
$data['multiplier'] = $multiplier;
|
||||
$data['si_or_bp'] = $this->request->getPost('si_or_bp');
|
||||
|
||||
$policyPremium = $this->policyPremium1Model->insert($data);
|
||||
}
|
||||
|
||||
}else {
|
||||
|
||||
$data['premium'] = str_replace(',', '', $this->request->getPost('gpa_basic_premium'));
|
||||
$data['si'] = str_replace(',', '', $this->request->getPost('gpa_basic_si'));
|
||||
$data['basic_multiplier'] = str_replace(',', '', $this->request->getPost('basic_multiplier'));
|
||||
@ -798,6 +835,7 @@ class ClientController extends AdminController
|
||||
|
||||
$policyPremium = $this->policyPremium1Model->insert($data);
|
||||
}
|
||||
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '2') {
|
||||
@ -819,6 +857,8 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '4') {
|
||||
|
||||
|
||||
$premium = $this->request->getPost('4_premium[]');
|
||||
$sum_insure = $this->request->getPost('4_si');
|
||||
$age_from = $this->request->getPost('4_age_from[]');
|
||||
@ -832,6 +872,8 @@ class ClientController extends AdminController
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
|
||||
|
||||
} else if ($policy_grid_id == '5') {
|
||||
$premium = $this->request->getPost('5_premium[]');
|
||||
$sum_insure = $this->request->getPost('5_si[]');
|
||||
@ -847,19 +889,23 @@ class ClientController extends AdminController
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
} else if ($policy_grid_id == '6') {
|
||||
|
||||
|
||||
$premium = $this->request->getPost('6_premium[]');
|
||||
$sum_insure = $this->request->getPost('6_si[]');
|
||||
$sum_insure = $this->request->getPost('6_si');
|
||||
$age_from = $this->request->getPost('6_age_from[]');
|
||||
$age_to = $this->request->getPost('6_age_to[]');
|
||||
for ($i = 0; $i < count($premium); $i++) {
|
||||
$data['premium'] = str_replace(',', '', $premium[$i]);
|
||||
$data['si'] = str_replace(',', '', $sum_insure[$i]);
|
||||
$data['si'] = str_replace(',', '', $sum_insure);
|
||||
$data['age_from'] = $age_from[$i];
|
||||
$data['age_to'] = $age_to[$i];
|
||||
$dataa = $this->policyPremium2Model->insert($data);
|
||||
}
|
||||
$data = $this->request->getPost();
|
||||
$insert = true;
|
||||
|
||||
|
||||
} else if ($policy_grid_id == '7') {
|
||||
$premium = $this->request->getPost('7_premium[]');
|
||||
$sum_insure = $this->request->getPost('7_si[]');
|
||||
@ -1117,12 +1163,13 @@ class ClientController extends AdminController
|
||||
|
||||
try {
|
||||
foreach ($results as $index => $record) {
|
||||
if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) {
|
||||
if ($index == '0' || $index == '1' || $index == '2') {
|
||||
// if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) {
|
||||
if ($family_floater == 1) {
|
||||
if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
|
||||
$resultss[$index] = $record;
|
||||
}
|
||||
} else {
|
||||
if ($index == '3' || $index == '4' || $index == '5' || $index == '6' || $index == '8' || $index == '7' || $index == '9' || $index == '10') {
|
||||
if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
|
||||
$resultss[$index] = $record;
|
||||
}
|
||||
}
|
||||
@ -1174,7 +1221,8 @@ class ClientController extends AdminController
|
||||
public function policyGMCTerms()
|
||||
{
|
||||
try {
|
||||
// print_r($this->request->getPost('family_floaters'));die;
|
||||
// echo "<pre>";
|
||||
// print_r($this->request->getPost());die;
|
||||
$this->myLogger->logme('error','Terms CREATE function called');
|
||||
|
||||
/*** Client Policy Table Primary Key(ID) ***/
|
||||
@ -1183,7 +1231,19 @@ class ClientController extends AdminController
|
||||
$data['sum_insured'] =str_replace(',', '',$this->request->getPost("sum_insured"));
|
||||
$data['family_floater'] =$this->request->getPost("family_floater");
|
||||
$data['corporatebuffer'] = $this->request->getPost("corporatebuffer");
|
||||
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
|
||||
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
|
||||
|
||||
// print_r($this->request->getPost());die;
|
||||
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
|
||||
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
|
||||
$data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age");
|
||||
$data['age_ratio']['spouse']['max'] = $this->request->getPost("spouse_max_age");
|
||||
$data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age");
|
||||
$data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age");
|
||||
$data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age");
|
||||
$data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age");
|
||||
|
||||
|
||||
|
||||
// if (!in_array("self", $data['family_floaters'])) {
|
||||
// array_unshift($data['family_floaters'], "self");
|
||||
@ -1254,7 +1314,8 @@ class ClientController extends AdminController
|
||||
$data['family_floaters']['either-parents-pil'] =0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data['family_floaters']['elders_count'] =$this->request->getPost("member_count");
|
||||
|
||||
$data['waiverofpreexistingdiseases'] =$this->request->getPost("waiverofpreexistingdiseases");
|
||||
if ($data['waiverofpreexistingdiseases'] == 1) {
|
||||
@ -1340,23 +1401,24 @@ class ClientController extends AdminController
|
||||
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
$policy_name = $this->policesModel->select('name')->where('id', $record['policy_id'])->first();
|
||||
|
||||
$emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
->where("employees.client_id", $record['client_id'])
|
||||
->where("employees.emp_status",'active')
|
||||
->countAllResults();
|
||||
// $emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
// ->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
// ->where("employees.client_id", $record['client_id'])
|
||||
// ->where("employees.emp_status",'active')
|
||||
// ->countAllResults();
|
||||
|
||||
$emp_count_by_policy = $this->employeePolicyModel->where('client_policy_id',$client_policy_id)->where('is_active',1)->countAllResults();
|
||||
if($emp_count == 0){
|
||||
$emp_count = true;
|
||||
}else{
|
||||
$emp_count = false;
|
||||
}
|
||||
|
||||
// if($emp_count == 0){
|
||||
// $emp_count = true;
|
||||
// }else{
|
||||
// $emp_count = false;
|
||||
// }
|
||||
|
||||
if ($record) {
|
||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'count' => $emp_count, 'policy_name' => $policy_name,'policy_addon' => $record['is_addon'], 'emp_count_by_policy'=>$emp_count_by_policy], 200);
|
||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'policy_name' => $policy_name,'policy_addon' => $record['is_addon'], 'emp_count_by_policy'=>$emp_count_by_policy], 200);
|
||||
} else {
|
||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'policy_name' => $policy_name], 200);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1371,6 +1433,8 @@ class ClientController extends AdminController
|
||||
|
||||
$data['sumInsured2'] =str_replace(',', '', $this->request->getPost("sumInsured2"));
|
||||
$data['totalSumInsured'] =str_replace(',', '',$this->request->getPost("totalSumInsured"));
|
||||
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
|
||||
$data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
|
||||
$data['accidentalDeathBenefit'] =str_replace(',', '',$this->request->getPost("accidentalDeathBenefit"));
|
||||
$data['permanentTotalDisablement'] =str_replace(',', '',$this->request->getPost("permanentTotalDisablement"));
|
||||
$data['permanentPartialDisablement'] =$this->request->getPost("permanentPartialDisablement");
|
||||
@ -1416,6 +1480,9 @@ class ClientController extends AdminController
|
||||
$data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
$data['terrorism'] = $this->request->getPost("terrorism");
|
||||
$data['worldwideCover'] = $this->request->getPost("worldwideCover");
|
||||
$data['gpa_special_condition_label'] = str_replace(',', '',$this->request->getPost("gpa_special_condition_label")) ?? [];
|
||||
$data['gpa_special_condition_input'] = str_replace(',', '',$this->request->getPost("gpa_special_condition_input")) ?? [];
|
||||
|
||||
|
||||
$jsonData = json_encode($data);
|
||||
$dataa = array(
|
||||
@ -1507,7 +1574,7 @@ class ClientController extends AdminController
|
||||
}
|
||||
|
||||
// Check if 'family_floater' key exists and has a value
|
||||
if (isset($termsData->family_floater) && empty($termsData->family_floater)) {
|
||||
if (isset($termsData->family_floater) && $termsData->family_floater == null) {
|
||||
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Family Floater field is empty'], 200);
|
||||
}
|
||||
|
||||
|
||||
@ -1598,7 +1598,7 @@ class EmpDataServiceController extends BaseController
|
||||
foreach ($ids as $key => $id) {
|
||||
|
||||
$get_emp_email_and_other_details = $this->employeePolicyModel
|
||||
->select('employee_polices.client_policy_id, employees.emp_code, employees.email_corporate, employees.name, employee_polices.rand_string, employee_polices.tpa_id')
|
||||
->select('employee_polices.client_policy_id, employees.emp_code, employees.email_corporate, employees.name, employees.id as employee_id, employees.emp_code employee_polices.rand_string, employee_polices.tpa_id')
|
||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||
->where('employees.emp_status', 'active')
|
||||
->where('employees.is_active', '1')
|
||||
@ -1608,7 +1608,9 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
if ($get_emp_email_and_other_details != null && $get_emp_email_and_other_details != "") {
|
||||
|
||||
$employee_id = $get_emp_email_and_other_details['employee_id'];
|
||||
$name = $get_emp_email_and_other_details['name'];
|
||||
$emp_code = $get_emp_email_and_other_details['name'];
|
||||
$email = $get_emp_email_and_other_details['email_corporate'];
|
||||
$rand_string = $get_emp_email_and_other_details['rand_string'];
|
||||
$tpa_id = $get_emp_email_and_other_details['tpa_id'];
|
||||
@ -1645,7 +1647,17 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
// dd($data);
|
||||
$this->myLogger->logme('error', 'status : {status}, message : {message}, email : {email}', $data);
|
||||
|
||||
}else{
|
||||
|
||||
$this->myLogger->log('error', 'The employee (primaryKey : {id}, Name : {name}, Emp Code : {emp_code} ) has no corporate email.', ['id' => $employee_id, 'name' => $name, 'emp_code' => $emp_code]);
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$this->myLogger->log('error', 'The employee policy ID ( {id} ) has no active policy or the employee is not active.', ['id' => $id]);
|
||||
|
||||
}
|
||||
}
|
||||
return true; // Email(s) sent successfully
|
||||
@ -1655,4 +1667,5 @@ class EmpDataServiceController extends BaseController
|
||||
return false; // Email(s) sending failed
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ use App\Models\FileModel;
|
||||
use App\Models\ClientPolicyModel;
|
||||
use App\Models\PolicyPremium1Model;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
use App\Models\PolicyTypeModel;
|
||||
|
||||
use App\Controllers\Jobs ;
|
||||
use App\Controllers\JobWorker ;
|
||||
@ -47,6 +48,7 @@ class EmployeeRestController extends AdminController
|
||||
protected $clientPolicyModel;
|
||||
protected $policyPremium1Model;
|
||||
protected $policyPremium2Model;
|
||||
protected $policyTypeModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -62,6 +64,7 @@ class EmployeeRestController extends AdminController
|
||||
$this->clientPolicyModel = new ClientPolicyModel();
|
||||
$this->policyPremium1Model = new PolicyPremium1Model();
|
||||
$this->policyPremium2Model = new PolicyPremium2Model();
|
||||
$this->policyTypeModel = new PolicyTypeModel();
|
||||
}
|
||||
|
||||
|
||||
@ -518,134 +521,7 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
// public function getEmployeePolicy()
|
||||
// {
|
||||
// try {
|
||||
// $id = $this->request->getGet('id');
|
||||
// $emp_code = $this->request->getGet('emp_code');
|
||||
|
||||
// $keysToRemove = ["removable_keys"];
|
||||
|
||||
// $empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||
|
||||
// $empData = $this->employeeModel->where('emp_code',$emp_code)->findAll();
|
||||
// if ($empPolicy) {
|
||||
|
||||
// $result = [];
|
||||
// foreach ($empPolicy as $array) {
|
||||
|
||||
// $decodedArray = json_decode($array->Policy_Terms);
|
||||
// $refusingData = (object) array_diff_key((array) $decodedArray, array_flip($keysToRemove));
|
||||
|
||||
|
||||
// $array->Policy_Terms = $refusingData;
|
||||
// $getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array->ClientPolicyId,$array->ClientId);
|
||||
// $array->SlabRates = $getSlabAndGridData['slab_rates'];
|
||||
// $array->GridMaster = $getSlabAndGridData['grid_master'];
|
||||
|
||||
// if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){
|
||||
// $default_si = $array->Policy_Terms->sumInsured2;
|
||||
// $index = -1;
|
||||
// foreach ($array->SlabRates as $key => $value) {
|
||||
// if ($value['si'] == $default_si) {
|
||||
// $index = $key;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if ($index >= 0) {
|
||||
// $element =$array->SlabRates[$index];
|
||||
// array_splice($array->SlabRates, $index, 1);
|
||||
// array_unshift($array->SlabRates, $element);
|
||||
// }
|
||||
|
||||
// $employee_policy = $this->employeePolicyModel->where('employee_id',$id)->where('client_policy_id',$array->ClientPolicyId)->get()->getRow();
|
||||
// if($employee_policy){
|
||||
// $gpaSI['family_floater_key'] = 'self';
|
||||
// $gpaSI['label'] = 'Self';
|
||||
// $gpaSI['employee_id'] = $employee_policy->employee_id;
|
||||
// $gpaSI['basic_cover_si'] = isset($employee_policy->basic_cover_si) ? $employee_policy->basic_cover_si : null;
|
||||
// $gpaSI['premium'] = isset($employee_policy->premium) ? $employee_policy->premium : null;
|
||||
// $gpaSI['client_policy_id'] = $array->ClientPolicyId;
|
||||
|
||||
// $array->mapped_family_floaters = $gpaSI;
|
||||
// }else{
|
||||
// $gpaSI['family_floater_key'] = 'self';
|
||||
// $gpaSI['label'] = 'Self';
|
||||
// $gpaSI['employee_id'] = $id;
|
||||
// $gpaSI['basic_cover_si'] = null;
|
||||
// $gpaSI['premium'] = null;
|
||||
// $gpaSI['client_policy_id'] = $array->ClientPolicyId;
|
||||
|
||||
// $array->mapped_family_floaters = $gpaSI;
|
||||
// }
|
||||
|
||||
// }else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC"){
|
||||
|
||||
// // re-arranging order of si
|
||||
// $default_si = $array->Policy_Terms->sum_insured;
|
||||
// // Filter the array using the callback function
|
||||
// $getPremium = array_filter($array->SlabRates , function ($value) use ($default_si) { return $value['si'] == $default_si; } );
|
||||
// $default_premium = $getPremium[0]['premium'];
|
||||
|
||||
// $index = -1;
|
||||
// foreach ($array->SlabRates as $key => $value) {
|
||||
// if ($value['si'] == $default_si) {
|
||||
// $index = $key;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if ($index >= 0) {
|
||||
// $element =$array->SlabRates[$index];
|
||||
// array_splice($array->SlabRates, $index, 1);
|
||||
// array_unshift($array->SlabRates, $element);
|
||||
// }
|
||||
|
||||
// //map family floates array to employee and dependent
|
||||
// $familyFloates = $array->Policy_Terms->family_floaters;
|
||||
// $data = [];
|
||||
// foreach ($familyFloates as $familyFloatesValue) {
|
||||
// $dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
||||
// if(count($empData)){
|
||||
// foreach ($empData as $key => $value) {
|
||||
// if ($value['family_floater_key'] === $dependent) {
|
||||
// $employee_policy = $this->employeePolicyModel->where('employee_id',$value['id'])->where('client_policy_id',$array->ClientPolicyId)->get()->getRow();
|
||||
// $temp['family_floater_key'] = $familyFloatesValue;
|
||||
// $temp['label'] = $value['relationship'];
|
||||
// $temp['name'] = $value['name'];
|
||||
// $temp['employee_id'] = $value['id'];
|
||||
// $temp['basic_cover_si'] = isset($employee_policy->basic_cover_si) ? $employee_policy->basic_cover_si : null;
|
||||
// $temp['premium'] = isset($employee_policy->premium) ? $employee_policy->premium : null;
|
||||
// $temp['client_policy_id'] = $array->ClientPolicyId;
|
||||
// array_push($data,$temp);
|
||||
// unset($empData[$key]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// $array->mapped_family_floaters = $data;
|
||||
|
||||
// $temp2=[];
|
||||
// foreach ($array->SlabRates as $key => $value) {
|
||||
// $value['additional_premium'] = $value['premium'] - $default_premium;
|
||||
// array_push($temp2,$value);
|
||||
// }
|
||||
// $array->SlabRates = $temp2;
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// $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);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// Get the RelationShip list
|
||||
|
||||
@ -1039,10 +915,11 @@ public function getEmployeePolicy()
|
||||
$keysToRemove = ["removable_keys"];
|
||||
// Retrieve employee policy data by passing the employee primary key
|
||||
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||
|
||||
// Retrieve employee and dependents data by passing the employee code
|
||||
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id)
|
||||
->where('is_active', 1 )->where('is_addon_value',0)->findAll();
|
||||
// dd($empPolicy);
|
||||
|
||||
|
||||
if ($empPolicy) {
|
||||
|
||||
@ -1050,8 +927,8 @@ public function getEmployeePolicy()
|
||||
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);
|
||||
$refusingData = (object) array_diff_key((array) $decodedArray, array_flip($keysToRemove));
|
||||
@ -1062,12 +939,17 @@ public function getEmployeePolicy()
|
||||
$array->SlabRates = $getSlabAndGridData['slab_rates'];
|
||||
$array->GridMaster = $getSlabAndGridData['grid_master'];
|
||||
|
||||
if($array->tpa_id != null){
|
||||
$array->eCardDownload = base_url('download-e-card/') . $array->rand_string;
|
||||
}else{ $array->eCardDownload = null; }
|
||||
|
||||
|
||||
// Construct value for policy type GPA
|
||||
if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){
|
||||
|
||||
|
||||
// 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['data']['family_floater_key'] = 'self';
|
||||
$self['data']['employee_id'] = $id;
|
||||
@ -1089,7 +971,7 @@ public function getEmployeePolicy()
|
||||
}else if($getSlabAndGridData['grid_master']['policy_type'] == "GMC"){
|
||||
|
||||
|
||||
|
||||
|
||||
// Map family floaters that already exist in the employee table
|
||||
$familyFloates = $array->Policy_Terms->family_floaters;
|
||||
|
||||
@ -1164,28 +1046,171 @@ public function getEmployeePolicy()
|
||||
}
|
||||
|
||||
$array->mapped_family_floaters = $data;
|
||||
|
||||
$array->type = "Group Medical Coverage";
|
||||
|
||||
$checkGmcParentsPolicyExist = $this->clientPolicyModel->select('client_policy.id as ClientPolicyId , client_policy.client_id as ClientId, policies.id as PolicyId , client_policy.policy_type_id as policy_type_id, policies.name as Policy_Name , client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type , client_policy.policy_terms as Policy_Terms')
|
||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||
->where('client_policy.policy_type_id', 3 )
|
||||
->where('client_policy.is_addon', 1 )
|
||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||
->where('client_policy.is_active', 1 )
|
||||
->get()
|
||||
->getResult();
|
||||
if($checkGmcParentsPolicyExist)
|
||||
{
|
||||
$GmcParrentsData = $this->getGmcParrentsPolicy($checkGmcParentsPolicyExist,$emp_code,$client_id);
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => [$array,$GmcParrentsData]], 200);
|
||||
|
||||
}
|
||||
|
||||
if($this->request->getGet('policy') == 'GMC'){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $array], 200);
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => [$array]], 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// $result[] = $array;
|
||||
}
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => []], 200);
|
||||
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
|
||||
{
|
||||
|
||||
$employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id)
|
||||
->where('is_active', 1 )->where('is_addon_value',0)->findAll();
|
||||
foreach ($GmcParrentsPolicy as $key => $array) {
|
||||
|
||||
|
||||
|
||||
// Reset employee array
|
||||
$empData = $employeeData;
|
||||
|
||||
|
||||
$array->Policy_Terms = json_decode($array->Policy_Terms);
|
||||
|
||||
|
||||
// Retrieve slab rate and grid master data by passing the ClientPolicyId and ClientId
|
||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array->ClientPolicyId,$array->ClientId);
|
||||
$array->SlabRates = $getSlabAndGridData['slab_rates'];
|
||||
$array->GridMaster = $getSlabAndGridData['grid_master'];
|
||||
|
||||
$tpaArray = $this->employeeModel->select('employees.name as name , employee_polices.tpa_id as tpa_id , employee_polices.rand_string as rand_string')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code',$emp_code)
|
||||
->where('employees.is_active',1)
|
||||
->where('employee_polices.client_policy_id',$array->ClientPolicyId)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
if(count($tpaArray))
|
||||
{
|
||||
|
||||
if($tpaArray[0]->tpa_id != null)
|
||||
$array->eCardDownload = base_url('download-e-card/') . $tpaArray[0]->rand_string;
|
||||
else
|
||||
$array->eCardDownload = null;
|
||||
|
||||
}else{
|
||||
$array->eCardDownload = null;
|
||||
}
|
||||
|
||||
// if($array->tpa_id != null){
|
||||
// $array->eCardDownload = base_url('download-e-card/') . $array->rand_string;
|
||||
// }else{ $array->eCardDownload = null; }
|
||||
$array->eCardDownload = null;
|
||||
|
||||
// Map family floaters that already exist in the employee table
|
||||
$familyFloates = $array->Policy_Terms->family_floaters;
|
||||
|
||||
// Generate Notes string based on familyFloates terms
|
||||
$array->notes = $this->FloterNotesConvertion($familyFloates);
|
||||
|
||||
if($getSlabAndGridData['slab_rates'][0]['premium_type'] == 1)
|
||||
{
|
||||
$array->floter_text_heading = 'Floater Sum Insured';
|
||||
$array->floter_text_description = 'This is a floater sum insured. A floater is a type of sum insured that provides coverage to more than one member ot a family at the same time. Simply put, its a single insurance cover for the entire family.';
|
||||
}else{
|
||||
$array->floter_text_heading = 'Sum Insured';
|
||||
$array->floter_text_description = '';
|
||||
}
|
||||
|
||||
// Convert familyFloaters terms data to plain array
|
||||
$floters = $this->FloterConvertion($familyFloates);
|
||||
|
||||
$data = [];
|
||||
foreach ($floters as $familyFloatesValue) {
|
||||
$dependent = preg_replace('/\d/', '', $familyFloatesValue);
|
||||
if(count($empData)){
|
||||
foreach ($empData 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->ClientPolicyId;
|
||||
$temp['data']['form_type'] = $dependent;
|
||||
array_push($data,$temp);
|
||||
unset($empData[$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))
|
||||
{
|
||||
$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['data']['family_floater_key'] = $familyFloatesValue;
|
||||
$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);
|
||||
|
||||
array_push($data,$temp2);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$array->mapped_family_floaters = $data;
|
||||
$array->type = "Group Medical Coverage - Parents";
|
||||
|
||||
return $array;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public function FloterConvertion($array){
|
||||
|
||||
$result = [];
|
||||
@ -1219,7 +1244,7 @@ public function FloterConvertion($array){
|
||||
|
||||
public function FloterNotesConvertion($array){
|
||||
|
||||
$result = 'Can Add Self ';
|
||||
$result = ' ';
|
||||
foreach ($array as $key => $value) {
|
||||
if ($value > 0) {
|
||||
if($value != 0 && $key ==='either-parents-pil') {
|
||||
@ -1229,6 +1254,7 @@ public function FloterNotesConvertion($array){
|
||||
$string = ucwords($string);
|
||||
$result .= ' + '.$string;
|
||||
}else if($value != 0 && $key ==='self') {
|
||||
$result = 'Can Add Self ';
|
||||
}else if($value != 0 && $key ==='childrens') {
|
||||
if($value > 1){ $result .= ' + '.$value.' Children'; }else{ $result .= ' + '.$value.' Child'; }
|
||||
}else{
|
||||
@ -1265,17 +1291,19 @@ 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'))->findAll();
|
||||
// dd($clientPolicy);
|
||||
$clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))
|
||||
->where('policy_status', 1)
|
||||
->findAll();
|
||||
|
||||
if(count($clientPolicy))
|
||||
{
|
||||
$PolicyData = [];
|
||||
foreach ($clientPolicy as $key => $array) {
|
||||
$responce = [];
|
||||
|
||||
|
||||
$decodedArray = json_decode($array['policy_terms']);
|
||||
$policy_terms = $decodedArray;
|
||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array['id'],$array['client_id']);
|
||||
@ -1286,8 +1314,28 @@ public function getAddOnPolicy()
|
||||
$responce['client_id'] = $array['client_id'];
|
||||
$responce['client_policy_id'] = $array['id'];
|
||||
$responce['is_addon'] = $array['is_addon'];
|
||||
$responce['open_for_enrollment'] = $array['open_for_enrollment'];
|
||||
$responce['OpenForEnrollment'] = $array['open_for_enrollment'];
|
||||
$responce['policy_terms'] = $decodedArray;
|
||||
$responce['policy_type_id'] = $array['policy_type_id'];
|
||||
|
||||
$tpaArray = $this->employeeModel->select('employees.name as name , employee_polices.tpa_id as tpa_id , employee_polices.rand_string as rand_string')
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
->where('employees.emp_code',$this->request->getGet('emp_code'))
|
||||
->where('employees.is_active',1)
|
||||
->where('employee_polices.client_policy_id',$array['id'])
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
if(count($tpaArray))
|
||||
{
|
||||
if($tpaArray[0]->tpa_id != null)
|
||||
$responce['eCardDownload'] = base_url('download-e-card/') . $tpaArray[0]->rand_string;
|
||||
else
|
||||
$responce['eCardDownload'] = null;
|
||||
|
||||
}else{
|
||||
$responce['eCardDownload'] = null;
|
||||
}
|
||||
|
||||
if(count($getSlabAndGridData['slab_rates'])){
|
||||
if($getSlabAndGridData['slab_rates'][0]['premium_type'] == 1)
|
||||
@ -1299,7 +1347,7 @@ public function getAddOnPolicy()
|
||||
}
|
||||
|
||||
|
||||
if($array['is_addon'] == 3)
|
||||
if($array['is_addon'] == 3 && $array['policy_type_id'] == 3)//dependent add on policy
|
||||
{
|
||||
|
||||
|
||||
@ -1409,14 +1457,29 @@ public function getAddOnPolicy()
|
||||
}
|
||||
|
||||
//array_push($PolicyData, $responce);
|
||||
}else if($array['is_addon'] == 2){
|
||||
|
||||
}else if($array['is_addon'] == 2 && $array['policy_type_id'] == 4)//Topup policy
|
||||
{
|
||||
|
||||
$whereArray = [];
|
||||
foreach ( $decodedArray->family_floaters as $key => $value) {
|
||||
if($value != 0){
|
||||
if($key == 'parents'){ $text = 'parent'; }else if($key == 'childrens'){ $text = 'child'; }else{ $text = $key; }
|
||||
array_push($whereArray,$text);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$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)->whereIn('family_floater_key',$whereArray)->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; }
|
||||
@ -1438,12 +1501,62 @@ public function getAddOnPolicy()
|
||||
$responce['family_floaters_of_only_si_value'] = $only_si_value;
|
||||
$responce['family_floaters_of_only_si_premium_value'] = $only_si_premium_value;
|
||||
$responce['family_floaters_of_only_si_gst_value'] = $only_si_gst_value;
|
||||
$responce['type'] = "Group Medical Coverage - Top Up";
|
||||
|
||||
if($this->request->getGet('policy') == 'GMC-SI-TOPUP'){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => ['gmc_si_topup'=>$responce]], 200);
|
||||
}
|
||||
|
||||
|
||||
}else if($array['is_addon'] == 2 && $array['policy_type_id'] == 5)//Parents Topup policy
|
||||
{
|
||||
|
||||
$whereArray = [];
|
||||
foreach ( $decodedArray->family_floaters as $key => $value) {
|
||||
if($value != 0){
|
||||
if($key == 'parents'){ $text = 'parent'; }else if($key == 'childrens'){ $text = 'child'; }else{ $text = $key; }
|
||||
array_push($whereArray,$text);
|
||||
}
|
||||
}
|
||||
|
||||
$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;
|
||||
$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)->whereIn('family_floater_key',$whereArray)->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; }
|
||||
if(isset($employee_policy->premium)){ $only_si_premium_value = $only_si_premium_value + $employee_policy->premium;}
|
||||
if(isset($employee_policy->gst)){ $only_si_gst_value = $only_si_gst_value + $employee_policy->gst;}
|
||||
$temp3['is_value_exist'] = true;
|
||||
$temp3['data']['employee_id'] = $value['id'];
|
||||
$temp3['data']['relationship'] = $value['relationship'];
|
||||
$temp3['data']['name'] = $value['name'];
|
||||
$temp3['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
|
||||
$temp3['data']['client_policy_id'] = $array['id'];
|
||||
$temp3['data']['basic_cover_si'] = isset($employee_policy->basic_cover_si) ? $employee_policy->basic_cover_si : null;
|
||||
$temp3['data']['premium'] = isset($employee_policy->premium) ? $employee_policy->premium : null;
|
||||
array_push($only_si_array,$temp3);
|
||||
|
||||
}
|
||||
|
||||
$responce['family_floaters_of_only_si_array'] = $only_si_array;
|
||||
$responce['family_floaters_of_only_si_value'] = $only_si_value;
|
||||
$responce['family_floaters_of_only_si_premium_value'] = $only_si_premium_value;
|
||||
$responce['family_floaters_of_only_si_gst_value'] = $only_si_gst_value;
|
||||
$responce['type'] = "Group Medical Coverage - Parents Top Up";
|
||||
|
||||
if($this->request->getGet('policy') == 'GMC-SI-PARENT-TOPUP'){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => ['gmc_si_parent_topup'=>$responce]], 200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1452,7 +1565,7 @@ public function getAddOnPolicy()
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => []], 200);
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 404);
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()], 500);
|
||||
@ -1554,6 +1667,8 @@ public function getCashDepositData()
|
||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.client_id as clientId , client_policy.insurer_id as insurerId,insurers.name as insurer_name')
|
||||
->join('insurers', 'client_policy.insurer_id = insurers.id', 'left')
|
||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||
->where('client_policy.is_active', 1 )
|
||||
->where('client_policy.policy_status', 1)
|
||||
->groupBy('client_policy.insurer_id')
|
||||
->findAll();
|
||||
$result = [];
|
||||
@ -1569,15 +1684,18 @@ public function getCashDepositData()
|
||||
$data['balance'] = count($data['depositData']) ? $data['depositData'][0]->balance : 0;
|
||||
|
||||
$data['policyDetails'] = [];
|
||||
$ClientPolicyData =$this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, policies.id as policy_id,policies.policy_type_id as policy_type_id, policies.name as policy_name , client_policy.is_addon as is_addon')
|
||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.id as client_policy_id , client_policy.client_id as client_id, policies.id as policy_id , client_policy.policy_type_id as policy_type_id, policies.name as policy_name , client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type ')
|
||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||
->where('client_policy.insurer_id', $value['insurerId'] )
|
||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||
->where('client_policy.is_active', 1 )
|
||||
->where('client_policy.policy_status', 1)
|
||||
->findAll();
|
||||
// dd( $ClientPolicyData);
|
||||
foreach ($ClientPolicyData as $key => $value)
|
||||
{
|
||||
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard( $value['client_policy_id'],$value['client_id']);
|
||||
if($value['is_addon'] == "2"){ $value['type'] = 'SI TopUp'; }else if($value['is_addon'] == "3"){ $value['type'] = 'Dependent AddOn'; }else{ $value['type'] = $getSlabAndGridData['grid_master']['policy_type']; }
|
||||
|
||||
$value['type'] = $this->policyTypeModel->where('id',$value['policy_type_id'])->get()->getRow()->policy_type;
|
||||
$employeeDetails = $this->employeePolicyModel->getEmployeePolicy( client_id:$value['client_id'],policy_id: $value['client_policy_id'],status:0);
|
||||
$enrolledCount = 0;
|
||||
$draftCount = 0;
|
||||
@ -1740,7 +1858,7 @@ public function removeEmpAndEmpPolicyData()
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => [] ], 404);
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => [] ], 200);
|
||||
}
|
||||
|
||||
|
||||
@ -1752,4 +1870,93 @@ public function removeEmpAndEmpPolicyData()
|
||||
|
||||
|
||||
|
||||
|
||||
function getEmployeeOldPolicy()
|
||||
{
|
||||
$ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type')
|
||||
->join('policies', 'client_policy.policy_id = policies.id', 'left')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
||||
->where('client_policy.client_id', $this->request->getGet('client_id') )
|
||||
->where('client_policy.is_active', 1 )
|
||||
->where('client_policy.policy_status', 0)
|
||||
->orderby('client_policy.id' , 'ASC')
|
||||
->findAll();
|
||||
|
||||
// Retrieve employee and dependents data by passing the employee code
|
||||
$employeeData = $this->employeeModel->where('emp_code',$this->request->getGet('emp_code'))
|
||||
->where('client_id',$this->request->getGet('client_id'))
|
||||
->where('is_active', 1 )->findAll();
|
||||
$whereArrayForId = [];
|
||||
foreach ( $employeeData as $key => $value) { array_push($whereArrayForId, $value['id']); }
|
||||
|
||||
if(count($ClientPolicyData) > 0 && count($employeeData) > 0)
|
||||
{
|
||||
$result = [];
|
||||
foreach ($ClientPolicyData as $key => $ClientPolicyValue) {
|
||||
|
||||
$terms = json_decode($ClientPolicyValue['policy_terms']);
|
||||
// dd($terms);
|
||||
$data['client_id'] = $ClientPolicyValue['client_id'];
|
||||
$data['client_policy_id'] = $ClientPolicyValue['id'];
|
||||
$data['policy_name'] = $ClientPolicyValue['policy_name'];
|
||||
$data['policy_type'] = $ClientPolicyValue['policy_type'];
|
||||
$data['policy_type'] = $ClientPolicyValue['policy_type'];
|
||||
$data['policy_start_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_start_date']);
|
||||
$data['policy_end_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_end_date']);
|
||||
|
||||
if($ClientPolicyValue['policy_type_id'] == 1){ $data['heading'] = 'Group Personal Accident Coverage'; }else
|
||||
if($ClientPolicyValue['policy_type_id'] == 2){ $data['heading'] = 'Group Medical Coverage'; }else
|
||||
if($ClientPolicyValue['policy_type_id'] == 3){ $data['heading'] = 'Group Medical Coverage - Parents'; }else
|
||||
if($ClientPolicyValue['policy_type_id'] == 4){ $data['heading'] = 'Group Medical Coverage - Top Up'; }else
|
||||
if($ClientPolicyValue['policy_type_id'] == 5){ $data['heading'] = 'Group Medical Coverage - Parents (Top Up)'; }
|
||||
|
||||
if($ClientPolicyValue['policy_type_id'] == 1){ $data['floter_text_heading'] = 'Sum Insured'; }
|
||||
else
|
||||
{
|
||||
if($terms->family_floater == 1){ $data['floter_text_heading'] = 'Floter Sum Insured'; }else{ $data['floter_text_heading'] = 'Sum Insured'; }
|
||||
}
|
||||
|
||||
$employee_policy = $this->employeePolicyModel->select('employees.*,employee_polices.employee_id , employee_polices.basic_cover_si , employee_polices.premium , employee_polices.gst , employee_polices.tpa_id , employee_polices.rand_string')
|
||||
->join('employees', 'employee_polices.employee_id = employees.id', 'left')
|
||||
->whereIn('employee_polices.employee_id',$whereArrayForId)
|
||||
->where('employee_polices.client_policy_id',$ClientPolicyValue['id'])
|
||||
->where('employee_polices.is_active', 1 )->findAll();
|
||||
$si_value = 0;
|
||||
$si_premium_value = 0;
|
||||
$si_gst_value = 0;
|
||||
foreach ($employee_policy as $key => $value) {
|
||||
if(isset($value['basic_cover_si'])){ $si_value = $value['basic_cover_si']; }
|
||||
if(isset($value['premium'])){ $si_premium_value = $si_premium_value + $value['premium'];}
|
||||
if(isset($value['gst'])){ $si_gst_value = $si_gst_value + $value['gst'];}
|
||||
}
|
||||
|
||||
$data['si_value'] = $si_value;
|
||||
$data['si_premium_value'] = ($ClientPolicyValue['policy_type_id'] == 1 || $ClientPolicyValue['policy_type_id'] == 2) ? 0 : $si_premium_value;
|
||||
$data['si_gst_value'] = ($ClientPolicyValue['policy_type_id'] == 1 || $ClientPolicyValue['policy_type_id'] == 2) ? 0 : $si_gst_value;
|
||||
|
||||
$data['EmployeePolicy'] = $employee_policy;
|
||||
array_push($result, $data);
|
||||
}
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result ], 200);
|
||||
|
||||
}else{
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => [] ], 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function convertDateFormatDisplay($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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -34,7 +34,7 @@ class EmployeeServiceController extends AdminController
|
||||
protected $policiesModel;
|
||||
protected $empEndorsementModel;
|
||||
protected $general_relationships = ['self' => ['name' => 'Self', 'gender' => 'M','age_min' => 18,'age_max' => null], 'spouse' => ['name' => 'Spouse', 'gender' => 'F','age_min' => 18,'age_max' => null], 'son' => ['name' => 'Son', 'gender' => 'M','age_min' => null,'age_max' => 25], 'daughter' => ['name' => 'Daughter', 'gender' => 'F','age_min' => null,'age_max' => 25], 'father' => ['name' => 'Father', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother' => ['name' => 'Mother', 'gender' => 'F','age_min' => 18,'age_max' => null], 'father-in-law' => ['name' => 'Father in Law', 'gender' => 'M','age_min' => 18,'age_max' => null], 'mother-in-law' => ['name' => 'Mother in Law', 'gender' => 'F','age_min' => 18,'age_max' => null]];
|
||||
protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship','policy_terms']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
|
||||
protected $inception_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'dob'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'DOB','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_dob_diff','params'=>['row','relationship','default_age_ratio']],'gender'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Gender','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['M','F']],'relationship'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'RELATIONSHIP','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_relationship','params'=>['row','relationship','policy_terms']],'basic_cover_si'=>['col_idx'=>6,'col_cell_name'=>'G','col_name'=>'BASIC COVER SI','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom' => 'check_si','params' => ['row','policy_terms','slab_details']],'doc'=>['col_idx'=>7,'col_cell_name'=>'H','col_name'=>'Date of Coverage','is_mandatory'=>['A','DA'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'params'=>['row']],'doj'=>['col_idx'=>8,'col_cell_name'=>'I','col_name'=>'DOJ','is_mandatory'=>false,'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null,'custom'=>'check_doj','params'=>['row']],'basic_pay'=>['col_idx'=>9,'col_cell_name'=>'J','col_name'=>'Basic Pay','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_basic_pay','params'=>['row','policy_terms','slab_details']],'band_grade'=>['col_idx'=>10,'col_cell_name'=>'K','col_name'=>'Band/Grade','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null,'custom'=>'check_employee_band','params'=>['row','policy_terms','slab_details']],'designation'=>['col_idx'=>11,'col_cell_name'=>'L','col_name'=>'Designation','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'phone'=>['col_idx'=>12,'col_cell_name'=>'M','col_name'=>'Phone','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'email'=>['col_idx'=>13,'col_cell_name'=>'N','col_name'=>'Email','is_mandatory'=>false,'data_type'=>'str','format'=>null,'allowed_values'=>null],'pre_existing_ailments'=>['col_idx'=>14,'col_cell_name'=>'O','col_name'=>'PRE EXISTING AILMENTS','is_mandatory'=>['I','A','DA'],'data_type'=>'str','format'=>null,'allowed_values'=>['0','1']],'change_event'=>['col_idx'=>15,'col_cell_name'=>'P','col_name'=>'Change event','is_mandatory'=>['A','DA','D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>16,'col_cell_name'=>'Q','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>17,'col_cell_name'=>'R','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
|
||||
|
||||
protected $deletion_excel_columns = ['sno'=>['col_idx'=>0,'col_cell_name'=>'A','col_name'=>'S.No','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'emp_id'=>['col_idx'=>1,'col_cell_name'=>'B','col_name'=>'EMP ID','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'name_of_emp_dep'=>['col_idx'=>2,'col_cell_name'=>'C','col_name'=>'NAME OF EMP/DEP','is_mandatory'=>true,'data_type'=>'str','format'=>null,'allowed_values'=>null],'change_event'=>['col_idx'=>3,'col_cell_name'=>'D','col_name'=>'Change event','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null],'date_of_exit'=>['col_idx'=>4,'col_cell_name'=>'E','col_name'=>'Date of exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>'d-M-Y','allowed_values'=>null],'reason_for_exit'=>['col_idx'=>5,'col_cell_name'=>'F','col_name'=>'Reason for exit','is_mandatory'=>['D'],'data_type'=>'str','format'=>null,'allowed_values'=>null]];
|
||||
|
||||
@ -140,11 +140,12 @@ class EmployeeServiceController extends AdminController
|
||||
// dd($columns_to_check);die();
|
||||
|
||||
// get policy and rack details
|
||||
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
$policy_terms = json_decode($policy_terms[0]->policy_terms);
|
||||
$policy_details = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
$policy_terms = json_decode($policy_details[0]->policy_terms);
|
||||
$policy_terms = (array) $policy_terms;// convert obj to array
|
||||
$default_age_ratio = isset($policy_details[0]->age_ratio) ? json_decode($policy_details[0]->age_ratio) : [];
|
||||
//
|
||||
// dd($policy_terms);
|
||||
// dd($default_age_ratio);
|
||||
|
||||
//get policy slab rates
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
|
||||
@ -169,10 +170,12 @@ class EmployeeServiceController extends AdminController
|
||||
{
|
||||
break;
|
||||
}
|
||||
//iterate each row
|
||||
|
||||
//iterate each row for columns validations
|
||||
foreach ($row as $col_key => $col)
|
||||
{
|
||||
|
||||
|
||||
$is_mandatory = $columns_to_check[$keys[$col_key]]['is_mandatory'];
|
||||
$format = $columns_to_check[$keys[$col_key]]['format'];
|
||||
$allowed_values = $columns_to_check[$keys[$col_key]]['allowed_values'];
|
||||
@ -263,19 +266,14 @@ class EmployeeServiceController extends AdminController
|
||||
$result['error_summary'] = array_count_values($result['error_summary']);
|
||||
$status = 'failed';
|
||||
$failure_reason = ((json_encode($result)));
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
|
||||
$this->fileModel->where('id', $file_id)->set(['status' => $status,'reason' => $failure_reason])->update();
|
||||
$this->myLogger->logme("error",'{file_id} uploaded failed',['file_id' => $file_id]);
|
||||
//return $this->respond(['dataStatus' => true,'code' => 404,'data' => 'file upload failed with errors'], 200);
|
||||
// dd($failure_reason);
|
||||
|
||||
|
||||
//print_r($r);
|
||||
}
|
||||
else //trigger next data validation via job queue server
|
||||
{
|
||||
//proceed next data level validation in JOB queue
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
||||
$r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]);
|
||||
// $jobWorker = new JobWorker();
|
||||
// JobWorker::processJob($r);
|
||||
}
|
||||
@ -350,13 +348,15 @@ class EmployeeServiceController extends AdminController
|
||||
if($file['action'] == 'dependent_addition')
|
||||
{
|
||||
$existing_famility_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],client_policy_id: $file ['policy_id'],emp_status: ['active'],policy_status:['active']);
|
||||
// dd($existing_famility_details);
|
||||
// dd(($existing_famility_details));
|
||||
//transsform familiy details from db columns to exxcel row with column indexs for checking remaining functionalitites
|
||||
$existing_famility_details = transform_db_data_to_excel($existing_famility_details,$file);
|
||||
// dd($existing_famility_details);
|
||||
// dd(array_keys($existing_famility_details[0]));
|
||||
$family = array_merge($family,$existing_famility_details);
|
||||
// kint::dump($family);
|
||||
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again is bring self to first index of the array
|
||||
}
|
||||
// kint::dump($family);die();
|
||||
// kint::dump($family);//die();
|
||||
//check name dup within a family
|
||||
|
||||
if($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addition')
|
||||
@ -373,14 +373,26 @@ class EmployeeServiceController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
if(($file['action'] == 'inception' || $file['action'] == 'addition') && ($policy_details['is_addon'] != 3)) // 3 is depent addon
|
||||
if(($file['action'] == 'inception' || $file['action'] == 'addition' || $file['action'] == 'dependent_addition') && ($policy_details['policy_type_id'] != 3)) // 3 is GMC parents (base policy or dep addon)
|
||||
{
|
||||
$res = check_self_available_in_family($family,$file['action']);
|
||||
// dd($res);
|
||||
if(!$res['is_self_found'])
|
||||
{
|
||||
array_push($result['error_summary'],14); // Self not found
|
||||
$result['error_data'][ $res['emp_code'] ]['name_of_emp_dep']['error'][] = "Self not found ";
|
||||
$result['error_data'][ $res['row_id'] ]['sno']['error'][] = "Self not found ";
|
||||
}
|
||||
}
|
||||
|
||||
//check self avaialbe where self data is not available either in excel or same policy (i.e.) gMC parents
|
||||
if($policy_details['policy_type_id'] == 3) // 3 is GMC parents (base policy or dep addon)
|
||||
{
|
||||
$self_details = $this->employeeModel->getEmpFamilybyEmpCode(emp_code: $emp_id,client_id: $file['client_id'],emp_status: ['active'],policy_status:['active']);
|
||||
// dd($self_details);
|
||||
if(!count($self_details))
|
||||
{
|
||||
array_push($result['error_summary'],14); // Self not found
|
||||
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found ";
|
||||
}
|
||||
}
|
||||
|
||||
@ -458,9 +470,8 @@ class EmployeeServiceController extends AdminController
|
||||
else //inception OR addition OR dependent addition
|
||||
{
|
||||
//proceed next data level validation in JOB queue
|
||||
$job_details = new Jobs();
|
||||
|
||||
$r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]);
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'employeesOnboardPreprocess','payload' => ['file_id' => $file_id]]);
|
||||
// $jobWorker = new JobWorker();
|
||||
// JobWorker::processJob($r);
|
||||
}
|
||||
@ -501,7 +512,12 @@ class EmployeeServiceController extends AdminController
|
||||
}
|
||||
|
||||
$columns_to_check = [];
|
||||
if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; }
|
||||
if($file['action'] == 'inception'){ $columns_to_check = $this->inception_excel_columns; }
|
||||
if($file['action'] == 'addition'){ $columns_to_check = $this->inception_excel_columns; }
|
||||
if($file['action'] == 'dependent_addition'){ $columns_to_check = $this->inception_excel_columns; }
|
||||
if($file['action'] == 'deletion'){ $columns_to_check = $this->deletion_excel_columns; }
|
||||
if($file['action'] == 'correction'){ $columns_to_check = $this->correction_excel_columns; }
|
||||
if($file['action'] == 'si_enhancement'){ $columns_to_check = $this->si_enhance_excel_columns; }
|
||||
|
||||
// get policy and rack details
|
||||
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
|
||||
@ -515,6 +531,7 @@ class EmployeeServiceController extends AdminController
|
||||
|
||||
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
|
||||
$allowedHighestColumn = end($columns_to_check);
|
||||
// dd($allowedHighestColumn);
|
||||
$excel_data = $sheet->rangeToArray('A1:' . $allowedHighestColumn['col_cell_name'] . $highestRowAndColumn['row']);
|
||||
unset($excel_data[0]);
|
||||
|
||||
@ -537,6 +554,7 @@ class EmployeeServiceController extends AdminController
|
||||
$existing_famility_details = transform_db_data_to_excel($existing_famility_details,$file);
|
||||
// Kint::dump($existing_famility_details);
|
||||
$family = array_merge($family,$existing_famility_details);
|
||||
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again is bring self to first index of the array
|
||||
// dd($family);
|
||||
}
|
||||
|
||||
@ -826,15 +844,10 @@ class EmployeeServiceController extends AdminController
|
||||
{
|
||||
$familiy_data = $params['familiy_data'];
|
||||
$file = $params['file'];
|
||||
// dd($file);
|
||||
// print_r($familiy_data);
|
||||
// echo '------------------------------------------------------';
|
||||
|
||||
|
||||
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($file['policy_id'],$file['client_id']);
|
||||
foreach($familiy_data as $fkey => $value)
|
||||
{
|
||||
if($file['id'] == null || $value['temp']['source'] == 'excel') //insert data come from excel and from db i.e. ( $file['id'] == null for enrollment data)
|
||||
if($file['id'] == null || $value['temp']['source'] == 'excel' || (($file['action'] == 'dependent_addition' && in_array($value['temp']['source'],[10,11]) && ($slab_details['slab_rates'][0]['premium_type'] == 1 && strtolower($value['relationship']) == 'self') || ($slab_details['slab_rates'][0]['premium_type'] == 1 || $slab_details['slab_rates'][0]['premium_type'] == null)))) //insert data come from excel and from db i.e. ( $file['id'] == null for enrollment data)
|
||||
{
|
||||
|
||||
$employee = $this->employeeModel->checkExistingEmp($value);
|
||||
@ -842,11 +855,25 @@ class EmployeeServiceController extends AdminController
|
||||
$temp = $value['temp'];
|
||||
unset($value['policy_details']);
|
||||
unset($value['temp']);
|
||||
|
||||
//start implemet of si enhancement of grid type 10,11
|
||||
if(count($employee) && (($file['action'] == 'dependent_addition' && in_array($value['temp']['source'],[10,11]) && ($slab_details['slab_rates'][0]['premium_type'] == 1 && strtolower($value['relationship']) == 'self') || ($slab_details['slab_rates'][0]['premium_type'] == 1 || $slab_details['slab_rates'][0]['premium_type'] == null))))
|
||||
{
|
||||
$res = $this->employeesSIEnhanceProcessWhileOnbboard(employee:$employee[0],policy_data: $policy_data,file:$file);// where employee holds existing emp data and policy_data holds new si enhancement
|
||||
if(!$res)
|
||||
{
|
||||
//if endorsement not happend no need to update emp/policy details in DB.
|
||||
break;
|
||||
}
|
||||
}
|
||||
//end implemet of si enhancement of grid type 10,11
|
||||
|
||||
//save employee table
|
||||
if(count($employee))
|
||||
{
|
||||
$value['updated_by'] = $file['created_by'];
|
||||
$value['id'] = $employee[0]['id'];
|
||||
$value['emp_status'] = 'active';
|
||||
$log_message = 'Update Employee - '.$employee[0]['name'].'('.$employee[0]['emp_code'].') with PK '.$employee[0]['id'];
|
||||
// $this->myLogger->logme('error',('Update - ' . $employee[0]['id'].' - '. $employee[0]['emp_code'] .' - '.$employee[0]['name']));
|
||||
}
|
||||
@ -895,7 +922,50 @@ class EmployeeServiceController extends AdminController
|
||||
}// for end
|
||||
}//function end
|
||||
|
||||
// $employee -> holds existing emp model obj and $policy_data holds new policy changes as array
|
||||
public function employeesSIEnhanceProcessWhileOnbboard(array $employee,array $policy_data,array $file)
|
||||
{
|
||||
$employee = $this->employeeModel->where('emp_code', $employee['emp_code'])->where('name',$employee['name'])->where('client_id',$employee['client_id'])->where('is_active',1)->first();
|
||||
|
||||
$employee_policy = $this->employeePolicyModel->where('employee_id',$employee['id'])->where('client_policy_id',$file['policy_id'])->first();
|
||||
|
||||
$slab_details = $this->policiesModel->getPolicySlabRatesForEmpOnboard($employee_policy['policy_id'],$employee['client_id']);
|
||||
|
||||
//check si has changed in normal case OR check premium only changed, still treat as SI enhancement in grid type 10
|
||||
if($employee_policy['basic_cover_si'] != $policy_data['basic_cover_si'] || ($slab_details['grid_master']['ui_type'] == 10 && $policy_data['premimum'] != null && $policy_data['premimum'] != "" && $employee_policy['premimum'] != $policy_data['premimum']))
|
||||
{
|
||||
$existing_endorsements = $this->empEndorsementModel->where('actions','si')
|
||||
->where('table_name','employee_polices')
|
||||
->where('endorsement_id is null')
|
||||
->where('emp_code',$employee['emp_code'])
|
||||
->where('name',$employee['name'])
|
||||
->where('field_name','basic_cover_si')
|
||||
->findAll();
|
||||
// dd($existing_endorsements);
|
||||
//make entry in endorsement table
|
||||
if(!count($existing_endorsements))
|
||||
{
|
||||
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $policy_data['basic_cover_si'])
|
||||
{
|
||||
$group_key = rand(100000, 999999);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'basic_cover_si','old_value' => $employee_policy['basic_cover_si'],'new_value' => $policy_data['basic_cover_si'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement via DA','group_key' => $group_key,'file_id' => $file['id']]);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'premium','old_value' => $employee_policy['premium'],'new_value' => $slab_value['premium'],'created_by' => $file['created_by'],'remarks' => 'general si enhancement via DA','group_key' => $group_key,'file_id' => $file['id']]);
|
||||
$this->empEndorsementModel->save(['pk' => (int)$employee['id'],'emp_code' => $employee['emp_code'],'table_name' => 'employee_polices','actions' => 'si','name' => $employee['name'],'field_name' => 'si_enhancement_date','old_value' => null,'new_value' => date('Y-m-d'),'created_by' => $file['created_by'],'remarks' => 'general si enhancement via DA','group_key' => $group_key,'file_id' => $file['id']]);
|
||||
$this->myLogger->logme('error',($employee['emp_code'].' - '.$employee['name'].'- ( NEW/OLD SI - '.$employee_policy['basic_cover_si'].'/'.$policy_data['basic_cover_si'].')'. '( NEW/OLD PREMIUM - '.$employee_policy['premium'].'/'.$policy_data['premimum'].') '.' - si enhancement via DA'));
|
||||
return true; //retun true when endorsement inserted
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return false; //retun false when endorsement not happend
|
||||
}
|
||||
return false; //retun false when endorsement not happend
|
||||
|
||||
|
||||
}
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Files\File;
|
||||
|
||||
use App\Models\UserModel;
|
||||
use App\Models\ClientModel;
|
||||
@ -186,8 +187,11 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','Insurer general info function called');
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('insurer_logo'), $uploadFilePath);
|
||||
$data = $this->request->getPost();
|
||||
$data['created_by'] = get_session_userid();
|
||||
$data['insurer_logo'] = $file_name;
|
||||
|
||||
$insert = $this->insurerModel->insert($data);
|
||||
if($insert){
|
||||
@ -249,9 +253,18 @@ class MasterController extends AdminController
|
||||
public function editInsurerGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit Insurer general info function called');
|
||||
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('insurer_logo'), $uploadFilePath);
|
||||
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$data = $this->request->getPost();
|
||||
$data['updated_by'] = get_session_userid();
|
||||
|
||||
if(!empty($file_name)){
|
||||
$data['insurer_logo'] = $file_name;
|
||||
}
|
||||
|
||||
$update = $this->insurerModel->update($id,$data);
|
||||
if($update){
|
||||
echo json_encode(array("status" => true , 'data' => $data));
|
||||
@ -399,10 +412,50 @@ class MasterController extends AdminController
|
||||
{
|
||||
|
||||
$this->myLogger->logme('error','TPA general info function called');
|
||||
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('tpa_logo'), $uploadFilePath);
|
||||
|
||||
$template_bg_path = ROOTPATH . 'public/uploads/template_bg';
|
||||
$front_card_file_name = file_Upload($this->request->getFile('fc'), $template_bg_path);
|
||||
$back_card_file_name = file_Upload($this->request->getFile('bc'), $template_bg_path);
|
||||
|
||||
|
||||
$eCardTemplate = $this->request->getPost('ecard_content');
|
||||
$data = $this->request->getPost();
|
||||
$data['created_by'] = get_session_userid();
|
||||
$data['tpa_logo'] = $file_name;
|
||||
$data['front_card'] = $front_card_file_name;
|
||||
$data['back_card'] = $back_card_file_name;
|
||||
|
||||
$insert = $this->tpaModel->insert($data);
|
||||
|
||||
$tpa_name = (string) $this->request->getPost('name');
|
||||
$short_name = (string) $this->request->getPost('short_name');
|
||||
|
||||
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
|
||||
$file_directory = WRITEPATH . 'e_card_template/';
|
||||
$file_path = $file_directory . $filename;
|
||||
|
||||
// Ensure that the directory exists, if not, create it
|
||||
if (!is_dir($file_directory)) {
|
||||
mkdir($file_directory, 0777, true);
|
||||
}
|
||||
|
||||
// Set the appropriate content type
|
||||
header('Content-type:text/html; charset=utf-8');
|
||||
|
||||
// Write the HTML content to the file
|
||||
$data = file_put_contents($file_path, $eCardTemplate);
|
||||
|
||||
|
||||
if ($data !== false) {
|
||||
$this->myLogger->logme('error', 'TPA: {tpa}, e-Card HTML template file saved successfully: {data}, filepath is: {path}', ['data' => $filename, 'tpa' => $tpa_name, 'path' => $file_path]);
|
||||
} else {
|
||||
$this->myLogger->logme('error', 'TPA: {tpa}, e-Card HTML template file unable to save: {data}', ['data' => $filename, 'tpa' => $tpa_name]);
|
||||
}
|
||||
|
||||
|
||||
if($insert){
|
||||
$tpa_data = $this->tpaModel->where(['id' => $insert, 'is_active' => 1])->first();
|
||||
echo json_encode(array("status" => true , 'data' => $tpa_data));
|
||||
@ -457,11 +510,23 @@ class MasterController extends AdminController
|
||||
$this->myLogger->logme('error','Edit TPA Onboarding function called');
|
||||
$headerData['page_name'] = 'Edit TPA Master';
|
||||
|
||||
$editData['tpa'] = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
$tpa_data = $this->tpaModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||
|
||||
$editData['tpa'] = $tpa_data;
|
||||
$editData['tpa_branch'] = $this->tpaBranchModel->where(['tpa_id' => $id, 'is_active' => 1])->findAll();
|
||||
$editData['state'] = $this->stateModel->getAllStates();
|
||||
|
||||
$filename = strtolower(str_replace(' ', '_', $tpa_data['short_name'])) . '.html';
|
||||
$template_data_path = WRITEPATH . 'e_card_template/';
|
||||
$final_path = $template_data_path . $filename;
|
||||
|
||||
|
||||
if (file_exists($final_path)) {
|
||||
|
||||
$tmplt_data = file_get_contents($final_path);
|
||||
$editData['template_data'] = $tmplt_data;
|
||||
}
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($editData); die;
|
||||
|
||||
@ -477,10 +542,61 @@ class MasterController extends AdminController
|
||||
public function editTPAGeneralInfo()
|
||||
{
|
||||
$this->myLogger->logme('error','edit TPA general info function called');
|
||||
|
||||
$uploadFilePath = ROOTPATH . 'public/uploads/logo/';
|
||||
$file_name = file_Upload($this->request->getFile('tpa_logo'), $uploadFilePath);
|
||||
|
||||
$template_bg_path = ROOTPATH . 'public/uploads/template_bg';
|
||||
$front_card_file_name = file_Upload($this->request->getFile('fc'), $template_bg_path);
|
||||
$back_card_file_name = file_Upload($this->request->getFile('bc'), $template_bg_path);
|
||||
|
||||
$id = $this->request->getPost('PrimaryKey');
|
||||
$data = $this->request->getPost();
|
||||
$data['updated_by'] = get_session_userid();
|
||||
|
||||
if(!empty($file_name)){
|
||||
$data['tpa_logo'] = $file_name;
|
||||
}
|
||||
|
||||
if(!empty($front_card_file_name)){
|
||||
$data['front_card'] = $front_card_file_name;
|
||||
}
|
||||
|
||||
if(!empty($back_card_file_name)){
|
||||
$data['back_card'] = $back_card_file_name;
|
||||
}
|
||||
|
||||
$update = $this->tpaModel->update($id,$data);
|
||||
|
||||
|
||||
$tpa_name = (string) $this->request->getPost('name');
|
||||
$short_name = (string) $this->request->getPost('short_name');
|
||||
$eCardTemplate = $this->request->getPost('ecard_content');
|
||||
|
||||
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
|
||||
$file_directory = WRITEPATH . 'e_card_template/';
|
||||
$file_path = $file_directory . $filename;
|
||||
|
||||
// Ensure that the directory exists, if not, create it
|
||||
if (!is_dir($file_directory)) {
|
||||
mkdir($file_directory, 0777, true);
|
||||
}
|
||||
|
||||
// Set the appropriate content type
|
||||
header('Content-type:text/html; charset=utf-8');
|
||||
|
||||
// Write the HTML content to the file
|
||||
$data = file_put_contents($file_path, $eCardTemplate);
|
||||
|
||||
|
||||
if ($data !== false) {
|
||||
$this->myLogger->logme('error', 'TPA: {tpa}, e-Card HTML template file saved successfully: {data}, filepath is: {path}', ['data' => $filename, 'tpa' => $tpa_name, 'path' => $file_path]);
|
||||
} else {
|
||||
$this->myLogger->logme('error', 'TPA: {tpa}, e-Card HTML template file unable to save: {data}', ['data' => $filename, 'tpa' => $tpa_name]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($update){
|
||||
echo json_encode(array("status" => true , 'data' => $data));
|
||||
}else{
|
||||
@ -504,9 +620,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function editTPABranch()
|
||||
{
|
||||
$this->myLogger->logme('error','TPA branch CREATE function called');
|
||||
@ -548,8 +661,6 @@ class MasterController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function tpaBranchList($id = null)
|
||||
{
|
||||
$this->myLogger->logme('error','TPA List function called');
|
||||
|
||||
@ -96,7 +96,7 @@ class RestAuthenticationController extends AdminController
|
||||
$mobile_number = $this->request->getJSON()->mobile_number;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->first();
|
||||
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
|
||||
if ($employeeData && $otp == $employeeData["otp"] || $employeeData && isset($this->request->getJSON()->login_by_hr)) {
|
||||
$auth = HttpRequestHelper::getRequestInfo();
|
||||
if ($auth) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\EmployeeModel;
|
||||
use Kint\Kint;
|
||||
|
||||
|
||||
if(!function_exists('calculate_days_bw_dates'))
|
||||
@ -78,8 +79,8 @@ if(!function_exists('check_relationship'))
|
||||
$slug = \Config\Services::slug();
|
||||
$col = $slug->slugify($row[5]);
|
||||
// echo $col;//die();
|
||||
// if($col != 'self' && $col != 'spouse')
|
||||
// {
|
||||
if($col != 'self' && $col != 'spouse')
|
||||
{
|
||||
if(!isset($relationship[ $col ]))
|
||||
{
|
||||
return array('status' => false,'error' => 'Rule Conflict: Unknown Relationship');
|
||||
@ -104,7 +105,7 @@ if(!function_exists('check_relationship'))
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
}
|
||||
return array('status' => true);
|
||||
}
|
||||
else
|
||||
@ -142,6 +143,13 @@ if(!function_exists('check_employee_band'))
|
||||
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available
|
||||
{
|
||||
$is_emp_band_needed = $slab_details['grid_master']['emp_band'];
|
||||
if($slab_details['grid_master']['ui_type'] == 1) //gpa rack rate 1
|
||||
{
|
||||
if($slab_details['slab_rates'][0]['si_or_bp'] == 3)
|
||||
{
|
||||
$is_emp_band_needed = true;
|
||||
}
|
||||
}
|
||||
$slug = \Config\Services::slug();
|
||||
$relationship = $slug->slugify($row[5]);
|
||||
// echo $relationship;echo $row[7];
|
||||
@ -170,21 +178,65 @@ if(!function_exists('check_si'))
|
||||
{
|
||||
function check_si($row,$policy_terms,$slab_details)
|
||||
{
|
||||
$return_array = array('status' => true,'error' => '');
|
||||
$is_si_found = false;
|
||||
$is_age_slab_found = false;
|
||||
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA','SI']))// check rule only of action column data available
|
||||
{
|
||||
$received_si = $row['current_action'] == 'SI' ? $row[3] : $row[6];
|
||||
$found = false;
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $received_si)
|
||||
if($is_si_found && $is_age_slab_found)
|
||||
{
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$is_si_found && $slab_value['si'] == $received_si) //match si amount
|
||||
{
|
||||
$is_si_found = true;
|
||||
}
|
||||
|
||||
// check age slab
|
||||
if($row[3] != null && DateTime::createFromFormat('d-M-Y', $row[3]) !== false)// dob
|
||||
{
|
||||
$dob = change_date_format($row[3],'d-M-Y','Y-m-d');
|
||||
// echo $row[3].' - '.$dob;echo '<br>';
|
||||
$currentDateTime = new DateTime();//die();
|
||||
$passedDateTime = new DateTime($dob);
|
||||
$interval = $currentDateTime->diff($passedDateTime);
|
||||
if(!$is_age_slab_found)
|
||||
{
|
||||
if(isset($slab_value['age_from']) && isset($slab_value['age_to']))
|
||||
{
|
||||
if($slab_value['age_from'] !== null && $slab_value['age_to'] !== null && $slab_value['age_from'] <= $interval->y && $slab_value['age_to'] >= $interval->y && $slab_value['si'] == $received_si)
|
||||
{
|
||||
$is_age_slab_found = true;// send true if age slab found
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_age_slab_found = true;// send true if age conditin is not applicable
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}//end of check age slab
|
||||
}
|
||||
if(!$found) { return array('status' => false,'error' => "Sum insured not found"); }
|
||||
return array('status' => true);
|
||||
}else { return array('status' => true); } // in else condition no need to check rule, just return true
|
||||
|
||||
}
|
||||
|
||||
if(!$is_si_found)
|
||||
{
|
||||
$return_array['status'] = false;
|
||||
$return_array['error'] = "Sum insured not found";
|
||||
}
|
||||
if(!$is_age_slab_found)
|
||||
{
|
||||
$return_array['status'] = false;
|
||||
$return_array['error'] = !empty($return_array['error']) ? ($return_array['error'].', '.'Sum insured not configured for this age slab') : 'Sum insured not configured for this age slab';
|
||||
}
|
||||
|
||||
return $return_array;
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,18 +259,31 @@ if(!function_exists('check_basic_pay'))
|
||||
|
||||
if (!function_exists('check_dob_diff'))
|
||||
{
|
||||
function check_dob_diff($row,$relationships) {
|
||||
function check_dob_diff($row,$relationships,$default_age_ratio) {
|
||||
// echo 'called';
|
||||
if($row['current_action'] != null && in_array(strtoupper($row['current_action']), ['I','A','DA']))// check rule only of action column data available
|
||||
{
|
||||
if($row[3] != null && $row[5] != null)
|
||||
{
|
||||
if (DateTime::createFromFormat('d-M-Y', $row[3]) === false)
|
||||
{
|
||||
return array('status' => false,'error' => 'Not a valid Date');
|
||||
}
|
||||
// return array('status' => true);
|
||||
$dob = change_date_format($row[3],'d-M-Y','Y-m-d');
|
||||
// echo $row[3].' - '.$dob;echo '<br>';
|
||||
$currentDateTime = new DateTime();//die();
|
||||
// print_r($currentDateTime);
|
||||
// die();
|
||||
$passedDateTime = new DateTime($dob);
|
||||
// print_r($passedDateTime);
|
||||
|
||||
$interval = $currentDateTime->diff($passedDateTime);
|
||||
|
||||
//remap default age ratio data into relationship array
|
||||
if(count($default_age_ratio))
|
||||
{
|
||||
$relationships = remap_default_age_ratio_into_relationship($relationships,$default_age_ratio);
|
||||
}
|
||||
$slug = \Config\Services::slug();
|
||||
$relationship = $slug->slugify($row[5]);
|
||||
$age_min = isset($relationships[$relationship]['age_min']) ? $relationships[$relationship]['age_min'] : NULL;
|
||||
@ -247,7 +312,7 @@ if (!function_exists('data_group_by_family'))
|
||||
function data_group_by_family($emp_data,$data_source = 'excel')
|
||||
{
|
||||
$result = [];
|
||||
// dd($emp_data);
|
||||
// Kint::dump($emp_data);
|
||||
foreach ($emp_data as $rkey => $row)
|
||||
{
|
||||
if($data_source == 'excel')
|
||||
@ -305,8 +370,13 @@ if (!function_exists('check_self_available_in_family'))
|
||||
{
|
||||
function check_self_available_in_family($family_data)
|
||||
{
|
||||
|
||||
|
||||
$is_self_found = false;
|
||||
|
||||
$row_id_from_excel = array_filter($family_data,function($item){ return !isset($item['temp']);});
|
||||
// Kint::dump($row_id_from_excel);
|
||||
$row_id_from_excel = current($row_id_from_excel); // get excel sno/rowid of employee amoung familiy array where this array has both data from excel and db
|
||||
$row_id_from_excel = $row_id_from_excel[0];
|
||||
foreach ($family_data as $rkey => $row)
|
||||
{
|
||||
if($row[5] != null && strtolower($row[5]) == 'self')//$row[5] = relationship $row[4] = Gender
|
||||
@ -317,7 +387,7 @@ if (!function_exists('check_self_available_in_family'))
|
||||
|
||||
}
|
||||
|
||||
return ['is_self_found' => $is_self_found,'emp_code' => $family_data[0][1]];
|
||||
return ['is_self_found' => $is_self_found,'emp_code' => $family_data[0][1],'row_id' => $row_id_from_excel];
|
||||
}
|
||||
}
|
||||
|
||||
@ -335,28 +405,31 @@ if (!function_exists('name_and_empid_check_in_db'))
|
||||
|
||||
foreach ($family_data as $rkey => $row)
|
||||
{
|
||||
$res = $employeeModel
|
||||
->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
// ->where("cp.id",$policy_id)
|
||||
->where("employees.client_id",$client_id)
|
||||
->where("employees.is_active",1)
|
||||
->where("ep.is_active",1)
|
||||
// ->where("ep.client_id",$client_id)
|
||||
->where('name',$row[2])->where('emp_code',$row[1])
|
||||
->findAll();
|
||||
|
||||
// dd($employeeModel->getLastQuery());
|
||||
|
||||
|
||||
if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res))
|
||||
{
|
||||
array_push($result['del'],$row[0]);
|
||||
}
|
||||
if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition') && count($res))
|
||||
{
|
||||
array_push($result['i'],$row[0]);
|
||||
}
|
||||
if(isset($row['temp']) && $row['temp']['source'] != 'db')
|
||||
{
|
||||
$res = $employeeModel
|
||||
->join('client_policy cp',"employees.client_id = cp.client_id")
|
||||
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||
// ->where("cp.id",$policy_id)
|
||||
->where("employees.client_id",$client_id)
|
||||
->where("employees.is_active",1)
|
||||
->where("ep.is_active",1)
|
||||
// ->where("ep.client_id",$client_id)
|
||||
->where('name',$row[2])->where('emp_code',$row[1])
|
||||
->findAll();
|
||||
|
||||
// dd($employeeModel->getLastQuery());
|
||||
|
||||
|
||||
if(($current_action == 'deletion' || $current_action == 'correction' || $current_action == 'si_enhancement') && !count($res))
|
||||
{
|
||||
array_push($result['del'],$row[0]);
|
||||
}
|
||||
if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition') && count($res))
|
||||
{
|
||||
array_push($result['i'],$row[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -386,9 +459,9 @@ if (!function_exists('check_dependent_conflict'))
|
||||
$self_emp_row_id = null;
|
||||
$temp_counts = [2,3,4,5,6,7,8,9,10]; //temp variable for check relation repetaed count
|
||||
$slug = \Config\Services::slug();
|
||||
|
||||
// if($policy_terms['family_floater'] == true)
|
||||
// {
|
||||
// dd($policy_terms);
|
||||
if(isset($policy_terms['family_floater']) && !empty($policy_terms['family_floaters']))
|
||||
{
|
||||
|
||||
// $temp_string = implode(" ",$policy_terms['family_floaters']);
|
||||
$temp = $policy_terms['family_floaters'];
|
||||
@ -466,7 +539,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) )
|
||||
{
|
||||
$result['status'] = false;
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
}
|
||||
|
||||
// || ($allowed_parents_count < $received_parents_count) || ($allowed_parent_in_laws_count < $received_parent_in_laws_count)
|
||||
@ -478,7 +551,7 @@ if (!function_exists('check_dependent_conflict'))
|
||||
if((2 < $received_parents_count) || (2 < $received_parent_in_laws_count))
|
||||
{
|
||||
$result['status'] = false;
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
}
|
||||
}
|
||||
|
||||
@ -488,19 +561,16 @@ if (!function_exists('check_dependent_conflict'))
|
||||
{
|
||||
// dd($allowed_adults);
|
||||
$result['status'] = false;
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict: Dependent count greater than allowed dependent count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
$result['error_data'][] = ['code' => 12,'col_name' => 'sno','msg' => 'Rule conflict:As per policy, count of dependents has exceeded configured count','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];//dependent count mismatch
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if(count($family_data) > 1)
|
||||
// {
|
||||
// $result['status'] = false;
|
||||
// $result['error_data'][] = ['code' => 11,'col_name' => 'sno','msg' => 'Rule conflict: Dependents not allowed','row_id' => $row[0]];//dependents not allowed
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['status'] = true;
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
|
||||
@ -525,7 +595,7 @@ if (!function_exists('calculate_premimum'))
|
||||
function calculate_premimum($family_data,$policy_terms,$slab_details,$fileArr,$default_si = null)
|
||||
{
|
||||
//
|
||||
// dd($fileArr);
|
||||
// dd($slab_details);
|
||||
// grid type
|
||||
// 1 = premium => si
|
||||
$result = [];
|
||||
@ -574,7 +644,7 @@ if (!function_exists('calculate_premimum'))
|
||||
|
||||
$transformed_familiy_member_data['policy_details']['basic_cover_si'] = isset($emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['si']) ? $emp_details_with_empband_max_age_max_count[ $transformed_familiy_member_data['emp_code'] ]['si'] : $transformed_familiy_member_data['policy_details']['basic_cover_si'];
|
||||
|
||||
if( $fileArr['id'] == null || (in_array($grid_type,[10,11]) || $transformed_familiy_member_data['temp']['source'] == 'excel'))//if file id is null then data coming from enrollment (from DB) otherwise data coming from xcel, so calculate only data from excel (new entry) note: even data coming from excel for event dependet additon we fetch other dependts from db and calculate premium for whole family
|
||||
if( $fileArr['id'] == null || $transformed_familiy_member_data['temp']['source'] == 'excel' || ($fileArr['action'] == 'dependent_addition' && in_array($grid_type,[10,11]) && $slab_details['slab_rates'][0]['premium_type'] == 1 && strtolower($transformed_familiy_member_data['relationship']) == 'self'))//if file id is null then data coming from enrollment (from DB) otherwise data coming from xcel, so calculate only data from excel (new entry) note: even data coming from excel for event dependet additon we fetch other dependts from db and calculate premium for whole family
|
||||
{
|
||||
$transformed_familiy_member_data = premium_calculation_manager($transformed_familiy_member_data,$policy_terms,$slab_details,$default_si);
|
||||
|
||||
@ -652,6 +722,8 @@ if (!function_exists('premium_calculation_manager'))
|
||||
{
|
||||
function premium_calculation_manager($emp_data,$policy_terms,$slab_details,$default_si = null)
|
||||
{
|
||||
|
||||
$myLogger = \Config\Services::mylogger();
|
||||
// grid type
|
||||
// 1 = premium => si
|
||||
// dd($emp_data);
|
||||
@ -687,14 +759,15 @@ if (!function_exists('premium_calculation_manager'))
|
||||
//gird and calculation start
|
||||
$slug = \Config\Services::slug();
|
||||
$grid_type = $slab_details['grid_master']['ui_type'];
|
||||
|
||||
$is_match_found = false;
|
||||
switch ($grid_type) {
|
||||
case "1":
|
||||
//GPA - Sum Insured (SI) * Multiplier
|
||||
$employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si;
|
||||
$employee_received_band = $emp_data['temp']['band'];
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $employee_received_si)
|
||||
if(($slab_value['si'] == $employee_received_si) || ($slab_value['grade'] != null && $slab_value['grade'] == $employee_received_band && $slab_value['si'] == $employee_received_si))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
@ -703,7 +776,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -723,7 +796,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -742,7 +815,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -766,7 +839,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -786,7 +859,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -795,6 +868,28 @@ if (!function_exists('premium_calculation_manager'))
|
||||
//GMC - Employees + Dependent Age band
|
||||
$employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si;
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && strtolower($emp_data['relationship']) == 'self') || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
// echo $emp_data['name'];
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case "7":
|
||||
//GMC - Employees + Dependent Age + SI
|
||||
$employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si;
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && strtolower($emp_data['relationship']) == 'self') || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
@ -807,27 +902,7 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "7":
|
||||
//GMC - Employees + Dependent Age + SI
|
||||
$employee_received_si = $default_si == null ? $emp_data['policy_details']['basic_cover_si'] : $default_si;
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
if($slab_value['si'] == $employee_received_si && ($slab_value['age_from'] <= $age && $slab_value['age_to'] >= $age) && (($slab_value['premium_type'] == 1 && strtolower($emp_data['relationship']) == 'self') || ($slab_value['premium_type'] == 2 || $slab_value['premium_type'] == null) ))
|
||||
{
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -845,11 +920,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -866,11 +941,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $slab_value['si'];
|
||||
$emp_data['policy_details']['date_coverage'] = (isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = (float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.','');
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -888,11 +963,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
$emp_data['policy_details']['date_coverage'] = isset($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date'];
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''));
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -917,11 +992,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $familiy_si_covered;
|
||||
$emp_data['policy_details']['date_coverage'] = (empty($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = get_premium_for_si(slab_details: $slab_details,si_amount: $familiy_si_covered,band: $employee_received_band);
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($emp_data['policy_details']['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''));
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -942,11 +1017,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
$emp_data['policy_details']['date_coverage'] = (empty($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''));
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -967,11 +1042,11 @@ if (!function_exists('premium_calculation_manager'))
|
||||
$emp_data['policy_details']['basic_cover_si'] = $employee_received_si;
|
||||
$emp_data['policy_details']['date_coverage'] = (empty($emp_data['policy_details']['date_coverage']) ? $emp_data['policy_details']['date_coverage'] : $policy_terms['policy_start_date']);
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($policy_terms['policy_start_date'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['days'] = calculate_days_bw_dates($emp_data['policy_details']['date_coverage'],$policy_terms['policy_end_date'])->days;
|
||||
$emp_data['policy_details']['premium'] = $slab_value['premium'];
|
||||
$emp_data['policy_details']['rata_premimum'] = calculate_pro_rata_premimum($slab_value['premium'],$emp_data['policy_details']['days']);
|
||||
$emp_data['policy_details']['gst'] = ((float) number_format(($emp_data['policy_details']['rata_premimum'] * (18/100)),2,'.',''));
|
||||
|
||||
$is_match_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -980,10 +1055,28 @@ if (!function_exists('premium_calculation_manager'))
|
||||
|
||||
|
||||
default:
|
||||
echo "Not a valid grid";
|
||||
$this->myLogger->logme('error',($emp_data['emp_code'].'-'.$emp_data['name'].' - grid type not found'));
|
||||
}
|
||||
|
||||
// unset($emp_data['temp']);//remove temp data
|
||||
if(!$is_match_found)
|
||||
{
|
||||
$age = calculate_days_bw_dates(from_date: $emp_data['dob'])->y;
|
||||
$log_message = '[ client_policy_id : ' .$emp_data['policy_details']['client_policy_id'].' - '. $emp_data['emp_code'].' - '.$emp_data['name'] .' - '. $emp_data['policy_details']['basic_cover_si'] . ', Age : '. $age.' ]';
|
||||
if($slab_details['slab_rates'][0]['premium_type'] == 1)
|
||||
{
|
||||
$log_message .= ' - skipping, calculating only self..!';
|
||||
//reset emp si and others policy level data if premium only for self
|
||||
$emp_data['policy_details']['policy_end_date'] = $policy_terms['policy_end_date'];
|
||||
$emp_data['policy_details']['basic_cover_si'] = 0;
|
||||
$emp_data['policy_details']['premium'] = 0;
|
||||
$emp_data['policy_details']['rata_premimum'] = 0;
|
||||
$emp_data['policy_details']['gst'] = 0;
|
||||
$emp_data['policy_details']['days'] = 0;
|
||||
}
|
||||
else { $log_message .= '- skipping, slab rate not found'; }
|
||||
$myLogger->logme('error',$log_message);
|
||||
// echo $log_message;
|
||||
|
||||
}
|
||||
return $emp_data;
|
||||
|
||||
}
|
||||
@ -1125,4 +1218,67 @@ if(!function_exists('replace_original_data'))
|
||||
}
|
||||
return $current_data;
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('get_premium_for_si'))
|
||||
{
|
||||
function get_premium_for_si(array $slab_details,string $si_amount,string $band)
|
||||
{
|
||||
foreach ($slab_details['slab_rates'] as $skey => $slab_value)
|
||||
{
|
||||
if($slab_value['si'] == $si_amount && $slab_value['grade'] == $band)
|
||||
{
|
||||
return $slab_value['premium'];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('remap_default_age_ratio_into_relationship'))
|
||||
{
|
||||
function remap_default_age_ratio_into_relationship(array $general_relationships,array $default_age_ratio)
|
||||
{
|
||||
foreach ($default_age_ratio as $relationship => $age_ratio)
|
||||
{
|
||||
switch ($relationship) {
|
||||
case 'child':
|
||||
if (isset($general_relationships['son'])) {
|
||||
$general_relationships['son']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['son']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
if (isset($general_relationships['daughter'])) {
|
||||
$general_relationships['daughter']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['daughter']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
break;
|
||||
case 'elders':
|
||||
if (isset($general_relationships['father'])) {
|
||||
$general_relationships['father']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['father']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
if (isset($general_relationships['mother'])) {
|
||||
$general_relationships['mother']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['mother']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
if (isset($general_relationships['father-in-law'])) {
|
||||
$general_relationships['father-in-law']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['father-in-law']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
if (isset($general_relationships['mother-in-law'])) {
|
||||
$general_relationships['mother-in-law']['age_min'] = $age_ratio['min'];
|
||||
$general_relationships['mother-in-law']['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (isset($general_relationships[$relationship])) {
|
||||
$general_relationships[$relationship]['age_min'] = $age_ratio['min'];
|
||||
$general_relationships[$relationship]['age_max'] = $age_ratio['max'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $general_relationships;
|
||||
}
|
||||
}
|
||||
@ -167,6 +167,24 @@ if (!function_exists('generate_random_alphanumeric')) {
|
||||
|
||||
|
||||
|
||||
if (!function_exists('get_base64_image')) {
|
||||
|
||||
function get_base64_image($path)
|
||||
{
|
||||
// Get file extension
|
||||
$type = pathinfo($path, PATHINFO_EXTENSION);
|
||||
|
||||
// Read file content
|
||||
$dataContent = file_get_contents($path);
|
||||
|
||||
// Encode as base64
|
||||
$base64Image = 'data:image/' . $type . ';base64,' . base64_encode($dataContent);
|
||||
|
||||
return $base64Image;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ class ClientModel extends Model
|
||||
->join('policies p', 'p.id = client_policy.policy_id')
|
||||
->where('client_policy.client_id',$client['id'])
|
||||
->where('client_policy.is_active', 1)
|
||||
->where('client_policy.policy_status', 1)
|
||||
->findAll();
|
||||
|
||||
$client['policies'] = $clientPolicies;
|
||||
|
||||
@ -34,6 +34,7 @@ class ClientPolicyModel extends Model
|
||||
"policy_terms",
|
||||
"open_for_enrollment",
|
||||
"is_addon",
|
||||
"inception_type",
|
||||
"base_policy",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
@ -81,6 +82,7 @@ class ClientPolicyModel extends Model
|
||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||
->where('client_policy.client_id', $client_id)
|
||||
->where('client_policy.policy_status', 1)
|
||||
->where('client_policy.is_active', 1)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
|
||||
@ -36,7 +36,8 @@ class EmployeeModel extends Model
|
||||
"updated_at",
|
||||
"is_active",
|
||||
"file_id",
|
||||
"is_addon_value"
|
||||
"is_addon_value",
|
||||
"is_createdby_hr"
|
||||
];
|
||||
|
||||
// Callbacks
|
||||
@ -95,7 +96,7 @@ class EmployeeModel extends Model
|
||||
}
|
||||
|
||||
|
||||
public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,array $emp_status = [],array $policy_status = [])
|
||||
public function getEmpFamilybyEmpCode(string $client_policy_id = null,string $emp_code = null,string $client_id = null,array $emp_status = [],array $policy_status = [],array $relationship = [])
|
||||
{
|
||||
$result = $this->select(['employees.id as emp_id', 'employees.client_id', 'employees.relationship', 'employees.relationship_code', 'employees.change_event', 'employees.emp_code', 'employees.name', 'employees.email_personal', 'employees.email_corporate', 'employees.mobile', 'employees.gender', 'employees.dob', 'employees.doj', 'employees.basic_pay', 'employees.band', 'employees.designation', 'employees.emp_status','employee_polices.id as emp_policy_id', 'employee_polices.employee_id', 'employee_polices.client_policy_id', 'employee_polices.tpa_id', 'employee_polices.uhid', 'employee_polices.batch_code', 'employee_polices.status', 'employee_polices.pre_existing_alignments', 'employee_polices.basic_cover_si', 'employee_polices.date_coverage', 'employee_polices.policy_end_date', 'employee_polices.days', 'employee_polices.premium', 'employee_polices.rata_premimum', 'employee_polices.gst', 'employee_polices.date_of_exit', 'employee_polices.reason_for_exit'])
|
||||
->join('employee_polices', 'employee_polices.employee_id = employees.id')
|
||||
@ -105,7 +106,7 @@ class EmployeeModel extends Model
|
||||
})
|
||||
|
||||
->where('employee_polices.is_active',1)
|
||||
// ->where('employees.emp_status', ($emp_status !== null ? $emp_status : 'active'))
|
||||
->where('employees.is_active',1)
|
||||
// ->where('employees.emp_code',$emp_code)
|
||||
->when($emp_code, function($query) use ($emp_code){
|
||||
return $query->where('employees.emp_code',$emp_code);
|
||||
@ -114,6 +115,9 @@ class EmployeeModel extends Model
|
||||
->when(count($emp_status), function($query) use ($emp_status){
|
||||
return $query->whereIn('employees.emp_status', $emp_status);
|
||||
})
|
||||
->when(count($relationship), function($query) use ($relationship){
|
||||
return $query->whereIn('employees.relationship', $relationship);
|
||||
})
|
||||
->when(count($policy_status), function($query) use ($policy_status){
|
||||
return $query->whereIn('employee_polices.status', $policy_status);
|
||||
})
|
||||
@ -132,9 +136,10 @@ class EmployeeModel extends Model
|
||||
{
|
||||
|
||||
return $this->db->table('employee_polices')
|
||||
->select(' policies.name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId,client_policy.id as ClientPolicyId, client_policy.open_for_enrollment as OpenForEnrollment') // Select all columns from both tables
|
||||
->select(' policies.name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId,client_policy.id as ClientPolicyId, client_policy.open_for_enrollment as OpenForEnrollment , employee_polices.tpa_id as tpa_id , employee_polices.rand_string as rand_string') // Select all columns from both tables
|
||||
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
||||
->join('policies', 'policies.id = client_policy.policy_id')
|
||||
->where('client_policy.policy_status', 1)
|
||||
->where('employee_polices.employee_id', $id)
|
||||
->get()
|
||||
->getResult();
|
||||
|
||||
@ -720,6 +720,8 @@ class EmployeePolicyModel extends Model
|
||||
e.doj,
|
||||
e.band,
|
||||
TIMESTAMPDIFF(YEAR, e.dob, CURDATE()) AS emp_age,
|
||||
(SELECT name FROM employees WHERE relationship = "Self" and emp_code = ' . $this->db->escape($emp_code) . ') AS self,
|
||||
|
||||
|
||||
ep.tpa_id,
|
||||
ep.uhid,
|
||||
@ -728,12 +730,22 @@ class EmployeePolicyModel extends Model
|
||||
clients.client_name,
|
||||
clients.short_name AS client_short_name,
|
||||
|
||||
cp.policy_start_date,
|
||||
|
||||
policies.name AS policy_name,
|
||||
|
||||
insurers.name AS insurer_name,
|
||||
insurers.short_name AS insurer_short_name,
|
||||
insurers.insurer_logo,
|
||||
|
||||
insurer_branch.branch_name,
|
||||
insurer_branch.branch_code,
|
||||
insurer_branch.city as insurer_branch_city,
|
||||
|
||||
tpa.name AS tpa_name,
|
||||
tpa.tpa_logo AS tpa_logo,
|
||||
tpa.front_card,
|
||||
tpa.back_card,
|
||||
tpa.short_name AS tpa_short_name'
|
||||
)
|
||||
|
||||
@ -742,7 +754,9 @@ class EmployeePolicyModel extends Model
|
||||
->join('clients', 'clients.id = cp.client_id')
|
||||
->join('policies', 'policies.id = cp.policy_id')
|
||||
->join('insurers', 'insurers.id = cp.insurer_id')
|
||||
->join('insurer_branch', 'insurer_branch.id = cp.insurer_branch_id')
|
||||
->join('tpa', 'tpa.id = cp.tpa_id')
|
||||
->where("ep.tpa_id IS NOT NULL AND ep.tpa_id <> ''")
|
||||
->where('e.emp_status', 'active')
|
||||
->where('e.is_active', '1')
|
||||
->where('ep.status', 'active')
|
||||
@ -753,6 +767,7 @@ class EmployeePolicyModel extends Model
|
||||
->getResultArray();
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ class InsurerModel extends Model
|
||||
"category",
|
||||
"name",
|
||||
"short_name",
|
||||
"insurer_logo",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"is_active",
|
||||
|
||||
@ -24,6 +24,7 @@ class PolicyPremium1Model extends Model
|
||||
"created_by",
|
||||
"updated_by",
|
||||
'is_active',
|
||||
'grade',
|
||||
'premium_type',
|
||||
|
||||
];
|
||||
|
||||
@ -12,6 +12,9 @@ class TPAModel extends Model
|
||||
"id",
|
||||
"name",
|
||||
"short_name",
|
||||
"front_card",
|
||||
"back_card",
|
||||
"tpa_logo",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"is_active",
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1)?></b></td>
|
||||
<td><?php echo $file['batch_code']?></td>
|
||||
<td><?php echo $file['file_name']?></td>
|
||||
<td data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>" ><?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?></td>
|
||||
<td><?php echo $file['client_short_name']?></td>
|
||||
<td><?php echo $file['policy_name']?></td>
|
||||
<td><?php echo $file['event_type']?></td>
|
||||
|
||||
@ -34,6 +34,7 @@ body {
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row" id="client_add">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
@ -95,8 +96,8 @@ body {
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
<script>
|
||||
// $(document).ready(function(){
|
||||
// var tabid = localStorage.getItem('tabId');
|
||||
// console.log(tabid)
|
||||
@ -210,3 +211,4 @@ body {
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -105,6 +105,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row" id="third" style="display: none; position: relative;top: 22px;">
|
||||
|
||||
<label class="switch">
|
||||
<input id="inception_type" type="checkbox" name="inception_type">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
|
||||
<label for="inception_type" style="position: relative;bottom: 5px;left: 10px;">Enable Employee Enrolment Process</label>
|
||||
</div>
|
||||
|
||||
<div id="policy_fields"></div>
|
||||
|
||||
</div>
|
||||
@ -151,6 +161,7 @@
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
var endDate = new Date(selectedDates[0]);
|
||||
endDate.setFullYear(endDate.getFullYear() + 1);
|
||||
endDate.setDate(endDate.getDate() - 1); // Set end date to last day of selected year
|
||||
endDatePicker.setDate(endDate);
|
||||
}
|
||||
});
|
||||
@ -158,6 +169,7 @@
|
||||
// Calculate the end date (today + 1 year)
|
||||
var endDate = new Date(today);
|
||||
endDate.setFullYear(endDate.getFullYear() + 1);
|
||||
endDate.setDate(endDate.getDate() - 1); // Set end date to last day of next year
|
||||
|
||||
// Initialize Flatpickr for the end date with the calculated end date
|
||||
var endDatePicker = flatpickr("#end_date", {
|
||||
@ -167,6 +179,7 @@
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#add_form').hide();
|
||||
$('.btnBack').hide();
|
||||
|
||||
@ -192,6 +205,7 @@
|
||||
|
||||
$('#first').hide();
|
||||
$('#second').hide();
|
||||
$('#third').hide();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
|
||||
@ -284,6 +298,12 @@
|
||||
policy_PrimaryKey = $('#client_id_policy').val();
|
||||
policy_client = $('#policy_PrimaryKey').val();
|
||||
|
||||
var policyDataId = $('#policy').children('option:selected').attr('data-id');
|
||||
var basePolicyDataId = $('#base_policy').children('option:selected').attr('data-id');
|
||||
|
||||
console.log('policyDataId', policyDataId);
|
||||
console.log('basePolicyDataId', basePolicyDataId);
|
||||
|
||||
if (policy_PrimaryKey === '' && policy_client === '') {
|
||||
toastr.error('Client is required', 'Error');
|
||||
$('#insurer').val('');
|
||||
@ -292,6 +312,22 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (basePolicyDataId == policyDataId) {
|
||||
|
||||
toastr.warning('The policy cannot be the same as the base policy.', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
if (basePolicyDataId == 3 || basePolicyDataId == 2) {
|
||||
|
||||
if (policyDataId == 1) {
|
||||
|
||||
toastr.warning('The GPA policy cannot be Select.', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var isValid = $('#policy_form').parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
@ -461,7 +497,8 @@
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
} else if ($policy_type_value == 1) {
|
||||
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
|
||||
|
||||
if (item.policy_type_id == 1 || item.policy_type_id == 2 || item.policy_type_id == 3) {
|
||||
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' +
|
||||
item.id +
|
||||
@ -492,6 +529,9 @@
|
||||
console.log('id', id)
|
||||
$('#policy_type_id').val(dataId);
|
||||
|
||||
var base_policy_dataId = $('#base_policy').children('option:selected').attr('data-id');
|
||||
|
||||
|
||||
// $('#base_policy option').each(function() {
|
||||
// var val = $(this).val();
|
||||
// if (val == id) {
|
||||
@ -508,6 +548,29 @@
|
||||
// appendPolicyFormFields(2);
|
||||
// }
|
||||
|
||||
if (dataId == 3) {
|
||||
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').show();
|
||||
$('#base_policy').prop('required', true);
|
||||
|
||||
if (displayStatus === 'none') {
|
||||
$('#base_policy').val('').change();
|
||||
}
|
||||
|
||||
// $('#base_policy').find('option[data-id="3"]').hide();
|
||||
|
||||
} else {
|
||||
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
|
||||
if (displayStatus === 'none') {
|
||||
$('#base_policy').val('').change();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -557,19 +620,29 @@
|
||||
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
||||
$('#policy_status_field').show();
|
||||
|
||||
if (res.data.inception_type == 1) {
|
||||
$('#inception_type').prop('checked', true);
|
||||
} else {
|
||||
$('#inception_type').prop('checked', false);
|
||||
}
|
||||
|
||||
|
||||
if (res.data.is_addon != '1' && res.data.is_addon != '0') {
|
||||
$('#base_policy_id').show();
|
||||
$('#base_policy').prop('required', true);
|
||||
$('#first').show();
|
||||
$('#second').show();
|
||||
$('#third').show();
|
||||
} else if (res.data.is_addon == '0') {
|
||||
$('#first').hide();
|
||||
$('#second').hide();
|
||||
$('#third').hide();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
} else if (res.data.is_addon == '1') {
|
||||
$('#first').show();
|
||||
$('#second').show();
|
||||
$('#third').show();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
}
|
||||
@ -640,7 +713,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnOpenEnroll', function() {
|
||||
|
||||
Swal.fire({
|
||||
@ -650,7 +722,7 @@
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
confirmButtonText: "Yes"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
var client_policy_id = $(this).attr('data-id');
|
||||
@ -734,6 +806,7 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
function appendPolicyFormFields(policy_type, data = false) {
|
||||
|
||||
var html = '';
|
||||
@ -1133,11 +1206,13 @@
|
||||
$('#base_policy').prop('required', true);
|
||||
$('#first').show();
|
||||
$('#second').show();
|
||||
$('#third').show();
|
||||
|
||||
} else if ($(this).val() == '0') {
|
||||
|
||||
$('#first').hide();
|
||||
$('#second').hide();
|
||||
$('#third').hide();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
|
||||
@ -1146,6 +1221,7 @@
|
||||
|
||||
$('#first').show();
|
||||
$('#second').show();
|
||||
$('#third').show();
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
}
|
||||
@ -1176,9 +1252,22 @@
|
||||
var OptionsHTML = '';
|
||||
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||
$.each(res.data, function(index, item) {
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
|
||||
if ($('#policy_type').val() == 1) {
|
||||
|
||||
console.log('if')
|
||||
|
||||
if (item.policy_type_id == 1 || item.policy_type_id == 2) {
|
||||
console.log('if 2')
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('if')
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||
'">' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
}
|
||||
});
|
||||
$('#base_policy').html(OptionsHTML);
|
||||
},
|
||||
@ -1204,6 +1293,9 @@
|
||||
var policy_type = $('#policy_type').val()
|
||||
console.log(client_policy_id);
|
||||
|
||||
var dataId = $('#policy').children('option:selected').attr('data-id');
|
||||
console.log('dataId', dataId)
|
||||
|
||||
var queryParams = {
|
||||
client_policy_id: client_policy_id,
|
||||
policy_type: policy_type,
|
||||
@ -1238,26 +1330,31 @@
|
||||
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date)).change();
|
||||
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date)).change();
|
||||
|
||||
|
||||
var policeOptionHTML = '';
|
||||
$policy_type_value = $('#policy_type').val();
|
||||
$.each(res.policy, function(index, item) {
|
||||
|
||||
// if ($policy_type_value == 3) {
|
||||
// if (item.policy_type_id == 5) {
|
||||
console.log(item);
|
||||
|
||||
|
||||
|
||||
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
||||
'" value="' + item.id + '" ' + (res.data.policy_id === item.id ?
|
||||
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||
// }
|
||||
// }
|
||||
|
||||
});
|
||||
|
||||
$('#policy').html(policeOptionHTML);
|
||||
|
||||
if (dataId == 3) {
|
||||
setTimeout(function() {
|
||||
var $option = $('#policy').find('option[data-id="3"]');
|
||||
if ($option.length > 0) {
|
||||
$option.prop('selected', true).change();
|
||||
} else {
|
||||
toastr.warning('The insurer does not have a GMC-Parents policy.', 'Warning');
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -1269,6 +1366,7 @@
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
@ -157,8 +157,7 @@ $(document).ready(function(){
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
console.log('Something Wrong!', 'warning'); }, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>NHANCE</title>
|
||||
<title>E-Card</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="A fully featured CRM" name="description" />
|
||||
<meta content="Venba info tech" name="author" />
|
||||
@ -23,6 +23,7 @@
|
||||
<!-- Left side of the ID card -->
|
||||
<div
|
||||
style="width: 400px; height: 250px; background-color: #f0f0f0; border: 1px solid #ccc; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; margin: 0 10px;">
|
||||
|
||||
<div style="padding: 20px; box-sizing: border-box; border-right: 1px solid #ccc;">
|
||||
<div style="margin-bottom: 10px; display: flex; justify-content: space-between;">
|
||||
<label style="font-weight: bold;">Name:</label>
|
||||
@ -49,6 +50,7 @@
|
||||
<span><?= htmlspecialchars(formatDateOrReturn($value['policy_end_date'])) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@ -77,6 +79,12 @@
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
|
||||
<?php if(!isset($data)) { ?>
|
||||
<a href="<?= generate_download_link('HX3kUB') ?>"
|
||||
target="_blank">button</a>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
203
app/Views/ecard_template/fhpl_tpa.php
Normal file
@ -0,0 +1,203 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>E-Card</title>
|
||||
|
||||
<style>
|
||||
ol {
|
||||
list-style-type: decimal;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table style="width: 100%;">
|
||||
|
||||
<?php if(isset($data)) { ?>
|
||||
<?php foreach ($data as $key => $value) { ?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="padding-right: 50px;">
|
||||
<div style="display: flex;justify-content: center;gap: 10px;">
|
||||
<div
|
||||
style="width: 100%;min-height: 320px; background-image:url(<?= base_url() . "public/assets/images/New-india-front.jpg"; ?>);background-size: 100% 100%;border: 1px solid black;line-height: 20px;padding-left: 20px;font-size: 14px;position: relative;">
|
||||
|
||||
<div>
|
||||
<h3
|
||||
style="font-family: sans-serif;margin-bottom: 40px;margin-top: 30px;padding-left: 100px;">
|
||||
THE NEW INDIA ASSURANCE CO.LTD</h3>
|
||||
|
||||
<div style="display: flex;gap: 20px;">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>UHID No</span><span
|
||||
style="margin-left: 52px;">:</span></div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">NIAC49688264</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<div style="font-family: sans-serif;"><b><?= htmlspecialchars($value['name']) ?></b></div>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>Age</span><span
|
||||
style="margin-left:82px;">:</span></div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><?= htmlspecialchars($value['emp_age']) ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>Relationship</span><span
|
||||
style="margin-left: 29px;">:</span></div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><?= htmlspecialchars($value['relationship']) ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>Plan Period</span><span
|
||||
style="margin-left: 34px;">:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><?= htmlspecialchars($value['policy_start_date']) ?> To <?= htmlspecialchars($value['policy_end_date']) ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>Policy No</span><span
|
||||
style="margin-left: 47px;">:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><?= htmlspecialchars($value['tpa_id']) ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;"><span>Insurer</span><span
|
||||
style="margin-left: 62px;">:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">
|
||||
<span>LCO</span><span>:</span><span><?= htmlspecialchars($value['branch_code']) ?></span><span>:</span><span><?= htmlspecialchars($value['insurer_branch_city']) ?></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<img src="<?= base_url() . "public/assets/images/New_India_Assurance.png"; ?>" alt=""
|
||||
width="70px" height="70px"
|
||||
style="object-fit: fill;position: absolute;top: 6px;left: 38px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td style="width: 50%; padding-left: 50px;">
|
||||
<div style="display: flex;justify-content: center;gap: 10px;">
|
||||
<div
|
||||
style="width: 100%;min-height: 310px; background-image: url(<?= base_url() . "public/assets/images/New-india-back.jpg"; ?>);background-size: 100% 100%;border: 1px solid black;padding-top: 10px;padding-right: 10px;">
|
||||
<h4 style="font-family: sans-serif;padding-left: 20px;margin:0px;">Instructions</h4>
|
||||
<ul style="font-family: sans-serif;font-size: 11px;line-height: 15px;padding-left: 30px;">
|
||||
<li>Card has to be presented to our network hospitals at the time of the admission while
|
||||
availing cashless</li>
|
||||
<li>Free authorizationfrom FHPL it must should be taken before 48 hrs for all planed
|
||||
admissions & emergency admissions within 24 hrs of getting admitted to any network
|
||||
hospitals FHPL</li>
|
||||
<li>The issuance of this card doesnot guarantee cashless benefits /hospitalisation</li>
|
||||
<li>The card is for the identification purpose.in case of without photograph
|
||||
card.Alternative identification proof such as Voter ID/driving license etc...should be
|
||||
produced</li>
|
||||
<li>All insurance claim will be processed as per policy terms & conditions</li>
|
||||
<li>For more details kindly referbook kindly provided</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<div
|
||||
style="margin-left: 20%; position:relative; top:70px; width: 160%; display: flex;justify-content: center; line-height: 27px; ">
|
||||
|
||||
<span style="font-family: sans-serif;margin: 0px;margin-left: 30px;font-size: 15px;font-weight: 100;">TERMS
|
||||
AND CONDITIONS:</span>
|
||||
|
||||
<div style=" font-size : 15px; justify-content: space-around;align-items: center;">
|
||||
|
||||
<ol type="number" style="font-family: sans-serif;">
|
||||
<li>This card is generated as per the details given by your employer/HR. Incase of any
|
||||
errors in the
|
||||
details you may confirm the same through your employer for making required corrections.
|
||||
</li>
|
||||
<li>No physical card will be provided to you. For all requirements you may use this card
|
||||
printed in black
|
||||
and white or colour.</li>
|
||||
<li>You can access our network hospitals list from our website https://www.fhpl.net for any
|
||||
information
|
||||
regarding hospitals available within your location or as required.</li>
|
||||
<li>For the convenience of the members the guide book is made available on our website
|
||||
https://www.fhpl.net for understanding protocols in the event of any hospitalization
|
||||
assistance required
|
||||
for availing cashless service and also to forward any claim where the member has spent
|
||||
on his/her own.</li>
|
||||
<li>All our network hospitals will accept the printed card and seek the preauthorization
|
||||
from FHPL in the
|
||||
event of any in-patient hospitalization.</li>
|
||||
<li>Incase there is no photograph on the ID card, the member has to identify himself/herself
|
||||
with any other
|
||||
photo-card like: credit card, ration card, electoral card, Company ID card etc in
|
||||
conjunction with this card.</li>
|
||||
<li>This card is not transferable and cannot be forwarded further to any other person by
|
||||
email/fax.</li>
|
||||
<li> The card will be visible to any member as long the policy is valid after which this
|
||||
service will be
|
||||
withdrawn or till such time the member is employed with the current employer.</li>
|
||||
<li>Usage of this card after the validity/policy expiry will not be entertained.</li>
|
||||
<li>A fresh card will be generated subjected to the renewal of the policy.</li>
|
||||
<li>For Any further queries, Please feel free to contact us on Toll—Free Helpline :1800 -
|
||||
103 - 7519</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="padding-top: 500px;" ></div>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
179
app/Views/ecard_template/icici_tpa.php
Normal file
@ -0,0 +1,179 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>E-Card</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table style="width: 100%;">
|
||||
|
||||
<?php if(isset($data)) { ?>
|
||||
<?php foreach ($data as $key => $value) { ?>
|
||||
|
||||
<tr>
|
||||
<td style="width: 42%;">
|
||||
<div
|
||||
style="width: 97%; min-height: 330px; padding-left: 21px; line-height: 19px; font-size: 13px;background-image: url(<?= base_url() . "public/assets/images/icici-front.jpg"; ?>);background-size:100% 100%;">
|
||||
|
||||
<div >
|
||||
|
||||
<div style="font-weight: 600;font-family: sans-serif;margin-top: 50px;margin-bottom: 10px;">
|
||||
MADRAS BOAT CLUB</div>
|
||||
|
||||
<div style="display: flex;gap: 20px; padding-top: 10px;">
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Name</span><span >:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">MURUGAN M</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Policy No</span><span >:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">4016/x/255486172/01/000</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Card No</span><span>:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">IL22710628200</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Emp ID</span><span>:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">60</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Age</span><span >:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">51</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;font-weight: 400;font-weight: bold;">
|
||||
<span>Valid up</span><span>:</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-family: sans-serif;">10-Aug-2024</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
</td>
|
||||
|
||||
<td style="padding-left: 30px; padding-bottom: 40px">
|
||||
<div
|
||||
style="width: 90%;min-height: 210px;background-image: url(<?= base_url() . "public/assets/images/icici-back.jpg"; ?>);background-size: 100% 100%;padding-top: 10px; position: relative;top: 18px;">
|
||||
|
||||
<ul style="font-family: sans-serif;font-size: 10px;margin-left: 0px;padding-left: 35px;">
|
||||
<li>*For services like second opinion,doctor appointment,facilitating hospitalisation,post
|
||||
hospitalisation care,call our health assistance helpline at 040-66274205{8AM-8PM Monday
|
||||
to Saturday except public holidays}</li>
|
||||
<li>This Card is non-Transferable and is valid at Network hospitals only</li>
|
||||
<li>Use of this card is governed by the policy terms and conditions</li>
|
||||
<li>Cashless access to the network provider can only be obtained When accompanied with the
|
||||
authorization letter issued by ICICI Lombard GIC Ltd</li>
|
||||
<li>In case of non photo cards,to prove your identy,please produce this card along with any
|
||||
photo id card issued by government</li>
|
||||
<li>valid up to policy expiry date or cancellation date whichever is earlier</li>
|
||||
</ul>
|
||||
|
||||
<div style="padding-left: 20px;">
|
||||
<div style="font-size: 10px;"><span style="color: #AA292E;font-family: sans-serif;">ICICI
|
||||
Lombard Health Care Pays:</span><span style="font-family: sans-serif;">hospitalisation
|
||||
bills for admissable claim,Subject
|
||||
to prior prior approval.In case of Emergency.Approval can be taken with in 24 hours
|
||||
of hospitalisation</span></div>
|
||||
|
||||
<div style="font-size: 10px;"><span style="color: #AA292E;font-family: sans-serif;">Insured
|
||||
pays:</span><span style="font-family: sans-serif;">All non medical Hospitalisation
|
||||
bills and expenses not covered Under the policy</span></div>
|
||||
|
||||
<div style="font-size: 10px;"><span style="color: #AA292E;font-family: sans-serif;">Mailing
|
||||
Address:</span><span style="font-family: sans-serif;">ICICI Lombard GIC
|
||||
Ltd,1st,4th,5th & 6th,Floor.Varun Towers-II,Opp,Hydrabad Public
|
||||
School,Begumpet,Hyderabad-50016,Telangana</span></div>
|
||||
|
||||
<div style="font-size: 10px;"><span style="color: #AA292E;font-family: sans-serif;">Registered
|
||||
Addresss:</span><span style="font-family: sans-serif;">ICICI Lombard General insurance
|
||||
company
|
||||
limited,ICICI Lombard House,414,savakar marg,near sidhivinayak
|
||||
temple,prabhadevi,Mumbai-400025</span></div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
style="display: flex;gap: 30px;padding-left: 20px;margin: 10px 0px 10px 0px;font-size: 10px;font-family: sans-serif;">
|
||||
<div>
|
||||
<div><span><b>Fax Number:</b></span><span>(040)6698916061</span></div>
|
||||
<div><span><b>Email:</b></span><span>ihealth@icicilombard.com</span></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div><span><b>Toll Free number:</b></span><span>18002666</span></div>
|
||||
<div><span><b>Visit Us at:</b></span><span>www.icicilombard.com</span></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="padding-left: 20px;">
|
||||
<div style="font-family: sans-serif;font-size: 9px;">Insurance is the subject matter of the
|
||||
soficitation.IRDA Reg no.115.CIN:L67200MH2000PLC129408</div>
|
||||
<div style="font-family: sans-serif;font-size: 9px;">*The Mentioned Covers are add-ones by
|
||||
paying additional premium and available only if opted by policyholders</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
119
app/Views/ecard_template/md_tpa.php
Normal file
@ -0,0 +1,119 @@
|
||||
<body>
|
||||
|
||||
<div style="display: flex;justify-content: center;gap: 10px; width:840px;margin:0 auto 15px; page-break-after: auto;">
|
||||
|
||||
<div style="border: 1px solid black;width: 400px;max-height: 300px;background: url('{FRONT_CARD}');background-size: 100% 100%;padding: 10px;">
|
||||
|
||||
<div style="display: flex;">
|
||||
<div><img src="{INSURER_LOGO}" alt="" width="60px"
|
||||
width="60px" style="object-fit: fill;;"></div>
|
||||
<div style="text-align: center;font-family: sans-serif;font-weight: 600;margin-top: 10px;"><span>THE NEW
|
||||
INDIA ASSURANCE CO.LTD.</span> <br><span style="font-size: 15px;">GOOD HEALTH MEDICLAIM
|
||||
POLICY</span></div>
|
||||
</div>
|
||||
|
||||
<table
|
||||
style="font-family: sans-serif;font-size: 14px;width: 100%;margin-top: 20px;margin-left: 20px;line-height: 20px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>MDID : {TPA_ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><b>{NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Certificate No : {UHID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>Sex : {GENDER} </span> <span style="margin-left: 30px;"> Date of Birth : {DOB}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><b>{SELF_NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Valid form :{POLICY_DATE}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid black;width: 400px;max-height: 300px;padding: 5px;">
|
||||
<div style="font-size: 11px;text-align: center;">The card is for identification purpose only</div>
|
||||
<table style="width: 100%;text-align: center;font-size: 11px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>General & Claim Enquiry Helpline</td>
|
||||
<td>Cashless Enquiry helpline</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table style="font-size: 11px;width: 100%;text-align: center;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Toll Free : 1800-209-7777 <br>Email :
|
||||
citibank_chennai@mdindia.com</td>
|
||||
<td style="border: 1px solid black;">Toll Free : 1800-209-7800 <br>Email:
|
||||
authorisation@mdindia.com</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="font-size: 14px;text-align: center;">CITI MDIndia branch contact</div>
|
||||
|
||||
<div>
|
||||
<table style="text-align: center;width: 100%;font-size: 12px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border: 1px solid black;">Center</th>
|
||||
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
|
||||
<th style="border: 1px solid black;">Center</th>
|
||||
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Chennai</td>
|
||||
<td style="border: 1px solid black;">9381819401</td>
|
||||
<td style="border: 1px solid black;">Delhi</td>
|
||||
<td style="border: 1px solid black;">9310596976</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Chennai</td>
|
||||
<td style="border: 1px solid black;">9381819501</td>
|
||||
<td style="border: 1px solid black;">Mumbai</td>
|
||||
<td style="border: 1px solid black;">9320373542</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Hyderabad</td>
|
||||
<td style="border: 1px solid black;">9390838023</td>
|
||||
<td style="border: 1px solid black;">Pune</td>
|
||||
<td style="border: 1px solid black;">9371644536</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Bangalore</td>
|
||||
<td style="border: 1px solid black;">9341555665</td>
|
||||
<td style="border: 1px solid black;">Kolkata</td>
|
||||
<td style="border: 1px solid black;">9333441389</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h6 style="margin: 5px;">TERMS AND CONDITIONS</h6>
|
||||
<ol style="font-size: 11px;padding-left: 15px;margin-top: 0px;">
|
||||
<li>Pre authorisation is compulsary from tpa prior to planned admission within 24hours for
|
||||
emergencies.</li>
|
||||
<li>Admission for Investigation/Evaluation Not covered.</li>
|
||||
<li>All terms and conditions of the policy would be applicable</li>
|
||||
<li>cashless hospitalisation in network hospitals can be obtained in conjunction with this card.an
|
||||
authorisation letter issued by tpa and photo identification and such as Voters ID,Driver
|
||||
Licence,Passport,etc.</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<th class="font-weight-medium">Policy name</th>
|
||||
<th class="font-weight-medium">Insurer name</th>
|
||||
<th class="font-weight-medium">TPA ID</th>
|
||||
<th class="font-weight-medium">UHID ID</th>
|
||||
<th class="font-weight-medium">UHID</th>
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">Sum Insured</th>
|
||||
<th class="font-weight-medium">Premium</th>
|
||||
|
||||
@ -2,29 +2,23 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form"
|
||||
enctype="multipart/form-data">
|
||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey"
|
||||
value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||
<input type="hidden" name="insurer_id" id="insurer_id" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="insurer_name">Insurer Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="insurer_name"
|
||||
placeholder="Enter Insurer Name"
|
||||
value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
<input type="text" class="form-control" id="insurer_name" placeholder="Enter Insurer Name" value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="short_name">Insurer Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name"
|
||||
value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>"
|
||||
name="short_name" required minlength="3" maxlength="8">
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required minlength="3" maxlength="8">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -52,13 +46,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Insurer Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="insurer_logo" name="insurer_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4 float-right" style="position: relative;left: 40px;bottom: 28px;">
|
||||
<img src="<?= isset($insurer['insurer_logo']) && !empty($insurer['insurer_logo']) ? base_url() . "public/uploads/logo/" . $insurer['insurer_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -68,111 +73,119 @@
|
||||
<!-- end -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#insurer_general_form").submit(function(events) {
|
||||
$("#insurer_general_form").submit(function(events) {
|
||||
|
||||
events.preventDefault();
|
||||
// var isValid = validateForm();
|
||||
events.preventDefault();
|
||||
// var isValid = validateForm();
|
||||
|
||||
var isValid = true;
|
||||
jQuery.each(events.target, function(index, event) {
|
||||
if (event.validity.valid) {
|
||||
var isValid = true;
|
||||
jQuery.each(events.target, function(index, event) {
|
||||
if (event.validity.valid) {
|
||||
|
||||
} else {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
|
||||
var PrimaryKey = $('#insurer_General_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
|
||||
if (PrimaryKey === '') {
|
||||
form_action = '<?= base_url("master/insurer/createpost"); ?>';
|
||||
} else {
|
||||
form_action = '<?= base_url("master/insurer/edit"); ?>';
|
||||
}
|
||||
|
||||
var formData = new FormData($('#insurer_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_id').val(res.data.id);
|
||||
$('#insurer_General_PrimaryKey').val(res.data.id);
|
||||
$('#insurer_id_branch').val(res.data.id);
|
||||
$('#insurer_branch_contacts_id').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "Insurer General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
// $.toast({
|
||||
// text: 'Insurer General Info',
|
||||
// heading: "Submitted Sucessfully",
|
||||
// position: 'top-right',
|
||||
// icon: 'success',
|
||||
// bgColor: !1,
|
||||
// });
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
} else {
|
||||
isValid = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
var PrimaryKey = $('#insurer_General_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
|
||||
// Perform validation for each field
|
||||
$('#insurer_general_form input, #insurer_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
if (PrimaryKey === '') {
|
||||
form_action = '<?= base_url("master/insurer/createpost"); ?>';
|
||||
} else {
|
||||
form_action = '<?= base_url("master/insurer/edit"); ?>';
|
||||
}
|
||||
}
|
||||
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
var formData = new FormData($('#insurer_general_form')[0]);
|
||||
var OptionsHTML1 = ''
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
console.log(res);
|
||||
$('#insurer_id').val(res.data.id);
|
||||
$('#insurer_General_PrimaryKey').val(res.data.id);
|
||||
$('#insurer_id_branch').val(res.data.id);
|
||||
$('#insurer_branch_contacts_id').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "Insurer General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
// $.toast({
|
||||
// text: 'Insurer General Info',
|
||||
// heading: "Submitted Sucessfully",
|
||||
// position: 'top-right',
|
||||
// icon: 'success',
|
||||
// bgColor: !1,
|
||||
// });
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log('Something Wrong!', 'warning'); }, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
|
||||
// Perform validation for each field
|
||||
$('#insurer_general_form input, #insurer_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("insurer_logo").files[0]);
|
||||
|
||||
oFReader.onload = function(oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@ -304,8 +304,7 @@ $(document).ready(function () {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
console.log('Something Wrong!', 'warning'); }, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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/staff/login?' . http_build_query(['token' => $sessionData]);
|
||||
?>
|
||||
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
||||
<i class="mdi mdi-lifebuoy"></i>
|
||||
|
||||
@ -10,26 +10,26 @@
|
||||
margin-right: -85px;
|
||||
}
|
||||
|
||||
.radiobuttondiv{
|
||||
.radiobuttondiv {
|
||||
margin-left: 32px;
|
||||
}
|
||||
|
||||
.form-control-client-policy-master{
|
||||
width:62% !important;
|
||||
.form-control-client-policy-master {
|
||||
width: 62% !important;
|
||||
margin-left: 30px;
|
||||
margin-top: 3px
|
||||
}
|
||||
|
||||
/* .form-group.col-md-6 */
|
||||
.form-group-client-policy-master{
|
||||
display:-webkit-box;
|
||||
.form-group-client-policy-master {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
/* border:1px solid; */
|
||||
/* background-color: #0001; */
|
||||
}
|
||||
|
||||
.form-group-client-policy-masters{
|
||||
display:-webkit-box;
|
||||
.form-group-client-policy-masters {
|
||||
display: -webkit-box;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
@ -39,46 +39,54 @@
|
||||
/* align-items: center; Align items vertically center */
|
||||
}
|
||||
|
||||
.flex-container > div {
|
||||
flex: 1; /* Each div takes equal space */
|
||||
.flex-container>div {
|
||||
flex: 1;
|
||||
/* Each div takes equal space */
|
||||
}
|
||||
label{
|
||||
|
||||
label {
|
||||
padding-top: 7px;
|
||||
width: 400px;
|
||||
/* background-color: #0001; */
|
||||
height: 36px;
|
||||
/* text-align: center; */
|
||||
}
|
||||
.jodit-status-bar{
|
||||
display:none;
|
||||
|
||||
.jodit-status-bar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
width: 64.5% !important;
|
||||
}
|
||||
.input-group-append-client-policy-master{
|
||||
|
||||
.input-group-append-client-policy-master {
|
||||
margin-top: 3px;
|
||||
}
|
||||
.jodit-wysiwyg{
|
||||
|
||||
.jodit-wysiwyg {
|
||||
margin-bottom: 162px;
|
||||
}
|
||||
.form-control-client-policy-masters{
|
||||
|
||||
.form-control-client-policy-masters {
|
||||
margin-left: 30px;
|
||||
width: 689px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="policyGPATermsForm" style="display:none">
|
||||
<span id="policyGPATermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGPA"></span></label></h5>
|
||||
<form role="form" class="parsley-examples" method="post" id="policyGPATerms" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
|
||||
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_policy_id" id="gpa_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id"/>
|
||||
<input type="hidden" id="emp_count"/>
|
||||
<div class="form-group">
|
||||
<div id="policyGPATermsForm" style="display:none">
|
||||
<span id="policyGPATermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGPA"></span></label></h5>
|
||||
<form role="form" class="parsley-examples" method="post" id="policyGPATerms" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||
<input type="hidden" name="client_policy_id" id="gpa_client_policy_id" />
|
||||
<input type="hidden" name="policy_id" id="gpa_policy_id" />
|
||||
<input type="hidden" id="emp_count" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="sumInsured">Sum Insured</label>
|
||||
</div>
|
||||
@ -105,6 +113,45 @@
|
||||
<div id='numberToWordTotalSumInsured' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for=""></label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
|
||||
<tr>
|
||||
<td style="width: 5%;">
|
||||
<span style="margin-right: 20px;">Self:</span>
|
||||
</td>
|
||||
<td style="width: 11%;">
|
||||
<input disabled type="checkbox" style="margin-right: 70px;" name="family_floaters[]" value="self" id="self" checked>
|
||||
</td>
|
||||
<td style="width: 20%;">
|
||||
<div class="self-age">
|
||||
<span style="margin-right: 20px;">Min Age:</span>
|
||||
<input class="underline-input min_age" value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>" style="width: 35%;" type="number" name="self_min_age" id="self_min_age_gpa">
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 20%;">
|
||||
<div class="self-age">
|
||||
<span style="margin-right: 20px;">Max Age:</span>
|
||||
<input class="underline-input max_age" value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>" style="width: 35%;" type="number" name="self_max_age" id="self_max_age_gpa">
|
||||
</div>
|
||||
</td>
|
||||
<td ></td>
|
||||
</tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-bottom: 10px;">
|
||||
<div class="col-md-6">
|
||||
<label for="totalSumInsured">Accidental Death Benefit</label>
|
||||
@ -277,24 +324,31 @@
|
||||
<input type="radio" name="worldwideCover" value="0" style="margin-left:10px" checked> No
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit" style="margin-top: 100px;">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="gpa_special_condition">
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
|
||||
<a href="#" class="button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit" style="margin-top: 100px;">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var policy_grid_id = $('#client_id').val();
|
||||
var grid_html = '';
|
||||
var grid_html = '';
|
||||
|
||||
$('.close').click(function(){
|
||||
$('.close').click(function() {
|
||||
|
||||
});
|
||||
|
||||
@ -306,7 +360,7 @@
|
||||
if ($(this).val() == '1') {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
|
||||
|
||||
} else {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "none");
|
||||
@ -320,7 +374,7 @@
|
||||
if ($(this).val() == '1') {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
|
||||
|
||||
} else {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "none");
|
||||
@ -334,7 +388,7 @@
|
||||
if ($(this).val() == '1') {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
|
||||
|
||||
} else {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "none");
|
||||
@ -348,7 +402,7 @@
|
||||
if ($(this).val() == '1') {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
|
||||
|
||||
} else {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "none");
|
||||
@ -362,28 +416,34 @@
|
||||
if ($(this).val() == '1') {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
|
||||
|
||||
} else {
|
||||
var element = $(this).parent().parent().next()[0];
|
||||
$(element).css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#policyGPATerms").submit(function(event) {
|
||||
|
||||
|
||||
if (!$('#self').prop('checked')) {
|
||||
$('#self_min_age_gpa').removeAttr('name')
|
||||
$('#self_max_age_gpa').removeAttr('name')
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
var isValid = $('#policyGPATerms').parsley().validate();
|
||||
var isValid = $('#policyGPATerms').parsley().validate();
|
||||
console.log('isvalid', isValid);
|
||||
|
||||
if($('#emp_count').val() == true){
|
||||
if ($('#emp_count').val() == true) {
|
||||
toastr.warning('Client has active employees', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
$('.loader').fadeIn();
|
||||
@ -391,7 +451,7 @@
|
||||
|
||||
var formData = new FormData($('#policyGPATerms')[0]);
|
||||
var policy_form_action = '<?= base_url("client/terms/gpa_create") ?>';
|
||||
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
@ -400,19 +460,20 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
$('#policyGPATerms')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
console.log(res);
|
||||
|
||||
|
||||
if (res.status === false) {
|
||||
toastr.error('Policy Dose Not Create', 'Error');
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -420,22 +481,22 @@
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('#policyGPATermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display','');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','');
|
||||
var message = 'Policy Terms Updated successfully';
|
||||
toastr.success('message', 'Success');
|
||||
}, 1000);
|
||||
setTimeout(function() {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('#policyGPATermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||||
var message = 'Policy Terms Updated successfully';
|
||||
toastr.success(message, 'Success');
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnPolicyMaster', function () {
|
||||
$('body').on('click', '.btnPolicyMaster', function() {
|
||||
|
||||
var client_policy_id = $(this).data('id');
|
||||
// console.log('client_policy_id :' ,client_policy_id);
|
||||
@ -445,62 +506,84 @@
|
||||
var gpa_policy_type_id = $(this).attr('id');
|
||||
// console.log('gpa_policy_type_id', gpa_policy_type_id)
|
||||
|
||||
if(gpa_policy_type_id == 'GPA'){
|
||||
if (gpa_policy_type_id == 'GPA') {
|
||||
|
||||
$('#policyGPATermsForm').css('display', '');
|
||||
$('#police-tab').css('display', 'none');
|
||||
$('.nav.nav-pills.navtab-bg').css('display','none');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','none');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', 'none');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display', 'none');
|
||||
$('.removeDom').remove()
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/policy/getterms") ?>',
|
||||
url: '<?= base_url("client/policy/getterms") ?>',
|
||||
method: 'GET',
|
||||
data: {client_policy_id: client_policy_id},
|
||||
data: {
|
||||
client_policy_id: client_policy_id
|
||||
},
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
console.log('count', res.count);
|
||||
console.log('count', res.emp_count_by_policy);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
$('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
|
||||
|
||||
|
||||
$('#emp_count').val(res.count)
|
||||
if(res.count === false){
|
||||
$("#btnGPATermsSubmit").hide();
|
||||
}else{
|
||||
$("#btnGPATermsSubmit").show();
|
||||
}
|
||||
|
||||
$('#emp_count').val(res.count)
|
||||
if (res.emp_count_by_policy != 0) {
|
||||
$("#btnGPATermsSubmit").hide();
|
||||
$("#gpaButtonSpecialCondition").hide();
|
||||
} else {
|
||||
$("#btnGPATermsSubmit").show();
|
||||
$("#gpaButtonSpecialCondition").show();
|
||||
}
|
||||
|
||||
|
||||
if (res) {
|
||||
|
||||
let gpaJsonObjectForSpecialCondition = JSON.parse(res.data);
|
||||
Object.keys(gpaJsonObjectForSpecialCondition).forEach(function(key) {
|
||||
if (key.includes("gpa_special_condition_label") || key.includes("gpa_special_condition_input")) {
|
||||
if (key.includes("gpa_special_condition_label")) {
|
||||
for (let index = 0; index < gpaJsonObjectForSpecialCondition[key].length; index++) {
|
||||
specialConditionForGPA();
|
||||
}
|
||||
}
|
||||
let elements = document.getElementsByName(`${key}[]`);
|
||||
|
||||
if (elements) {
|
||||
elements.forEach((element, index) => {
|
||||
element.value = gpaJsonObjectForSpecialCondition[key][index];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let jsonObject = JSON.parse(res.data);
|
||||
$("#numberToWordSumInsured").text(convertCommaNumberToWords(jsonObject.sumInsured2));
|
||||
$("#numberToWordTotalSumInsured").text(convertCommaNumberToWords(jsonObject.totalSumInsured));
|
||||
if(jsonObject.compassionateVisitExpenses == '1'){
|
||||
if (jsonObject.compassionateVisitExpenses == '1') {
|
||||
var element = $('input[name="compassionateVisitExpenses"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
if(jsonObject.brokenBoneExpenses == '1'){
|
||||
if (jsonObject.brokenBoneExpenses == '1') {
|
||||
var element = $('input[name="brokenBoneExpenses"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
if(jsonObject.ambulanceCharges == '1'){
|
||||
if (jsonObject.ambulanceCharges == '1') {
|
||||
var element = $('input[name="ambulanceCharges"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
if(jsonObject.burnExpenses == '1'){
|
||||
if (jsonObject.burnExpenses == '1') {
|
||||
var element = $('input[name="burnExpenses"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
if(jsonObject.carriageOfDeadBody == '1'){
|
||||
if (jsonObject.carriageOfDeadBody == '1') {
|
||||
var element = $('input[name="carriageOfDeadBody"]').parent().parent().next()[0];
|
||||
$(element).css("display", "");
|
||||
}
|
||||
@ -521,49 +604,93 @@
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
} else {
|
||||
element.value = jsonObject[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (key.includes("age_ratio")) {
|
||||
console.log("-------------------------");
|
||||
console.log(jsonObject[key]);
|
||||
console.log(jsonObject[key].self);
|
||||
console.log(jsonObject[key].self.min);
|
||||
|
||||
$('#self_min_age_gpa').val(jsonObject[key].self.min);
|
||||
$('#self_max_age_gpa').val(jsonObject[key].self.max);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
$("#sumInsured2").trigger("keyup");
|
||||
$("#totalSumInsured").trigger("keyup");
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
}else if(gpa_policy_type_id != 'GPA' && gpa_policy_type_id != 'GMC'){
|
||||
} else if (gpa_policy_type_id != 'GPA' && gpa_policy_type_id != 'GMC') {
|
||||
toastr.warning("This policy has no policy terms.", 'warning');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
document.getElementById('gpaButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
console.log('specialConditionForGPA callback clicked')
|
||||
event.preventDefault();
|
||||
specialConditionForGPA();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function specialConditionForGPA(count = 0) {
|
||||
|
||||
console.log('specialConditionForGPA function called')
|
||||
|
||||
console.log('before if count', count)
|
||||
|
||||
if (count === 0) {
|
||||
|
||||
console.log('after if count', count)
|
||||
|
||||
var index = $('.modifyclassinput').length;
|
||||
var appendElement = `<div class="form-group col-md-6 form-group-client-policy-masters removeDom">
|
||||
<label for="specialconditionlabel" class="special_condition_label[]" style="width: 450px;"><input name="gpa_special_condition_label[]" id="gpa_special_condition_label[]" style="position: relative;right: 15px;"><span class="specialConditionClose" style="color: red;margin-left: 5px;">X</span></label>
|
||||
<input type="text" name="gpa_special_condition_input[]" id="gpa_special_condition_input[]" class="form-control s special_condition_input[]">
|
||||
</div>`;
|
||||
console.log($(this));
|
||||
$('.gpa_special_condition').each(function() {
|
||||
$(this).append(appendElement);
|
||||
});
|
||||
} else {
|
||||
|
||||
console.log('else')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '#policyGPATermsClose', function() {
|
||||
$('#policyGPATermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display','');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display','');
|
||||
$('#policyGPATerms')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
$('#policyGPATermsForm').css('display', 'none');
|
||||
$('#police-tab').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').css('display', '');
|
||||
$('.nav.nav-pills.navtab-bg').prev().css('display', '');
|
||||
$('#policyGPATerms')[0].reset();
|
||||
$('.text-danger-2').html('');
|
||||
|
||||
});
|
||||
|
||||
@ -588,18 +715,18 @@
|
||||
$("#numberToWordTotalSumInsured").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// function formatNumber(input) {
|
||||
// Remove non-numeric characters
|
||||
// let value = input.value.replace(/\D/g, '');
|
||||
|
||||
|
||||
// Add commas
|
||||
// value = Number(value).toLocaleString('en-IN');
|
||||
|
||||
|
||||
// Update the input value
|
||||
// input.value = value;
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
@ -27,7 +27,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4" style="position: relative; left: 45px;display:none" id="premium_type">
|
||||
<!-- <div class="form-group col-md-4" style="position: relative; left: 45px;display:none" id="premium_type">
|
||||
<label for="css"> Premium Calculation </label>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<input type="radio" id="individual" name="premium_type" value="2">
|
||||
@ -35,8 +35,7 @@
|
||||
<input type="radio" id="single" name="premium_type" value="1">
|
||||
<label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
@ -285,30 +284,30 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
grid_html = `
|
||||
<div class="form-row" id="grid_6" style="width:84%">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="6_si[]" id="6_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="6_si" id="6_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" required>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="6_age_to[]" id="6_age_to" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="6_premium[]" id="6_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="6_premium[]" id="6_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='premium_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,6)">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(6)">+</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
} else if (dataIdValue == '7') {
|
||||
@ -684,18 +683,19 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
|
||||
$('#GridForm')[0].reset();
|
||||
|
||||
if(res.family_floater == 1){
|
||||
$('#premium_type').show();
|
||||
$('#individual').prop('checked', true)
|
||||
}else{
|
||||
$('#premium_type').hide();
|
||||
$('#individual').prop('checked', false)
|
||||
}
|
||||
// if(res.family_floater == 1){
|
||||
// $('#premium_type').show();
|
||||
// $('#individual').prop('checked', true)
|
||||
// }else{
|
||||
// $('#premium_type').hide();
|
||||
// $('#individual').prop('checked', false)
|
||||
// }
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
console.log('policy grid responce', res);
|
||||
var temp_for_premiumData = JSON.parse(res.premiumData);
|
||||
console.log('policy grid responce', temp_for_premiumData);
|
||||
@ -736,24 +736,24 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
});
|
||||
$('#grid').html(policeGridOptionHTML);
|
||||
|
||||
if (res.premiumData[0].hasOwnProperty('premium_type')) {
|
||||
// if (res.premiumData[0].hasOwnProperty('premium_type')) {
|
||||
|
||||
if (res.premiumData[0].premium_type == '2') {
|
||||
// if (res.premiumData[0].premium_type == '2') {
|
||||
|
||||
$('#individual').prop('checked', true)
|
||||
$('#single').prop('checked', false)
|
||||
// $('#individual').prop('checked', true)
|
||||
// $('#single').prop('checked', false)
|
||||
|
||||
} else if (res.premiumData[0].premium_type == '1') {
|
||||
// } else if (res.premiumData[0].premium_type == '1') {
|
||||
|
||||
$('#single').prop('checked', true)
|
||||
$('#individual').prop('checked', false)
|
||||
// $('#single').prop('checked', true)
|
||||
// $('#individual').prop('checked', false)
|
||||
|
||||
} else {
|
||||
$('#single').prop('checked', false)
|
||||
$('#individual').prop('checked', false)
|
||||
}
|
||||
// } else {
|
||||
// $('#single').prop('checked', false)
|
||||
// $('#individual').prop('checked', false)
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
var si_or_bp_value = '';
|
||||
@ -1034,20 +1034,14 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
||||
} else if (ui_type == '6') {
|
||||
|
||||
html = `
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="6_si[]" id="6_si_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)"required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" required>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="6_age_to[]" id="6_age_to" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="6_age_to[]" id="6_age_to" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
|
||||
@ -3,29 +3,71 @@
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="tpa_general_form" enctype="multipart/form-data">
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="tpa_General_PrimaryKey" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>"/>
|
||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="tpa_General_PrimaryKey" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>" />
|
||||
<input type="hidden" name="tpa_id" id="tpa_id" />
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="tpa_name">TPA Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required>
|
||||
<input type="text" class="form-control" id="tpa_name" placeholder="Enter TPA Name" value="<?= isset($tpa['name']) ? $tpa['name'] : '' ?>" name="name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">TPA Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name" value="<?= isset($tpa['short_name']) ? $tpa['short_name'] : '' ?>" name="short_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">TPA Logo<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage();" id="tpa_logo" name="tpa_logo" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-10">
|
||||
<label for="tpa_name">E-Card Template<span class="text-danger"></span></label>
|
||||
<textarea style="height: 100px;" class="form-control" id="ecard_content" placeholder="Enter E-card Content" name="ecard_content"><?= isset($template_data) ? $template_data : '' ?></textarea>
|
||||
</div>
|
||||
<div class="form-group col-md-2 float-right" style="position: relative;top: 0px;left: 40px;">
|
||||
<label for="short_name">Logo Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['tpa_logo']) && !empty($tpa['tpa_logo']) ? base_url() . "public/uploads/logo/" . $tpa['tpa_logo'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<a href="<?= isset($tpa['id']) ? base_url('/util/preview-card/') . $tpa['id'] : '' ?>" class="btn btn-primary" id="preview" target="_blank">Preview</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Front card Image<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage2();" id="fc" name="fc" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Back card Image<span class="text-danger"></span></label>
|
||||
<input type="file" class="form-control" onchange="PreviewImage3();" id="bc" name="bc" accept="image/jpeg, image/jpg, image/png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Front card Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['front_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview2" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="short_name">Back card Preview<span class="text-danger"></span></label>
|
||||
<img src="<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['back_card'] : base_url() . "public/assets/images/avatar_2x.png" ?>" width="100" height="100" id="uploadPreview3" class="avatar img-circle img-thumbnail" alt="avatar" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -34,103 +76,195 @@
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="full-width-modal-emp-list" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fullWidthModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="fullWidthModalLabel">Preview<span id="title_header_name"></span></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body" id="Preview_data">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#tpa_general_form").submit(function(events) {
|
||||
|
||||
$("#tpa_general_form").submit(function(events) {
|
||||
events.preventDefault();
|
||||
var isValid = $('#tpa_general_form').parsley().validate();
|
||||
|
||||
events.preventDefault();
|
||||
var isValid = $('#tpa_general_form').parsley().validate();
|
||||
var PrimaryKey = $('#tpa_General_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
|
||||
var PrimaryKey = $('#tpa_General_PrimaryKey').val();
|
||||
var form_action = '';
|
||||
if (isValid) {
|
||||
if (PrimaryKey === '') {
|
||||
form_action = '<?= base_url("master/tpa/createpost"); ?>';
|
||||
} else {
|
||||
form_action = '<?= base_url("master/tpa/edit"); ?>';
|
||||
}
|
||||
|
||||
if(PrimaryKey === ''){
|
||||
form_action = '<?= base_url("master/tpa/createpost"); ?>';
|
||||
}else{
|
||||
form_action = '<?= base_url("master/tpa/edit"); ?>';
|
||||
var formData = new FormData($('#tpa_general_form')[0]);
|
||||
var OptionsHTML1 = '';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
console.log(res);
|
||||
$('#tpa_id').val(res.data.id);
|
||||
$('#tpa_General_PrimaryKey').val(res.data.id);
|
||||
$('#tpa_id_branch').val(res.data.id);
|
||||
$('#tpa_branch_contacts_id').click();
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "TPA General Info";
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
// $.toast({
|
||||
// text: 'Insurer General Info',
|
||||
// heading: "Submitted Sucessfully",
|
||||
// position: 'top-right',
|
||||
// icon: 'success',
|
||||
// bgColor: !1,
|
||||
// });
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log('Something Wrong!', 'warning'); }, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var formData = new FormData($('#tpa_general_form')[0]);
|
||||
var OptionsHTML1 = '';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
console.log(res);
|
||||
$('#tpa_id').val(res.data.id);
|
||||
$('#tpa_General_PrimaryKey').val(res.data.id);
|
||||
$('#tpa_id_branch').val(res.data.id);
|
||||
$('#tpa_branch_contacts_id').click();
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
|
||||
$('#btnBranchAdd').show();
|
||||
var message = "TPA General Info";
|
||||
toastr.success(message, 'Success');
|
||||
// Perform validation for each field
|
||||
$('#tpa_general_form input, #tpa_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
|
||||
// $.toast({
|
||||
// text: 'Insurer General Info',
|
||||
// heading: "Submitted Sucessfully",
|
||||
// position: 'top-right',
|
||||
// icon: 'success',
|
||||
// bgColor: !1,
|
||||
// });
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
function validateForm() {
|
||||
var isValid = true;
|
||||
|
||||
// Perform validation for each field
|
||||
$('#tpa_general_form input, #tpa_general_form select').each(function() {
|
||||
// Check for empty text inputs and selects
|
||||
if ($(this).is('input[type="text"]') || $(this).is('select')) {
|
||||
if ($.trim($(this).val()) == '') {
|
||||
alert('Please fill in all fields');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
|
||||
// Check for file inputs (assuming image files)
|
||||
if ($(this).is('input[type="file"]')) {
|
||||
var fileInput = $(this)[0];
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Please select an image file');
|
||||
isValid = false;
|
||||
return false; // Exit the loop early
|
||||
}
|
||||
}
|
||||
function PreviewImage() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("tpa_logo").files[0]);
|
||||
|
||||
oFReader.onload = function(oFREvent) {
|
||||
document.getElementById("uploadPreview").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
function PreviewImage2() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("fc").files[0]);
|
||||
|
||||
oFReader.onload = function(oFREvent) {
|
||||
document.getElementById("uploadPreview2").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
function PreviewImage3() {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.readAsDataURL(document.getElementById("bc").files[0]);
|
||||
|
||||
oFReader.onload = function(oFREvent) {
|
||||
document.getElementById("uploadPreview3").src = oFREvent.target.result;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
$('#preview').click(function() {
|
||||
var ecardContent = $('#ecard_content').val();
|
||||
$('#Preview_data').html(ecardContent);
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// $(document).ready(function() {
|
||||
// $('#preview').click(function() {
|
||||
// // Get the value from the textarea
|
||||
// var ecardContent = $('#ecard_content').val();
|
||||
|
||||
|
||||
// var filename_front = $('#fc').val().split('\\').pop();
|
||||
// var original_string_front = '{FRONT_CARD}';
|
||||
// var replace_string_front = '<?= isset($tpa['front_card']) && !empty($tpa['front_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['front_card'] : "" ?>';
|
||||
// ecardContent = ecardContent.replace(original_string_front, replace_string_front);
|
||||
|
||||
// console.log(ecardContent);
|
||||
|
||||
|
||||
// var filename_back = $('#fc').val().split('\\').pop();
|
||||
// var original_string_back = '{BACK_CARD}';
|
||||
// var replace_string_back = '<?= isset($tpa['back_card']) && !empty($tpa['back_card']) ? base_url() . "public/uploads/template_bg/" . $tpa['back_card'] : "" ?>';
|
||||
// ecardContent = ecardContent.replace(original_string_back, replace_string_back);
|
||||
|
||||
// // console.log(ecardContent)
|
||||
|
||||
// // Open a new window for printing
|
||||
// var printWindow = window.open('', '_blank');
|
||||
|
||||
// // Insert the textarea value into the new window
|
||||
// printWindow.document.write('<html><head><title>Preview Page</title></head><body>');
|
||||
// printWindow.document.write(ecardContent); // Use <pre> tag to preserve formatting
|
||||
// printWindow.document.write('</body></html>');
|
||||
|
||||
// // Trigger the print functionality
|
||||
// printWindow.print();
|
||||
// printWindow.close();
|
||||
// });
|
||||
// });
|
||||
|
||||
|
||||
</script>
|
||||
@ -14,6 +14,7 @@ table.dataTable tbody td {
|
||||
<div class="table-rep-plugin">
|
||||
<div class="table-responsive" data-pattern="priority-columns">
|
||||
<table id="tech-companies-1" class="table table-striped">
|
||||
|
||||
<thead class="bg-light">
|
||||
<?php foreach ($thead as $header): ?>
|
||||
<th><?php echo $header; ?></th>
|
||||
@ -35,4 +36,37 @@ table.dataTable tbody td {
|
||||
</div> <!-- end .table-responsive -->
|
||||
|
||||
</div> <!-- end .table-rep-plugin-->
|
||||
</div> <!-- end .responsive-table-plugin-->
|
||||
</div> <!-- end .responsive-table-plugin-->
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$('#tech-companies-1').DataTable({
|
||||
// Enable sorting
|
||||
"ordering": true,
|
||||
|
||||
// Enable filtering/search
|
||||
"searching": true,
|
||||
|
||||
// Enable pagination
|
||||
"paging": true,
|
||||
|
||||
// Set the number of records per page
|
||||
"pageLength": 10, // Adjust as needed
|
||||
|
||||
// Define the initial sorting order (optional)
|
||||
"order": [[ 0, "asc" ]], // Sort by the first column in ascending order
|
||||
|
||||
// Customization for the pagination buttons (optional)
|
||||
"language": {
|
||||
"paginate": {
|
||||
"first": "First",
|
||||
"last": "Last",
|
||||
"next": "Next",
|
||||
"previous": "Previous"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
BIN
public/assets/images/New-india-back.jpg
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
public/assets/images/New-india-front.jpg
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
public/assets/images/New_India_Assurance.png
Normal file
|
After Width: | Height: | Size: 308 KiB |
BIN
public/assets/images/bg22.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
public/assets/images/icici-back.jpg
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
public/assets/images/icici-front.jpg
Normal file
|
After Width: | Height: | Size: 238 KiB |
BIN
public/assets/images/insr.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
public/assets/images/logo.png
Normal file
|
After Width: | Height: | Size: 224 KiB |
BIN
public/assets/images/mdi.jpg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
public/assets/images/qr.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
62
writable/e_card_template/phs_tpa.html
Normal file
@ -0,0 +1,62 @@
|
||||
<body>
|
||||
|
||||
<div style="display: flex;justify-content:center;gap: 10px;">
|
||||
<div style="border: 1px solid black;max-height: 250px;width: 400px;background-image: url({FRONT_CARD});background-size: 100% 100%;position: relative;">
|
||||
<div style="height: 50px;width: 100px;position: absolute;top: 20px;right: 40px;">
|
||||
<img src="../image/niva.png" alt="" width="100px" height="50px" style="object-fit: fill;">
|
||||
</div>
|
||||
<table style="width: 100%;font-family: sans-serif;font-size: 14px;margin-left: 20px;margin-top: 55px;line-height: 19px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Haamira Banu</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: auto;"><b>Xoriant Solutions Pvt Ltd</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>Dob : 02/05/2000</span><span style="padding-left: 40px;">EMP ID : 73496</span></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PHS ID : MBHI CHE 38728183 XSP E</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Valid upto : 31/01/2024</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="border: 1px solid black;min-height: 250px;width: 400px;border: none;"></div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;justify-content: space-around;justify-content: center;margin-top: 20px;">
|
||||
|
||||
<div style="border: 1px solid black;min-height: 450px;width: 800px;padding: 5px 5px 10px 5px ;">
|
||||
<div style="font-family: sans-serif;line-height: 15px;">
|
||||
<div style="font-size: 20px;font-weight: 600;margin-top: 10px;text-align: center;"><b>PARAMOUNT HEALTH SERVICES AND INSURANCE TPA PRIVATE.LTD</b></div>
|
||||
<div style="font-size: 15px;font-weight: 500;text-align: center;margin-top: 10px;">Plot No:A42,Road no-28,M.I.D.C.industrial area,Ram Nagar,Wagle Estate,Thane(W) - 400 604</div>
|
||||
</div>
|
||||
<div style="border: 1px solid black;text-align: center;font-size: 16px;font-family: sans-serif;padding: 10px;margin-top: 10px;margin-left: 40px;margin-right: 40px;line-height: 25px;">Cashless Access to Network Hospitals can only be obtained <br> When accompanied with the Authorization letter issued by PHS</div>
|
||||
<h2 style="font-family: sans-serif;text-align: center;margin: 5px;margin-bottom: 10px;">24 Hours Helpline - Mumbai:(022)-6662 0808</h2>
|
||||
|
||||
<div style="text-align: center;font-size: 17px;font-family: sans-serif;margin: 20px 20px;line-height: 25px;">
|
||||
<b> Toll Free no -</b> 1800 22 6655 (Admission preferably)<br>Website :WWW.paramounttpa.com Email : contact.phs@paramounttpa.com
|
||||
</div>
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<table style="border-spacing:50px 10px;">
|
||||
<tr>
|
||||
<td><img src="../image/1 android.png" alt="" width="170px" height="135px"></td>
|
||||
<td style="font-family: sans-serif;display: flex;align-items: start;font-size: 22px;"><b>Mobile App</b></td>
|
||||
<td><img src="../image/1-ios.png" alt="" width="150px" height="140px"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="text-align: center;font-family: sans-serif;font-size: 17px;line-height: 25px;">
|
||||
please Quote Your PHS ID No.For HELP <br>Immediate intimation to PHS is a must in case of Capitalization
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
119
writable/e_card_template/vh_tpa.html
Normal file
@ -0,0 +1,119 @@
|
||||
<body>
|
||||
|
||||
<div style="display: flex;justify-content: center;gap: 10px; width:840px;margin:0 auto 15px; page-break-after: auto;">
|
||||
|
||||
<div style="border: 1px solid black;width: 400px;max-height: 300px;background: url('{FRONT_CARD}');background-size: 100% 100%;padding: 10px;">
|
||||
|
||||
<div style="display: flex;">
|
||||
<div><img src="{INSURER_LOGO}" alt="" width="60px"
|
||||
width="60px" style="object-fit: fill;;"></div>
|
||||
<div style="text-align: center;font-family: sans-serif;font-weight: 600;margin-top: 10px;"><span>THE NEW
|
||||
INDIA ASSURANCE CO.LTD.</span> <br><span style="font-size: 15px;">GOOD HEALTH MEDICLAIM
|
||||
POLICY</span></div>
|
||||
</div>
|
||||
|
||||
<table
|
||||
style="font-family: sans-serif;font-size: 14px;width: 100%;margin-top: 20px;margin-left: 20px;line-height: 20px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>MDID : {TPA_ID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><b>{NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Certificate No : {UHID}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span>Sex : {GENDER} </span> <span style="margin-left: 30px;"> Date of Birth : {DOB}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><b>{SELF_NAME}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Valid form :{POLICY_DATE}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="border: 1px solid black;width: 400px;max-height: 300px;padding: 5px;">
|
||||
<div style="font-size: 11px;text-align: center;">The card is for identification purpose only</div>
|
||||
<table style="width: 100%;text-align: center;font-size: 11px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>General & Claim Enquiry Helpline</td>
|
||||
<td>Cashless Enquiry helpline</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table style="font-size: 11px;width: 100%;text-align: center;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Toll Free : 1800-209-7777 <br>Email :
|
||||
citibank_chennai@mdindia.com</td>
|
||||
<td style="border: 1px solid black;">Toll Free : 1800-209-7800 <br>Email:
|
||||
authorisation@mdindia.com</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="font-size: 14px;text-align: center;">CITI MDIndia branch contact</div>
|
||||
|
||||
<div>
|
||||
<table style="text-align: center;width: 100%;font-size: 12px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border: 1px solid black;">Center</th>
|
||||
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
|
||||
<th style="border: 1px solid black;">Center</th>
|
||||
<th style="border: 1px solid black;">Ph.No/Fax.No.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Chennai</td>
|
||||
<td style="border: 1px solid black;">9381819401</td>
|
||||
<td style="border: 1px solid black;">Delhi</td>
|
||||
<td style="border: 1px solid black;">9310596976</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Chennai</td>
|
||||
<td style="border: 1px solid black;">9381819501</td>
|
||||
<td style="border: 1px solid black;">Mumbai</td>
|
||||
<td style="border: 1px solid black;">9320373542</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Hyderabad</td>
|
||||
<td style="border: 1px solid black;">9390838023</td>
|
||||
<td style="border: 1px solid black;">Pune</td>
|
||||
<td style="border: 1px solid black;">9371644536</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid black;">Bangalore</td>
|
||||
<td style="border: 1px solid black;">9341555665</td>
|
||||
<td style="border: 1px solid black;">Kolkata</td>
|
||||
<td style="border: 1px solid black;">9333441389</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h6 style="margin: 5px;">TERMS AND CONDITIONS</h6>
|
||||
<ol style="font-size: 11px;padding-left: 15px;margin-top: 0px;">
|
||||
<li>Pre authorisation is compulsary from tpa prior to planned admission within 24hours for
|
||||
emergencies.</li>
|
||||
<li>Admission for Investigation/Evaluation Not covered.</li>
|
||||
<li>All terms and conditions of the policy would be applicable</li>
|
||||
<li>cashless hospitalisation in network hospitals can be obtained in conjunction with this card.an
|
||||
authorisation letter issued by tpa and photo identification and such as Voters ID,Driver
|
||||
Licence,Passport,etc.</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||