Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
velz 2024-05-14 14:50:22 +05:30
commit baf5b46484
41 changed files with 3582 additions and 1513 deletions

View File

@ -18,6 +18,7 @@ $routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
$routes->get('/update-emp-policy-status', 'ClientController::updateEmpAndPolicyStatus');
$routes->get('download-e-card/(:segment)', 'EmployeeController::generateIDCardForEmployee/$1');
$routes->get('download-kyc-docs/(:segment)', 'ClientController::downloadKYCDocument/$1');
@ -218,6 +219,7 @@ $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');

View File

@ -264,9 +264,9 @@ 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);
// dd($this->clientPolicyModel->getLastQuery());
foreach ($clientPoliceData as $key => $value) {
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
@ -277,7 +277,7 @@ class ClientController extends AdminController
// echo "<pre>";
// dd($editData); die;
// dd($clientPoliceData); die;
echo view('layout/header', $headerData);
echo view('client_onboarding', $editData);
@ -587,7 +587,14 @@ class ClientController extends AdminController
$data['insurer_id'] = $insurerId;
$tpaValue = (string) $this->request->getPost('tpa');
list($tpaBranchId, $tpaId) = explode('-', $tpaValue);
if ($tpaValue === null || $tpaValue === '') {
$tpaBranchId = null;
$tpaId = null;
} else {
list($tpaBranchId, $tpaId) = explode('-', $tpaValue);
}
$data['client_id'] = $client_id;
$data['tpa_branch_id'] = $tpaBranchId;
@ -609,28 +616,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') ? 2 : 1;
$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 +708,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') ? 2 : 1;
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
@ -747,12 +761,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 +797,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 +813,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 +842,7 @@ class ClientController extends AdminController
$policyPremium = $this->policyPremium1Model->insert($data);
}
$data = $this->request->getPost();
$insert = true;
} else if ($policy_grid_id == '2') {
@ -819,6 +864,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 +879,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 +896,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[]');
@ -918,6 +971,7 @@ class ClientController extends AdminController
$data = $this->request->getPost();
$insert = true;
} else if ($policy_grid_id == '11') {
$premium = $this->request->getPost('11_premium[]');
$sum_insure = $this->request->getPost('11_si[]');
$grade = $this->request->getPost('11_grade[]');
@ -926,7 +980,7 @@ class ClientController extends AdminController
$data['premium'] = str_replace(',', '', $premium[$i]);
$data['si'] = str_replace(',', '', $sum_insure[$i]);
$data['grade'] = $grade[$i];
$data['max_si'] = $max_sum_insure[$i];
$data['max_si'] = str_replace(',', '', $max_sum_insure[$i]);
$dataa = $this->policyPremium2Model->insert($data);
}
$data = $this->request->getPost();
@ -1117,12 +1171,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;
}
}
@ -1301,6 +1356,13 @@ class ClientController extends AdminController
$data['familytransportationbenefit'] =str_replace(',', '',$this->request->getPost("familytransportationbenefit"));
$data['reasonableandcustomarycharges'] =str_replace(',', '',$this->request->getPost("reasonableandcustomarycharges"));
$data['ayudhtreatmentcover'] =str_replace(',', '',$this->request->getPost("ayudhtreatmentcover"));
if ($data['ayudhtreatmentcover'] == 1) {
$data['ayushTreatmentCoverData'] = str_replace(',', '',$this->request->getPost("ayushTreatmentCoverData"));
}else{
$data['ayushTreatmentCoverData'] ="";
}
$data['armdcovered'] =str_replace(',', '',$this->request->getPost("armdcovered"));
$data['suminsuredenhancement'] =str_replace(',', '',$this->request->getPost("suminsuredenhancement"));
$data['automaticsuminsuredreinstatement'] =str_replace(',', '',$this->request->getPost("automaticsuminsuredreinstatement"));
@ -1316,6 +1378,15 @@ class ClientController extends AdminController
$data['special_condition_label'] = str_replace(',', '',$this->request->getPost("special_condition_label")) ?? [];
$data['special_condition_input'] = str_replace(',', '',$this->request->getPost("special_condition_input")) ?? [];
$data['cataract'] =str_replace(',', '',$this->request->getPost("cataract"));
if ($data['cataract'] == 1) {
$data['cataractData'] = str_replace(',', '',$this->request->getPost("cataractData"));
}else{
$data['cataractData'] ="";
}
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
@ -1354,23 +1425,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);
}
}
@ -1432,6 +1504,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(
@ -1480,77 +1555,82 @@ class ClientController extends AdminController
public function updateClientPolicyStatus()
{
$client_policy_id = $this->request->getGet('client_policy_id');
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$message = 'Policy updated Successfully' ;
if($record['open_for_enrollment'] == 0){
$open_for_enrollment_update_value = 1;
$message = 'Update Open Enrollment Successfully';
}else if($record['open_for_enrollment'] == 1){
$open_for_enrollment_update_value = 0;
$message = 'Update Open Enrollment Successfully';
}
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
$pattern = '/gmc/i';
$subject = $data[0]->policy_type;
if (preg_match($pattern, $subject)) {
$search_term = 'GMC';
} else {
$search_term = 'GPA';
}
if($search_term === 'GPA'){
$racRate = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
}else if($search_term === 'GMC'){
$racRate = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
}
$termsData = $this->clientPolicyModel->where(['id' => $client_policy_id, 'is_active' => 1])->first();
if(empty($termsData['policy_terms'])){
return $this->respond(['status' => false,'code' => 200,'message' => 'Please define policy terms '], 200);
}
$client_policy_id = $this->request->getGet('client_policy_id');
$message = 'Policy updated Successfully';
$termsData = json_decode($termsData['policy_terms']);
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
if (isset($termsData->sum_insured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Sum Insured field is empty', 'data' => $record], 200);
}
if ($record['open_for_enrollment'] == 0) {
$open_for_enrollment_update_value = 1;
$message = 'Enrollment Opened Successfully';
} else if ($record['open_for_enrollment'] == 1) {
$open_for_enrollment_update_value = 0;
$message = 'Enrollment Closed Successfully';
}
if (isset($termsData->SumInsured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Sum Insured field is empty'], 200);
}
// Check if 'family_floater' key exists and has a value
if (isset($termsData->family_floater) && empty($termsData->family_floater)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Family Floater field is empty'], 200);
}
// Check if 'family_floaters' key exists and has a value
if (isset($termsData->family_floaters) && is_array($termsData->family_floaters) && count($termsData->family_floaters) <= 0) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Family Members field is empty'], 200);
$familyFloatersCount = count($termsData->family_floaters);
}
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
$pattern = '/gmc/i';
$subject = $data[0]->policy_type;
if (preg_match($pattern, $subject)) {
$search_term = 'GMC';
} else {
$search_term = 'GPA';
}
if($racRate == 0){
if ($search_term === 'GPA') {
$racRate = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
} else if ($search_term === 'GMC') {
$racRate = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
}
return $this->respond(['status' => false,'code' => 200,'message' => 'Please define policy premium'], 200);
}
$termsData = $this->clientPolicyModel->where(['id' => $client_policy_id, 'is_active' => 1])->first();
if (empty($termsData['policy_terms'])) {
return $this->respond(['status' => false, 'code' => 200, 'message' => 'Please define policy terms '], 200);
}
$policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
$json_data ='';
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id )->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
if ($open_for_enrollment) {
$open_for_enrollment_1 = $this->clientPolicyModel->where('id', $client_policy_id )->find();
$open_for_enrollment_value = $open_for_enrollment_1[0]['open_for_enrollment'];
$client_policy_id_value = $client_policy_id;
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
}
$termsData = json_decode($termsData['policy_terms']);
return $this->respond(['status' => true,'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
if (isset($termsData->sum_insured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false, 'code' => 200, 'message' => 'The Policy terms Sum Insured field is empty', 'data' => $record], 200);
}
if (isset($termsData->SumInsured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false, 'code' => 200, 'message' => 'The Policy terms Sum Insured field is empty'], 200);
}
// Check if 'family_floater' key exists and has a value
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);
}
// Check if 'family_floaters' key exists and has a value
if (isset($termsData->family_floaters) && is_array($termsData->family_floaters) && count($termsData->family_floaters) <= 0) {
return $this->respond(['status' => false, 'code' => 200, 'message' => 'The Policy terms Family Members field is empty'], 200);
$familyFloatersCount = count($termsData->family_floaters);
}
if ($racRate == 0) {
return $this->respond(['status' => false, 'code' => 200, 'message' => 'Please define policy premium'], 200);
}
// $policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
$json_data = '';
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id)->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
if ($open_for_enrollment) {
$open_for_enrollment_1 = $this->clientPolicyModel->where('id', $client_policy_id)->find();
$open_for_enrollment_value = $open_for_enrollment_1[0]['open_for_enrollment'];
$client_policy_id_value = $client_policy_id;
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
}
return $this->respond(['status' => true, 'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data, 'client_policy_data' => $record], 200);
}
@ -1600,4 +1680,17 @@ class ClientController extends AdminController
}
public function downloadKYCDocument($file_name)
{
$file = WRITEPATH . 'uploads/client_kyc_documents/' . $file_name; // Example file path
if (file_exists($file)) {
return $this->response->download($file, null)->setFileName($file_name);
} else {
return "File not found.";
}
}
}

View File

@ -27,6 +27,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Exception as SpreadsheetReaderException;
use PhpParser\Node\Expr\Cast\Double;
use function PHPUnit\Framework\returnSelf;
@ -108,16 +109,24 @@ class EmpDataServiceController extends BaseController
{
// Fetch employee data for export from the database
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
$insurer_id = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first();
// dd($objects);
$cash_balance = $this->clientDepositModel->where('client_id',$export_data['client_id'] )->where('insurer_id', $insurer_id['insurer_id'])->orderBy('id', 'DESC')->first();
$totals = 0;
foreach ($objects as $key => $value) {
$totals += $value->total;
}
if((int) $cash_balance['balance'] < (int) $totals){
return 0;
}
// Log the count of exported data
$count = count($objects);
$export_data['count'] = $count;
@ -1598,7 +1607,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 +1617,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 +1656,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 +1676,5 @@ class EmpDataServiceController extends BaseController
return false; // Email(s) sending failed
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -304,7 +304,7 @@ class EmployeeRestController extends AdminController
->where('client_policy_id',$value['policy_details']['client_policy_id'] )
->where('employee_id' , $value['temp']['emp_id'] )
->where('is_active', 1 )
->set(array('premium'=> $value['policy_details']['premium'] , 'gst'=> $value['policy_details']['gst'] ))
->set(array('premium'=> $value['policy_details']['premium'] , 'rata_premimum'=> $value['policy_details']['rata_premimum'] , 'gst'=> $value['policy_details']['gst'] ))
->update();
}
@ -949,6 +949,7 @@ public function getEmployeePolicy()
// Filter employee data where the family_floater_key is 'self'
$selfData = array_filter($empData, fn($arr) => trim(strtolower($arr['family_floater_key'])) === 'self');
$employee_policy = $this->employeePolicyModel->where('employee_id',$selfData[0]['id'])->where('client_policy_id',$array->ClientPolicyId)->where('is_active', 1 )->get()->getRow();
$self['is_value_exist'] = true;
$self['data']['family_floater_key'] = 'self';
@ -958,6 +959,7 @@ public function getEmployeePolicy()
$self['data']['dob'] = $this->convertDateFormatDMY($selfData[0]['dob']);
$self['data']['mobile'] = $selfData[0]['mobile'];
$self['data']['client_policy_id'] = $array->ClientPolicyId;
$self['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
$array->mapped_family_floaters = $self;
@ -996,6 +998,7 @@ public function getEmployeePolicy()
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)->where('is_active', 1 )->get()->getRow();
$temp['is_value_exist'] = true;
$temp['data']['family_floater_key'] = $familyFloatesValue;
$temp['data']['employee_id'] = $value['id'];
@ -1003,7 +1006,12 @@ public function getEmployeePolicy()
$temp['data']['name'] = $value['name'];
$temp['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
$temp['data']['form_type'] = $dependent;
$temp['data']['form_type'] = $dependent;
$temp['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
$ageKey = ($dependent == 'parent' || $dependent == 'parent_in_law') ? 'elders' : $dependent;
$temp['data']['age_validation'] = $decodedArray->age_ratio->$ageKey;
array_push($data,$temp);
unset($empData[$key]);
$floters = array_diff($floters, [$familyFloatesValue]);
@ -1012,7 +1020,9 @@ public function getEmployeePolicy()
}
}
}
// dd($data);
// Remove Unwanted floter key from floters array based on either-parents-pil term value
if($familyFloates->{'either-parents-pil'} == 1 && count($floters))
{
@ -1147,13 +1157,16 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
// 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) {
$employee_policy = $this->employeePolicyModel->where('employee_id',$value['id'])->where('client_policy_id',$array->ClientPolicyId)->where('is_active', 1 )->get()->getRow();
// dd( $employee_policy);
$temp['is_value_exist'] = true;
$temp['data']['family_floater_key'] = $familyFloatesValue;
$temp['data']['employee_id'] = $value['id'];
@ -1161,7 +1174,11 @@ public function getGmcParrentsPolicy($GmcParrentsPolicy,$emp_code,$client_id)
$temp['data']['name'] = $value['name'];
$temp['data']['dob'] = $this->convertDateFormatDMY($value['dob']);
$temp['data']['client_policy_id'] = $array->ClientPolicyId;
$temp['data']['form_type'] = $dependent;
$temp['data']['form_type'] = $dependent;
$temp['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
$ageKey = ($dependent == 'parent' || $dependent == 'parent_in_law') ? 'elders' : $dependent;
$temp['data']['age_validation'] = $array->Policy_Terms->age_ratio->$ageKey;
array_push($data,$temp);
unset($empData[$key]);
$floters = array_diff($floters, [$familyFloatesValue]);
@ -1300,6 +1317,7 @@ public function getAddOnPolicy()
if(count($clientPolicy))
{
$band = $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('family_floater_key','self')->get()->getRow()->band;
$PolicyData = [];
foreach ($clientPolicy as $key => $array) {
$responce = [];
@ -1307,9 +1325,26 @@ public function getAddOnPolicy()
$decodedArray = json_decode($array['policy_terms']);
$policy_terms = $decodedArray;
$getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($array['id'],$array['client_id']);
$uniqueData = [];
$siValues = [];
foreach ($getSlabAndGridData['slab_rates'] as $item) {
if($getSlabAndGridData['grid_master']['emp_band'] == 1 ){
if ($item['grade'] == $band) {
$uniqueData[] = $item;
}
}else{
if (!in_array($item['si'], $siValues)) {
$uniqueData[] = $item;
$siValues[] = $item['si'];
}
}
}
$responce['policy_name'] = $this->policesModel->where('id',$array['policy_id'])->get()->getRow()->name;
$responce['SlabRates'] = $getSlabAndGridData['slab_rates'];
$responce['SlabRates'] = $uniqueData;
$responce['GridMaster'] = $getSlabAndGridData['grid_master'];
$responce['client_id'] = $array['client_id'];
$responce['client_policy_id'] = $array['id'];
@ -1460,11 +1495,12 @@ public function getAddOnPolicy()
}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; }
if($key == 'parents'){ $text = 'parent'; }else if($key == 'childrens'){ $text = 'child'; }else if($key == 'parents-in-law'){$text = 'parent_in_law';}else{ $text = $key; }
array_push($whereArray,$text);
}
}
@ -1483,7 +1519,7 @@ public function getAddOnPolicy()
$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->premium)){ $only_si_premium_value = $only_si_premium_value + $employee_policy->rata_premimum;}
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'];
@ -1514,7 +1550,7 @@ public function getAddOnPolicy()
$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; }
if($key == 'parents'){ $text = 'parent'; }else if($key == 'childrens'){ $text = 'child'; }else if($key == 'parents-in-law'){$text = 'parent_in_law';}else{ $text = $key; }
array_push($whereArray,$text);
}
}
@ -1532,7 +1568,7 @@ public function getAddOnPolicy()
$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->premium)){ $only_si_premium_value = $only_si_premium_value + $employee_policy->rata_premimum;}
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'];

View File

@ -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');

View File

@ -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;
}
}

View File

@ -22,6 +22,8 @@ class BatchFileModel extends Model
"updated_by",
"is_active",
"amount",
"status",
"error_data",
];
// Callbacks

View File

@ -34,6 +34,7 @@ class ClientPolicyModel extends Model
"policy_terms",
"open_for_enrollment",
"is_addon",
"inception_type",
"base_policy",
"created_by",
"updated_by",
@ -75,8 +76,8 @@ class ClientPolicyModel extends Model
->select('policy_type.policy_type as policy_type_name')
->join('insurers', 'insurers.id = client_policy.insurer_id')
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id')
->join('tpa', 'tpa.id = client_policy.tpa_id')
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id')
->join('tpa', 'tpa.id = client_policy.tpa_id', 'left')
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = policies.policy_type_id')
->where('client_policy.client_id', $client_id)

View File

@ -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;
}

View File

@ -14,6 +14,7 @@ class InsurerModel extends Model
"category",
"name",
"short_name",
"insurer_logo",
"created_by",
"updated_by",
"is_active",

View File

@ -24,6 +24,7 @@ class PolicyPremium1Model extends Model
"created_by",
"updated_by",
'is_active',
'grade',
'premium_type',
];

View File

@ -12,6 +12,9 @@ class TPAModel extends Model
"id",
"name",
"short_name",
"front_card",
"back_card",
"tpa_logo",
"created_by",
"updated_by",
"is_active",

View File

@ -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>

View File

@ -176,6 +176,26 @@
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
$('#form_'+item.kyc_doc_type_id).hide();
console.log('step 1')
if(item.file_name != null && item.file_name != ""){
console.log('step 2')
$('#download_'+item.kyc_doc_type_id).show();
$('#download_' + item.kyc_doc_type_id).attr('href', '<?= base_url('download-kyc-docs/') ?>' + item.file_name);
$('#delete_'+item.kyc_doc_type_id).show();
}
else{
console.log('step 3')
$('#download_'+item.kyc_doc_type_id).hide();
$('#download_' + item.kyc_doc_type_id).attr('href', '#');
$('#delete_'+item.kyc_doc_type_id).hide();
}
console.log('step 4')
});
},
@ -212,19 +232,27 @@
var tbody = $('#tbody');
tbody.empty();
$.each(res.data, function (index, item) {
$.each(res.data, function(index, item) {
var row = `<tr>
<td> ${item.file_name}</td>
<td id="form_${item.id}" style=""><form class="ajax" ><input class="file-input__input" type="file" name="file_name">
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id" />
<input type="hidden" name="client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
<button class="btn btn-sm btn-primary submit" style="position: relative;right: 80px;">Submit</button></form></td>
<td>${item.file_name}</td>
<td id="form_${item.id}">
<form class="ajax">
<input class="file-input__input" type="file" name="file_name">
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
<input type="hidden" name="client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>">
<button class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
</form>
</td>
<td id="name_${item.id}" style="display:none;"></td>
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px;"></i></td>
<td>
<i id="delete_${item.id}" data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px; display: none"></i>
<a id="download_${item.id}" data-id="${item.id}" class="fa fa-download" style="font-size:18px; display: none" download></a>
</td>
</tr>`;
tbody.append(row);
});
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
@ -250,7 +278,10 @@
<tr id="kyc-${item.id}">
<td>${item.other_docs_name}</td>
<td>${item.file_name}</td>
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i></td>
<td>
<i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
<a href = "<?= base_url('download-kyc-docs/') ?>${item.file_name}" data-id="${item.id}" class="fa fa-download" style="font-size:18px;" download></a>
</td>
</tr>
`;
@ -267,6 +298,29 @@
$('#name_'+item.kyc_doc_type_id).show();
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
$('#form_'+item.kyc_doc_type_id).hide();
console.log('step 1')
if(item.file_name != null && item.file_name != ""){
console.log('step 2')
$('#download_'+item.kyc_doc_type_id).show();
$('#download_' + item.kyc_doc_type_id).attr('href', '<?= base_url('download-kyc-docs/') ?>' + item.file_name);
$('#delete_'+item.kyc_doc_type_id).show();
}
else{
console.log('step 3')
$('#download_'+item.kyc_doc_type_id).hide();
$('#download_' + item.kyc_doc_type_id).attr('href', '#');
$('#delete_'+item.kyc_doc_type_id).hide();
}
console.log('step 4')
}, 1000);
});
@ -335,7 +389,10 @@
<tr id="kyc-${item.id}">
<td>${item.other_docs_name}</td>
<td>${item.file_name}</td>
<td><i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i></td>
<td>
<i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
<a href = "<?= base_url('download-kyc-docs/') ?>${item.file_name}" data-id="${item.id}" class="fa fa-download" style="font-size:18px; display: none" download></a>
</td>
</tr>
`;
}

View File

@ -14,6 +14,7 @@
<th>Policy</th>
<th>TPA</th>
<th>Date</th>
<th>Enrollment Status</th>
<th>Status</th>
<th>Action</th>
</tr>
@ -79,7 +80,7 @@
</select>
</div>
<div class="form-group col-md-4">
<label for="mobile">TPA<span class="text-danger">*</span></label>
<label for="mobile">TPA<span id="tpa_danger" class="text-danger">*</span></label>
<select class="form-control" id="tpa" name="tpa" required>
<option value="">Select TPA</option>
<?php foreach ($tpa as $value) { ?>
@ -105,6 +106,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 +162,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 +170,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 +180,7 @@
});
$('#add_form').hide();
$('.btnBack').hide();
@ -192,6 +206,7 @@
$('#first').hide();
$('#second').hide();
$('#third').hide();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
@ -232,15 +247,42 @@
} else {
search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists
}
// console.log('search_term :', search_term)
var enrollmentStatus = '';
if(item.inception_type == 1){
enrollmentStatus = 'N/A'
}else if(item.inception_type == 2){
if(item.open_for_enrollment == 1){
enrollmentStatus = '<a href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll" data-toggle="tooltip" data-placement="left" title="Click To Close Enrollment">Open</a>'
}else if(item.open_for_enrollment == 0){
enrollmentStatus = '<a href="#" data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
}
}
var tpaValue = 'TPA Unavailable';
if (item.tpa_short && item.tpa_branch_code) {
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
console.log('search_term :', search_term)
policyTable += `
<tr>
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
<td>${item.policy_name} (${item.policy_type_name})</td>
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
<td>${tpaValue}</td>
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
<td style="text-align: center;">${(enrollmentStatus)}</td>
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
<td>
<div class="btn-group dropdown">
@ -248,16 +290,7 @@
<div class="dropdown-menu dropdown-menu-right">
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
`;
if (item.open_for_enrollment == 0) {
policyTable +=
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
} else {
policyTable +=
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
}
policyTable += `
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
</div>
</div>
</td>
@ -284,6 +317,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 +331,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');
@ -353,14 +408,41 @@
subject; // Set default value if neither 'GMC' nor 'GPA' exists
}
console.log('search_term :', search_term)
// console.log('search_term :', search_term)
var enrollmentStatus = '';
if(item.inception_type == 1){
enrollmentStatus = 'N/A'
}else if(item.inception_type == 2){
if(item.open_for_enrollment == 1){
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Open</a>'
}else if(item.open_for_enrollment == 0){
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
}
}
var tpaValue = 'TPA Unavailable';
if (item.tpa_short && item.tpa_branch_code) {
tpaValue = item.tpa_short + '-' + item.tpa_branch_code;
}
policyTable += `
<tr>
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
<td>${item.policy_name} (${item.policy_type_name})</td>
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
<td>${tpaValue}</td>
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
<td style="text-align: center;">${(enrollmentStatus)}</td>
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
<td>
<div class="btn-group dropdown">
@ -368,16 +450,7 @@
<div class="dropdown-menu dropdown-menu-right">
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
`;
if (item.open_for_enrollment == 0) {
policyTable +=
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
} else {
policyTable +=
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
}
policyTable += `
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
</div>
</div>
</td>
@ -408,6 +481,7 @@
}, 1000);
}
});
});
$(document).ready(function() {
@ -461,7 +535,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 +567,18 @@
console.log('id', id)
$('#policy_type_id').val(dataId);
if (dataId == 1) {
$('#tpa').prop('required', false);
$('#tpa_danger').hide()
} else {
$('#tpa').prop('required', true);
$('#tpa_danger').show()
}
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 +595,42 @@
// appendPolicyFormFields(2);
// }
if($('#policy_type').val() == 1){
console.log('step 1')
if (dataId == 3) {
console.log('step 2')
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').show();
$('#base_policy').prop('required', true);
if (displayStatus === 'none') {
console.log('step 2.1')
$('#base_policy').val('').change();
}
// $('#base_policy').find('option[data-id="3"]').hide();
} else {
console.log('step 3')
var displayStatus = $('#base_policy_id').css('display');
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
if (displayStatus === 'none') {
console.log('step 3.1')
$('#base_policy').val('').change();
}
}
}
});
});
@ -545,7 +668,13 @@
$('.btnAdd').hide();
$('#insurer').val(res.data.insurer_branch_id + '-' + res.data.insurer_id).change();
$('#tpa').val(res.data.tpa_branch_id + '-' + res.data.tpa_id).change();
var tpaValue = '';
if (res.data.tpa_branch_id && res.data.tpa_id) {
tpaValue = res.data.tpa_branch_id + '-' + res.data.tpa_id;
}
$('#tpa').val(tpaValue).change();
// $('#policy').val(res.data.policy_id).change();
$('#policy_type').val(res.data.is_addon).change();
$('#base_policy').val(res.data.base_policy);
@ -557,24 +686,55 @@
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
$('#policy_status_field').show();
if (res.data.inception_type == 2) {
$('#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);
}
if(res.data.is_addon == 1 && res.data.base_policy > 0){
// $("#insurer").next(".select2-container").css({
// 'pointer-events': 'none',
// });
// $('#select2-insurer-container').css({
// 'background-color': '#ebebe0',
// });
// $("#tpa").next(".select2-container").css({
// 'pointer-events': 'none',
// });
// $('#select2-tpa-container').css({
// 'background-color': '#ebebe0',
// });
}
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
$("#insurer").next(".select2-container").css({
'pointer-events': 'none',
});
@ -619,14 +779,17 @@
$.each(res.client_policy_list, function(index, item) {
OptionsHTML += '<option data-id="' + item.policy_type_id +
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
'selected="selected"' : '') + '>' + item.name + '</option>';
'selected="selected"' : '') + '>' + item.name + '( ' + item.policy_type + ' )</option>';
});
$('#base_policy').html(OptionsHTML);
setTimeout(function() {
$('#policy').val(res.data.policy_id).change();
$('#base_policy').val(res.data.base_policy);
$('#base_policy').change();
}, 3000);
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
@ -640,24 +803,27 @@
});
});
$('body').on('click', '.btnOpenEnroll', function() {
Swal.fire({
title: "Are you sure?",
text: "You need to approve this!",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Yes, delete it!"
text: "You need to approve this!",
icon: "info",
showCancelButton: true,
confirmButtonColor: "#3085d6",
confirmButtonText: "Yes",
}).then((result) => {
if (result.isConfirmed) {
var client_policy_id = $(this).attr('data-id');
var policy_id = $(this).attr('id');
var client_id = $('#client_id_policy').val()
// console.log('client_policy_id', client_policy_id);
if (result.isConfirmed) {
var client_policy_id = $(this).attr('data-id');
var policy_id = $(this).attr('id');
var client_id = $('#client_id_policy').val()
console.log('client_policy_id', client_policy_id)
console.log('policy_id', policy_id)
console.log('client_id', client_id)
if (client_policy_id) {
$('.loader').fadeIn();
@ -671,30 +837,28 @@
client_policy_id: client_policy_id,
},
success: function(res) {
console.log(res);
console.log(res.client_policy_data);
if (res) {
if (res.open_for_enrollment) {
var json_decode = JSON.parse(res.open_for_enrollment);
var open_for_enrollment = json_decode.open_for_enrollment;
var client_policy_id = json_decode.client_policy_id;
if (open_for_enrollment == 1) {
// console.log($('[data-id="' + client_policy_id + '"]');
$('.btnOpenEnroll').each(function(index, element) {
if ($(element).data('id') == client_policy_id) {
$(element).css({
'background-color': 'lightgrey',
});
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
$(element).html('<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="' + res.client_policy_data.id + '" id="' + res.client_policy_data.policy_id + '" class="btnOpenEnroll">Open</a>');
}
});
} else {
$('.btnOpenEnroll').each(function(index, element) {
if ($(element).data('id') == client_policy_id) {
$(element).css({
'background-color': '',
});
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
$(element).html('<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="' + res.client_policy_data.id + '" id="' + res.client_policy_data.policy_id + '" class="btnOpenEnroll">Closed</a>');
}
});
}
@ -734,6 +898,7 @@
});
function appendPolicyFormFields(policy_type, data = false) {
var html = '';
@ -1028,6 +1193,10 @@
gpaSumInsureMultiplier(input);
}
if (input.id == 'gpa_sum_si2') {
gpaSumInsureMultiplier(input);
}
// if(input.id == 'basic_pay'){
// var inputNumber = input.value;
// if (inputNumber) {
@ -1133,11 +1302,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 +1317,7 @@
$('#first').show();
$('#second').show();
$('#third').show();
$('#base_policy_id').hide();
$('#base_policy').prop('required', false);
}
@ -1176,9 +1348,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);
},
@ -1195,7 +1380,7 @@
}
var dataId = 0;
$(document).ready(function() {
$('#base_policy').change(function() {
@ -1204,6 +1389,12 @@
var policy_type = $('#policy_type').val()
console.log(client_policy_id);
dataId = $('#policy').children('option:selected').attr('data-id');
console.log('dataId', dataId)
base_policy_data_id = $(this).children('option:selected').attr('data-id');
console.log('base_policy_data_id', base_policy_data_id);
var queryParams = {
client_policy_id: client_policy_id,
policy_type: policy_type,
@ -1238,26 +1429,37 @@
$('#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 || policy_type == 1) {
console.log('step 1')
setTimeout(function() {
console.log('step 2')
var $option = $('#policy').find('option[data-id="3"]');
if ($option.length > 0) {
console.log('step 3')
$option.prop('selected', true).change();
} else {
console.log('step 4');
toastr.warning('The insurer does not have a GMC-Parents policy.', 'Warning');
}
}, 1500);
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
@ -1269,6 +1471,7 @@
}, 500);
}
});
});
})

View File

@ -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);
}
});

View File

@ -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>

View 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>

View 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>

View 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>

View File

@ -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>

View File

@ -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>

View File

@ -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);
}
});
}

File diff suppressed because it is too large Load Diff

View File

@ -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>
@ -94,7 +102,7 @@
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="totalSumInsured">Total Sum Insured</label>
<label for="totalSumInsured">Total Sum Assured</label>
</div>
<div class="col-md-6">
<input type="text" style="width: 100% !important;" class="form-control" name="totalSumInsured" id="totalSumInsured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)">
@ -124,13 +132,13 @@
<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">
<input class="underline-input min_age" value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>" style="width: 44%;" type="number" name="self_min_age" id="self_min_age_gpa" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)">
</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">
<input class="underline-input max_age" value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>" style="width: 44%;" type="number" name="self_max_age" id="self_max_age_gpa" oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)">
</div>
</td>
<td ></td>
@ -316,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() {
});
@ -345,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");
@ -359,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");
@ -373,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");
@ -387,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");
@ -401,13 +416,13 @@
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) {
@ -418,17 +433,17 @@
}
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();
@ -436,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,
@ -445,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);
@ -465,87 +481,116 @@
}
});
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);
$('#gpa_client_policy_id').val(client_policy_id);
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) => {
if(gpaJsonObjectForSpecialCondition[key][index] == undefined){
element.value = " ";
}else{
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", "");
}
@ -566,8 +611,13 @@
}
}else {
element.value = jsonObject[key];
} else {
if(jsonObject[key] == undefined){
element.value = " ";
}else{
element.value = jsonObject[key];
}
}
}
@ -586,38 +636,79 @@
$("#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;position: relative;bottom: 6px;">
<input class="form-control" name="gpa_special_condition_label[]" id="gpa_special_condition_label[]" style="position: relative;right: 15px;">
<span class="specialConditionClose" style="color: red; float: right;position: relative;bottom: 28px;left: 15px;">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('');
});
@ -642,18 +733,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>

View File

@ -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>
@ -70,7 +69,6 @@ $('.close').click(function() {
for (var i = 1; i <= 13; i++) {
$('#grid_' + i).remove();
}
});
@ -87,7 +85,6 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
var selectElement = event.target;
var selectedOption = selectElement.options[selectElement.selectedIndex];
dataIdValue = selectedOption.getAttribute('data-id');
// console.log('dataIdValue', dataIdValue)
}
@ -100,20 +97,59 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
grid_html = `
<div class="form-row" id="grid_1">
<input value="1" type="hidden" name="policy_type">
<div class="form-group col-md-3">
<div class="form-group col-md-4">
<label for="mobile">Select <span class="text-danger">*</span></label>
<select class="form-control" id="si_or_bp" name="si_or_bp" onchange="si_orbp_change_function()" required>
<option value="2">Basic Pay</option>
<option value="1">Sum Insured</option>
<option value="3">Band/Grade</option>
</select>
</div>
<div id="si_or_bp_full_div" style="display:none">
</div>
<div id="si_or_bp_full_div" style="display:none;">
<div id="si_or_bp_grade" class="form-row">
<div class="form-row col-md-4" style="margin-left: 346px; margin-top: -114px;">
<label for="mobile">Premium Multiplier<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="gpa_sum_multiplier2" id="gpa_sum_multiplier2" onkeyup="gpaSumInsureMultiplier(this)" required>
</div>
<div class="form-row" style="width:101%;padding: 10px;" id="removeChild_${Count}">
<div class="form-group col-md-2" id="">
<label for="mobile">Band/Grade<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.grade : '') : ''}" type="text" class="form-control" placeholder="Enter Band/Grade" name="gpa_band[]" id="gpa_band" required>
</div>
<div class="form-group col-md-4" id="">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_sum_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<label for="mobile">Premium<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.premium : '') : ''}" type="text" class="form-control" placeholder="Enter Premium" name="gpa_sum_premium2[]" id="gpa_sum_premium2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_sum_premium_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4" style="position: absolute;left: 870px;">
<button style="margin-top: 44px;position: relative;right: 0px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton()">x</button>
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more2" onclick="appendGridtHtml('1')">+</button>
</div>
</div>
<div id="si_or_bp_sum_insure_child"></div>
</div>
<div id="si_or_bp_sum_insure" class="form-row">
<div class="form-row col-md-4" style="margin-left: 323px; margin-top: -114px;">
<label for="mobile">Multiplier<span class="text-danger">*</span></label>
<div class="form-row col-md-4" style="margin-left: 346px; margin-top: -114px;">
<label for="mobile">Premium Multiplier<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="gpa_sum_multiplier" id="gpa_sum_multiplier" onkeyup="gpaSumInsureMultiplier(this)" required>
</div>
<div class="form-row" style="width:84%" id="removeChild_${Count}">
<div class="form-row" style="width:101%;padding: 10px;" id="removeChild_${Count}">
<div class="form-group col-md-4" id="">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -125,40 +161,51 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
<div id='gpa_sum_premium_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1')">+</button>
<div class="form-group col-md-4" style="position: relative;right: 6px;">
<button style="margin-top: 44px;position: relative;right: 0px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton()">x</button>
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml('1')">+</button>
</div>
</div>
<div id="si_or_bp_sum_insure_child"></div>
</div>
<div id="si_or_bp_basic_pay" class="form-row">
<div class="form-row" style="margin-left: 301px;/* margin-bottom: -106px; */margin-top: -97px;">
<div class="form-col col-md-4">
<div class="form-row" style="margin-left: 347px;/* margin-bottom: -106px; */margin-top: -97px;">
<div class="form-col col-md-6">
<label for="mobile">Basic Pay<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_pay : '') : ''}" type="text" class="form-control" placeholder="Enter Basic Pay" name="basic_pay" id="basic_pay" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_basic_pay_number_word' class="text-danger-2" ></div>
</div>
<div class="form-col col-md-6">
<label for="mobile">Basic Multiplier<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="basic_multiplier" id="basic_multiplier" onkeyup='basicPayMultiple(this)' required>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_multiplier : '') : ''}" type="text" class="form-control" placeholder="Basic Multiplier" name="basic_multiplier" id="basic_multiplier" onkeyup='basicPayMultiple(this)' required>
</div>
</div>
<div class="form-row" style="padding: 10px;">
<div class="form-group col-md-4" id="" style="width:84%">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_basic_si" id="gpa_basic_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='basic_gpa_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-col col-md-4">
<label for="mobile">Premium Multiplier<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="premium_multiplier" id="premium_multiplier" onkeyup='basicPayMultiple(this)'required>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Premium Multiplier" name="premium_multiplier" id="premium_multiplier" onkeyup='basicPayMultiple(this)'required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4" id="" style="width:84%">
<label for="mobile">Basic Pay<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_pay : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="basic_pay" id="basic_pay" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_basic_pay_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4" id="">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_basic_si" id="gpa_basic_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='basic_gpa_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<label for="mobile">Premium<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.premium : '') : ''}" type="text" class="form-control basic_gpa_premium" placeholder="Enter Premium" name="gpa_basic_premium" id="gpa_basic_premium" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='basic_gpa_premium_number_word' class="text-danger-2" ></div>
<label for="mobile">Premium<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.premium : '') : ''}" type="text" class="form-control basic_gpa_premium" placeholder="Enter Premium" name="gpa_basic_premium" id="gpa_basic_premium" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='basic_gpa_premium_number_word' class="text-danger-2" ></div>
</div>
</div>
</div>
</div>
@ -225,11 +272,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
<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="4_age_from[]" id="4_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<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="4_age_to[]" id="4_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -259,11 +306,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
</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="5_age_from[]" id="5_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="5_age_to[]" id="5_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="5_age_to[]" id="5_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -285,30 +332,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>
<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" onkeypress = "return onlyNumbers(event)" 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_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="6_age_to[]" id="6_age_to" onkeypress = "return onlyNumbers(event)" 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') {
@ -327,11 +374,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
</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="7_age_from[]" id="7_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="7_age_to[]" id="7_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="7_age_to[]" id="7_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -412,11 +459,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
</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="10_age_from[]" id="10_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="10_age_to[]" id="10_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="10_age_to[]" id="10_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -454,7 +501,8 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
</div>
<div class="form-group col-md-2">
<label for="mobile">Max SI<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="11_max_si[]" id="11_max_si" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="11_max_si[]" id="11_max_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='max_si_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,11)">x</button>
@ -516,11 +564,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
</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="13_age_from[]" id="13_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="13_age_to[]" id="13_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="13_age_to[]" id="13_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<label for="mobile">Relationship<span class="text-danger">*</span></label>
@ -559,11 +607,14 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
if (dataIdValue == '1') {
$('#gpa_sum_si').trigger('keyup');
// $('input[name="gpa_sum_si[]"]').each(function() {
$('#gpa_sum_si2').trigger('keyup');
// $('input[name="gpa_sum_si[]"]').each(function() {
// console.log($(this));
// $(this).trigger('keyup');
// });
}
$('#gpa_sum_insured').hide();
$('#btnGridSubmit').show();
@ -684,18 +735,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,29 +788,30 @@ $('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 = '';
if (res.premiumData && res.premiumData.length > 0) {
if (res.premiumData[0].si_or_bp) {
si_or_bp_value = res.premiumData[0].si_or_bp;
}
@ -791,10 +844,18 @@ $('body').on('click', '.btnPolicyModel', function() {
$(this).trigger('keyup');
});
$('input[name="gpa_sum_si2[]"]').each(function() {
$(this).trigger('keyup');
});
$('input[name="gpa_sum_premium[]"]').each(function() {
$(this).trigger('keyup');
});
$('input[name="11_max_si[]"]').each(function() {
$(this).trigger('keyup');
});
var id_for_trigger = temp_for_premiumData[0].policy_grid_id;
$(`input[name="${id_for_trigger}_si[]"]`).each(function() {
console.log($(this));
@ -805,6 +866,7 @@ $('body').on('click', '.btnPolicyModel', function() {
console.log($(this));
$(this).trigger('keyup');
});
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
@ -934,29 +996,76 @@ var Count = 1
function appendGridtHtml(ui_type = false, data = false, ) {
console.log('appendGridtHtml function called')
console.log(ui_type)
console.log(data)
var html = '';
// console.log('Grid Content',data)
Count++;
var container = document.getElementById('grid_content_input');
if (ui_type == '1') {
html = `<div class="form-row gpa_sum_insure_remove" style="width:84%" id="removeChild_${Count}">
<div class="form-group col-md-4" id="">
<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="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<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="gpa_sum_premium[]" id="gpa_sum_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
console.log('step 1')
var currentTime = getCurrentTime();
console.log(currentTime);
if($("#si_or_bp").val() == 1 || data.si_or_bp == '1'){
console.log('step 2')
html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" id="removeChild_${Count}">
<div class="form-group col-md-4" id="">
<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="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<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="gpa_sum_premium[]" id="gpa_sum_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_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(${Count})">x</button>
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1')">+</button>
</div>
</div>`;
}else if($("#si_or_bp").val() == 3 || data.si_or_bp == '3'){
console.log('step 3')
html = `<div class="form-row gpa_band_remove" style="width:101%" id="removeChild_${Count}">
</div>
<div class="form-group">
<div class="form-group col-md-2" id="">
<label for="mobile">Band/Grade<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.grade : '') : ''}" type="text" class="form-control" placeholder="Enter Band/Grade" name="gpa_band[]" id="gpa_band" required>
</div>
<div class="form-group col-md-4" id="">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_si_number_word' class="text-danger-2" ></div>
</div>
<div class="form-group col-md-4">
<label for="mobile">Premium<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.premium : '') : ''}" type="text" class="form-control" placeholder="Enter Premium" name="gpa_sum_premium2[]" id="gpa_sum_premium2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='gpa_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(${Count})">x</button>
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1')">+</button>
</div>
</div>`;
</div>
</div>`;
}
console.log('step 4')
} else if (ui_type == '3') {
html = `
@ -985,11 +1094,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<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="4_age_from[]" id="4_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<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_from : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="4_age_to[]" id="4_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter To Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -1014,11 +1123,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
</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="5_age_from[]" id="5_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="5_age_to[]" id="5_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="5_age_to[]" id="5_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -1034,20 +1143,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>
<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" onkeypress = "return onlyNumbers(event)" 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_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="6_age_to[]" id="6_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -1071,11 +1174,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
</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="7_age_from[]" id="7_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="7_age_to[]" id="7_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="7_age_to[]" id="7_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -1147,11 +1250,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
</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="10_age_from[]" id="10_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="10_age_to[]" id="10_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="10_age_to[]" id="10_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-3">
<label for="mobile">Premium<span class="text-danger">*</span></label>
@ -1184,7 +1287,8 @@ function appendGridtHtml(ui_type = false, data = false, ) {
</div>
<div class="form-group col-md-2">
<label for="mobile">Max SI<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="11_max_si[]" id="11_max_si[]" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="11_max_si[]" id="11_max_si[]" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
<div id='max_si_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(${Count})">x</button>
@ -1234,11 +1338,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
</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="13_age_from[]" id="13_age_from" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<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="13_age_to[]" id="13_age_to" required>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="13_age_to[]" id="13_age_to" onkeypress = "return onlyNumbers(event)" required>
</div>
<div class="form-group col-md-2">
<label for="mobile">Relationship<span class="text-danger">*</span></label>
@ -1266,9 +1370,12 @@ function appendGridtHtml(ui_type = false, data = false, ) {
}
// console.log('html', html)
container.insertAdjacentHTML('beforeend', html);
$('#gmc_add_more').hide();
$('#gmc_add_more2').hide();
$('#gmc_remove').show();
Count--
$('#gmc_add_more_' + Count).hide()
@ -1307,16 +1414,20 @@ function removebutton(index, type) {
if (count == 2) {
$('#gmc_add_more').show();
$('#gmc_add_more2').show();
}
index--;
$('#gmc_add_more_' + index).show();
$('#gmc_add_more2_' + index).show();
}
}
function checkDuplicate() {
if ($('#grid')[0].value === '3') {
var siInputs = $('input[name="3_si[]"]');
var premiumInputs = $('input[name="3_premium[]"]');
@ -1634,10 +1745,110 @@ function checkDuplicate() {
} else {
return false;
}
}else if ($('#grid')[0].value === '1') {
var selectedValue = $('#si_or_bp').val();
if(selectedValue == 1){
var siInputs = $('input[name="gpa_sum_si[]"]');
var premiumInputs = $('input[name="gpa_sum_premium[]"]');
var siValues = [];
var premiumValues = [];
var siDuplicates = false;
var premiumDuplicates = false;
// Extract values from input arrays
siInputs.each(function() {
siValues.push($(this).val());
});
premiumInputs.each(function() {
premiumValues.push($(this).val());
});
for (var i = 0; i < siValues.length; i++) {
for (var j = i + 1; j < siValues.length; j++) {
if (siValues[i] === siValues[j]) {
siDuplicates = true;
}
}
}
console.log('siValues', siValues);
console.log('premiumValues', premiumValues);
console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates);
if (siDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning');
return true;
} else {
return false;
}
}else if(selectedValue == 3){
var siInputs = $('input[name="gpa_sum_si2[]"]');
var premiumInputs = $('input[name="gpa_sum_premium2[]"]');
var bandInputs = $('input[name="gpa_band[]"]');
var siValues = [];
var premiumValues = [];
var bandValues = [];
var siDuplicates = false;
var premiumDuplicates = false;
var bandDuplicates = false;
// Extract values from input arrays
siInputs.each(function() {
siValues.push($(this).val());
});
premiumInputs.each(function() {
premiumValues.push($(this).val());
});
bandInputs.each(function() {
bandValues.push($(this).val());
});
for (var i = 0; i < siValues.length; i++) {
for (var j = i + 1; j < siValues.length; j++) {
if (siValues[i] === siValues[j]) {
siDuplicates = true;
}
}
}
for (var i = 0; i < bandValues.length; i++) {
for (var j = i + 1; j < bandValues.length; j++) {
if (bandValues[i] === bandValues[j]) {
bandDuplicates = true;
}
}
}
console.log('siValues', siValues);
console.log('premiumValues', premiumValues);
console.log('bandValues', bandValues);
console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates);
console.log('bandDuplicates', bandDuplicates);
if (siDuplicates || bandDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning');
return true;
} else {
return false;
}
}
}
}
function basicPayMultiple(input) {
if (input.id == 'basic_pay') {
var multi = $('#basic_multiplier')[0].value.replace(/,/g, '') * input.value.replace(/,/g, '');
@ -1647,23 +1858,21 @@ function basicPayMultiple(input) {
'');
$('#gpa_basic_premium').val(multi_2).trigger('keyup');
} else if (input.id == 'basic_multiplier') {
var multi = input.value * $('#basic_pay')[0].value.replace(/,/g, '');
} else if (input.id == 'basic_multiplier') {
var multi = input.value * $('#basic_pay')[0].value.replace(/,/g, '');
$('#gpa_basic_si').val(multi).trigger('keyup');
var multi_2 = $('#gpa_basic_si')[0].value.replace(/,/g, '') * $('#premium_multiplier')[0].value.replace(/,/g,
'');
var multi_2 = $('#gpa_basic_si')[0].value.replace(/,/g, '') * $('#premium_multiplier')[0].value.replace(/,/g,'');
$('#gpa_basic_premium').val(multi_2).trigger('keyup');
} else if (input.id == 'premium_multiplier') {
var multi = input.value.replace(/,/g, '') * $('#gpa_basic_si')[0].value.replace(/,/g, '');
var multi = input.value.replace(/,/g, '') / 1000 * $('#gpa_basic_si')[0].value.replace(/,/g, '');
$('#gpa_basic_premium').val(multi).trigger('keyup');
} else if (input.id == 'gpa_basic_si') {
var multi = input.value.replace(/,/g, '') * $('#premium_multiplier')[0].value.replace(/,/g, '');
@ -1673,36 +1882,63 @@ function basicPayMultiple(input) {
}
function gpaSumInsureMultiplier(element) {
console.log(element);
var element = $('#gpa_sum_multiplier')[0];
var sumInsured = $('input[name="gpa_sum_si[]"]');
var sumInsured = $('input[name="gpa_sum_si[]"]');
if ($('#si_or_bp').val() == 3) {
var element = $('#gpa_sum_multiplier2')[0]
var sumInsured = $('input[name="gpa_sum_si2[]"]')
}
// console.log('sumInsured', sumInsured);
if ($('#si_or_bp').val() == 2) {
var premium = $('input[name="premium[]"]');
} else {
} else if ($('#si_or_bp').val() == 3) {
var premium = $('input[name="gpa_sum_premium2[]"]');
}else {
var premium = $('input[name="gpa_sum_premium[]"]');
}
// console.log(premium);
sumInsured.each(function(index) {
var siValue = $(this).val().replace(/,/g, '');
var premiumValue = siValue * element.value;
// console.log('siValue', siValue);
var premiumValue = (siValue / 1000) * element.value;
// console.log('premiumValue', premiumValue);
var premiumValuedata = premium[index];
// console.log('premiumValuedata', premiumValuedata);
if (premiumValuedata) {
premiumValuedata.value = Math.floor(premiumValue);
}
// premium[index].value = Math.floor(premiumValue);
$(premium[index]).trigger('keyup');
// premium.eq(index).val(Math.floor(premiumValue));
});
}
function si_orbp_change_function() {
// $('.gpa_sum_insure_remove').remove();
var selectedValue = $('#si_or_bp').val();
if (selectedValue == 2) {
$('.gpa_sum_insure_remove').hide();
$('.gpa_band_remove').hide();
$('#si_or_bp_full_div').css({
'display': '',
});
@ -1712,10 +1948,20 @@ function si_orbp_change_function() {
$('#si_or_bp_basic_pay').css({
'display': ''
});
$('#si_or_bp_grade').css({
'display': 'none'
});
$('#gpa_sum_multiplier').removeAttr('required', false);
$('#gpa_sum_si').removeAttr('required', false);
$('#gpa_sum_premium').removeAttr('required', false);
$('#gpa_sum_multiplier2').removeAttr('required', false);
$('#gpa_sum_si2').removeAttr('required', false);
$('#gpa_band').removeAttr('required', false);
$('#gpa_sum_premium2').removeAttr('required', false);
$('#gpa_sum_multiplier').removeAttr('required');
$('#gpa_sum_si').removeAttr('required');
$('#gpa_sum_premium').removeAttr('required');
$('#basic_multiplier').attr('required', true);
$('#premium_multiplier').attr('required', true);
@ -1732,6 +1978,28 @@ function si_orbp_change_function() {
} else if (selectedValue == 1) {
$('.gpa_sum_insure_remove').show();
$('.gpa_band_remove').hide();
var count = $("div.form-row.gpa_sum_insure_remove").length;
if(count == 0){
$('#gmc_add_more').show();
}else{
$('#gmc_add_more').hide();
}
console.log('gmcBandInput', count)
var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length;
console.log("Elements with class 'gpa_band_remove' within next div siblings:", gpaBandRemoveElements);
var gmcBandInput = $("#grid_1").find('input[name="gmc_band[]"]').length
console.log('gmcBandInput', gmcBandInput)
$('#si_or_bp_full_div').css({
'display': '',
});
@ -1741,13 +2009,21 @@ function si_orbp_change_function() {
$('#si_or_bp_basic_pay').css({
'display': 'none'
});
$('#si_or_bp_grade').css({
'display': 'none'
});
$('#basic_multiplier').removeAttr('required');
$('#premium_multiplier').removeAttr('required');
$('#basic_pay').removeAttr('required');
$('#gpa_basic_si').removeAttr('required');
$('#gpa_basic_premium').removeAttr('required');
$('#basic_multiplier').removeAttr('required', false);
$('#premium_multiplier').removeAttr('required', false);
$('#basic_pay').removeAttr('required', false);
$('#gpa_basic_si').removeAttr('required', false);
$('#gpa_basic_premium').removeAttr('required', false);
$('#gpa_sum_multiplier2').removeAttr('required', false);
$('#gpa_sum_si2').removeAttr('required', false);
$('#gpa_band').removeAttr('required', false);
$('#gpa_sum_premium2').removeAttr('required', false);
$('#gpa_sum_multiplier').attr('required', true);
@ -1760,6 +2036,56 @@ function si_orbp_change_function() {
elementsToUnhide.show();
} else if (selectedValue == 3) {
$('.gpa_sum_insure_remove').hide();
$('.gpa_band_remove').show();
var count = $("div.form-row.gpa_band_remove").length;
if(count == 0){
$('#gmc_add_more2').show();
}else{
$('#gmc_add_more2').hide();
}
console.log('gmcBandInput', count)
$('#si_or_bp_full_div').css({
'display': '',
});
$('#si_or_bp_grade').css({
'display': ''
});
$('#si_or_bp_basic_pay').css({
'display': 'none'
});
$('#si_or_bp_sum_insure').css({
'display': 'none'
});
$('#basic_multiplier').removeAttr('required', false);
$('#premium_multiplier').removeAttr('required', false);
$('#basic_pay').removeAttr('required', false);
$('#gpa_basic_si').removeAttr('required', false);
$('#gpa_basic_premium').removeAttr('required', false);
$('#gpa_sum_multiplier').attr('required', false);
$('#gpa_sum_si').attr('required');
$('#gpa_sum_premium').attr('required');
$('#gpa_sum_multiplier2').removeAttr('required', true);
$('#gpa_sum_si2').removeAttr('required', true);
$('#gpa_band').removeAttr('required', true);
$('#gpa_sum_premium2').removeAttr('required', true);
var gridContentInput = $('#grid_content_input');
var elementsToUnhide = gridContentInput.find('.gpa_sum_insure_remove');
// elementsToUnhide.show();
} else {
$('#si_or_bp_full_div').css({
'display': 'none',
@ -1770,8 +2096,26 @@ function si_orbp_change_function() {
$('#si_or_bp_basic_pay').css({
'display': ''
});
$('#si_or_bp_grade').css({
'display': ''
});
}
}
function getCurrentTime() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var ampm = hours >= 12 ? 'PM' : 'AM';
hours = hours % 12;
hours = hours ? hours : 12; // 0 should be considered as 12
minutes = minutes < 10 ? '0' + minutes : minutes; // Add leading zero if minutes < 10
var timeString = hours + ':' + minutes + ' ' + ampm;
return timeString;
}
</script>

View File

@ -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>

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
public/assets/images/qr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View 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>

View 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>