From 8d47a6d9c993998cc1fb8fa4bc04d2685abc2de4 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Wed, 28 May 2025 14:27:48 +0530 Subject: [PATCH] FEAT_NONEB_TERMS,AUTO_SAVE,EDLI-GDLI_TERMS_SRI --- app/Controllers/ClientController.php | 263 +++- app/Controllers/LeadsController.php | 15 +- app/Controllers/TicketController.php | 3 +- app/Views/bds_dash.php | 3 +- app/Views/claims_dash.php | 9 +- app/Views/client_onboarding.php | 2 +- app/Views/client_policy.php | 18 +- app/Views/leads_dash.php | 6 +- app/Views/other_policy_terms.php | 445 +++--- app/Views/policy_gmc_terms.php | 1952 ++++++++++++++------------ app/Views/policy_gpa_terms.php | 62 + app/Views/rfq/blu.php | 4 +- app/Views/rfq/bsu.php | 4 +- app/Views/rfq/burglary.php | 4 +- app/Views/ticket_list.php | 9 +- app/Views/view_rfq_non_eb.php | 73 +- 16 files changed, 1639 insertions(+), 1233 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 968fc9f9..50546278 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -2302,52 +2302,109 @@ class ClientController extends AdminController // print_r($data);die; - $data['waiverofpreexistingdiseases'] = $this->request->getPost("waiverofpreexistingdiseases"); - $data['waiverof1,2,3&4thyearexclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions"); - $data['waiverof30dayswaitingperiod'] = $this->request->getPost("waiverof30dayswaitingperiod"); - $data['waiver_of_90_days_waiting_period'] = $this->request->getPost("waiver_of_90_days_waiting_period"); - $data['waiver_of_other_waiting_periods'] = $this->request->getPost("waiver_of_other_waiting_periods"); - $data['maternity_benefit'] = $this->request->getPost("maternity_benefit"); - $data['9monthwaitingperiodwaived'] = str_replace(',', '', $this->request->getPost("9monthwaitingperiodwaived")); - $data['maternitycoverage'] = str_replace(',', '', $this->request->getPost("maternitycoverage")); - $data['twindelivery'] = str_replace(',', '', $this->request->getPost("twindelivery")); - $data['well_baby_well_mother_expenses'] = str_replace(',', '', $this->request->getPost("well_baby_well_mother_expenses")); - $data['preandpostnatal'] = str_replace(',', '', $this->request->getPost("preandpostnatal")); - $data['infertility_treatment_coverage'] = str_replace(',', '', $this->request->getPost("infertility_treatment_coverage")); - $data['babyday1cover'] = str_replace(',', '', $this->request->getPost("babyday1cover")); - $data['coverfromthedateofjoining'] = str_replace(',', '', $this->request->getPost("coverfromthedateofjoining")); - $data['mid_term_addition_of_new_born_newly_wedded_spouse'] = str_replace(',', '', $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse")); - $data['prehospitalizationcover'] = str_replace(',', '', $this->request->getPost("prehospitalizationcover")); - $data['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover"); - $data['congenitaldiseasesinternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesinternal")); - $data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal")); - $data['copayzonewisecopay'] = $this->request->getPost("copayzonewisecopay"); - $data['roomrentlimit'] = str_replace(',', '', $this->request->getPost("roomrentlimit")); - $data['icu_limit'] = str_replace(',', '', $this->request->getPost("icu_limit")); - $data['proportionatedeductionclause'] = str_replace(',', '', $this->request->getPost("proportionatedeductionclause")); - $data['ailmentcapping'] = $this->request->getPost("ailmentcapping"); - $data['ailment_capping_details'] = str_replace(',', '', $this->request->getPost("ailment_capping_details")); - $data['corporatebuffer'] = str_replace(',', '', $this->request->getPost("corporatebuffer")); - $data['non_admissible_contingency_corporate_buffer'] = str_replace(',', '', $this->request->getPost("non_admissible_contingency_corporate_buffer")); - $data['ambulancecharges'] = str_replace(',', '', $this->request->getPost("ambulancecharges")); - $data['airambulance'] = str_replace(',', '', $this->request->getPost("airambulance")); - $data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges")); - $data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment")); - $data['lasiksurgery'] = str_replace(',', '', $this->request->getPost("lasiksurgery")); - $data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover")); - $data['moderntreatmentsasperirdai'] = str_replace(',', '', $this->request->getPost("moderntreatmentsasperirdai")); - $data['opd_treatment'] = str_replace(',', '', $this->request->getPost("opd_treatment")); - $data['days_of_discharge'] = str_replace(',', '', $this->request->getPost("days_of_discharge")); - $data['days_from_dod'] = str_replace(',', '', $this->request->getPost("days_from_dod")); - $data['terrorism'] = str_replace(',', '', $this->request->getPost("terrorism")); - $data['widower_cover'] = str_replace(',', '', $this->request->getPost("widower_cover")); - $data['breavement_cover'] = str_replace(',', '', $this->request->getPost("breavement_cover")); + // $data['waiverofpreexistingdiseases'] = $this->request->getPost("waiverofpreexistingdiseases"); + // $data['waiverof1,2,3&4thyearexclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions"); + // $data['waiverof30dayswaitingperiod'] = $this->request->getPost("waiverof30dayswaitingperiod"); + // $data['waiver_of_90_days_waiting_period'] = $this->request->getPost("waiver_of_90_days_waiting_period"); + // $data['waiver_of_other_waiting_periods'] = $this->request->getPost("waiver_of_other_waiting_periods"); + // $data['maternity_benefit'] = $this->request->getPost("maternity_benefit"); + // $data['9monthwaitingperiodwaived'] = str_replace(',', '', $this->request->getPost("9monthwaitingperiodwaived")); + // $data['maternitycoverage'] = str_replace(',', '', $this->request->getPost("maternitycoverage")); + // $data['twindelivery'] = str_replace(',', '', $this->request->getPost("twindelivery")); + // $data['well_baby_well_mother_expenses'] = str_replace(',', '', $this->request->getPost("well_baby_well_mother_expenses")); + // $data['preandpostnatal'] = str_replace(',', '', $this->request->getPost("preandpostnatal")); + // $data['infertility_treatment_coverage'] = str_replace(',', '', $this->request->getPost("infertility_treatment_coverage")); + // $data['babyday1cover'] = str_replace(',', '', $this->request->getPost("babyday1cover")); + // $data['coverfromthedateofjoining'] = str_replace(',', '', $this->request->getPost("coverfromthedateofjoining")); + // $data['mid_term_addition_of_new_born_newly_wedded_spouse'] = str_replace(',', '', $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse")); + // $data['prehospitalizationcover'] = str_replace(',', '', $this->request->getPost("prehospitalizationcover")); + // $data['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover"); + // $data['congenitaldiseasesinternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesinternal")); + // $data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal")); + // $data['copayzonewisecopay'] = $this->request->getPost("copayzonewisecopay"); + // $data['roomrentlimit'] = str_replace(',', '', $this->request->getPost("roomrentlimit")); + // $data['icu_limit'] = str_replace(',', '', $this->request->getPost("icu_limit")); + // $data['proportionatedeductionclause'] = str_replace(',', '', $this->request->getPost("proportionatedeductionclause")); + // $data['ailmentcapping'] = $this->request->getPost("ailmentcapping"); + // $data['ailment_capping_details'] = str_replace(',', '', $this->request->getPost("ailment_capping_details")); + // $data['corporatebuffer'] = str_replace(',', '', $this->request->getPost("corporatebuffer")); + // $data['non_admissible_contingency_corporate_buffer'] = str_replace(',', '', $this->request->getPost("non_admissible_contingency_corporate_buffer")); + // $data['ambulancecharges'] = str_replace(',', '', $this->request->getPost("ambulancecharges")); + // $data['airambulance'] = str_replace(',', '', $this->request->getPost("airambulance")); + // $data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges")); + // $data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment")); + // $data['lasiksurgery'] = str_replace(',', '', $this->request->getPost("lasiksurgery")); + // $data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover")); + // $data['moderntreatmentsasperirdai'] = str_replace(',', '', $this->request->getPost("moderntreatmentsasperirdai")); + // $data['opd_treatment'] = str_replace(',', '', $this->request->getPost("opd_treatment")); + // $data['days_of_discharge'] = str_replace(',', '', $this->request->getPost("days_of_discharge")); + // $data['days_from_dod'] = str_replace(',', '', $this->request->getPost("days_from_dod")); + // $data['terrorism'] = str_replace(',', '', $this->request->getPost("terrorism")); + // $data['widower_cover'] = str_replace(',', '', $this->request->getPost("widower_cover")); + // $data['breavement_cover'] = str_replace(',', '', $this->request->getPost("breavement_cover")); - $data['suminsuredenhancement'] = str_replace(',', '', $this->request->getPost("suminsuredenhancement")); + // $data['suminsuredenhancement'] = str_replace(',', '', $this->request->getPost("suminsuredenhancement")); - $data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? []; - $data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? []; - $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? []; + // $data['special_condition_label'] = str_replace(',', '', $this->request->getPost("special_condition_label")) ?? []; + // $data['special_condition_input'] = str_replace(',', '', $this->request->getPost("special_condition_input")) ?? []; + // $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? []; + $fields = [ + 'waiverofpreexistingdiseases' => false, + 'waiverof1,2,3&4thyearexclusions' => false, + 'waiverof30dayswaitingperiod' => false, + 'waiver_of_90_days_waiting_period' => false, + 'waiver_of_other_waiting_periods' => false, + 'maternity_benefit' => false, + '9monthwaitingperiodwaived' => true, + 'maternitycoverage' => true, + 'twindelivery' => true, + 'well_baby_well_mother_expenses' => true, + 'preandpostnatal' => true, + 'infertility_treatment_coverage' => true, + 'babyday1cover' => true, + 'coverfromthedateofjoining' => true, + 'mid_term_addition_of_new_born_newly_wedded_spouse' => true, + 'prehospitalizationcover' => true, + 'posthospitalizationcover' => false, + 'congenitaldiseasesinternal' => true, + 'congenitaldiseasesexternal' => true, + 'copayzonewisecopay' => false, + 'roomrentlimit' => true, + 'icu_limit' => true, + 'proportionatedeductionclause' => true, + 'ailmentcapping' => false, + 'ailment_capping_details' => true, + 'corporatebuffer' => true, + 'non_admissible_contingency_corporate_buffer' => true, + 'ambulancecharges' => true, + 'airambulance' => true, + 'reasonableandcustomarycharges' => true, + 'daycaretreatment' => true, + 'lasiksurgery' => true, + 'ayudhtreatmentcover' => true, + 'moderntreatmentsasperirdai' => true, + 'opd_treatment' => true, + 'days_of_discharge' => true, + 'days_from_dod' => true, + 'terrorism' => true, + 'widower_cover' => true, + 'breavement_cover' => true, + 'suminsuredenhancement' => true, + 'special_condition_label' => true, + 'special_condition_input' => true, + 'multiple_sum_insured' => true, + ]; + + // $data = []; + + foreach ($fields as $field => $needsCleanup) { + $value = $this->request->getPost($field); + + if ($value !== null && $value !== '') { + $data[$field] = $needsCleanup ? str_replace(',', '', $value) : $value; + } + } + $data['enrollment_display_key'] = $this->enrollmentGMCDisplayValueTransform(); @@ -2616,33 +2673,79 @@ class ClientController extends AdminController $data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age"); $data['is_payable_employee']['self'] = 0; - $data['accidentalDeathBenefit'] = str_replace(',', '', $this->request->getPost("accidentalDeathBenefit")); - $data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement")); - $data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement"); - $data['temporaryTotalDisablementBenefit'] = $this->request->getPost("temporaryTotalDisablementBenefit"); - $data['medical_expenses_medical_extension'] = str_replace(',', '', $this->request->getPost("medical_expenses_medical_extension")); - $data['opd_treatment_cover'] = str_replace(',', '', $this->request->getPost("opd_treatment_cover")); - $data['ambulanceCharges'] = str_replace(',', '', $this->request->getPost("ambulanceCharges")); - $data['repatriation_of_mortal_remains'] = str_replace(',', '', $this->request->getPost("repatriation_of_mortal_remains")); - $data['childrenEducationWelfareFund'] = str_replace(',', '', $this->request->getPost("childrenEducationWelfareFund")); - $data['terrorism'] = $this->request->getPost("terrorism"); - $data['worldwideCover'] = $this->request->getPost("worldwideCover"); - $data['family_transportation_benefits'] = $this->request->getPost("family_transportation_benefits"); - $data['fractures_dislocation_burns'] = $this->request->getPost("fractures_dislocation_burns"); - $data['coma'] = $this->request->getPost("coma"); - $data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody"); - $data['compassionateVisitExpenses'] = $this->request->getPost("compassionateVisitExpenses"); - $data['travel_expenses_for_medical_treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment"); - $data['daily_cash_allowance'] = $this->request->getPost("daily_cash_allowance"); - $data['artifical_limb_and_prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis"); - $data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite"); - $data['air_ambulance'] = $this->request->getPost("air_ambulance"); + // $data['accidentalDeathBenefit'] = str_replace(',', '', $this->request->getPost("accidentalDeathBenefit")); + // $data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement")); + // $data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement"); + // $data['temporaryTotalDisablementBenefit'] = $this->request->getPost("temporaryTotalDisablementBenefit"); + // $data['medical_expenses_medical_extension'] = str_replace(',', '', $this->request->getPost("medical_expenses_medical_extension")); + // $data['opd_treatment_cover'] = str_replace(',', '', $this->request->getPost("opd_treatment_cover")); + // $data['ambulanceCharges'] = str_replace(',', '', $this->request->getPost("ambulanceCharges")); + // $data['repatriation_of_mortal_remains'] = str_replace(',', '', $this->request->getPost("repatriation_of_mortal_remains")); + // $data['childrenEducationWelfareFund'] = str_replace(',', '', $this->request->getPost("childrenEducationWelfareFund")); + // $data['terrorism'] = $this->request->getPost("terrorism"); + // $data['worldwideCover'] = $this->request->getPost("worldwideCover"); + // $data['family_transportation_benefits'] = $this->request->getPost("family_transportation_benefits"); + // $data['fractures_dislocation_burns'] = $this->request->getPost("fractures_dislocation_burns"); + // $data['coma'] = $this->request->getPost("coma"); + // $data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody"); + // $data['compassionateVisitExpenses'] = $this->request->getPost("compassionateVisitExpenses"); + // $data['travel_expenses_for_medical_treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment"); + // $data['daily_cash_allowance'] = $this->request->getPost("daily_cash_allowance"); + // $data['artifical_limb_and_prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis"); + // $data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite"); + // $data['air_ambulance'] = $this->request->getPost("air_ambulance"); - $data['gpa_special_condition_label'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_label")) ?? []; - $data['gpa_special_condition_input'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_input")) ?? []; - $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? []; + // $data['gpa_special_condition_label'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_label")) ?? []; + // $data['gpa_special_condition_input'] = str_replace(',', '', $this->request->getPost("gpa_special_condition_input")) ?? []; + // $data['multiple_sum_insured'] = str_replace(',', '', $this->request->getPost("multiple_sum_insured")) ?? []; + $fieldsWithCommaRemoval = [ + 'accidentalDeathBenefit', + 'permanentTotalDisablement', + 'medical_expenses_medical_extension', + 'opd_treatment_cover', + 'ambulanceCharges', + 'repatriation_of_mortal_remains', + 'childrenEducationWelfareFund', + 'gpa_special_condition_label', + 'gpa_special_condition_input', + 'multiple_sum_insured', + ]; + + $fieldsWithoutCommaRemoval = [ + 'permanentPartialDisablement', + 'temporaryTotalDisablementBenefit', + 'terrorism', + 'worldwideCover', + 'family_transportation_benefits', + 'fractures_dislocation_burns', + 'coma', + 'carriageOfDeadBody', + 'compassionateVisitExpenses', + 'travel_expenses_for_medical_treatment', + 'daily_cash_allowance', + 'artifical_limb_and_prosthesis', + 'animalSnakeInsectBite', + 'air_ambulance' + ]; + + // Remove commas and assign if present + foreach ($fieldsWithCommaRemoval as $field) { + $value = $this->request->getPost($field); + if ($value !== null) { + $data[$field] = str_replace(',', '', $value); + } + } + + // Direct assign if present + foreach ($fieldsWithoutCommaRemoval as $field) { + $value = $this->request->getPost($field); + if ($value !== null) { + $data[$field] = $value; + } + } + $data['enrollment_display_key'] = $this->enrollmentGPADisplayValueTransform(); // print_r($data); die; @@ -3268,11 +3371,29 @@ class ClientController extends AdminController $client_policy_id = $this->request->getPost("client_policy_id"); $policy_terms = $this->request->getPost("policy_terms"); + $policy_terms = json_decode($policy_terms, true); - if (!empty($policy_terms)) { - $policy_terms = json_decode($policy_terms, true); + $data = []; + + foreach ($policy_terms as $key => $value) { + + if (str_ends_with($key, '_display')) { + + $original_key = substr($key, 0, -8); + + $newKey = implode(' ', array_map('ucfirst', explode('_', $original_key))); + + $data['enrollment_display_key'][$newKey] = $policy_terms[$original_key] ?? " "; + + } else { + + $data[$key] = $value; + } + } + + if (!empty($data)) { $policy_terms['is_payable_employee']['self'] = 0; - $policy_terms = json_encode($policy_terms); + $policy_terms = json_encode($data); } diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 77a6ba81..bb0e45f6 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -2874,6 +2874,7 @@ class LeadsController extends BaseController $JSON = json_decode($QCRData['json'], true); $converted_json = $this->transformProposelData($JSON, $proposel_data['proposel_name'], $proposel_data['insurer_name']); + // log_message('error', 'Converted JSON: ' . json_encode($converted_json)); return $this->convertQCRJsonToPolicyTerms($converted_json, $data['policy_type_id'], $proposel_data['proposel_name'], $proposel_data['insurer_name']); } catch (\Throwable $e) { $this->myLogger->logme('error','preparePolicyTermsFromRFQ'); @@ -2925,7 +2926,7 @@ class LeadsController extends BaseController foreach ($dataRow['data'] as $cellData) { $parentth = $cellData['parentth'] ?? ''; $subth = $cellData['subth'] ?? ''; - $input_value = $cellData['input_value'] ?? ''; + $input_value = $cellData['input_value'] != "" ? $cellData['input_value'] : ($cellData['value'] ?? ''); $value = $cellData['value'] ?? ''; // Skip unwanted keys @@ -2937,7 +2938,9 @@ class LeadsController extends BaseController // CASE 1: Handle special conditions case str_starts_with($item, 'special_condition') && $parentth === $proposel_name && $subth === $insurer_name: + // log_message("error","INPUT".json_encode($input_value)); $parts = explode('-', $input_value); + $labelKey = $policy_type == 1 ? 'gpa_special_condition_label' : 'special_condition_label'; $inputKey = $policy_type == 1 ? 'gpa_special_condition_input' : 'special_condition_input'; @@ -3015,7 +3018,15 @@ class LeadsController extends BaseController // Set the value directly, overwriting with latest encountered if (!empty($item) && !empty($value)) { - $terms_array[$item] = $value; + + $finalItem = $item; + + if (strpos($tableGroup['tableId'], 'summary') !== false) { + $policy_type = explode('_', $tableGroup['tableId'])[0] ?? ''; + $finalItem = $policy_type . ' - ' . $item; + + } + $terms_array[$finalItem] = $value; } } } diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 005bebc4..15c2fad6 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -188,6 +188,7 @@ class TicketController extends BaseController } else { $isFromDashboard = $this->request->getPost("is_dashboard"); + log_message('error', 'Is From Dashboard: ' . $isFromDashboard); if (isset($isFromDashboard) && !empty($isFromDashboard)){ $data['page_name'] = "Claims"; @@ -223,7 +224,7 @@ class TicketController extends BaseController public function ticketSearch($action = null) { $db = db_connect(); - + // log_message('error', 'Ticket Search Action: ' . $action); $subquery = $db->table('ticket_master tm') ->select([ 'tm.id AS ticket_id', diff --git a/app/Views/bds_dash.php b/app/Views/bds_dash.php index 4afc8015..0544e646 100644 --- a/app/Views/bds_dash.php +++ b/app/Views/bds_dash.php @@ -243,7 +243,8 @@ function linkRedirectForBDS(input, team) console.log(link); if(link){ - window.location.href = link; + + window.open(link, '_blank'); } } diff --git a/app/Views/claims_dash.php b/app/Views/claims_dash.php index 64e5c5e6..c62af2ab 100644 --- a/app/Views/claims_dash.php +++ b/app/Views/claims_dash.php @@ -268,8 +268,8 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team( } function linkRedirectForClaims(ticketTypeId, status,ids) { - $('.loader').fadeIn(); - $('.loader-mask').fadeIn(); + // $('.loader').fadeIn(); + // $('.loader-mask').fadeIn(); // $.ajax({ // url: "", // type: "POST", @@ -305,13 +305,14 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team( - redirectWithPost("", data); + redirectWithPost2("", data); } - function redirectWithPost(url, data = {}) { + function redirectWithPost2(url, data = {}) { const form = document.createElement('form'); form.method = 'POST'; form.action = url; + form.target = '_blank'; for (const key in data) { if (data.hasOwnProperty(key)) { diff --git a/app/Views/client_onboarding.php b/app/Views/client_onboarding.php index 6434057b..c7c64bb0 100755 --- a/app/Views/client_onboarding.php +++ b/app/Views/client_onboarding.php @@ -179,7 +179,7 @@ body { } function client_policies() { - var check_client_id = $('#general_PrimaryKey'); + var check_client_id = $('#general_PrimaryKey').val(); if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){ diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index cbe4f817..4af506d9 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -136,7 +136,7 @@ -
+
-
+
-
+
-
+
- +
- +
@@ -405,10 +405,10 @@ label { id="9monthwaitingperiodwaived_display" class="unchecked" checked>
- +
- +
@@ -418,7 +418,7 @@ label { id="maternitycoverage_display" class="unchecked" checked>
- +
@@ -431,7 +431,7 @@ label { id="twindelivery_display" class="unchecked" checked>
- +
@@ -457,7 +457,7 @@ label { id="preandpostnatal_display" class="unchecked" checked>
- +
@@ -483,7 +483,7 @@ label { id="babyday1cover_display" class="unchecked" checked>
- +
@@ -496,7 +496,7 @@ label { id="coverfromthedateofjoining_display" class="unchecked" checked>
- +
- +
- +
- +
@@ -564,7 +564,7 @@ label { id="congenitaldiseasesexternal_display" class="unchecked" checked>
- +
- +
@@ -617,7 +617,7 @@ label { id="proportionatedeductionclause_display" class="unchecked" checked>
- +
@@ -643,7 +643,7 @@ label { id="ailment_capping_details_display" class="unchecked" checked>
- +
@@ -656,7 +656,7 @@ label { id="corporatebuffer_display" class="unchecked" checked>
- +
@@ -683,7 +683,7 @@ label { id="ambulancecharges_display" class="unchecked" checked>
- +
@@ -696,7 +696,7 @@ label { id="airambulance_display" class="unchecked" checked>
- +
@@ -735,7 +735,7 @@ label { id="lasiksurgery_display" class="unchecked" checked>
- +
@@ -744,14 +744,14 @@ label {
- +
- +
@@ -761,7 +761,7 @@ label { id="moderntreatmentsasperirdai_display" class="unchecked" checked>
- +
- +
@@ -801,7 +801,7 @@ label { id="days_from_dod_display" class="unchecked" checked>
- +
@@ -817,7 +817,7 @@ label {
- +
@@ -849,7 +849,7 @@ label {
- +
@@ -880,584 +880,191 @@ label { + + + + + + + + + - - - - - - - - - \ No newline at end of file diff --git a/app/Views/policy_gpa_terms.php b/app/Views/policy_gpa_terms.php index 3ad9d2be..0424063f 100755 --- a/app/Views/policy_gpa_terms.php +++ b/app/Views/policy_gpa_terms.php @@ -784,6 +784,7 @@ $('body').on('click', '.btnPolicyMaster', function() { .next()[0]; $(element).css("display", ""); } + disableUnwantedTermsforGPA(jsonObject); Object.keys(jsonObject).forEach(function(key) { @@ -853,6 +854,34 @@ $('body').on('click', '.btnPolicyMaster', function() { \ No newline at end of file diff --git a/app/Views/rfq/blu.php b/app/Views/rfq/blu.php index c1dccbcb..09f7a164 100644 --- a/app/Views/rfq/blu.php +++ b/app/Views/rfq/blu.php @@ -11,11 +11,11 @@
> - +
> - +
diff --git a/app/Views/rfq/bsu.php b/app/Views/rfq/bsu.php index c1dccbcb..09f7a164 100644 --- a/app/Views/rfq/bsu.php +++ b/app/Views/rfq/bsu.php @@ -11,11 +11,11 @@
> - +
> - +
diff --git a/app/Views/rfq/burglary.php b/app/Views/rfq/burglary.php index c1dccbcb..09f7a164 100644 --- a/app/Views/rfq/burglary.php +++ b/app/Views/rfq/burglary.php @@ -11,11 +11,11 @@
> - +
> - +
diff --git a/app/Views/ticket_list.php b/app/Views/ticket_list.php index d3408054..b81836f1 100644 --- a/app/Views/ticket_list.php +++ b/app/Views/ticket_list.php @@ -297,11 +297,12 @@ $(document).ready(function() { function viewTicket(ticket_id){ - $('.loader').fadeIn(); - $('.loader-mask').fadeIn(); + // $('.loader').fadeIn(); + // $('.loader-mask').fadeIn(); + + let url = '' + ticket_id; + window.open(url, '_blank'); - let url = '' + ticket_id - window.location.href = url } diff --git a/app/Views/view_rfq_non_eb.php b/app/Views/view_rfq_non_eb.php index 183a1bb1..aa289999 100644 --- a/app/Views/view_rfq_non_eb.php +++ b/app/Views/view_rfq_non_eb.php @@ -295,6 +295,7 @@ " /> +
@@ -629,6 +630,27 @@ myModal = new bootstrap.Modal(document.getElementById('policyRegisterModel')); // monitorTableChanges(); }); + + $(document).ready(function () { + + console.log("Document ready"); + + let lead_status = ''; + console.log('Lead status retrieved:', lead_status); + + if (lead_status != "won") { + console.log("Lead status is not 'won', setting interval for submitData"); + + setInterval(function () { + console.log("Calling submitData(1) at 20-second interval"); + saveRFQ(true); + }, 20000); + } else { + console.log("Lead status is 'won', submitData will not be called"); + } + }); + + var tableCount = 0; const policies = ; // // console.log('policies', policies); @@ -2473,10 +2495,7 @@ table_type: "new", table_id: `${policyName}_summary_` + locationIndex, table_editable: true, - table_name: "Risk Location " + locationIndex + "- " + - storedData.locations[i].policyRisk['occupancy'] + "- " + - storedData.locations[i].policyRisk['address1'] + " " + - storedData.locations[i].policyRisk['address2'], + table_name: "Risk Location " + locationIndex, table_row_contents: rowContents }); } @@ -2548,17 +2567,17 @@ return null; // If canceled, return null } - function saveRFQ() { + function saveRFQ(isAutoSave = false) { // alert("Function Called"); isSaved = true; // // console.log("save button clicked"); leadJson = tablesToJson(); - // // console.log("json from function ", leadJson); + console.log("json from function ", leadJson); var policyJson = localStorage.getItem("policyData") ?? null; - saveRFQTODB(leadJson, policyJson); + saveRFQTODB(leadJson, policyJson, isAutoSave); } - function saveRFQTODB(tableJSON, policyJson) { + function saveRFQTODB(tableJSON, policyJson,isAutoSave = false) { let submit_type = "RFQ" if(rfq_or_qcr == 2){submit_type = 'QCR'} @@ -2570,9 +2589,20 @@ registration_json: policyJson } + let rfq_primaryKey = $('#rfq_primaryKey').val(); + + if (isAutoSave) { + formData['rfq_primaryKey'] = rfq_primaryKey; + } + var url = ''; - $('.loader').fadeIn(); - $('.loader-mask').fadeIn(); + + if (!isAutoSave) { + + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + } + $.ajax({ url: url, @@ -2583,24 +2613,27 @@ console.log('RFQ NON EB FORM SUBMIT RESPONSE : ', response); if (response.status == true) { - localStorage.removeItem('policyData'); - toastr.success(response.message, "Success"); - // // console.log(rfq_data.length); - $('.actionBtns').show(); - if (rfq_or_qcr == 2) { - $("#openQCR").hide(); + if (!isAutoSave) { + + localStorage.removeItem('policyData'); + + $('.actionBtns').show(); + if (rfq_or_qcr == 2) { + $("#openQCR").hide(); + } } - // window.location.reload(); } else { toastr.error(response.message, "Error"); $('.actionBtns').hide(); } - $('.loader').fadeOut(); - $('.loader-mask').delay(350).fadeOut('slow'); - window.location.reload(); + if (!isAutoSave) { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + window.location.reload(); + } }, error: function(xhr, status, error) { $('.loader').fadeOut();