CHANGE_UI_FIX - VADIVEL J 2025-09-09

This commit is contained in:
vadivelJ96 2025-09-09 15:46:50 +05:30
commit c197036cce
27 changed files with 2559 additions and 1358 deletions

4
.gitignore vendored
View File

@ -22,8 +22,8 @@ writable/debugbar/*
writable/**/*.db
writable/**/*.sqlite
writable/e_card_template/*
!writable/e_card_template/.gitkeep
# writable/e_card_template/*
# !writable/e_card_template/.gitkeep
writable/tmp/*
!writable/tmp/.gitkeep

View File

@ -184,6 +184,7 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
$routes->post("test-rack-rate", "EmployeeController::testRackRate");
$routes->get('test_members_list', 'EmployeeController::test_members_list');
$routes->post('get_emp_history','EmployeeController::getEmpHistory');
$routes->get("retail-endorsement-list", "EmployeeController::retailendorsementList");
});
@ -504,9 +505,6 @@ $routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
$routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->post("logined", "RestAuthenticationController::logined");
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
$routes->post('initiateClaim',"EmployeeRestController::initiateClaim");
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
});
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
@ -579,6 +577,12 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->post("hrFileUpload", "EmployeeRestController::hrFileUpload");
$routes->post("updateHrFileUploadData", "EmployeeRestController::updateHrFileUploadData");
//claims
$routes->post('initiateClaim',"EmployeeRestController::initiateClaim");
$routes->get('get_ticket_type',"EmployeeRestController::get_ticket_type");
$routes->get('get_ticket_data',"EmployeeRestController::get_ticket_data");
});
$routes->get("hrFileDownload", "EmployeeRestController::hrFileDownload");
$routes->post("hrFileList", "EmployeeRestController::hrFileList");
@ -680,8 +684,8 @@ $routes->get("ticketHistoryList", "ThzController::ticketHistoryList");
$routes->group('test', function($routes) {
$routes->post('api/saveForm', 'TestingController::saveForm');
$routes->get('insurerRFQRemainder', 'LeadsController::remainderForQcr');
$routes->get('ecard/generate-pdf', 'TestingController::generatePDF');
$routes->get('view-pdf', 'TestingController::viewPDF');
$routes->get('generatePDF', 'TestingController::generatePDF');
$routes->get('viewPDF', 'TestingController::viewPDF');
$routes->get('generate-pdf-view', 'TestingController::generatePDFWithView');
});
$routes->cli('cli/testcli', 'TestingController::testcli');

View File

@ -2148,6 +2148,29 @@ class ClientController extends AdminController
}
}
public function generateKycPrimaryTable($client_id){
$db = db_connect();
$builder = $db->table('kyc_docs kd');
$builder->select('kd.*, ck.file_name AS upload_doc_name');
$builder->join('clients c', 'kd.kyc_type_id = c.entity_type_id');
$builder->join(
'client_kyc_documents ck',
'kd.id = ck.kyc_doc_type_id AND ck.client_id = c.id AND ck.is_active = 1',
'left'
);
$builder->where('c.id', $client_id);
$builder->groupBy(['kd.id', 'ck.file_name']);
$query = $builder->get();
$result['data'] = $query->getResult();
$table = view('client_kyc_primary_table', $result);
print_r($table);
}
public function getPolicesByInsurerId($id = null)
{
$this->myLogger->logme('error', 'getPolicesByInsurerId function called');
@ -2659,194 +2682,269 @@ class ClientController extends AdminController
}
}
// public function enrollmentGMCDisplayValueTransform()
// {
// $data = [];
// if ($this->request->getPost("waiverofpreexistingdiseases_display")) {
// $data['Waiver of Pre-existing Diseases'] = $this->request->getPost("waiverofpreexistingdiseases");
// }
// if ($this->request->getPost("waiverof1234thyearexclusions_display")) {
// $data['Waiver of 1, 2, 3 & 4th year Exclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
// }
// if ($this->request->getPost("waiverof30dayswaitingperiod_display")) {
// $data['Waiver of 30 days waiting period'] = $this->request->getPost("waiverof30dayswaitingperiod");
// }
// if ($this->request->getPost("suminsuredenhancement_display")) {
// $data['Sum Insured Enhancement'] = $this->request->getPost("suminsuredenhancement");
// }
// if ($this->request->getPost("waiver_of_90_days_waiting_period_display")) {
// $data['Waiver of 90 Days Waiting Period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
// }
// if ($this->request->getPost("waiver_of_other_waiting_periods_display")) {
// $data['Waiver of Other Waiting Periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
// }
// if ($this->request->getPost("maternity_benefit_display")) {
// $data['Maternity Benefit'] = $this->request->getPost("maternity_benefit");
// }
// if ($this->request->getPost("9monthwaitingperiodwaived_display")) {
// $data['9-month waiting Period - waived'] = $this->request->getPost("9monthwaitingperiodwaived");
// }
// if ($this->request->getPost("maternitycoverage_display")) {
// $data['Maternity Coverage'] = $this->request->getPost("maternitycoverage");
// }
// if ($this->request->getPost("twindelivery_display")) {
// $data['Twin Delivery'] = $this->request->getPost("twindelivery");
// }
// if ($this->request->getPost("well_baby_well_mother_expenses_display")) {
// $data['Well baby / Well Mother Expenses'] = $this->request->getPost("well_baby_well_mother_expenses");
// }
// if ($this->request->getPost("preandpostnatal_display")) {
// $data['Pre and Post natal'] = $this->request->getPost("preandpostnatal");
// }
// if ($this->request->getPost("infertility_treatment_coverage_display")) {
// $data['Infertility Treatment Coverage'] = $this->request->getPost("infertility_treatment_coverage");
// }
// if ($this->request->getPost("babyday1cover_display")) {
// $data['Baby Day 1 Cover'] = $this->request->getPost("babyday1cover");
// }
// if ($this->request->getPost("coverfromthedateofjoining_display")) {
// $data['Cover from the date of Joining'] = $this->request->getPost("coverfromthedateofjoining");
// }
// if ($this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse_display")) {
// $data['Mid Term Addition of New Born / Newly Wedded Spouse'] = $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse");
// }
// if ($this->request->getPost("prehospitalizationcover_display")) {
// $data['Pre Hospitalization Cover'] = $this->request->getPost("prehospitalizationcover");
// }
// if ($this->request->getPost("posthospitalizationcover_display")) {
// $data['Post Hospitalization Cover'] = $this->request->getPost("posthospitalizationcover");
// }
// if ($this->request->getPost("congenitaldiseasesinternal_display")) {
// $data['Congenital Diseases - Internal'] = $this->request->getPost("congenitaldiseasesinternal");
// }
// if ($this->request->getPost("congenitaldiseasesexternal_display")) {
// $data['Congenital Diseases - External'] = $this->request->getPost("congenitaldiseasesexternal");
// }
// if ($this->request->getPost("copayzonewisecopay_display")) {
// $data['Co-Pay/Zone wise Co Pay'] = $this->request->getPost("copayzonewisecopay");
// }
// if ($this->request->getPost("roomrentlimit_display")) {
// $data['Room Rent Limit'] = $this->request->getPost("roomrentlimit");
// }
// if ($this->request->getPost("icu_limit_display")) {
// $data['ICU Limit'] = $this->request->getPost("icu_limit");
// }
// if ($this->request->getPost("proportionatedeductionclause_display")) {
// $data['Proportionate Deduction Clause'] = $this->request->getPost("proportionatedeductionclause");
// }
// if ($this->request->getPost("ailmentcapping_display")) {
// $data['Ailment capping'] = $this->request->getPost("ailmentcapping");
// }
// if ($this->request->getPost("ailment_capping_details_display")) {
// $data['Ailment capping Details'] = $this->request->getPost("ailment_capping_details");
// }
// if ($this->request->getPost("corporatebuffer_display")) {
// $data['Corporate Buffer'] = $this->request->getPost("corporatebuffer");
// }
// if ($this->request->getPost("non_admissible_contingency_corporate_buffer_display")) {
// $data['Non-Admissible / Contingency Corporate Buffer'] = $this->request->getPost("non_admissible_contingency_corporate_buffer");
// }
// if ($this->request->getPost("ambulancecharges_display")) {
// $data['Ambulance Charges'] = $this->request->getPost("ambulancecharges");
// }
// if ($this->request->getPost("airambulance_display")) {
// $data['Air Ambulance'] = $this->request->getPost("airambulance");
// }
// if ($this->request->getPost("reasonableandcustomarycharges_display")) {
// $data['Reasonable and Customary Charges'] = $this->request->getPost("reasonableandcustomarycharges");
// }
// if ($this->request->getPost("daycaretreatment_display")) {
// $data['Day Care Treatment'] = $this->request->getPost("daycaretreatment");
// }
// if ($this->request->getPost("lasiksurgery_display")) {
// $data['Lasik Surgery'] = $this->request->getPost("lasiksurgery");
// }
// if ($this->request->getPost("ayushtreatmentcover_display")) {
// $data['AYUSH treatment cover'] = $this->request->getPost("ayudhtreatmentcover");
// }
// if ($this->request->getPost("moderntreatmentsasperirdai_display")) {
// $data['Modern treatments as per IRDAI'] = $this->request->getPost("moderntreatmentsasperirdai");
// }
// if ($this->request->getPost("opd_treatment_display")) {
// $data['OPD Treatment'] = $this->request->getPost("opd_treatment");
// }
// if ($this->request->getPost("days_of_discharge_display")) {
// $data['Claim Intimation Clause'] = $this->request->getPost("days_of_discharge");
// }
// if ($this->request->getPost("days_from_dod_display")) {
// $data['Claim Submission'] = $this->request->getPost("days_from_dod");
// }
// if ($this->request->getPost("terrorism_display")) {
// $data['Terrorism'] = $this->request->getPost("terrorism");
// }
// if ($this->request->getPost("widower_cover_display")) {
// $data['Widower Cover'] = $this->request->getPost("widower_cover");
// }
// if ($this->request->getPost("breavement_cover_display")) {
// $data['Breavement Cover'] = $this->request->getPost("breavement_cover");
// }
// if ($this->request->getPost("special_condition_display_value")) {
// $specialConditionKeyValue = $this->request->getPost("special_condition_display_value") ?? [];
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
// $data = array_merge($data, $mergedArray);
// }
// }
// if(isset($data) && !empty($data)){
// return $data;
// }else{
// $data = [];
// return $data;
// }
// }
public function enrollmentGMCDisplayValueTransform()
{
$data = [];
if ($this->request->getPost("waiverofpreexistingdiseases_display")) {
$data['Waiver of Pre-existing Diseases'] = $this->request->getPost("waiverofpreexistingdiseases");
}
if ($this->request->getPost("waiverof1234thyearexclusions_display")) {
$data['Waiver of 1, 2, 3 & 4th year Exclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
}
if ($this->request->getPost("waiverof30dayswaitingperiod_display")) {
$data['Waiver of 30 days waiting period'] = $this->request->getPost("waiverof30dayswaitingperiod");
}
// Mapping of POST keys to display labels
$fields = [
'waiverofpreexistingdiseases' => 'Waiver of Pre-existing Diseases',
'waiverof1,2,3&4thyearexclusions' => 'Waiver of 1, 2, 3 & 4th year Exclusions',
'waiverof30dayswaitingperiod' => 'Waiver of 30 days waiting period',
'suminsuredenhancement' => 'Sum Insured Enhancement',
'waiver_of_90_days_waiting_period' => 'Waiver of 90 Days Waiting Period',
'waiver_of_other_waiting_periods' => 'Waiver of Other Waiting Periods',
'maternity_benefit' => 'Maternity Benefit',
'9monthwaitingperiodwaived' => '9-month waiting Period - waived',
'maternitycoverage' => 'Maternity Coverage',
'twindelivery' => 'Twin Delivery',
'well_baby_well_mother_expenses' => 'Well baby / Well Mother Expenses',
'preandpostnatal' => 'Pre and Post natal',
'infertility_treatment_coverage' => 'Infertility Treatment Coverage',
'babyday1cover' => 'Baby Day 1 Cover',
'coverfromthedateofjoining' => 'Cover from the date of Joining',
'mid_term_addition_of_new_born_newly_wedded_spouse' => 'Mid Term Addition of New Born / Newly Wedded Spouse',
'prehospitalizationcover' => 'Pre Hospitalization Cover',
'posthospitalizationcover' => 'Post Hospitalization Cover',
'congenitaldiseasesinternal' => 'Congenital Diseases - Internal',
'congenitaldiseasesexternal' => 'Congenital Diseases - External',
'copayzonewisecopay' => 'Co-Pay/Zone wise Co Pay',
'roomrentlimit' => 'Room Rent Limit',
'icu_limit' => 'ICU Limit',
'proportionatedeductionclause' => 'Proportionate Deduction Clause',
'ailmentcapping' => 'Ailment capping',
'ailment_capping_details' => 'Ailment capping Details',
'corporatebuffer' => 'Corporate Buffer',
'non_admissible_contingency_corporate_buffer' => 'Non-Admissible / Contingency Corporate Buffer',
'ambulancecharges' => 'Ambulance Charges',
'airambulance' => 'Air Ambulance',
'reasonableandcustomarycharges' => 'Reasonable and Customary Charges',
'daycaretreatment' => 'Day Care Treatment',
'lasiksurgery' => 'Lasik Surgery',
'ayudhtreatmentcover' => 'AYUSH treatment cover',
'moderntreatmentsasperirdai' => 'Modern treatments as per IRDAI',
'opd_treatment' => 'OPD Treatment',
'days_of_discharge' => 'Claim Intimation Clause',
'days_from_dod' => 'Claim Submission',
'terrorism' => 'Terrorism',
'widower_cover' => 'Widower Cover',
'breavement_cover' => 'Breavement Cover'
];
if ($this->request->getPost("suminsuredenhancement_display")) {
$data['Sum Insured Enhancement'] = $this->request->getPost("suminsuredenhancement");
}
if ($this->request->getPost("waiver_of_90_days_waiting_period_display")) {
$data['Waiver of 90 Days Waiting Period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
}
if ($this->request->getPost("waiver_of_other_waiting_periods_display")) {
$data['Waiver of Other Waiting Periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
}
if ($this->request->getPost("maternity_benefit_display")) {
$data['Maternity Benefit'] = $this->request->getPost("maternity_benefit");
}
if ($this->request->getPost("9monthwaitingperiodwaived_display")) {
$data['9-month waiting Period - waived'] = $this->request->getPost("9monthwaitingperiodwaived");
}
if ($this->request->getPost("maternitycoverage_display")) {
$data['Maternity Coverage'] = $this->request->getPost("maternitycoverage");
}
if ($this->request->getPost("twindelivery_display")) {
$data['Twin Delivery'] = $this->request->getPost("twindelivery");
}
if ($this->request->getPost("well_baby_well_mother_expenses_display")) {
$data['Well baby / Well Mother Expenses'] = $this->request->getPost("well_baby_well_mother_expenses");
}
if ($this->request->getPost("preandpostnatal_display")) {
$data['Pre and Post natal'] = $this->request->getPost("preandpostnatal");
}
if ($this->request->getPost("infertility_treatment_coverage_display")) {
$data['Infertility Treatment Coverage'] = $this->request->getPost("infertility_treatment_coverage");
}
if ($this->request->getPost("babyday1cover_display")) {
$data['Baby Day 1 Cover'] = $this->request->getPost("babyday1cover");
}
if ($this->request->getPost("coverfromthedateofjoining_display")) {
$data['Cover from the date of Joining'] = $this->request->getPost("coverfromthedateofjoining");
}
if ($this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse_display")) {
$data['Mid Term Addition of New Born / Newly Wedded Spouse'] = $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse");
}
if ($this->request->getPost("prehospitalizationcover_display")) {
$data['Pre Hospitalization Cover'] = $this->request->getPost("prehospitalizationcover");
}
if ($this->request->getPost("posthospitalizationcover_display")) {
$data['Post Hospitalization Cover'] = $this->request->getPost("posthospitalizationcover");
}
if ($this->request->getPost("congenitaldiseasesinternal_display")) {
$data['Congenital Diseases - Internal'] = $this->request->getPost("congenitaldiseasesinternal");
}
if ($this->request->getPost("congenitaldiseasesexternal_display")) {
$data['Congenital Diseases - External'] = $this->request->getPost("congenitaldiseasesexternal");
}
if ($this->request->getPost("copayzonewisecopay_display")) {
$data['Co-Pay/Zone wise Co Pay'] = $this->request->getPost("copayzonewisecopay");
}
if ($this->request->getPost("roomrentlimit_display")) {
$data['Room Rent Limit'] = $this->request->getPost("roomrentlimit");
}
if ($this->request->getPost("icu_limit_display")) {
$data['ICU Limit'] = $this->request->getPost("icu_limit");
}
if ($this->request->getPost("proportionatedeductionclause_display")) {
$data['Proportionate Deduction Clause'] = $this->request->getPost("proportionatedeductionclause");
}
if ($this->request->getPost("ailmentcapping_display")) {
$data['Ailment capping'] = $this->request->getPost("ailmentcapping");
}
if ($this->request->getPost("ailment_capping_details_display")) {
$data['Ailment capping Details'] = $this->request->getPost("ailment_capping_details");
}
if ($this->request->getPost("corporatebuffer_display")) {
$data['Corporate Buffer'] = $this->request->getPost("corporatebuffer");
}
if ($this->request->getPost("non_admissible_contingency_corporate_buffer_display")) {
$data['Non-Admissible / Contingency Corporate Buffer'] = $this->request->getPost("non_admissible_contingency_corporate_buffer");
}
if ($this->request->getPost("ambulancecharges_display")) {
$data['Ambulance Charges'] = $this->request->getPost("ambulancecharges");
}
if ($this->request->getPost("airambulance_display")) {
$data['Air Ambulance'] = $this->request->getPost("airambulance");
}
if ($this->request->getPost("reasonableandcustomarycharges_display")) {
$data['Reasonable and Customary Charges'] = $this->request->getPost("reasonableandcustomarycharges");
}
if ($this->request->getPost("daycaretreatment_display")) {
$data['Day Care Treatment'] = $this->request->getPost("daycaretreatment");
}
if ($this->request->getPost("lasiksurgery_display")) {
$data['Lasik Surgery'] = $this->request->getPost("lasiksurgery");
}
if ($this->request->getPost("ayushtreatmentcover_display")) {
$data['AYUSH treatment cover'] = $this->request->getPost("ayudhtreatmentcover");
}
if ($this->request->getPost("moderntreatmentsasperirdai_display")) {
$data['Modern treatments as per IRDAI'] = $this->request->getPost("moderntreatmentsasperirdai");
}
if ($this->request->getPost("opd_treatment_display")) {
$data['OPD Treatment'] = $this->request->getPost("opd_treatment");
}
if ($this->request->getPost("days_of_discharge_display")) {
$data['Claim Intimation Clause'] = $this->request->getPost("days_of_discharge");
}
if ($this->request->getPost("days_from_dod_display")) {
$data['Claim Submission'] = $this->request->getPost("days_from_dod");
}
if ($this->request->getPost("terrorism_display")) {
$data['Terrorism'] = $this->request->getPost("terrorism");
}
if ($this->request->getPost("widower_cover_display")) {
$data['Widower Cover'] = $this->request->getPost("widower_cover");
}
if ($this->request->getPost("breavement_cover_display")) {
$data['Breavement Cover'] = $this->request->getPost("breavement_cover");
}
if ($this->request->getPost("special_condition_display_value")) {
$specialConditionKeyValue = $this->request->getPost("special_condition_display_value") ?? [];
$specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
$data = array_merge($data, $mergedArray);
foreach ($fields as $postKey => $label) {
$displayKey = $postKey . '_display';
$value = $this->request->getPost($postKey);
if ($this->request->getPost($displayKey) && $value !== null && $value !== '') {
$data[$label] = $value;
}
}
if(isset($data) && !empty($data)){
return $data;
}else{
$data = [];
return $data;
// Handle special conditions
if ($this->request->getPost("special_condition_display_value")) {
$specialConditionKeyValue = json_decode($this->request->getPost("special_condition_display_value"), true);
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
// Only add non-empty values
foreach ($mergedArray as $k => $v) {
if ($v !== null && $v !== '') {
$data[$k] = $v;
}
}
}
}
return $data;
}
public function getterms()
{
$client_policy_id = $this->request->getVar('client_policy_id');
@ -3006,92 +3104,145 @@ class ClientController extends AdminController
}
}
// public function enrollmentGPADisplayValueTransform()
// {
// $data = [];
// if ($this->request->getPost("accidentalDeathBenefit_display")) {
// $data['Accidental Death Benefit'] = $this->request->getPost("accidentalDeathBenefit");
// }
// if ($this->request->getPost("permanentTotalDisablement_display")) {
// $data['Permanent Total Disablement'] = $this->request->getPost("permanentTotalDisablement");
// }
// if ($this->request->getPost("permanentPartialDisablement_display")) {
// $data['Permanent Partial Disablement'] = $this->request->getPost("permanentPartialDisablement");
// }
// if ($this->request->getPost("temporaryTotalDisablementBenefit_display")) {
// $data['Temporary Total Disablement Benefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
// }
// if ($this->request->getPost("medical_expenses_medical_extension_display")) {
// $data['Medical Expenses / Medical Extension (IPD)'] = $this->request->getPost("medical_expenses_medical_extension");
// }
// if ($this->request->getPost("opd_treatment_cover_display")) {
// $data['OPD Treatment Cover'] = $this->request->getPost("opd_treatment_cover");
// }
// if ($this->request->getPost("ambulanceCharges_display")) {
// $data['Ambulance Charges'] = $this->request->getPost("ambulanceCharges");
// }
// if ($this->request->getPost("repatriation_of_mortal_remains_display")) {
// $data['Repatriation of Mortal Remains'] = $this->request->getPost("repatriation_of_mortal_remains");
// }
// if ($this->request->getPost("childrenEducationWelfareFund_display")) {
// $data['Children Education Welfare Fund'] = $this->request->getPost("childrenEducationWelfareFund");
// }
// if ($this->request->getPost("terrorism_display")) {
// $data['Terrorism'] = $this->request->getPost("terrorism");
// }
// if ($this->request->getPost("worldwideCover_display")) {
// $data['Worldwide Cover'] = $this->request->getPost("worldwideCover");
// }
// if ($this->request->getPost("family_transportation_benefits_display")) {
// $data['Family Transportation Benefits'] = $this->request->getPost("family_transportation_benefits");
// }
// if ($this->request->getPost("fractures_dislocation_burns_display")) {
// $data['Fractures / Dislocation / Burns'] = $this->request->getPost("fractures_dislocation_burns");
// }
// if ($this->request->getPost("coma_display")) {
// $data['Coma'] = $this->request->getPost("coma");
// }
// if ($this->request->getPost("carriageofDeadBody_display")) {
// $data['Carriage of Dead Body'] = $this->request->getPost("carriageOfDeadBody");
// }
// if ($this->request->getPost("compassionateVisitExpenses_display")) {
// $data['Compassionate Visit Expenses'] = $this->request->getPost("compassionateVisitExpenses");
// }
// if ($this->request->getPost("travel_expenses_for_medical_treatment_display")) {
// $data['Travel expenses for Medical Treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
// }
// if ($this->request->getPost("daily_cash_allowance_display")) {
// $data['Daily cash Allowance'] = $this->request->getPost("daily_cash_allowance");
// }
// if ($this->request->getPost("artifical_limb_and_prosthesis_display")) {
// $data['Artifical Limb and Prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
// }
// if ($this->request->getPost("animalSnakeInsectBite_display")) {
// $data['Animal/Snake/Insect Bite'] = $this->request->getPost("animalSnakeInsectBite");
// }
// if ($this->request->getPost("air_ambulance_display")) {
// $data['Air Ambulance'] = $this->request->getPost("air_ambulance");
// }
// if ($this->request->getPost("gpa_special_condition_display_value")) {
// $specialConditionKeyValue = $this->request->getPost("gpa_special_condition_display_value") ?? [];
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
// $data = array_merge($data, $mergedArray);
// }
// }
// // print_r($data); die;
// if (isset($data) && !empty($data)) {
// return $data;
// } else {
// $data = [];
// return $data;
// }
// }
public function enrollmentGPADisplayValueTransform()
{
{
$data = [];
if ($this->request->getPost("accidentalDeathBenefit_display")) {
$data['Accidental Death Benefit'] = $this->request->getPost("accidentalDeathBenefit");
}
if ($this->request->getPost("permanentTotalDisablement_display")) {
$data['Permanent Total Disablement'] = $this->request->getPost("permanentTotalDisablement");
}
if ($this->request->getPost("permanentPartialDisablement_display")) {
$data['Permanent Partial Disablement'] = $this->request->getPost("permanentPartialDisablement");
}
if ($this->request->getPost("temporaryTotalDisablementBenefit_display")) {
$data['Temporary Total Disablement Benefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
}
if ($this->request->getPost("medical_expenses_medical_extension_display")) {
$data['Medical Expenses / Medical Extension (IPD)'] = $this->request->getPost("medical_expenses_medical_extension");
}
if ($this->request->getPost("opd_treatment_cover_display")) {
$data['OPD Treatment Cover'] = $this->request->getPost("opd_treatment_cover");
}
if ($this->request->getPost("ambulanceCharges_display")) {
$data['Ambulance Charges'] = $this->request->getPost("ambulanceCharges");
}
if ($this->request->getPost("repatriation_of_mortal_remains_display")) {
$data['Repatriation of Mortal Remains'] = $this->request->getPost("repatriation_of_mortal_remains");
}
if ($this->request->getPost("childrenEducationWelfareFund_display")) {
$data['Children Education Welfare Fund'] = $this->request->getPost("childrenEducationWelfareFund");
}
if ($this->request->getPost("terrorism_display")) {
$data['Terrorism'] = $this->request->getPost("terrorism");
}
if ($this->request->getPost("worldwideCover_display")) {
$data['Worldwide Cover'] = $this->request->getPost("worldwideCover");
}
if ($this->request->getPost("family_transportation_benefits_display")) {
$data['Family Transportation Benefits'] = $this->request->getPost("family_transportation_benefits");
}
if ($this->request->getPost("fractures_dislocation_burns_display")) {
$data['Fractures / Dislocation / Burns'] = $this->request->getPost("fractures_dislocation_burns");
}
if ($this->request->getPost("coma_display")) {
$data['Coma'] = $this->request->getPost("coma");
}
if ($this->request->getPost("carriageofDeadBody_display")) {
$data['Carriage of Dead Body'] = $this->request->getPost("carriageOfDeadBody");
}
if ($this->request->getPost("compassionateVisitExpenses_display")) {
$data['Compassionate Visit Expenses'] = $this->request->getPost("compassionateVisitExpenses");
}
if ($this->request->getPost("travel_expenses_for_medical_treatment_display")) {
$data['Travel expenses for Medical Treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
}
if ($this->request->getPost("daily_cash_allowance_display")) {
$data['Daily cash Allowance'] = $this->request->getPost("daily_cash_allowance");
}
if ($this->request->getPost("artifical_limb_and_prosthesis_display")) {
$data['Artifical Limb and Prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
}
if ($this->request->getPost("animalSnakeInsectBite_display")) {
$data['Animal/Snake/Insect Bite'] = $this->request->getPost("animalSnakeInsectBite");
}
if ($this->request->getPost("air_ambulance_display")) {
$data['Air Ambulance'] = $this->request->getPost("air_ambulance");
}
// Map POST keys to display labels
$fields = [
'accidentalDeathBenefit' => 'Accidental Death Benefit',
'permanentTotalDisablement' => 'Permanent Total Disablement',
'permanentPartialDisablement' => 'Permanent Partial Disablement',
'temporaryTotalDisablementBenefit' => 'Temporary Total Disablement Benefit',
'medical_expenses_medical_extension' => 'Medical Expenses / Medical Extension (IPD)',
'opd_treatment_cover' => 'OPD Treatment Cover',
'ambulanceCharges' => 'Ambulance Charges',
'repatriation_of_mortal_remains' => 'Repatriation of Mortal Remains',
'childrenEducationWelfareFund' => 'Children Education Welfare Fund',
'terrorism' => 'Terrorism',
'worldwideCover' => 'Worldwide Cover',
'family_transportation_benefits' => 'Family Transportation Benefits',
'fractures_dislocation_burns' => 'Fractures / Dislocation / Burns',
'coma' => 'Coma',
'carriageOfDeadBody' => 'Carriage of Dead Body',
'compassionateVisitExpenses' => 'Compassionate Visit Expenses',
'travel_expenses_for_medical_treatment' => 'Travel expenses for Medical Treatment',
'daily_cash_allowance' => 'Daily cash Allowance',
'artifical_limb_and_prosthesis' => 'Artifical Limb and Prosthesis',
'animalSnakeInsectBite' => 'Animal/Snake/Insect Bite',
'air_ambulance' => 'Air Ambulance'
];
if ($this->request->getPost("gpa_special_condition_display_value")) {
$specialConditionKeyValue = $this->request->getPost("gpa_special_condition_display_value") ?? [];
$specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
$data = array_merge($data, $mergedArray);
foreach ($fields as $postKey => $label) {
$displayKey = $postKey . '_display';
$value = $this->request->getPost($postKey);
if ($this->request->getPost($displayKey) && $value !== null && $value !== '') {
$data[$label] = $value;
}
}
// print_r($data); die;
if (isset($data) && !empty($data)) {
return $data;
} else {
$data = [];
return $data;
// Handle GPA special conditions
if ($this->request->getPost("gpa_special_condition_display_value")) {
$specialConditionKeyValue = json_decode($this->request->getPost("gpa_special_condition_display_value"), true);
if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
$mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
foreach ($mergedArray as $k => $v) {
if ($v !== null && $v !== '') {
$data[$k] = $v;
}
}
}
}
return $data;
}
public function getPolicyGPATerms()

View File

@ -1180,8 +1180,10 @@ class EmployeeController extends AdminController
return $response;
}
//E-CARD DOWNLOAD FUNCTION
public function generateIDCardForEmployee($rand_string, $people = 0)
// --------------- For E-Card Download -----------------------------------------------------------------------------------------------------
//E-CARD DOWNLOAD FUNCTION USING HTML PRINT
public function generateIDCardForEmployeeUsingHtml($rand_string, $people = 0)
{
// dd($rand_string, $people);
try {
@ -1316,6 +1318,258 @@ class EmployeeController extends AdminController
}
// Preview E-Card Template function
public function previewTemplate($id = null)
{
$value = [
'tpa_id' => 'TPA12345',
'name' => 'John Doe',
'uhid' => 'UHID67890',
'gender' => 'Male',
'dob' => '1985-05-15',
'self' => 'John Doe',
'policy_end_date' => '2024-12-31',
'policy_start_date' => '2023-01-01',
'policy_no' => 'POL1234567890',
'insurer_name' => 'Example Insurance Company',
'emp_code' => 'EMP001122',
'client_name' => 'Corporate Client Inc.',
'emp_age' => 39,
'tpa_name' => 'Example TPA',
'insurer_branch_city' => 'New York',
'relationship' => 'Self',
'basic_cover_si' => '5,00,000',
];
$tpa_id = $this->TPAModel->where('id', $id)->first();
$template_data_path = WRITEPATH . 'e_card_template/';
$tpa_short_name = strtolower(str_replace(' ', '_', $tpa_id['short_name'])) . '.html';
$final_path = $template_data_path . $tpa_short_name;
if (!file_exists($final_path)) {
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
$tmplt_data = file_get_contents($final_path);
$placeholders = [
'{TPA_ID}' => $value['tpa_id'],
'{NAME}' => $value['name'],
'{UHID}' => $value['uhid'],
'{GENDER}' => $value['gender'],
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{POLICY_NO}' => $value['policy_no'],
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
'{EMP_ID}' => $value['emp_code'],
'{SI_AMT}' => $value['basic_cover_si'],
'{CORPORATE_NAME}' => $value['client_name'],
'{AGE}' => $value['emp_age'],
'{TPA_NAME}' => $value['tpa_name'],
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
'{RELATION}' => $value['relationship'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['front_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['back_card'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $tpa_id['tpa_logo'],
'{INSURER_LOGO}' => base_url() . 'public/assets/images/sample_logo_3.png',
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
];
$placeholders['{LEVELS}'] = '
<span style="font-family: sans-serif;">Level 1</span><br><br>
<span style="font-family: sans-serif;">1. Gowtham / 8754081806 / gowtham@gmail.com</span><br>
<span style="font-family: sans-serif;">2. Gowtham / 8754081806 / gowtham@gmail.com</span><br><br>';
// dd($placeholders);
// Get the values to replace the placeholders
$replaceValues = array_values($placeholders);
// Get the placeholders to search for
$searchPlaceholders = array_keys($placeholders);
// Replace placeholders with values in HTML content
$htmlContent = str_replace($searchPlaceholders, $replaceValues, $tmplt_data);
echo $htmlContent;
}
//E-CARD DOWNLOAD FUNCTION USING DOM PDF ( CURRENTLY USING THIS )
public function generateIDCardForEmployee($rand_string, $people = 0, $mode = 0)
{
// dd($rand_string, $people);
$this->myLogger->logme('error', 'generateIDCardForEmployee params .' . json_encode(["rand_string" => $rand_string, "people" => $people, "mode" => $mode]));
try {
$this->myLogger->logme('error', 'generateIDCardForEmployee function started.');
// Step 1: Attempt to fetch employee code and client policy ID
$this->myLogger->logme('error', 'Fetching employee code and client policy ID.');
$get_emp_code_and_client_policy_id = $this->employeePolicyModel
->select('employee_polices.client_policy_id, employees.emp_code, tpa.short_name,employees.client_id')
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
->join('employees', 'employees.id = employee_polices.employee_id')
->join('tpa', 'tpa.id = client_policy.tpa_id')
->where('employees.emp_status', 'active')
->where('employees.is_active', '1')
->where("employee_polices.tpa_id IS NOT NULL AND employee_polices.tpa_id <> ''")
->where('employee_polices.status', 'active')
->where('employee_polices.is_active', '1')
->where('employee_polices.rand_string', $rand_string)
->first();
// dd($this->employeePolicyModel->getLastQuery());
// dd($rand_string, $get_emp_code_and_client_policy_id);
if ($get_emp_code_and_client_policy_id == null || $get_emp_code_and_client_policy_id == "") {
$this->myLogger->logme('error', 'Member not found in this rand_string: ' . $rand_string);
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
$this->myLogger->logme('error', 'Member found. Client policy ID: ' . $get_emp_code_and_client_policy_id['client_policy_id']);
$client_policy_id = $get_emp_code_and_client_policy_id['client_policy_id'];
$emp_code = $get_emp_code_and_client_policy_id['emp_code'];
$client_id = $get_emp_code_and_client_policy_id['client_id'];
// Step 2: Fetch ECard data
$this->myLogger->logme('error', 'Fetching ECard data using client_policy_id: ' . $client_policy_id . ' and emp_code: ' . $emp_code);
$data = $this->employeePolicyModel->getECardDataUsingMd5($client_policy_id, $emp_code,$client_id);
if ($people == 0) {
$this->myLogger->logme('error', 'Fetching single ECard data using rand_string: ' . $rand_string . ' and emp_code: ' . $emp_code);
$data = $this->employeePolicyModel->getECardSingleData($rand_string, $emp_code,$client_id);
}
// Step 3: Prepare template path
$template_data_path = WRITEPATH . 'e_card_template/';
// $tpa_short_name = strtolower(str_replace(' ', '_', $get_emp_code_and_client_policy_id['short_name'])) . '.html';
$tpa_short_name = 'common.html';
$final_path = $template_data_path . $tpa_short_name;
$this->myLogger->logme('error', 'Checking if template file exists at: ' . $final_path);
if (!file_exists($final_path)) {
$this->myLogger->logme('error', 'Template file not found: ' . $final_path);
$data['message'] = 'Template File Not Found';
return view('errors/404', $data);
}
$this->myLogger->logme('error', 'Template file found. Reading template data.');
$tmplt_data = file_get_contents($final_path);
// Step 4: Generate HTML content
$this->myLogger->logme('error', 'Generating HTML content from template.');
$html = "";
foreach ($data as $key => $value) {
$htmlContent = $tmplt_data;
$value['front_card'] = "Nhance_Ecard_working_1_front.png";
$value['back_card'] = "Nhance_Ecard_working_1_Back.png";
$placeholders = [
'{CLIENT_NAME}' => $value['client_name'],
'{TPA_ID}' => $value['tpa_id'],
'{NAME}' => $value['name'],
'{UHID}' => $value['uhid'],
'{GENDER}' => $value['gender'],
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{POLICY_NO}' => $value['policy_no'],
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
'{INSURER_LOGO}' => base_url() . 'public/uploads/logo/' . $value['insurer_logo'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['front_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $value['back_card'],
'{EMP_ID}' => $value['emp_code'],
'{SI_AMT}' => $value['basic_cover_si'],
'{CORPORATE_NAME}' => $value['client_name'],
'{AGE}' => $value['emp_age'],
'{TPA_NAME}' => $value['tpa_name'],
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
'{RELATION}' => $value['relationship'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $value['tpa_logo'],
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
];
$placeholders['{LEVELS}'] = $this->generateAcmAndMForEcard($client_id);
foreach ($placeholders as $placeholder => $replaceValue) {
$htmlContent = str_replace($placeholder, $replaceValue, $htmlContent);
}
$html .= $htmlContent;
}
// DomPdf
$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('isHtml5ParserEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->loadHtml('<style>@page { margin: 0; }</style>' . $html); // remove the margin
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
// Set document title
$dompdf->addInfo("Title", "E-Card");
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
// if($mode == 1){
// $dompdf->stream($filename, ['Attachment' => false]); // Inline view
// }else{
// $dompdf->stream($filename, ['Attachment' => true]); // Force download
// }
if ($mode == 1) {
// Inline view
return $this->response
->setHeader('Content-Type', 'application/pdf')
->setHeader('Content-Disposition', 'inline; filename="' . $filename . '"')
->setBody($dompdf->output());
} else {
// Force download
return $this->response
->setHeader('Content-Type', 'application/pdf')
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"')
->setBody($dompdf->output());
}
$this->myLogger->logme('error', 'generateIDCardForEmployee function completed successfully.');
} catch (\Exception $e) {
$this->myLogger->logme('error', 'Exception occurred: ' . $e->getMessage());
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
}
// --------------------------------------------------------------------------------------------------------------------
public function viewECard()
{
@ -1883,95 +2137,6 @@ class EmployeeController extends AdminController
}
}
// Preview E-Card Template function
public function previewTemplate($id = null)
{
$value = [
'tpa_id' => 'TPA12345',
'name' => 'John Doe',
'uhid' => 'UHID67890',
'gender' => 'Male',
'dob' => '1985-05-15',
'self' => 'John Doe',
'policy_end_date' => '2024-12-31',
'policy_start_date' => '2023-01-01',
'policy_no' => 'POL1234567890',
'insurer_name' => 'Example Insurance Company',
'emp_code' => 'EMP001122',
'client_name' => 'Corporate Client Inc.',
'emp_age' => 39,
'tpa_name' => 'Example TPA',
'insurer_branch_city' => 'New York',
'relationship' => 'Self',
'basic_cover_si' => '5,00,000',
];
$tpa_id = $this->TPAModel->where('id', $id)->first();
$template_data_path = WRITEPATH . 'e_card_template/';
$tpa_short_name = strtolower(str_replace(' ', '_', $tpa_id['short_name'])) . '.html';
$final_path = $template_data_path . $tpa_short_name;
if (!file_exists($final_path)) {
$data['message'] = 'Record Not Found';
return view('errors/404', $data);
}
$tmplt_data = file_get_contents($final_path);
$placeholders = [
'{TPA_ID}' => $value['tpa_id'],
'{NAME}' => $value['name'],
'{UHID}' => $value['uhid'],
'{GENDER}' => $value['gender'],
'{DOB}' => date('d-M-Y', strtotime($value['dob'])),
'{SELF_NAME}' => $value['self'] ?? $value['name'],
'{POLICY_DATE}' => date('d-M-Y', strtotime($value['policy_end_date'])),
'{POLICY_START_DATE}' => date('d-M-Y', strtotime($value['policy_start_date'])),
'{POLICY_NO}' => $value['policy_no'],
'{INSURER_NAME}' => strtoupper($value['insurer_name']),
'{EMP_ID}' => $value['emp_code'],
'{SI_AMT}' => $value['basic_cover_si'],
'{CORPORATE_NAME}' => $value['client_name'],
'{AGE}' => $value['emp_age'],
'{TPA_NAME}' => $value['tpa_name'],
'{INSURER_BRANCH}' => $value['insurer_branch_city'],
'{RELATION}' => $value['relationship'],
'{FRONT_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['front_card'],
'{BACK_CARD}' => base_url() . 'public/uploads/template_bg/' . $tpa_id['back_card'],
'{TPA_LOGO}' => base_url() . 'public/uploads/logo/' . $tpa_id['tpa_logo'],
'{INSURER_LOGO}' => base_url() . 'public/assets/images/sample_logo_3.png',
'{MEDI_USER}' => base_url() . 'public/e_card_imgs/medi_uesr.jpg',
'{MEDI_INSURER}' => base_url() . 'public/e_card_imgs/Magma.png',
'{MEDI_BARCODE}' => base_url() . 'public/e_card_imgs/borcode.jpeg',
'{QR_ANDROID}' => base_url() . 'public/e_card_imgs/android.png',
'{QR_IOS}' => base_url() . 'public/e_card_imgs/ios.png',
'{QR_ANDROID_2}' => base_url() . 'public/e_card_imgs/play_store.png',
'{QR_IOS_2}' => base_url() . 'public/e_card_imgs/appstore.png',
];
$placeholders['{LEVELS}'] = '
<span style="font-family: sans-serif;">Level 1</span><br><br>
<span style="font-family: sans-serif;">1. Gowtham / 8754081806 / gowtham@gmail.com</span><br>
<span style="font-family: sans-serif;">2. Gowtham / 8754081806 / gowtham@gmail.com</span><br><br>';
// dd($placeholders);
// Get the values to replace the placeholders
$replaceValues = array_values($placeholders);
// Get the placeholders to search for
$searchPlaceholders = array_keys($placeholders);
// Replace placeholders with values in HTML content
$htmlContent = str_replace($searchPlaceholders, $replaceValues, $tmplt_data);
echo $htmlContent;
}
public function errorListExportImport($file_id)
{
@ -2842,4 +3007,11 @@ class EmployeeController extends AdminController
}
public function retailendorsementList()
{
$data['message'] = 'File Not Found';
echo view('errors/404', $data);
}
}

View File

@ -51,7 +51,7 @@ use CodeIgniter\API\ResponseTrait;
use Illuminate\Http\Request;
use App\Controllers\EmployeeServiceController;
use App\Models\ClaimFilesModel;
use Kreait\Firebase\Factory;
use Kreait\Firebase\Messaging\CloudMessage;
use Kreait\Firebase\Messaging\Notification;
@ -2820,18 +2820,29 @@ class EmployeeRestController extends AdminController
{
$policyGroup = 'gpa';
$data['ticket_type_id'] = 2;
$data['claim_subject'] = "Claim GPA";
$data['sum_insured_label'] = "Sum Assured";
}else if($ClientPolicyValue['policy_type_id'] == 6)
{
$policyGroup = 'gpa';
$data['ticket_type_id'] = 3;
$data['claim_subject'] = "Claim EDLI";
$data['sum_insured_label'] = "Sum Assured";
}else if($ClientPolicyValue['policy_type_id'] == 7)
{
$policyGroup = 'gpa';
$data['ticket_type_id'] = 4;
$data['claim_subject'] = "Claim GTLI";
$data['sum_insured_label'] = "Sum Assured";
}else
{
$policyGroup = 'gmc';
$data['ticket_type_id'] = 1;
$data['claim_subject'] = "Claim GMC";
$data['sum_insured_label'] = "Sum Insured";
}
$terms = json_decode($ClientPolicyValue['policy_terms'] , true);
@ -3406,11 +3417,19 @@ class EmployeeRestController extends AdminController
{
$received_data = $this->request->getPost();
// print_r($received_data); die;
$get_file_data = $this->request->getFiles('claim_docs');
// print_r($get_file_data); die;
$employee_id = $received_data['emp_id'];
$client_policy_id = $received_data['client_policy_id'];
$insured_emp_id = $received_data['insured_emp_id'];
$file_data = "";
if(isset($get_file_data) && !empty($get_file_data)){
$file_path = WRITEPATH . 'uploads/claim_files/';
$file_data = multi_file_Upload($get_file_data, $file_path);
}
if (empty($received_data['doa'])) {
$received_data['doa'] = null;
} else{
@ -3491,6 +3510,8 @@ class EmployeeRestController extends AdminController
if ($insert_status && !empty($ticket_id)) {
$this->handleCliamFiles($file_data, $ticket_id);
//insert first history
$this->ticketController->putHistoryAfterInsert($fetchData, $ticket_id);
@ -3544,15 +3565,131 @@ class EmployeeRestController extends AdminController
}
}
public function handleCliamFiles($data, $ticket_id)
{
if(!empty($data) && !empty($ticket_id))
{
$insert_ids = [];
$claim_file = new ClaimFilesModel();
foreach ($data as $key => $value) {
$data = [
'ticket_id' => $ticket_id,
'doc_name' => $value['file_name'],
'url' => $value['file_path'],
'file_type' => 2,
];
$insert_ids[] = $claim_file->insert($data);
}
return $insert_ids;
}
return [];
}
//department
// public function get_ticket_type()
// {
// $ticket_type = $this->ticketController->ticketType;
// $ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
// // print_r($ticket_type); die;
// return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
// }
public function get_ticket_type()
{
$ticket_type = $this->ticketController->ticketType;
$ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
// print_r($ticket_type); die;
return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
try {
$client_id = $this->request->getGet('client_id');
$emp_code = $this->request->getGet('emp_code');
if (empty($client_id) || empty($emp_code)) {
$this->myLogger->logme('error', "Missing required parameters: client_id={$client_id}, emp_code={$emp_code}");
// return $this->response->setJSON([
// 'status' => false,
// 'code' => 400,
// 'message' => 'client_id and emp_code are required'
// ])->setStatusCode(400);
$ticket_type = $this->ticketController->ticketType;
$ticket_type = array_map(fn($value, $key) => (object) ['id' => $key, 'name' => $value], array_values($ticket_type), array_keys($ticket_type));
return $this->response->setJSON(['ticket_type' => $ticket_type])->setStatusCode(200);
}
// Get policy type ids
$policy_type_ids = $this->employeePolicyModel
->select('client_policy.policy_type_id')
->join('employees', 'employee_polices.employee_id = employees.id')
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
->where('employees.is_active', 1)
->whereIn('employees.emp_status', ['active', 'expired'])
->where('employee_polices.is_active', 1)
->whereIn('employee_polices.status', ['active', 'expired'])
->where('employees.client_id', $client_id)
->where('employees.emp_code', $emp_code)
->groupBy('employee_polices.client_policy_id')
->findAll();
if (!$policy_type_ids) {
$this->myLogger->logme('error', "No policy types found for client_id={$client_id}, emp_code={$emp_code}");
return $this->response->setJSON([
'status' => false,
'code' => 404,
'message' => 'No policy types found'
])->setStatusCode(404);
}
$this->myLogger->logme('info', "Policy type IDs fetched: " . json_encode($policy_type_ids));
$ticket_type = $this->ticketController->ticketType;
$filtered = [];
$mapping = [
2 => 1,
3 => 1,
4 => 1,
5 => 1,
1 => 2,
6 => 3,
7 => 4,
];
foreach ($policy_type_ids as $value) {
$ticketTypeId = $value['policy_type_id'] ?? null;
if (isset($mapping[$ticketTypeId]) && isset($ticket_type[$mapping[$ticketTypeId]])) {
$mappedId = $mapping[$ticketTypeId];
$mappedName = $ticket_type[$mappedId];
// Use mappedId as key to avoid duplicates
$filtered[$mappedId] = [
'id' => $mappedId,
'name' => $mappedName
];
$this->myLogger->logme('info', "Ticket type resolved: ID={$ticketTypeId}, Name={$mappedName}");
} else {
$this->myLogger->logme('warning', "No valid ticket type mapping for policy_type_id={$ticketTypeId}");
}
}
$filtered = array_values($filtered);
return $this->response->setJSON(['status' => true,'code' => 200, 'ticket_type' => $filtered ])->setStatusCode(200);
} catch (\Throwable $e) {
$this->myLogger->logme('error', "Error in get_ticket_type: " . $e->getMessage() . " Trace: " . $e->getTraceAsString());
return $this->response->setJSON([
'status' => false,
'code' => 500,
'message' => 'Internal Server Error'
])->setStatusCode(500);
}
}
//ticket data
public function get_ticket_data()
{
@ -3566,6 +3703,9 @@ class EmployeeRestController extends AdminController
$emp_id = $this->request->getGet('emp_id');
$ticket_type = $this->request->getGet('ticket_type') ?? null;
$ticket_id = $this->request->getGet('ticket_id') ?? null;
$request = \Config\Services::request();
$uri = $request->uri->getPath();
$returnType = (strpos($uri, 'api') !== false) ? 'api' : 'web';
// dd($emp_id);
if (empty($emp_id)) {
@ -3573,7 +3713,7 @@ class EmployeeRestController extends AdminController
}
$TicketMasterModel = new TicketMasterModel();
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $ticket_type, $ticket_id);
$ticket_data = $TicketMasterModel->get_ticket_data($emp_id, $returnType, $ticket_type, $ticket_id);
if (!empty($ticket_data)) {

View File

@ -1894,6 +1894,8 @@ class MasterController extends AdminController
'cache' => WRITEPATH . 'cache',
'sample_import_excel' => ROOTPATH . 'public/sample_import_excel',
'lead_files' => WRITEPATH . 'uploads/lead_files/',
'claim_files' => WRITEPATH . 'uploads/claim_files/',
'claim_dump_excel' => WRITEPATH . 'uploads/claim_dump_excel/',
'claim_sample_forms' => ROOTPATH . 'public/claim_sample_forms/',
];

View File

@ -3,6 +3,7 @@
namespace App\Controllers;
use App\Controllers\BaseController;
use App\Models\EmployeePolicyModel;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\API\ResponseTrait;
use Dompdf\Dompdf;
@ -32,7 +33,8 @@ class TestingController extends BaseController
}
public function testcli()
{ echo "hi";
{
echo "hi";
$this->myLogger->logme('error', "test log");
echo "hi 2";
log_message('error', 'test message for log_message_function');
@ -97,6 +99,22 @@ class TestingController extends BaseController
{
// Same as generatePDF but with inline view
$data = [
'NAME' => 'Korukonda Naga Venkata Ramalinga Satya Swarna Kumari',
'GENDER' => 'Male',
'DOB' => '01/01/1990',
'RELATION' => 'Self',
'POLICY_NO' => '97000034230400000109_EX_Parental',
'TPA_ID' => 'TPA987654321',
'POLICY_START_DATE' => '01/01/2024',
'POLICY_DATE' => '31/12/2024',
'INSURER_NAME' => 'ZURICH KOTAK GTNERAL INSURANCE COIIPANY lNDlA LIMITED',
'TPA_NAME' => 'HealthIndia Insurance TPA Services Pvt. Ltd.',
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
];
$data2 = [
'NAME' => 'John Doe',
'GENDER' => 'Male',
'DOB' => '01/01/1990',
@ -107,23 +125,30 @@ class TestingController extends BaseController
'POLICY_DATE' => '31/12/2024',
'INSURER_NAME' => 'ABC Insurance Co.',
'TPA_NAME' => 'XYZ TPA Ltd.',
'FRONT_CARD' => base_url('assets/images/front-card.jpg'),
'BACK_CARD' => base_url('assets/images/back-card.jpg'),
'FRONT_CARD' => base_url() .('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
'BACK_CARD' => base_url() . ('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
];
$html = $this->loadTemplate($data);
$employeeController = new EmployeeController();
// $html = $employeeController->generateIDCardForEmployeeUsingDom('LfpH3R');
$html = $this->loadTemplate($data2);
// print_r($html); die;
$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('isHtml5ParserEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
// $dompdf->loadHtml($html);
$dompdf->loadHtml('<style>@page { margin: 0; }</style>' . $html);
$dompdf->setPaper('A4', 'portrait');
// $dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
$dompdf->stream($filename, ['Attachment' => false]); // Inline view
// $dompdf->stream($filename, ['Attachment' => true]); // Inline view
$dompdf->stream($filename, ['Attachment' => false]); // Force download
}
private function loadTemplate($data)
@ -139,79 +164,76 @@ class TestingController extends BaseController
return $template;
}
// Alternative method using CodeIgniter's view system
public function generatePDFWithView()
// not using and not working
public function viewPdfUsingMpdf()
{
$data = [
'NAME' => 'John Doe',
'NAME' => 'Korukonda Naga Venkata Ramalinga Satya Swarna Kumari',
'GENDER' => 'Male',
'DOB' => '01/01/1990',
'RELATION' => 'Self',
'POLICY_NO' => 'POL123456789',
'POLICY_NO' => '97000034230400000109_EX_Parental',
'TPA_ID' => 'TPA987654321',
'POLICY_START_DATE' => '01/01/2024',
'POLICY_DATE' => '31/12/2024',
'INSURER_NAME' => 'ABC Insurance Co.',
'TPA_NAME' => 'XYZ TPA Ltd.',
'FRONT_CARD' => base_url('assets/images/front-card.jpg'),
'BACK_CARD' => base_url('assets/images/back-card.jpg'),
'INSURER_NAME' => 'ZURICH KOTAK GTNERAL INSURANCE COIIPANY lNDlA LIMITED',
'TPA_NAME' => 'HealthIndia Insurance TPA Services Pvt. Ltd.',
'FRONT_CARD' => base_url('public/uploads/template_bg/Nhance_Ecard_working_1_front_3.png'),
'BACK_CARD' => base_url('public/uploads/template_bg/Nhance_Ecard_working_1_Back_3.png'),
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
];
// Load view with data
$html = view('ecard_template', $data);
$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('isHtml5ParserEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
$dompdf->stream($filename, ['Attachment' => true]);
$html = $this->loadTemplate($data);
// Load mPDF
$mpdf = "";
// $mpdf = new \Mpdf\Mpdf([
// 'mode' => 'utf-8',
// 'format' => 'A4',
// 'margin_left' => 0,
// 'margin_right' => 0,
// 'margin_top' => 0,
// 'margin_bottom' => 0,
// 'tempDir' => __DIR__ . '/writable/mpdf'
// ]);
// Optional: Stretch background or images fully
// $html = '
// <style>
// body { margin:0; padding:0; }
// @page { margin:0; }
// </style>' . $html;
// $mpdf->WriteHTML($html);
// // Output inline (no download prompt)
// $filename = 'ecard_' . date('Y-m-d_H-i-s') . '.pdf';
// $mpdf->Output($filename, 'D');
/*
'I' = inline view in browser (no download prompt).
'D' = force download.
'F' = save to file.
'S' = return as string.
*/
}
public function generatePDFById($id)
public function getEmployeePolicyTypes($client_id, $emp_code, $emp_id)
{
// Get data from database
$ecardData = [];
if (!$ecardData) {
throw new \CodeIgniter\Exceptions\PageNotFoundException('E-card not found');
}
$employeePolicy = new EmployeePolicyModel();
$data = [
'NAME' => $ecardData['name'],
'GENDER' => $ecardData['gender'],
'DOB' => $ecardData['dob'],
'RELATION' => $ecardData['relation'],
'POLICY_NO' => $ecardData['policy_no'],
'TPA_ID' => $ecardData['tpa_id'],
'POLICY_START_DATE' => $ecardData['policy_start_date'],
'POLICY_DATE' => $ecardData['policy_end_date'],
'INSURER_NAME' => $ecardData['insurer_name'],
'TPA_NAME' => $ecardData['tpa_name'],
'FRONT_CARD' => base_url('assets/images/front-card.jpg'),
'BACK_CARD' => base_url('assets/images/back-card.jpg'),
'LEVELS' => 'Level 1: 1800-XXX-XXXX<br>Level 2: support@company.com'
];
$data = $employeePolicy
->select('client_policy.policy_type_id')
->join('employees', 'employee_polices.employee_id = employees.id')
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
->where('employees.is_active', 1)
->where('employees.emp_status', ['active', 'expired'])
->where('employee_polices.is_active', 1)
->where('employee_polices.status', ['active', 'expired'])
->where('employees.client_id', $client_id)
->where('employees.emp_code', $emp_code)
->groupBy('employee_polices.client_policy_id')
->findAll();
$html = view('ecard_template', $data);
$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('isHtml5ParserEnabled', true);
$dompdf = new Dompdf($options);
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
$filename = 'ecard_' . $ecardData['policy_no'] . '_' . date('Y-m-d') . '.pdf';
$dompdf->stream($filename, ['Attachment' => true]);
}
}

View File

@ -713,7 +713,10 @@ class TicketController extends BaseController
$claim_status_id = 25;
}else if($ticket_type == 4){
$claim_status_id = 35;
}else{
}else if($ticket_type == 8){
$claim_status_id = 62;
}
else{
$claim_status_id = 1;
}
}
@ -728,7 +731,7 @@ class TicketController extends BaseController
$data['claim_type'] = $this->claimType[2];
}
$data['client_for_motor'] = $this->clientModel->select('id,client_name')->where('client_type', 2)->where('is_active', 1)->findAll();
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
$this->myLogger->logme('error', "Ticket form data fetched successfully for Ticket Type: $ticket_type");
@ -750,9 +753,10 @@ class TicketController extends BaseController
->where('owner', $id)
->findAll();
$data['partner_policy_list'] = $this->partnerPolicyModel
->where('is_active', 1)
->findAll();
// $data['partner_policy_list'] = $this->partnerPolicyModel
// ->where('is_active', 1)
// ->findAll();
$data['partner_policy_list'] = $this->partnerPolicyModel->partnerPolicyList();
$client = $this->clientModel
->where('is_active', 1)
@ -868,9 +872,10 @@ class TicketController extends BaseController
}
public function view_ticket($ticket_id)
{
{
// $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first();
$ticket_data = $this->ticketMasterModel->getTicketDataByTicketID($ticket_id);
$ticket_data = $this->formatDateForClaim($ticket_data, 'd/m/Y');
if (in_array($ticket_data['claim_status_id'], [15, 25, 35])) {
@ -929,6 +934,14 @@ class TicketController extends BaseController
// print_rr($data); die;
}
// 8TH TYPE is Motor - so do not remove it....
if($ticket_data['ticket_type_id'] == 8){
$claim_status_id = $ticket_data['claim_status_id'];
$ticket_type = $ticket_data['ticket_type_id'];
$data['claim_status'] = $this->transFormClaimStatus($claim_status_id, $ticket_type);
$data['client_for_motor'] = $this->clientModel->select('id,client_name,phone')->where('client_type', 2)->where('is_active', 1)->findAll();
}
return $this->loadLayout('ticket_edit_onbording', $data);
}
@ -2274,7 +2287,8 @@ class TicketController extends BaseController
'url' => $data['url'][$key]??'',
'ticket_id'=> $data['ticket_id_url']??'',
'created_by' => get_session_userid(),
'is_active' => 1
'is_active' => 1,
'file_type' => 1
];
$insertArr[] = $insertData;
@ -2311,6 +2325,7 @@ class TicketController extends BaseController
$urlData = $this->claimFilesModel
->where('ticket_id', $ticket_id)
->where('is_active',1)
->where('file_type',1)
->findAll();
return $this->response->setJSON([

View File

@ -64,6 +64,42 @@ if (!function_exists('file_Upload')) {
}
}
if (!function_exists('multi_file_Upload')) {
function multi_file_Upload($fileToUpload, $filepath)
{
$uploadedFiles = [];
// Handle multiple files
if (is_array($fileToUpload)) {
foreach ($fileToUpload as $file) {
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
$file->move($filepath);
$fileName = $file->getName(); // safer unique name
$uploadedFiles[] = [
'file_name' => $fileName,
'file_path' => $filepath . $fileName
];
}
}
}
// Handle single file
else {
if ($fileToUpload !== null && $fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
$fileToUpload->move($filepath);
$fileName = $fileToUpload->getName();
$uploadedFiles[] = [
'file_name' => $fileName,
'file_path' => $filepath . $fileName
];
}
}
return $uploadedFiles; // always return array of files
}
}
if (!function_exists('file_unlink')) {
function file_unlink($filepath)
{

View File

@ -11,6 +11,7 @@ class ClaimFilesModel extends Model
protected $allowedFields = [
'id',
'ticket_id',
'file_type',
'doc_name',
'url',
'created_by',

View File

@ -0,0 +1,40 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PartnerEndorsementRequestModel extends Model
{
protected $table = 'partner_endorsement_request';
protected $primaryKey = 'id';
// Auto-increment
protected $useAutoIncrement = true;
// Return type
protected $returnType = 'array';
// Soft deletes (youre using is_active instead of deleted_at, so keep it false)
protected $useSoftDeletes = false;
// Allowed fields (columns you want to insert/update)
protected $allowedFields = [
'id',
'client_id',
'client_policy_id',
'insurer_id',
'insurer_branch_id',
'policy_number',
'endorsement_no',
'endorsement_type',
'endorsement_description',
'updated_by',
'is_active',
'created_by',
'manager_id',
'agent_id',
'status',
];
}

View File

@ -38,5 +38,35 @@ class PartnerPolicyModel extends Model
protected $createdField = 'created_on';
protected $updatedField = 'updated_on';
protected $dateFormat = 'datetime';
public function partnerPolicyList()
{
return $this->db->table('partner_policy as pp')
->select('
pp.id,
pp.id as partner_policy_id,
pp.enquiry_id,
pp.insured_name,
pp.policy_number,
pp.agent_id,
pp.manager_id,
pp.client_id,
pp.client_policy_id,
pp.is_active as partner_policy_is_active,
pe.insurer_id,
pe.is_active as partner_enquiry_is_active,
i.name as insurer_name,
i.short_name as insurer_short_name,
i.is_active as insurer_is_active
')
->join('partner_enquiry as pe', 'pe.id = pp.enquiry_id', 'left')
->join('insurers as i', 'i.id = pe.insurer_id', 'left')
->where('pp.is_active', 1)
->get()
->getResultArray();
}
// $data['partner_policy_list'] = $this->partnerPolicyModel
// ->where('is_active', 1)
// ->findAll();
}

View File

@ -79,7 +79,10 @@ class TicketMasterModel extends Model
'approved_description',
'file_id',
'denial_letter',
'manager_id',
'agent_id' ,
'vehicle_id',
];
@ -788,13 +791,19 @@ class TicketMasterModel extends Model
}
//api
public function get_ticket_data($emp_id, $ticket_type = null, $ticket_id = null)
public function get_ticket_data($emp_id, $returnType,$ticket_type = null, $ticket_id = null)
{
$query = $this->select('ticket_master.*, tms.mail_subject as subject')
->join('ticket_messages tms', 'ticket_master.id = tms.ticket_id', 'left')
->where('ticket_master.is_active', 1)
->where('tms.sender', "user")
->where('ticket_master.emp_id', $emp_id);
->where('ticket_master.is_active', 1);
if($returnType == 'api'){
$query->whereIn('sender', ['staff', 'user']);
}else{
$query->where('tms.sender', "user");
}
$query->where('ticket_master.emp_id', $emp_id);
if (!empty($ticket_id)) {
$query->where('ticket_master.id', $ticket_id);
@ -805,7 +814,8 @@ class TicketMasterModel extends Model
}
$data = $query->findAll();
// dd($data, db_connect()->getLastQuery());
// dd($data, db_connect()->getLastQuery());
// print_r($this->db->getLastQuery());die;
return $data;
}

View File

@ -195,7 +195,7 @@
<?php } ?>
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] . "/0/1" ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
<?php } ?>
<?php if($employee['relationship'] == 'Self' && in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['email_corporate'] != '' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>

View File

@ -14,17 +14,17 @@
<!-- Optional CSS -->
<style>
/* Make modal really XL and scrollable */
#branchModal .modal-dialog.modal-xl {
#insurerBranchModal .modal-dialog.modal-xl {
max-width: 90%;
height: 90vh;
}
#branchModal .modal-content {
#insurerBranchModal .modal-content {
height: 100%;
overflow: hidden;
}
#branchModal .modal-body {
#insurerBranchModal .modal-body {
overflow-y: auto;
max-height: 80vh;
}
@ -170,7 +170,7 @@
<!-- end -->
<!-- Modal -->
<div class="modal fade" id="branchModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal fade" id="insurerBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
<div class="modal-content">
<!-- Modal Header -->
@ -183,116 +183,133 @@
<!-- Modal Body -->
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
<form id="insurer_branch_form" class="parsley-examples" method="post" enctype="multipart/form-data">
<div class="row">
<!-- Left Section: Branch Details -->
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
<!-- Branch Name & Code -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name" required>
</div>
<div class="form-group col-md-6">
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code" required>
</div>
</div>
<!-- Address Lines -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="address1" name="address1" required>
</div>
<div class="form-group col-md-6">
<label for="address2">Address Line 2</label>
<input type="text" class="form-control" id="address2" name="address2">
</div>
</div>
<!-- State & District -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="state">State <span class="text-danger">*</span></label>
<select class="form-control" id="state" name="state" required>
<option value="">Select State</option>
<?php foreach($state as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-6">
<label for="district">District <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="district" name="district" required>
</div>
</div>
<!-- City & Pincode -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_city">City <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_city" name="city" required>
</div>
<div class="form-group col-md-6">
<label for="pincode">Pincode <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pincode" name="pincode" required>
</div>
</div>
<!-- Submit / Cancel -->
<form id="insurer_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="insurer_Branch_PrimaryKey" />
<input type="hidden" name="insurer_id" id="insurer_id_branch" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
<div class="row">
<!-- Left Section: Branch Details -->
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
<!-- Branch Name & Code -->
<div class="form-row">
<!-- <div class="form-group col-md-12 mt-2"> -->
<div style="margin-top: 85px;">
<button type="submit" class="btn btn-primary mr-2" id="btnSubmit">Submit</button>
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
<!-- </div> -->
<div class="form-group col-md-6">
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name"
placeholder="Enter Branch Name" name="branch_name" required>
</div>
<div class="form-group col-md-6">
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code"
placeholder="Enter Branch Code" name="branch_code" required>
</div>
</div>
<!-- Address Lines -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
</div>
<div class="form-group col-md-6">
<label for="address2">Address Line 2</label>
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
</div>
</div>
<!-- State & District -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="state">State <span class="text-danger">*</span></label>
<select class="form-control" id="state" name="state" required>
<option value="">Select State</option>
<?php foreach($state as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-6">
<label for="district">District <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="district"
placeholder="Enter District" name="district" required>
</div>
</div>
<!-- City & Pincode -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_city">City <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_city"
placeholder="Enter City" name="city" required>
</div>
<div class="form-group col-md-6">
<label for="pincode">Pincode <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
</div>
</div>
<!-- Submit / Cancel -->
<div class="form-row">
<!-- <div class="form-group col-md-12 mt-2"> -->
<div style="margin-top: 85px;">
<button type="submit" class="btn btn-primary mr-2" id="btnSubmit">Submit</button>
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
<!-- </div> -->
</div>
</div>
<!-- Right Section: Contact Details -->
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
<!-- First Contact -->
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
<div class="d-flex justify-content-between align-items-center mb-2">
<h6 class="modal-subtitle mb-0">Contact 1</h6>
<div class="d-flex align-items-center">
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
</div>
</div>
<!-- Contact Form Fields -->
<div class="form-row">
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
<div class="form-group col-md-12">
<label for="name">Name <span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="designation">Designation <span class="text-danger">*</span></label>
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">Email <span class="text-danger">*</span></label>
<input value="" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">Mobile <span class="text-danger">*</span></label>
<!-- <input name="mobile[]" pattern="[0-9]{10}" value="" type="tel" data-parsley-type="number" data-parsley-length="[10,10]" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required> -->
<!-- oninput="this.value = this.value.replace(/[^0-9]/g,'');" maxlength="10" -->
<input value="" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
</div>
</div>
</div>
<!-- Container for dynamically added contacts -->
<div id="container"></div>
<div>
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
</div>
</div>
</div>
<!-- Right Section: Contact Details -->
<div class="col-md-4" style="background:#f8f9fa; max-height: calc(80vh - 50px); overflow-y:auto; border-radius:8px; padding:10px;">
<!-- First Contact -->
<div id="contact_1_wrapper" class="bg-white p-2 mb-2 rounded contact-block">
<div class="d-flex justify-content-between align-items-center mb-2">
<h6 class="modal-subtitle mb-0">Contact 1</h6>
<div class="d-flex align-items-center">
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="contact_1_remove"></i>
</div>
</div>
<!-- Contact Form Fields -->
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
<div class="form-group mb-2">
<label for="name">Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
</div>
<div class="form-group mb-2">
<label for="designation">Designation <span class="text-danger">*</span></label>
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
</div>
<div class="form-group mb-2">
<label for="email">Email <span class="text-danger">*</span></label>
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
</div>
<div class="form-group mb-2">
<label for="mobile">Mobile <span class="text-danger">*</span></label>
<input type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" id="mobile" required>
</div>
</div>
<!-- Container for dynamically added contacts -->
<div id="container"></div>
<div>
<button type="button" class="btn btn-primary btn-sm ac me-3" style="width: 100%;" onclick="appendContactHtml()" id="add"><i class="mdi mdi-plus"></i> Add Contact</button>
</div>
</div>
</div>
</form>
</div>
@ -310,16 +327,17 @@
$(document).ready(function () {
insurer_Branch_PrimaryKey = $('#insurer_id_branch').val();
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
myModal.hide();
// $('#add_branch').hide();
$('.btnBack').hide();
// $('.btnBack').hide();
if(insurer_Branch_PrimaryKey !== ''){
var branchTable = '';
var data = <?= isset($insuer_branch) ? json_encode($insuer_branch) : '[]' ?>;
console.log("insurer branch data", data);
$.each(data, function(index, item) {
branchTable += `
<tr>
@ -347,11 +365,11 @@
$("#insurer_branch_form")[0].reset();
contactCount = 1
insurer_branch_form_action = '<?= base_url("master/insurer/branch/create"); ?>';
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
myModal.show();
// $('#add_branch').show();
// $('#branch_table').hide();
$('.btnBack').show();
// $('.btnBack').show();
// $('#btnBranchAdd').hide();
$('#branch_name').val('');
@ -391,12 +409,12 @@
$('.btnBack').click(function(){
$("#insurer_branch_form")[0].reset();
contactCount = 1
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
myModal.hide();
$('.close').click();
// $('#add_branch').hide();
// $('#branch_table').show();
$('.btnBack').hide();
// $('.btnBack').hide();
// $('#btnBranchAdd').show();
$('#branch_name').val('');
@ -409,6 +427,7 @@
$('#email').val('');
$('#mobile').val('');
$('#designation').val('');
$('#container').empty(); $('#contact_1_wrapper input').val('');
})
@ -430,12 +449,12 @@
dataType: 'json',
processData: false,
contentType: false,
beforeSend: function() {
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
},
success: function(res) {
$("#insurer_branch_form")[0].reset();
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
console.log(res);
$('#insurer_branch_list tr').remove();
var insurerBranchTableInsert = ''
@ -453,9 +472,9 @@
});
$('#insurer_branch_list').append(insurerBranchTableInsert);
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
myModal.hide();
$('#container').empty(); $('#contact_1_wrapper input').val('');
$('.close').click();
// window.location.reload();
// $('#add_branch').hide();
// $('#branch_table').show();
// $('.btnBack').hide();
@ -467,10 +486,17 @@
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');
toastr.warning('Something Wrong!', 'warning');
}, 1000);
},
complete: function() {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
$('.close').click();
}
});
@ -501,11 +527,11 @@
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('insurerBranchModal'));
myModal.show();
// $('#add_branch').show();
// $('#branch_table').show();
$('.btnBack').show();
// $('.btnBack').show();
// $('#btnBranchAdd').hide();
console.log("res.levelcontact[0].id"+res.levelcontact[0].id);
$('#branch_name').val(res.insurerbranch.branch_name);
@ -661,6 +687,7 @@
var container = document.getElementById('container');
var uniqueId = Date.now().toString();
// <input type="hidden" name="primarykey[]" id="contact_id_1" value="${contact !== undefined && contact !== false ? contact.id : ''}"/>
var html = `
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
<div class="d-flex justify-content-between align-items-center mb-2">
@ -669,29 +696,28 @@
<i class="mdi mdi-trash-can text-danger" style="cursor:pointer; font-size:24px !important;" onclick="removeContact(this)" id="${uniqueId}_remove"></i>
</div>
</div>
<div class="form-row">
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
<div class="form-row">
<div class="form-group col-md-12">
<label>Name<span class="text-danger">*</span></label>
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Designation<span class="text-danger">*</span></label>
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Email<span class="text-danger">*</span></label>
<input value="${contact ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
<input value="${contact ? contact.email : ''}" type="email" data-parsley-type="email" data-parsley-trigger="change"class="form-control" placeholder="Enter Contact Email" name="email[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Mobile<span class="text-danger">*</span></label>
<input value="${contact ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Designation<span class="text-danger">*</span></label>
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
<input value="${contact ? contact.mobile : ''}" name="mobile[]" value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" id="mobile" required maxlength="10" inputmode="numeric">
</div>
</div>
</div>
@ -705,18 +731,29 @@
}
function removeContact(btn){
var $block = $(btn).closest('.contact-block');
var isFirst = $block.attr('id') === 'contact_1_wrapper';
function removeContact(button) {
var uniqueId = button.id.split("_")[0];
var contactSection = document.getElementById(uniqueId);
if (contactSection) {
contactSection.parentNode.removeChild(contactSection);
renumberContacts(); // ✅ renumber after removal
toggleAddButton();
if (isFirst) {
var $next = $('#container .contact-block').first();
if ($next.length){
$block.replaceWith($next);
$next.attr('id','contact_1_wrapper');
$next.find('.modal-subtitle').text('Contact 1');
} else {
$block.find('input').val('');
return;
}
} else {
$block.remove();
}
renumberContacts();
toggleAddButton();
}
function toggleAddButton() {
var totalContacts = document.querySelectorAll('.contact-block, #contact_1_wrapper').length;
var addButton = document.querySelector('.ac');

View File

@ -68,9 +68,9 @@
$('#btnBranchAdd').hide();
toastr.warning('First Add the Insurer!', 'warning',{timeOut: 2000});
}else{
if ($('#btnBranchBack')[0].style.display == 'none') {
// if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show();
}
// }
}
}

View File

@ -1487,7 +1487,79 @@
<?php } ?>
<!-- <li>
<!-- Enrollment process -->
<?php if (in_array(get_role_id(), [1,2,3,5]) || in_array(ENROLLMENT_TEAM_ID, user_team())) { ?>
<li>
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect img-inactive-not-working" >
<img style="border-radius: 5px;"
src="<?= base_url() . "public"; ?>/assets/images/action_on_policies_sb.png" alt="Logo" height="20">
<span> Action on Policies </span>
</a>
<div class="collapse" id="sidebarDashboards">
<ul class="nav-second-level">
<li>
<a href="<?= base_url('/employee/upload') ?>">View Inception</a>
</li>
<li>
<a href="<?= base_url('/employee/list') ?>">View Members</a>
</li>
<li>
<a href="<?= base_url('/employee/endorsement-list') ?>">View Endorsement</a>
</li>
<li>
<a href="<?= base_url('/employee/enrollment-list') ?>">View Enrolment</a>
</li>
<li>
<a href="<?= base_url('/employee/test_members_list') ?>">Test Members List</a>
</li>
<li>
<a href="<?= base_url('/employee/retail-endorsement-list') ?>">Retail Endorsement</a>
</li>
</ul>
</div>
</li>
<?php } ?>
<!-- Masters -->
<?php if (get_role_id() == 1 || get_role_id() == 5) { ?>
<li>
<a href="#sidebarDashboards" data-toggle="collapse" class=" img-inactive-not-working">
<img
src="<?= base_url() . "public"; ?>/assets/images/masters_sb.png" alt="Logo" height="20">
<span> Masters </span>
</a>
<div class="collapse" id="sidebarDashboards">
<ul class="nav-second-level">
<li>
<a href="<?= base_url('/master/insurer/list') ?>">Insurer</a>
</li>
<li>
<a href="<?= base_url('/master/tpa/list') ?>">TPA</a>
</li>
<li>
<a href="<?= base_url('/master/kyc/list') ?>">KYC</a>
</li>
<li>
<a href="<?= base_url('/master/policy/list') ?>">Policy</a>
</li>
<li>
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
</li>
<li>
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
</li>
<li>
<a href="<?= base_url('/user/list') ?>"> Users </a>
</li>
</ul>
</div>
</li>
<?php } ?>
<!-- <li>
<?php
$sessionData = get_session_userdata();
$currentUrl = base_url();

View File

@ -328,8 +328,7 @@
<label for="waiverof30dayswaitingperiod">Waiver of 30 days waiting period</label>
</div>
<div class="col-md-6">
<input type="text" name="waiverof30dayswaitingperiod" class="form-control waiverof30dayswaitingperiod"
value="1">
<input type="text" name="waiverof30dayswaitingperiod" class="form-control waiverof30dayswaitingperiod">
</div>
</div>

View File

@ -1253,11 +1253,16 @@ $(document).ready(function(){
e.preventDefault();
}
if(shouldClose){
console.log("alert closed")
localStorage.removeItem('vehicleFormData');
$("#vehicle_form").find("input, select, textarea").val("");
}
}
});
$('#aadhar').attr('data-parsley-required', 'false');
$('#aadhar').removeAttr('required');

View File

@ -176,56 +176,192 @@ $(document).ready(function() {
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
// buttons: [
// {
// extend: 'csv',
// text: 'CSV',
// title: 'Policy-Tranction-BDS-List',
// },
// {
// extend: 'excel',
// text: 'Excel',
// title: 'Policy-Tranction-BDS-List',
// customize: function(xlsx) {
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
// var total = 0;
// // 🔹 Force column K (11) and L (12) as string
// $('row c[r^="K"], row c[r^="L"]', sheet).attr('t', 'inlineStr');
// // Find cells in column AB (28th column in Excel)
// $('row c[r^="AB"]', sheet).each(function() {
// var value = parseFloat($('v', this).text()); // Get the value inside the cell
// if (!isNaN(value)) {
// total += value;
// }
// });
// // Get the last row index and append the total row
// var lastRow = $('row:last', sheet);
// var rowIndex = parseInt(lastRow.attr('r')) + 2; // Find the next row index
// var totalRow = '<row r="' + rowIndex + '">' +
// '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' + // Insert "Total" in AA
// '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' + // Insert sum in AB
// '</row>';
// // Append the new total row to the sheet
// $(sheet).find('sheetData').append(totalRow);
// },
// exportOptions: {
// orthogonal: 'sort'
// },
// customizeData: function (data) {
// for (var i = 0; i < data.body.length; i++) {
// for (var j = 0; j < data.body[i].length; j++) {
// // Check if the column is the 9th index (10th column) and 10th index (11th column)
// if (j === 9 || j === 10) {
// data.body[i][j] = '\u200C' + data.body[i][j];
// }
// }
// }
// }
// }
// ],
buttons: [
{
extend: 'csv',
text: 'CSV',
title: 'Policy-Tranction-BDS-List',
exportOptions: {
columns: ':visible', // or specify exact columns [0,1,2,...]
format: {
body: function (data, row, column, node) {
// Force K and L columns to string
if (column === 10 || column === 11) {
// Option 1: prepend single quote
return '\u200C' + data;
// Option 2: use Excel formula trick
// return '="' + data + '"';
}
return data;
}
}
},
},
{
extend: 'excel',
text: 'Excel',
title: 'Policy-Tranction-BDS-List',
customize: function(xlsx) {
// customize: function (xlsx) {
// var sheet = xlsx.xl.worksheets['sheet1.xml'];
// var total = 0;
// // 🔹 Force column K (11) and L (12) as string
// // $('row c[r^="K"], row c[r^="L"]', sheet).attr('t', 'inlineStr');
// // 🔹 Convert column K (11th) & L (12th) to inline string
// $('row c[r^="K"], row c[r^="L"]', sheet).each(function () {
// var cell = $(this);
// console.log(cell);
// var val = cell.find('v').text(); // get value
// if (val) {
// cell.attr('t', 'inlineStr'); // mark as text
// cell.remove('v'); // remove <v>
// cell.append('<is><t>' + val + '</t></is>'); // replace with inline string
// }
// });
// // Calculate total in AB (28th column)
// $('row c[r^="AB"]', sheet).each(function () {
// var value = parseFloat($('v', this).text());
// if (!isNaN(value)) {
// total += value;
// }
// });
// // Append total row
// var lastRow = $('row:last', sheet);
// var rowIndex = parseInt(lastRow.attr('r')) + 2;
// var totalRow = '<row r="' + rowIndex + '">' +
// '<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
// '<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
// '</row>';
// $(sheet).find('sheetData').append(totalRow);
// },
customize: function (xlsx) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
var total = 0;
// Find cells in column AB (28th column in Excel)
$('row c[r^="AB"]', sheet).each(function() {
var value = parseFloat($('v', this).text()); // Get the value inside the cell
if (!isNaN(value)) {
total += value;
function forceAsText(cell) {
var val = cell.find('v').text();
if (val) {
// Remove old <v>
cell.find('v').remove();
// Force as inline string
cell.attr('t', 'inlineStr');
cell.append('<is><t>' + val + '</t></is>');
}
}
function forceAsTextPreserveOriginal(cell) {
// Get the original cell value from the cell's text content
var vElement = cell.find('v');
if (vElement.length > 0) {
var originalValue = vElement.text();
// Remove the <v> element
vElement.remove();
// Set cell type to inline string and preserve the original value
cell.attr('t', 'inlineStr');
cell.append('<is><t>' + originalValue + '</t></is>');
}
}
// 🔹 Force K column as text (working correctly)
$('row c[r^="K"]', sheet).each(function () {
forceAsText($(this));
});
// Get the last row index and append the total row
// 🔹 Force L column as text with better preservation
$('row c[r^="L"]', sheet).each(function () {
forceAsTextPreserveOriginal($(this));
});
// 🔹 Calculate total in AB (28th column)
$('row c[r^="AB"] v', sheet).each(function () {
var value = parseFloat($(this).text());
if (!isNaN(value)) total += value;
});
// 🔹 Append total row
var lastRow = $('row:last', sheet);
var rowIndex = parseInt(lastRow.attr('r')) + 2; // Find the next row index
var rowIndex = parseInt(lastRow.attr('r')) + 2;
var totalRow = '<row r="' + rowIndex + '">' +
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' + // Insert "Total" in AA
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' + // Insert sum in AB
'<c t="inlineStr" r="AA' + rowIndex + '"><is><t>Total</t></is></c>' +
'<c t="n" r="AB' + rowIndex + '"><v>' + total.toFixed(2) + '</v></c>' +
'</row>';
// Append the new total row to the sheet
$(sheet).find('sheetData').append(totalRow);
},
exportOptions: {
orthogonal: 'sort'
},
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// Check if the column is the 9th index (10th column) and 10th index (11th column)
if (j === 9 || j === 10) {
data.body[i][j] = '\u200C' + data.body[i][j];
}
}
}
}
orthogonal: 'sort'
},
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// Force 10th (index 9) & 11th (index 10) as text
if (j === 9 || j === 10 || j === 11 || j === 12 ) {
data.body[i][j] = '\u200C' + data.body[i][j];
}
}
}
}
}
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."

View File

View File

@ -54,6 +54,7 @@
<span class="d-none d-sm-inline-block">History</span>
</a>
</li>
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
<li class="nav-item">
<a href="#autoQuery-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="auto_query_tab"
aria-expanded="false">
@ -61,6 +62,7 @@
<span class="d-none d-sm-inline-block">Auto Query Content</span>
</a>
</li>
<?php } ?>
<li class="nav-item">
<a href="#uploads-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="uploads_tab"
aria-expanded="false">
@ -68,6 +70,7 @@
<span class="d-none d-sm-inline-block">Claim Files</span>
</a>
</li>
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
<li class="nav-item">
<a href="#viewpolicyterms-tab" data-toggle="tab" class="nav-link px-2 py-1 label-font-size" id="viewpolicyterms_tab"
aria-expanded="false">
@ -75,6 +78,7 @@
<span class="d-none d-sm-inline-block">View Policy Terms</span>
</a>
</li>
<?php } ?>
</ul>
<!-- Tab Content -->
@ -84,9 +88,11 @@
if ($ticket_data['ticket_type_id'] == 1) {
include('ticket_form_gmc.php');
} else if($ticket_data['ticket_type_id'] == 8){
include('ticket_form_motor.php');
} else {
include('ticket_form_gpa.php');
}
}
?>
</div>
<div class="tab-pane fade" id="reply-tab">
@ -98,15 +104,19 @@
<div class="tab-pane fade" id="history-tab">
<?php include('ticket_history.php'); ?>
</div>
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
<div class="tab-pane fade" id="autoQuery-tab">
<?php include('ticket_auto_query.php'); ?>
</div>
<?php } ?>
<div class="tab-pane fade" id="uploads-tab">
<?php include('claim_files_upload.php'); ?>
</div>
<?php if(in_array($ticket_data['ticket_type_id'], [1,2,3,4,5,6,7])){ ?>
<div class="tab-pane fade" id="viewpolicyterms-tab">
<?php include('view_policy_terms.php'); ?>
</div>
<?php } ?>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -14,17 +14,17 @@
<!-- Optional CSS -->
<style>
/* Make modal really XL and scrollable */
#branchModal .modal-dialog.modal-xl {
#tpaBranchModal .modal-dialog.modal-xl {
max-width: 90%;
height: 90vh;
}
#branchModal .modal-content {
#tpaBranchModal .modal-content {
height: 100%;
overflow: hidden;
}
#branchModal .modal-body {
#tpaBranchModal .modal-body {
overflow-y: auto;
max-height: 80vh;
}
@ -166,7 +166,7 @@
</div>
<!-- end -->
<!-- Modal -->
<div class="modal fade" id="branchModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal fade" id="tpaBranchModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" style="max-width: 1140px !important;">
<div class="modal-content">
<!-- Modal Header -->
@ -179,20 +179,24 @@
<!-- Modal Body -->
<div class="modal-body" style="overflow-y:auto; max-height:80vh;">
<form id="insurer_branch_form" class="parsley-examples" method="post" enctype="multipart/form-data">
<form id="tpa_branch_form" role="form" class="parsley-examples" method="post" action="" enctype="multipart/form-data">
<div class="row">
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="tpa_Branch_PrimaryKey" />
<input type="hidden" name="tpa_id" id="tpa_id_branch" value="<?= isset($tpa['id']) ? $tpa['id'] : '' ?>"/>
<!-- Left Section: Branch Details -->
<div class="col-md-8 d-flex flex-column" style="max-height: calc(80vh - 50px);">
<!-- Branch Name & Code -->
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_name">Branch Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name" required>
<input type="text" class="form-control" id="branch_name"
placeholder="Enter Branch Name" name="branch_name" required>
</div>
<div class="form-group col-md-6">
<label for="branch_code">Branch Code <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code" required>
<input type="text" class="form-control" id="branch_code"
placeholder="Enter Branch Code" name="branch_code" required>
</div>
</div>
@ -200,11 +204,11 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="address1">Address Line 1 <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="address1" name="address1" required>
<input type="text" class="form-control" id="address1" name="address1" placeholder="Enter Address 1" required>
</div>
<div class="form-group col-md-6">
<label for="address2">Address Line 2</label>
<input type="text" class="form-control" id="address2" name="address2">
<input type="text" class="form-control" id="address2" placeholder="Enter Address 2" name="address2">
</div>
</div>
@ -213,15 +217,17 @@
<div class="form-group col-md-6">
<label for="state">State <span class="text-danger">*</span></label>
<select class="form-control" id="state" name="state" required>
<option value="">Select State</option>
<?php foreach($state as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } ?>
<option value="">Select State</option>
<?php if ($state) {
foreach($state as $value) { ?>
<option value="<?= $value['id'] ?>"><?= $value['state'] ?></option>
<?php } }?>
</select>
</div>
<div class="form-group col-md-6">
<label for="district">District <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="district" name="district" required>
<input type="text" class="form-control" id="district"
placeholder="Enter District" name="district" required>
</div>
</div>
@ -229,18 +235,19 @@
<div class="form-row">
<div class="form-group col-md-6">
<label for="branch_city">City <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_city" name="city" required>
<input type="text" class="form-control" id="branch_city"
placeholder="Enter City" name="city" required>
</div>
<div class="form-group col-md-6">
<label for="pincode">Pincode <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pincode" name="pincode" required>
<input type="text" class="form-control" id="pincode" placeholder="Enter Pincode" name="pincode" required>
</div>
</div>
<!-- Submit / Cancel -->
<div class="form-row">
<!-- <div class="form-group col-md-12 mt-2"> -->
<div class="mt-2">
<!-- <div class="form-group col-md-12 mt-2"> -->
<div style="margin-top: 85px;">
<button type="submit" class="btn app-btn-secondary mr-2" id="btnSubmit">Submit</button>
<button type="button" class="btn app-btn-outline-secondary btnBack" id="btnBack" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
@ -260,22 +267,30 @@
</div>
<!-- Contact Form Fields -->
<input type="hidden" name="primarykey[]" id="contact_id_1" value=""/>
<div class="form-group mb-2">
<!-- <input type="hidden" name="primarykey[]" id="contact_id_1" value=""/> -->
<div class="form-row">
<div class="form-group col-md-12">
<label for="name">Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
<input value="" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" id="name" required>
</div>
<div class="form-group mb-2">
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="designation">Designation <span class="text-danger">*</span></label>
<input type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
<input value="" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" id="designation" required>
</div>
<div class="form-group mb-2">
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">Email <span class="text-danger">*</span></label>
<input type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
<input value="" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" id="email" required>
</div>
<div class="form-group mb-2">
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="mobile">Mobile <span class="text-danger">*</span></label>
<input type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" id="mobile" required>
<input value="" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" id="mobile" required maxlength="10" inputmode="numeric">
</div>
</div>
</div>
@ -309,21 +324,21 @@ $(document).ready(function () {
var tpa_Branch_PrimaryKey = $('#tpa_id_branch').val();
var tpa_branch_form_action = '';
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.hide();
// $('#add_branch').hide();
$('.btnBack').hide();
// $('.btnBack').hide();
loadBranchList();
$('#btnBranchAdd').click(function(){
tpa_branch_form_action = '<?= base_url("master/tpa/branch/create"); ?>';
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.show();
// $('#add_branch').show();
// $('#branch_table').hide();
$('.btnBack').show();
// $('.btnBack').show();
// $('#btnBranchAdd').hide();
$('#branch_name').val('');
@ -364,11 +379,11 @@ $(document).ready(function () {
$('.btnBack').click(function(){
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.hide();
// $('#add_branch').hide();
// $('#branch_table').show();
$('.btnBack').hide();
// $('.btnBack').hide();
// $('#btnBranchAdd').show();
$('#branch_name').val('');
@ -381,6 +396,7 @@ $(document).ready(function () {
$('#email').val('');
$('#mobile').val('');
$('#designation').val('');
$('#container').empty(); $('#contact_1_wrapper input').val('');
})
@ -449,8 +465,8 @@ $(document).ready(function () {
});
}
$('#tpa_branch_list').append(tpaBranchTableInsert);
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
myModal.hide();
$('#container').empty(); $('#contact_1_wrapper input').val('');
$('.close').click();
// $('#add_branch').hide();
// $('#branch_table').show();
// $('.btnBack').hide();
@ -464,6 +480,13 @@ $(document).ready(function () {
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
}, 1000);
},
complete: function() {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
$('.close').click();
}
});
}
@ -487,7 +510,7 @@ $(document).ready(function () {
}, 1000);
console.log("tpa.............");
console.log(res)
var myModal = new bootstrap.Modal(document.getElementById('branchModal'));
var myModal = new bootstrap.Modal(document.getElementById('tpaBranchModal'));
myModal.show();
// $('#add_branch').show();
// $('#branch_table').hide();
@ -663,7 +686,7 @@ function renumberContacts() {
var container = document.getElementById('container');
var uniqueId = Date.now().toString();
// <input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
var html = `
<div id="${uniqueId}" class="bg-white p-2 mb-2 rounded contact-block">
<div class="d-flex justify-content-between align-items-center mb-2">
@ -673,28 +696,28 @@ function renumberContacts() {
</div>
</div>
<div class="form-row">
<input type="hidden" name="primarykey[]" value="${contact ? contact.id : ''}"/>
<div class="form-group col-md-12">
<label>Name<span class="text-danger">*</span></label>
<input value="${contact ? contact.name : ''}" type="text" class="form-control" placeholder="Enter Contact Name" name="name[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Designation<span class="text-danger">*</span></label>
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Email<span class="text-danger">*</span></label>
<input value="${contact ? contact.email : ''}" type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
<input value="${contact ? contact.email : ''}" data-parsley-type="email" type="email" data-parsley-trigger="change" data-parsley-type="email" class="form-control" placeholder="Enter Contact Email" name="email[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Mobile<span class="text-danger">*</span></label>
<input value="${contact ? contact.mobile : ''}" type="tel" class="form-control" placeholder="Enter Contact Mobile" pattern="[0-9]{10}" name="mobile[]" required>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label>Designation<span class="text-danger">*</span></label>
<input value="${contact ? contact.designation : ''}" type="text" class="form-control" placeholder="Enter Designation Name" name="designation[]" required>
<input value="${contact ? contact.mobile : ''}" data-parsley-type="digits" data-parsley-length="[10,10]" data-parsley-trigger="change" type="text" class="form-control" placeholder="Enter Contact Mobile" name="mobile[]" required maxlength="10" inputmode="numeric">
</div>
</div>
</div>
@ -707,15 +730,26 @@ function renumberContacts() {
}
}
function removeContact(button) {
var uniqueId = button.id.split("_")[0];
var contactSection = document.getElementById(uniqueId);
function removeContact(btn){
var $block = $(btn).closest('.contact-block');
var isFirst = $block.attr('id') === 'contact_1_wrapper';
if (contactSection) {
contactSection.parentNode.removeChild(contactSection);
renumberContacts(); // ✅ renumber after removal
toggleAddButton();
if (isFirst) {
var $next = $('#container .contact-block').first();
if ($next.length){
$block.replaceWith($next);
$next.attr('id','contact_1_wrapper');
$next.find('.modal-subtitle').text('Contact 1');
} else {
$block.find('input').val('');
return;
}
} else {
$block.remove();
}
renumberContacts();
toggleAddButton();
}
function toggleAddButton() {

View File

@ -83,9 +83,9 @@ body {
$('#btnBranchAdd').hide();
toastr.warning('First Add the TPA!', 'warning',{timeOut: 2000});
}else{
if ($('#btnBranchBack')[0].style.display == 'none') {
// if ($('#btnBranchBack')[0].style.display == 'none') {
$('#btnBranchAdd').show();
}
// }
}
}

View File

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
.ecard-container {
width: 100%;
display: table; /* Dompdf supports table better than flex */
table-layout: fixed;
border-spacing: 10px; /* Gap between front & back */
}
.ecard-section {
display: table-cell;
width: 50%;
height: 200px; /* Fixed height */
max-height: 200px;
font-size: 9px;
background-size: contain;
background-position: top center;
background-repeat: no-repeat;
vertical-align: top;
padding: 12px;
box-sizing: border-box;
overflow: hidden;
}
.ecard-table {
font-size: 9px;
line-height: 14px; /* 🔹 Reduced line height */
border-collapse: collapse;
}
.ecard-table td {
padding: 0px 3px; /* 🔹 Reduced vertical padding */
vertical-align: top;
}
.label {
font-weight: bold;
width: 70px; /* Fixed width for alignment */
white-space: nowrap;
}
.colon {
width: 5px;
text-align: center;
}
.value {
width: auto;
word-wrap: break-word;
}
</style>
</head>
<body>
<div class="ecard-container">
<!-- FRONT CARD -->
<div class="ecard-section front" style="background-image: url('{FRONT_CARD}');">
<div style="margin-left: 100px; margin-top: 20px; position: relative; top: -8px;">
<table class="ecard-table">
<tr><td class="label">Name</td><td class="colon">:</td><td class="value">{NAME}</td></tr>
<tr><td class="label">Gender</td><td class="colon">:</td><td class="value">{GENDER}</td></tr>
<tr><td class="label">D.O.B</td><td class="colon">:</td><td class="value">{DOB}</td></tr>
<tr><td class="label">Relationship</td><td class="colon">:</td><td class="value">{RELATION}</td></tr>
<tr><td class="label">Policy No</td><td class="colon">:</td><td class="value">{POLICY_NO}</td></tr>
<tr><td class="label">TPA/UHID</td><td class="colon">:</td><td class="value">{TPA_ID}</td></tr>
<tr><td class="label">Policy Start</td><td class="colon">:</td><td class="value">{POLICY_START_DATE}</td></tr>
<tr><td class="label">Policy End</td><td class="colon">:</td><td class="value">{POLICY_DATE}</td></tr>
<tr><td class="label">Insurer</td><td class="colon">:</td><td class="value">{INSURER_NAME}</td></tr>
<tr><td class="label">TPA</td><td class="colon">:</td><td class="value">{TPA_NAME}</td></tr>
</table>
</div>
</div>
<!-- BACK CARD -->
<div class="ecard-section back" style="background-image: url('{BACK_CARD}');">
<div style="margin-left: 110px; margin-top: 15px; font-size: 9px; line-height: 11px; position: relative; top: -8px;">
<div>
<span style="color: #AA292E;">For support, Please contact us:</span><br>
{LEVELS}
</div>
<div style="margin-top: -10px;">
<span style="color: #AA292E;">For cashless claims:</span><br>
Share a valid ID with this E-card at the Hospital Insurance Desk.
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,149 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
@media print {
body {
margin: 0;
padding: 0;
}
.ecard-container {
width: 97%;
display: flex;
justify-content: center;
gap: 10px;
padding-top: 35px;
margin-left: 10px;
}
.ecard-section {
width: 50%;
min-height: 255px;
padding-left: 15px;
font-size: 13px;
background-size: 100% 100%;
}
.front, .back {
break-inside: avoid;
page-break-inside: avoid;
}
}
@media screen {
.ecard-container {
display: flex;
justify-content: center;
gap: 10px;
width: 840px;
}
.ecard-section {
width: 420px;
min-height: 255px;
padding-left: 15px;
font-size: 13px;
background-size: 100% 100%;
}
}
.label {
font-family: sans-serif;
font-weight: bold;
min-width: 100px; /* Adjust based on your needs */
}
.text-wrap {
font-family: sans-serif;
word-wrap: break-word;
white-space: normal;
}
</style>
</head>
<body>
<div class="ecard-container">
<div class="ecard-section front" style="background-image: url('{FRONT_CARD}');">
<div style="margin-left: 111px; margin-top: 35px; line-height: 18px; font-size: 10px;">
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Name</span>
<span style="margin-left: 53px;">:</span>
</div>
<div class="text-wrap">{NAME}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Gender</span>
<span style="margin-left: 45px;">:</span>
</div>
<div class="text-wrap">{GENDER}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>D.O.B</span>
<span style="margin-left: 53px;">:</span>
</div>
<div class="text-wrap">{DOB}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Relationship</span>
<span style="margin-left: 21px;">:</span>
</div>
<div class="text-wrap">{RELATION}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Policy No</span>
<span style="margin-left: 36px;">:</span>
</div>
<div class="text-wrap">{POLICY_NO}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>TPA/UHID</span>
<span style="margin-left: 36px;">:</span>
</div>
<div class="text-wrap">{TPA_ID}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Policy Start Date</span>
<span style="margin-left: 3px;">:</span>
</div>
<div class="text-wrap">{POLICY_START_DATE}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Policy End Date</span>
<span style="margin-left: 8px;">:</span>
</div>
<div class="text-wrap">{POLICY_DATE}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>Insurer</span>
<span style="margin-left: 49px;">:</span>
</div>
<div class="text-wrap">{INSURER_NAME}</div>
</div>
<div style="display: flex; gap: 3px;">
<div class="label">
<span>TPA</span>
<span style="margin-left: 63px;">:</span>
</div>
<div class="text-wrap">{TPA_NAME}</div>
</div>
</div>
</div>
<div class="ecard-section back" style="background-image: url('{BACK_CARD}');">
<div style="padding-left: 20px; margin-left: 90px; margin-top: 25px;">
<div style="font-size: 10px;">
<span style="color: #AA292E; font-family: sans-serif;">For support, Please contact us:</span> <br>
{LEVELS}
</div>
<div style="font-size: 10px;">
<span style="color: #AA292E; font-family: sans-serif;">For cashless claims:</span><br>
<span style="font-family: sans-serif;">Share a valid ID with this E-card at the Hospital Insurance Desk.</span><br><br><br>
</div>
</div>
</div>
</div>
</body>
</html>