MERGE_LIVE_SI_MAPPING_ISSUE
This commit is contained in:
commit
a19731f82f
@ -2071,9 +2071,12 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------- POLICY TREMS ------------------------------------------------------------------------------------
|
||||
|
||||
public function policyGMCTerms()
|
||||
{
|
||||
try {
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($this->request->getPost());die;
|
||||
$this->myLogger->logme('error', 'Terms CREATE function called');
|
||||
@ -2083,7 +2086,6 @@ class ClientController extends AdminController
|
||||
|
||||
$data['sum_insured'] = str_replace(',', '', $this->request->getPost("sum_insured"));
|
||||
$data['family_floater'] = $this->request->getPost("family_floater") ? $this->request->getPost("family_floater") : 0;
|
||||
// $data['corporatebuffer'] = $this->request->getPost("corporatebuffer") ? $this->request->getPost("corporatebuffer") : 0;
|
||||
$data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];
|
||||
|
||||
$data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age") ? $this->request->getPost("self_min_age") : 0;
|
||||
@ -2101,12 +2103,9 @@ class ClientController extends AdminController
|
||||
$data['is_payable_employee']['elders'] = $this->request->getPost("is_payable_employee_for_elders") ? 1 : 0;
|
||||
|
||||
|
||||
|
||||
// if (!in_array("self", $data['family_floaters'])) {
|
||||
// array_unshift($data['family_floaters'], "self");
|
||||
// }
|
||||
$temp_family_floaters = $data['family_floaters'];
|
||||
$data['family_floaters'] = [];
|
||||
|
||||
if (in_array("self", $temp_family_floaters) == 1) {
|
||||
$data['family_floaters']['self'] = 1;
|
||||
} else {
|
||||
@ -2119,8 +2118,6 @@ class ClientController extends AdminController
|
||||
$data['family_floaters']['spouse'] = 0;
|
||||
}
|
||||
|
||||
// $data['family_floaters']['either-parents-pil'] =0;
|
||||
|
||||
if (count($temp_family_floaters)) {
|
||||
$children_value = 0;
|
||||
$value = 0;
|
||||
@ -2179,79 +2176,55 @@ class ClientController extends AdminController
|
||||
// print_r($data);die;
|
||||
|
||||
$data['waiverofpreexistingdiseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
if ($data['waiverofpreexistingdiseases'] == 1) {
|
||||
$data['maternitycoverage'] = str_replace(',', '', $this->request->getPost("maternitycoverage"));
|
||||
$data['twindelivery'] = str_replace(',', '', $this->request->getPost("twindelivery"));
|
||||
$data['preandpostnatal'] = str_replace(',', '', $this->request->getPost("preandpostnatal"));
|
||||
$data['babyday1cover'] = str_replace(',', '', $this->request->getPost("babyday1cover"));
|
||||
} else {
|
||||
$data['maternitycoverage'] = "";
|
||||
$data['twindelivery'] = "";
|
||||
$data['preandpostnatal'] = "";
|
||||
$data['babyday1cover'] = "";
|
||||
}
|
||||
|
||||
$data['9monthwaitingperiodwaived'] = str_replace(',', '', $this->request->getPost("9monthwaitingperiodwaived"));
|
||||
$data['coverfromthedateofjoining'] = str_replace(',', '', $this->request->getPost("coverfromthedateofjoining"));
|
||||
$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['posthospitalizationcover'] =$this->request->getPost("posthospitalizationcover");
|
||||
$data['congenitaldiseasesinternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesinternal"));
|
||||
// $data['congenitaldiseasesexternal'] =$this->request->getPost("congenitaldiseasesexternal");
|
||||
$data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal"));
|
||||
$data['copayzonewisecopay'] = $this->request->getPost("copayzonewisecopay");
|
||||
$data['co_pay_details'] = str_replace(',', '', $this->request->getPost("co_pay_details"));
|
||||
|
||||
$data['bioabsorbablestenttoriclensmultifocallens'] = $this->request->getPost("bioabsorbablestenttoriclensmultifocallens");
|
||||
$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['nursingallowance'] =str_replace(',', '',$this->request->getPost("nursingallowance"));
|
||||
$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['familytransportationbenefit'] = str_replace(',', '', $this->request->getPost("familytransportationbenefit"));
|
||||
$data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges"));
|
||||
$data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment"));
|
||||
$data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover"));
|
||||
|
||||
$data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal"));
|
||||
// $data['optionalparentalcopay'] = str_replace(',', '', $this->request->getPost("optionalparentalcopay"));
|
||||
$data['posthospitalizationcover'] = str_replace(',', '', $this->request->getPost("posthospitalizationcover"));
|
||||
$data['corporatebuffer'] = str_replace(',', '', $this->request->getPost("corporatebuffer"));
|
||||
$data['sublimitofcorporatebuffer'] = str_replace(',', '', $this->request->getPost("sublimitofcorporatebuffer"));
|
||||
|
||||
if ($data['ayudhtreatmentcover'] == 1) {
|
||||
$data['ayushTreatmentCoverData'] = str_replace(',', '', $this->request->getPost("ayushTreatmentCoverData"));
|
||||
} else {
|
||||
$data['ayushTreatmentCoverData'] = "";
|
||||
}
|
||||
|
||||
$data['armdcovered'] = str_replace(',', '', $this->request->getPost("armdcovered"));
|
||||
$data['suminsuredenhancement'] = str_replace(',', '', $this->request->getPost("suminsuredenhancement"));
|
||||
$data['automaticsuminsuredreinstatement'] = str_replace(',', '', $this->request->getPost("automaticsuminsuredreinstatement"));
|
||||
$data['additionalsicknessbenefit'] = str_replace(',', '', $this->request->getPost("additionalsicknessbenefit"));
|
||||
$data['lasiksurgery'] = str_replace(',', '', $this->request->getPost("lasiksurgery"));
|
||||
$data['midterminclusion'] = str_replace(',', '', $this->request->getPost("midterminclusion"));
|
||||
$data['capd'] = str_replace(',', '', $this->request->getPost("capd"));
|
||||
$data['organdonorexpenses'] = str_replace(',', '', $this->request->getPost("organdonorexpenses"));
|
||||
$data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover"));
|
||||
$data['moderntreatmentsasperirdai'] = str_replace(',', '', $this->request->getPost("moderntreatmentsasperirdai"));
|
||||
$data['Wellness'] = str_replace(',', '', $this->request->getPost("Wellness"));
|
||||
$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['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['cataract'] = str_replace(',', '', $this->request->getPost("cataract"));
|
||||
|
||||
if ($data['cataract'] == 1) {
|
||||
$data['cataractData'] = str_replace(',', '', $this->request->getPost("cataractData"));
|
||||
} else {
|
||||
$data['cataractData'] = "";
|
||||
}
|
||||
$data['enrollment_display_key'] = $this->enrollmentGMCDisplayValueTransform();
|
||||
|
||||
// print_r($data);die;
|
||||
|
||||
$jsonData = json_encode($data);
|
||||
$dataa = array(
|
||||
@ -2260,7 +2233,6 @@ class ClientController extends AdminController
|
||||
|
||||
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
|
||||
|
||||
// print_r($data);die;
|
||||
if ($record) {
|
||||
$update = $this->clientPolicyModel->update($client_policy_id, $dataa);
|
||||
@ -2285,6 +2257,190 @@ 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("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 getterms()
|
||||
{
|
||||
$client_policy_id = $this->request->getVar('client_policy_id');
|
||||
@ -2337,52 +2493,32 @@ class ClientController extends AdminController
|
||||
$data['permanentTotalDisablement'] = str_replace(',', '', $this->request->getPost("permanentTotalDisablement"));
|
||||
$data['permanentPartialDisablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
$data['temporaryTotalDisablementBenefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
$data['accidentalHospitalizationExpenses'] = str_replace(',', '', $this->request->getPost("accidentalHospitalizationExpenses"));
|
||||
$data['childrenEducationWelfareFund'] = str_replace(',', '', $this->request->getPost("childrenEducationWelfareFund"));
|
||||
|
||||
$data['compassionateVisitExpenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
if ($data['compassionateVisitExpenses'] == 1) {
|
||||
$data['compassionateVisitExpensesData'] = $this->request->getPost("compassionateVisitExpensesData");
|
||||
} else {
|
||||
$data['compassionateVisitExpensesData'] = "";
|
||||
}
|
||||
|
||||
$data['brokenBoneExpenses'] = str_replace(',', '', $this->request->getPost("brokenBoneExpenses"));
|
||||
if ($data['brokenBoneExpenses'] == 1) {
|
||||
$data['brokenBoneExpensesData'] = str_replace(',', '', $this->request->getPost("brokenBoneExpensesData"));
|
||||
} else {
|
||||
$data['brokenBoneExpensesData'] = "";
|
||||
}
|
||||
|
||||
$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"));
|
||||
if ($data['ambulanceCharges'] == 1) {
|
||||
$data['ambulanceChargesData'] = str_replace(',', '', $this->request->getPost("ambulanceChargesData"));
|
||||
} else {
|
||||
$data['ambulanceChargesData'] = "";
|
||||
}
|
||||
|
||||
$data['burnExpenses'] = $this->request->getPost("burnExpenses");
|
||||
if ($data['burnExpenses'] == 1) {
|
||||
$data['burnExpensesData'] = $this->request->getPost("burnExpensesData");
|
||||
} else {
|
||||
$data['burnExpensesData'] = "";
|
||||
}
|
||||
|
||||
$data['carriageOfDeadBody'] = $this->request->getPost("carriageOfDeadBody");
|
||||
if ($data['carriageOfDeadBody'] == 1) {
|
||||
$data['carriageOfDeadBodyData'] = $this->request->getPost("carriageOfDeadBodyData");
|
||||
} else {
|
||||
$data['carriageOfDeadBodyData'] = "";
|
||||
}
|
||||
|
||||
$data['animalSnakeInsectBite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
$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['enrollment_display_key'] = $this->enrollmentGPADisplayValueTransform();
|
||||
|
||||
// print_r($data); die;
|
||||
|
||||
$jsonData = json_encode($data);
|
||||
$dataa = array(
|
||||
@ -2412,6 +2548,94 @@ 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 getPolicyGPATerms()
|
||||
{
|
||||
|
||||
@ -2426,6 +2650,8 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
|
||||
public function updateClientPolicyStatus()
|
||||
{
|
||||
|
||||
|
||||
@ -98,18 +98,59 @@ class DashboardController extends AdminController
|
||||
public function dashboard()
|
||||
{
|
||||
|
||||
$data = [];
|
||||
$data['page_name'] = 'Dashboard';
|
||||
|
||||
$results = $this->clientModel->select('clients.id as client_id, clients.client_name, clients.short_name,
|
||||
client_branch.id as client_branch_id, client_branch.branch_name,
|
||||
client_branch.branch_code, employees.id as employee_id,
|
||||
employees.name as employee_name, employees.relationship,
|
||||
employees.emp_code, employees.emp_status, auth_history.user_type, client_policy.policy_type_id, client_policy.id as client_policy_id')
|
||||
->join('client_branch', 'clients.id = client_branch.client_id', 'left')
|
||||
->join('client_policy', 'client_branch.id = client_policy.client_branch_id', 'left')
|
||||
->join('employees', 'client_branch.id = employees.client_branch_id', 'left')
|
||||
->join('auth_history', 'employees.id = auth_history.user_id AND "employee" = auth_history.user_type', 'left')
|
||||
->findAll();
|
||||
$db = db_connect();
|
||||
$sql = "SELECT
|
||||
clients.id AS client_id,
|
||||
clients.client_name,
|
||||
clients.short_name,
|
||||
client_branch.id AS client_branch_id,
|
||||
client_branch.branch_name,
|
||||
client_branch.branch_code,
|
||||
|
||||
COUNT(employees.id) AS total_employees,
|
||||
SUM(CASE WHEN employees.emp_status = 'draft' THEN 1 ELSE 0 END) AS draft_count,
|
||||
SUM(CASE WHEN employees.emp_status IN ('enrolled', 'active') THEN 1 ELSE 0 END) AS enrolled_count,
|
||||
|
||||
SUM(CASE WHEN auth_history.user_id IS NOT NULL THEN 1 ELSE 0 END) AS logged_in_count,
|
||||
SUM(CASE WHEN auth_history.user_id IS NULL THEN 1 ELSE 0 END) AS not_logged_in_count,
|
||||
|
||||
CASE
|
||||
WHEN EXISTS (
|
||||
SELECT 1 FROM client_policy
|
||||
WHERE client_policy.client_branch_id = client_branch.id
|
||||
AND client_policy.is_active = 1
|
||||
AND client_policy.open_for_enrollment = 1
|
||||
) THEN 1
|
||||
ELSE 0
|
||||
END AS open_or_close_enrollment
|
||||
|
||||
FROM clients
|
||||
LEFT JOIN client_branch ON clients.id = client_branch.client_id
|
||||
LEFT JOIN employees ON client_branch.id = employees.client_branch_id
|
||||
LEFT JOIN (
|
||||
SELECT user_id, user_type
|
||||
FROM auth_history
|
||||
WHERE user_type = 'employee'
|
||||
GROUP BY user_id
|
||||
) AS auth_history ON employees.id = auth_history.user_id
|
||||
|
||||
WHERE employees.relationship = 'Self'
|
||||
AND employees.emp_status IN ('draft', 'enrolled', 'active')
|
||||
AND employees.is_active = 1
|
||||
AND clients.is_active = 1
|
||||
AND client_branch.is_active = 1
|
||||
|
||||
GROUP BY clients.id, client_branch.id";
|
||||
|
||||
$query = $db->query($sql);
|
||||
$results = $query->getResultArray();
|
||||
|
||||
|
||||
$data['client_branch_emp_list'] = $results;
|
||||
$session = \Config\Services::session();
|
||||
$session->set('enrollment_data', json_encode($data));
|
||||
|
||||
// $pendingActionsController = new PendingActionsController;
|
||||
// $pendingActionsData = $pendingActionsController->getPendingActionsForDashBoard();
|
||||
@ -118,95 +159,6 @@ class DashboardController extends AdminController
|
||||
// $businessTeamStatusData = $this->data_construct_for_bds($businessTeamData);
|
||||
// $financeTeamStatusData = $this->data_construct_for_bds($financeTeamData);
|
||||
|
||||
$groupedData = [];
|
||||
|
||||
foreach ($results as $row) {
|
||||
$clientId = $row['client_id'];
|
||||
$clientName = $row['client_name'];
|
||||
$shortName = $row['short_name'];
|
||||
$branchId = $row['client_branch_id'];
|
||||
$branchName = $row['branch_name'];
|
||||
$branchCode = $row['branch_code'];
|
||||
|
||||
$clientPolicyId = $row['client_policy_id'];
|
||||
$policyTypeId = $row['policy_type_id'];
|
||||
$employeeId = '';
|
||||
if ($employeeId != $row['employee_id']) {
|
||||
$employeeId = $row['employee_id'];
|
||||
} else {
|
||||
$employeeId = null;
|
||||
}
|
||||
$employeeName = $row['employee_name'];
|
||||
$employeeRelationship = $row['relationship'];
|
||||
$employeeEmpCode = $row['emp_code'];
|
||||
$employeeEmpStatus = $row['emp_status'];
|
||||
$employeeUserType = $row['user_type'];
|
||||
|
||||
// Initialize the client entry if it doesn't exist
|
||||
if (!isset($groupedData[$clientId])) {
|
||||
$groupedData[$clientId] = [
|
||||
'client_id' => $clientId,
|
||||
'client_name' => $clientName,
|
||||
'short_name' => $shortName,
|
||||
'branches' => []
|
||||
];
|
||||
}
|
||||
|
||||
// Initialize the branch entry if it doesn't exist
|
||||
if (!isset($groupedData[$clientId]['branches'][$branchId])) {
|
||||
$groupedData[$clientId]['branches'][$branchId] = [
|
||||
'client_branch_id' => $branchId,
|
||||
'branch_name' => $branchName,
|
||||
'branch_code' => $branchCode,
|
||||
'emp_login' => 0,
|
||||
'emp_enroll' => 0,
|
||||
'client_policies' => [],
|
||||
'employees' => []
|
||||
];
|
||||
}
|
||||
|
||||
// Add the client policy to the branch's policies list if it exists, not already added, and policyTypeId is not equal to 1
|
||||
if ($clientPolicyId !== null && $policyTypeId != 1 && !in_array(['client_policy_id' => $clientPolicyId, 'policy_type_id' => $policyTypeId], $groupedData[$clientId]['branches'][$branchId]['client_policies'])) {
|
||||
$groupedData[$clientId]['branches'][$branchId]['client_policies'][] = [
|
||||
'client_policy_id' => $clientPolicyId,
|
||||
'policy_type_id' => $policyTypeId
|
||||
];
|
||||
}
|
||||
|
||||
// Append employee error to the branch's employees list if relationship is 'Self' and not already added
|
||||
$employeeKey = $employeeId . '-' . $employeeName; // unique key to identify an employee
|
||||
if ($employeeId !== null && $employeeRelationship == 'Self' && !isset($groupedData[$clientId]['branches'][$branchId]['employees'][$employeeKey])) {
|
||||
$groupedData[$clientId]['branches'][$branchId]['employees'][$employeeKey] = [
|
||||
'employee_id' => $employeeId,
|
||||
'employee_name' => $employeeName,
|
||||
'relationship' => $employeeRelationship,
|
||||
'emp_code' => $employeeEmpCode,
|
||||
'emp_status' => $employeeEmpStatus,
|
||||
'user_type' => $employeeUserType
|
||||
];
|
||||
if (!empty($employeeUserType)) {
|
||||
$groupedData[$clientId]['branches'][$branchId]['emp_login']++;
|
||||
}
|
||||
|
||||
// Increment emp_enroll if emp_status is not 'draft'
|
||||
if ($employeeEmpStatus !== 'draft') {
|
||||
$groupedData[$clientId]['branches'][$branchId]['emp_enroll']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Re-index the arrays to match the expected structure
|
||||
foreach ($groupedData as &$client) {
|
||||
foreach ($client['branches'] as &$branch) {
|
||||
$branch['employees'] = array_values($branch['employees']);
|
||||
}
|
||||
$client['branches'] = array_values($client['branches']);
|
||||
}
|
||||
|
||||
$data['client_branch_emp_list'] = $groupedData;
|
||||
$session = \Config\Services::session();
|
||||
$session->set('enrollment_data', json_encode($data));
|
||||
// echo "<pre>";
|
||||
// $data['pendingActionsData'] = $pendingActionsData;
|
||||
// $data['businessTeamCount'] = count($businessTeamData) ?? 0;
|
||||
// $data['financeTeamCount'] = count($financeTeamData) ?? 0;
|
||||
@ -214,9 +166,8 @@ class DashboardController extends AdminController
|
||||
// $data['financeTeamStatusData'] = $financeTeamStatusData;
|
||||
// $data['policyStatus'] = $this->policyStatus;
|
||||
// $data['colorShades'] = $this->colorShades;
|
||||
// dd($data);die;
|
||||
|
||||
$data['page_name'] = 'Dashboard';
|
||||
// dd($data);
|
||||
|
||||
echo view('layout/header', $data);
|
||||
echo view('DashBoard', $data);
|
||||
|
||||
@ -2199,12 +2199,17 @@ class EmployeeController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
//UPDATE EMPLOYEE
|
||||
public function update_emp_data()
|
||||
{
|
||||
helper('utility_helper');
|
||||
|
||||
$data = $this->request->getPost();
|
||||
// print_rr($data);die();
|
||||
// $data['dob'] = date('Y-m-d', strtotime($data['dob']));
|
||||
$data['dob'] = change_date_format($data['dob'], 'd/m/Y', 'Y-m-d');
|
||||
if (isset($data['dob'])) {
|
||||
$data['dob'] = change_date_format($data['dob'], null, 'Y-m-d');
|
||||
}
|
||||
// print_rr($data); die;
|
||||
|
||||
// Fetch current employee data
|
||||
@ -2212,14 +2217,17 @@ class EmployeeController extends AdminController
|
||||
|
||||
if ($employee_data['relationship'] == 'Self') {
|
||||
|
||||
if ($employee_data['gender'] != $data['gender']) {
|
||||
if (isset($data['gender'])) {
|
||||
|
||||
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
||||
$this->employeeModel
|
||||
->where('emp_code', $employee_data['emp_code'])
|
||||
->where('relationship', 'Spouse')
|
||||
->set(['gender' => $spouse_gender])
|
||||
->update();
|
||||
if ($employee_data['gender'] != $data['gender']) {
|
||||
|
||||
$spouse_gender = ($data['gender'] == 'M') ? 'F' : 'M';
|
||||
$this->employeeModel
|
||||
->where('emp_code', $employee_data['emp_code'])
|
||||
->where('relationship', 'Spouse')
|
||||
->set(['gender' => $spouse_gender])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -115,64 +115,63 @@ class RestAuthenticationController extends AdminController
|
||||
$email = $this->request->getJSON()->email;
|
||||
|
||||
|
||||
$employeeData = $this->employeeModel->select('employees.relationship,EP.employee_id')
|
||||
->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.relationship', 'self')
|
||||
->where('employees.emp_status !=', 'truncated')
|
||||
->where('employees.email_corporate', $email)
|
||||
->where('EP.is_active', 1)
|
||||
->whereIn('EP.status', ['draft', 'enrolled'])
|
||||
->first();
|
||||
$employeeData = $this->employeeModel->select('
|
||||
employees.relationship,
|
||||
EP.employee_id,
|
||||
employees.client_id,
|
||||
employees.client_branch_id,
|
||||
employees.email_corporate
|
||||
|
||||
if (isset($employeeData['employee_id']))
|
||||
{
|
||||
')
|
||||
->join('employee_polices EP', 'EP.employee_id = employees.id', 'inner')
|
||||
->where('employees.is_active', 1)
|
||||
->where('employees.relationship', 'Self')
|
||||
->where('employees.emp_status !=', 'truncated')
|
||||
->where('employees.email_corporate', $email)
|
||||
->where('EP.is_active', 1)
|
||||
->whereIn('EP.status', ['draft', 'enrolled'])
|
||||
->first();
|
||||
|
||||
if (isset($employeeData['employee_id'])) {
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
|
||||
$update = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'self')
|
||||
->where('is_active', 1)->set(array('otp' => $otp ))
|
||||
->update();
|
||||
if($update)
|
||||
{
|
||||
$update = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'Self')
|
||||
->where('is_active', 1)->set(array('otp' => $otp))
|
||||
->update();
|
||||
if ($update) {
|
||||
|
||||
$common = [
|
||||
'client_id' => $employeeData['client_id'],
|
||||
'client_branch_id' => $employeeData['client_branch_id'],
|
||||
'client_policy_id' => null,
|
||||
'employee_policy_id' => null,
|
||||
'employee_id' => $employeeData['id'],
|
||||
'employee_id' => $employeeData['employee_id'],
|
||||
'mail_type' => 'otp_mail',
|
||||
];
|
||||
];
|
||||
$subject = 'Nhance user verification - OTP';
|
||||
$mail_content = $otp.' is your verification code for Nhance.';
|
||||
$res = MailHelper::send_email(['mail' => $employeeData['email_corporate'], 'subject' => $subject ,'common'=>$common ,'message' => $mail_content]);
|
||||
$mail_content = $otp . ' is your verification code for Nhance.';
|
||||
$res = MailHelper::send_email(['mail' => $employeeData['email_corporate'], 'subject' => $subject, 'common' => $common, 'message' => $mail_content]);
|
||||
$this->myLogger->logme("info", $res);
|
||||
|
||||
if(json_decode($res)->status == 'success')
|
||||
{
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
|
||||
}else{
|
||||
$result = ['user_verification' => false , 'message' => "Mail sending failed , try again"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
if (json_decode($res)->status == 'success') {
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200);
|
||||
} else {
|
||||
$result = ['user_verification' => false, 'message' => "Mail sending failed , try again"];
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
|
||||
}
|
||||
} else {
|
||||
|
||||
}else{
|
||||
|
||||
$result = ['user_verification' => false , 'message' => "Verification failed , try again"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
|
||||
$result = ['user_verification' => false, 'message' => "Verification failed , try again"];
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// Call the third-party API function
|
||||
return $this->callThirdPartyAPI($this->request->getJSON(),'verifyEmployeeEmailId');
|
||||
return $this->callThirdPartyAPI($this->request->getJSON(), 'verifyEmployeeEmailId');
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $th], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1124,19 +1124,26 @@ if (!function_exists('premium_calculation_manager'))
|
||||
}
|
||||
$temp_slab_rates = $slab_details[ $slab_index ]['slab_rates'];
|
||||
|
||||
//if curent action is dependent addition OR addition then pull insurer master to set whether add one day from employee date of coverage
|
||||
if($emp_data['temp']['action'] == 'DA' || $emp_data['temp']['action'] == 'A')
|
||||
{
|
||||
$insurer = new InsurerModel();
|
||||
$insurer = ($insurer->find($policy_terms['insurer_id']));
|
||||
if($insurer['addition_add_day'] == true)
|
||||
{
|
||||
// $emp_data['policy_details']['date_coverage'] = (new DateTime($emp_data['policy_details']['date_coverage']))->modify('+1 day')->format('Y-m-d');
|
||||
|
||||
$emp_data['policy_details']['date_coverage'] = isset($emp_data['policy_details']['date_coverage']) && $emp_data['policy_details']['date_coverage'] != '' && $emp_data['policy_details']['date_coverage'] != null ?
|
||||
(new DateTime($emp_data['policy_details']['date_coverage']))->modify('+1 day')->format('Y-m-d') : null ;
|
||||
}
|
||||
}
|
||||
// ------------"THIS PART HAS NO INSURER IN THE PRE-ENROLL, SO COMMENT OUT THIS PART (04-03-2025)."-------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// //if curent action is dependent addition OR addition then pull insurer master to set whether add one day from employee date of coverage
|
||||
// if($emp_data['temp']['action'] == 'DA' || $emp_data['temp']['action'] == 'A')
|
||||
// {
|
||||
// $insurer = new InsurerModel();
|
||||
// $insurer = ($insurer->find($policy_terms['insurer_id']));
|
||||
// if($insurer['addition_add_day'] == true)
|
||||
// {
|
||||
// // $emp_data['policy_details']['date_coverage'] = (new DateTime($emp_data['policy_details']['date_coverage']))->modify('+1 day')->format('Y-m-d');
|
||||
|
||||
// $emp_data['policy_details']['date_coverage'] = isset($emp_data['policy_details']['date_coverage']) && $emp_data['policy_details']['date_coverage'] != '' && $emp_data['policy_details']['date_coverage'] != null ?
|
||||
// (new DateTime($emp_data['policy_details']['date_coverage']))->modify('+1 day')->format('Y-m-d') : null ;
|
||||
// }
|
||||
// }
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// dd($emp_data);
|
||||
$is_match_found = false;
|
||||
$gst = isset($policy_terms['gst']) && $policy_terms['gst'] != 0 ? $policy_terms['gst'] : 18;
|
||||
|
||||
@ -544,6 +544,10 @@ if (!function_exists('change_date_format')) {
|
||||
'Y/m/d', // 2024/12/01
|
||||
'Y.m.d', // 2024.12.01
|
||||
'Y,m,d', // 2024,12,01
|
||||
|
||||
'd/m/Y', // 01/01/2025
|
||||
'd-m-Y', // 01-01-2025
|
||||
|
||||
];
|
||||
|
||||
try {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
<div class="tab-pane active show" id="pending-actions-dash-tab" style="/*padding-left: 35px;*/padding-right: 35px;">
|
||||
<div class="row visa_status_count_view">
|
||||
<div class="col-12">
|
||||
<div class="card" style="border: 0px;height: 470px;">
|
||||
<div class="card-body status-option" id="statusContent" style="padding: 0.5rem !important;background-color: white;">
|
||||
<div class="card-body status-option" id="statusContent"
|
||||
style="padding: 0.5rem !important;background-color: white;">
|
||||
<!-- Search Input Field -->
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
@ -14,7 +14,8 @@
|
||||
</div>
|
||||
<div class="col-5"></div>
|
||||
<div class="col-4">
|
||||
<input type="text" id="searchInput" class="search-input" placeholder="Search by client or branch">
|
||||
<input type="text" id="searchInput" class="search-input"
|
||||
placeholder="Search by client or branch">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Carousel Structure -->
|
||||
@ -25,36 +26,46 @@
|
||||
$currentItem = 0; // Counter for items
|
||||
$isActive = true; // Variable to set the first item as active
|
||||
foreach ($client_branch_emp_list as $clients) {
|
||||
foreach ($clients['branches'] as $branches) {
|
||||
|
||||
// Start a new carousel item if needed
|
||||
if ($currentItem % $itemsPerSlide == 0) {
|
||||
if (!$isActive) echo '</div>'; // Close previous carousel item
|
||||
echo '<div class="carousel-item' . ($isActive ? ' active' : '') . '">';
|
||||
$isActive = false;
|
||||
}
|
||||
if(count($branches['client_policies']) != 0){ ?>
|
||||
<!-- New Card Layout for each item -->
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item" data-client="<?php echo $clients['short_name']; ?>" data-branch="<?php echo $branches['branch_name']; ?>">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random" >
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 " >
|
||||
<h3 class="my-2 py-1" ><span data-plugin="counterup" style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;" onclick="enrollment_list(this, 'emp_count_view_click')"><?php echo isset($branches['employees']) ? count($branches['employees']) : '0'; ?></span></h3>
|
||||
</div>
|
||||
echo '<div class="carousel-item' . ($isActive ? ' active' : '') . '">';
|
||||
$isActive = false;
|
||||
}
|
||||
?>
|
||||
<!-- New Card Layout for each item -->
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item"
|
||||
data-client="<?php echo $clients['short_name']; ?>"
|
||||
data-branch="<?php echo $clients['branch_name']; ?>">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random">
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 ">
|
||||
<h3 class="my-2 py-1"><span data-plugin="counterup"
|
||||
style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;"
|
||||
onclick="enrollment_list(this, 'emp_count_view_click')"><?php echo isset($clients['total_employees']) ? $clients['total_employees'] : '0'; ?></span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100" >
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info" style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;"><?php echo isset($clients['short_name']) ? $clients['short_name'] : 'N/A'; ?> - <?php echo isset($branches['branch_name']) ? $branches['branch_name'] : 'N/A'; ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100">
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info"
|
||||
style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;">
|
||||
<?php echo isset($clients['short_name']) ? $clients['short_name'] : 'N/A'; ?>
|
||||
-
|
||||
<?php echo isset($clients['branch_name']) ? $clients['branch_name'] : 'N/A'; ?>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 text-center" >
|
||||
<p class="mb-0 text-muted">
|
||||
@ -64,50 +75,76 @@
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<input type="text" class="client_id"
|
||||
value="<?php echo $clients['client_id']; ?>" hidden>
|
||||
<input type="text" class="client_branch_id"
|
||||
value="<?php echo $clients['client_branch_id'] ?>" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click">
|
||||
<span style="font-size: large;color: black !important;"
|
||||
class="number_css"
|
||||
onclick="enrollment_list(this, 'emp_logged_in_view_click')"><?php echo isset($clients['logged_in_count']) ? $clients['logged_in_count'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap "
|
||||
style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click">
|
||||
<span style="font-size: large;color: black !important;"
|
||||
class="number_css"
|
||||
onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"><?php echo isset($clients['not_logged_in_count']) ? $clients['not_logged_in_count'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap"
|
||||
style="color: currentColor;font-size: 15px;margin-left: -13px;">Not
|
||||
Logged-In</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" >
|
||||
<input type="text" class="client_id" value="<?php echo $clients['client_id']; ?>" hidden>
|
||||
<input type="text" class="client_branch_id" value="<?php echo $branches['client_branch_id'] ?>" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_logged_in_view_click')"><?php echo isset($branches['emp_login']) ? $branches['emp_login'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap " style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"><?php echo isset($branches['emp_login']) ? count($branches['employees']) - $branches['emp_login'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;margin-left: -13px;">Not Logged-In</span>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click">
|
||||
<span style="font-size: large;color: black !important;"
|
||||
class="number_css"
|
||||
onclick="enrollment_list(this, 'emp_not_enrolled_view_click')"><?php echo isset($clients['draft_count']) ? $clients['draft_count'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap"
|
||||
style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_enrolled_view_click')"><?php echo isset($branches['emp_enroll']) ? count($branches['employees']) - $branches['emp_enroll'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_enrolled_view_click')"><?php echo isset($branches['emp_enroll']) ? $branches['emp_enroll'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click">
|
||||
<span style="font-size: large;color: black !important;"
|
||||
class="number_css"
|
||||
onclick="enrollment_list(this, 'emp_enrolled_view_click')"><?php echo isset($clients['enrolled_count']) ? $clients['enrolled_count'] : '0'; ?></span><br>
|
||||
<span class="text-nowrap"
|
||||
style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
</div>
|
||||
<?php
|
||||
$currentItem++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($currentItem % $itemsPerSlide != 0) echo '</div>'; // Close the last carousel item
|
||||
?>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" style="width: 28px;"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg> <!-- <img src="<?php echo base_url()?>public/assets/images/left_arrow.png" alt="<"> -->
|
||||
<a class="carousel-control-prev" href="#carouselExampleControls" role="button"
|
||||
data-slide="prev">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" style="width: 28px;">
|
||||
<!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" />
|
||||
</svg>
|
||||
<!-- <img src="<?php echo base_url() ?>public/assets/images/left_arrow.png" alt="<"> -->
|
||||
<!-- <span class="carousel-control-prev-icon" aria-hidden="true"></span> -->
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" style="width: 28px;"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg>
|
||||
<a class="carousel-control-next" href="#carouselExampleControls" role="button"
|
||||
data-slide="next">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" style="width: 28px;">
|
||||
<!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
|
||||
<path
|
||||
d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z" />
|
||||
</svg>
|
||||
<!-- <span class="carousel-control-next-icon" aria-hidden="true"></span> -->
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
@ -119,435 +156,418 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var lastDirection = ''; // Variable to keep track of the last direction
|
||||
|
||||
// Scroll functionality
|
||||
$('.scroll-container').on('wheel', function(e) {
|
||||
if (e.originalEvent.deltaY < 0) {
|
||||
this.scrollLeft -= 100; // Adjust scroll speed
|
||||
} else {
|
||||
this.scrollLeft += 100; // Adjust scroll speed
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
var lastDirection = ''; // Variable to keep track of the last direction
|
||||
|
||||
// Search functionality
|
||||
$('#searchInput').on('input', function() {
|
||||
var searchValue = $(this).val().toLowerCase();
|
||||
var firstVisibleItem = null;
|
||||
// Scroll functionality
|
||||
$('.scroll-container').on('wheel', function(e) {
|
||||
if (e.originalEvent.deltaY < 0) {
|
||||
this.scrollLeft -= 100; // Adjust scroll speed
|
||||
} else {
|
||||
this.scrollLeft += 100; // Adjust scroll speed
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('.scroll-item').each(function() {
|
||||
var itemText = $(this).find('h5').text().toLowerCase();
|
||||
// Search functionality
|
||||
$('#searchInput').on('input', function() {
|
||||
var searchValue = $(this).val().toLowerCase();
|
||||
var firstVisibleItem = null;
|
||||
|
||||
if (itemText.indexOf(searchValue) > -1) {
|
||||
$(this).removeClass('hide-item').addClass('show-item'); // Show item
|
||||
$('.scroll-item').each(function() {
|
||||
var itemText = $(this).find('h5').text().toLowerCase();
|
||||
|
||||
if (!firstVisibleItem) {
|
||||
firstVisibleItem = $(this);
|
||||
if (itemText.indexOf(searchValue) > -1) {
|
||||
$(this).removeClass('hide-item').addClass('show-item'); // Show item
|
||||
|
||||
if (!firstVisibleItem) {
|
||||
firstVisibleItem = $(this);
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass('show-item').addClass('hide-item'); // Hide item
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass('show-item').addClass('hide-item'); // Hide item
|
||||
});
|
||||
|
||||
if (firstVisibleItem) {
|
||||
// Remove active class from all carousel items
|
||||
$('.carousel-item').removeClass('active');
|
||||
|
||||
// Add active class to the parent carousel item of the first visible item
|
||||
firstVisibleItem.closest('.carousel-item').addClass('active');
|
||||
|
||||
// Scroll to the first visible item
|
||||
$('html, body').animate({
|
||||
scrollTop: firstVisibleItem.offset().top
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
|
||||
if (firstVisibleItem) {
|
||||
// Remove active class from all carousel items
|
||||
$('.carousel-item').removeClass('active');
|
||||
function navigateCarousel(direction) {
|
||||
lastDirection = direction; // Track the direction
|
||||
var $carousel = $('#carouselExampleControls');
|
||||
var $activeItem = $carousel.find('.carousel-item.active');
|
||||
|
||||
// Add active class to the parent carousel item of the first visible item
|
||||
firstVisibleItem.closest('.carousel-item').addClass('active');
|
||||
|
||||
// Scroll to the first visible item
|
||||
$('html, body').animate({
|
||||
scrollTop: firstVisibleItem.offset().top
|
||||
}, 500);
|
||||
if (direction === 'next') {
|
||||
if ($activeItem.find('.scroll-item').length === 0) {
|
||||
$carousel.carousel('next');
|
||||
setTimeout(checkEmptyCarouselItem, 100); // Check after slide transition
|
||||
} else {
|
||||
$carousel.carousel('next');
|
||||
}
|
||||
} else if (direction === 'prev') {
|
||||
if ($activeItem.find('.scroll-item').length === 0) {
|
||||
$carousel.carousel('prev');
|
||||
setTimeout(checkEmptyCarouselItem, 100); // Check after slide transition
|
||||
} else {
|
||||
$carousel.carousel('prev');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function navigateCarousel(direction) {
|
||||
lastDirection = direction; // Track the direction
|
||||
var $carousel = $('#carouselExampleControls');
|
||||
var $activeItem = $carousel.find('.carousel-item.active');
|
||||
function checkEmptyCarouselItem() {
|
||||
var $carousel = $('#carouselExampleControls');
|
||||
var $activeItem = $carousel.find('.carousel-item.active');
|
||||
|
||||
if (direction === 'next') {
|
||||
// Check if the active item is empty
|
||||
if ($activeItem.find('.scroll-item').length === 0) {
|
||||
$carousel.carousel('next');
|
||||
setTimeout(checkEmptyCarouselItem, 100); // Check after slide transition
|
||||
} else {
|
||||
$carousel.carousel('next');
|
||||
}
|
||||
} else if (direction === 'prev') {
|
||||
if ($activeItem.find('.scroll-item').length === 0) {
|
||||
$carousel.carousel('prev');
|
||||
setTimeout(checkEmptyCarouselItem, 100); // Check after slide transition
|
||||
} else {
|
||||
$carousel.carousel('prev');
|
||||
// If empty, move to the next item
|
||||
$carousel.carousel(lastDirection === 'next' ? 'next' : 'prev');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkEmptyCarouselItem() {
|
||||
var $carousel = $('#carouselExampleControls');
|
||||
var $activeItem = $carousel.find('.carousel-item.active');
|
||||
|
||||
// Check if the active item is empty
|
||||
if ($activeItem.find('.scroll-item').length === 0) {
|
||||
// If empty, move to the next item
|
||||
$carousel.carousel(lastDirection === 'next' ? 'next' : 'prev');
|
||||
}
|
||||
}
|
||||
|
||||
// Attach click handlers to carousel controls
|
||||
$('.carousel-control-next').on('click', function() {
|
||||
navigateCarousel('next');
|
||||
$('.carousel-item').each(function(index, element) {
|
||||
if ($.trim($(element).html()) === '') {
|
||||
$(element).remove();
|
||||
}
|
||||
// Attach click handlers to carousel controls
|
||||
$('.carousel-control-next').on('click', function() {
|
||||
navigateCarousel('next');
|
||||
$('.carousel-item').each(function(index, element) {
|
||||
if ($.trim($(element).html()) === '') {
|
||||
$(element).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.carousel-control-prev').on('click', function() {
|
||||
navigateCarousel('prev');
|
||||
$('.carousel-item').each(function(index, element) {
|
||||
if ($.trim($(element).html()) === '') {
|
||||
$(element).remove();
|
||||
}
|
||||
$('.carousel-control-prev').on('click', function() {
|
||||
navigateCarousel('prev');
|
||||
$('.carousel-item').each(function(index, element) {
|
||||
if ($.trim($(element).html()) === '') {
|
||||
$(element).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Check the carousel item when the slide changes
|
||||
$('#carouselExampleControls').on('slid.bs.carousel', function() {
|
||||
// Check the carousel item when the slide changes
|
||||
$('#carouselExampleControls').on('slid.bs.carousel', function() {
|
||||
checkEmptyCarouselItem();
|
||||
});
|
||||
|
||||
// Initial check for empty carousel items
|
||||
checkEmptyCarouselItem();
|
||||
});
|
||||
|
||||
// Initial check for empty carousel items
|
||||
checkEmptyCarouselItem();
|
||||
});
|
||||
|
||||
|
||||
function enrollment_list(current_element, type) {
|
||||
var clientId = $(current_element).closest('.carousel-slide-item').find('.client_id').val();
|
||||
var branchId = $(current_element).closest('.carousel-slide-item').find('.client_branch_id').val();
|
||||
|
||||
var baseUrl = '<?php echo base_url(); ?>'; // Adjust this to your actual base URL if needed
|
||||
var url = baseUrl + 'employee/enrollment-list'; // Change this to the actual URL of your enroller_list page
|
||||
|
||||
var params = new URLSearchParams({
|
||||
client_id: clientId,
|
||||
branch_id: branchId,
|
||||
type: type
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
random_color_set();
|
||||
});
|
||||
|
||||
// Redirect to the constructed URL with parameters
|
||||
window.location.href = `${url}?${params.toString()}`;
|
||||
}
|
||||
$('#enrollment_status_open_close').change(function() {
|
||||
|
||||
if ($(this).val() === 'open') {
|
||||
|
||||
var enrollment_data = '<?php echo addslashes(json_encode($client_branch_emp_list, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT)); ?>';
|
||||
|
||||
console.log('Raw enrollment_data:', enrollment_data);
|
||||
|
||||
|
||||
$('#enrollment_status_open_close').change(function () {
|
||||
if ($(this).val() === 'open') {
|
||||
var enrollment_data = '<?php echo addslashes($_SESSION['enrollment_data']); ?>';
|
||||
try {
|
||||
// Parse JSON data
|
||||
var data = JSON.parse(enrollment_data);
|
||||
console.log('Parsed data:', data);
|
||||
|
||||
// Ensure data is an object and client_branch_emp_list is treated as an array
|
||||
if (data && typeof data === 'object') {
|
||||
if (Array.isArray(data.client_branch_emp_list)) {
|
||||
console.log('client_branch_emp_list:', data.client_branch_emp_list);
|
||||
updateCarouselWithData(data, 1);
|
||||
} else {
|
||||
// Convert client_branch_emp_list to an array if it's not already
|
||||
if (data.client_branch_emp_list && typeof data.client_branch_emp_list === 'object') {
|
||||
// If it's an object but not an array, wrap it in an array
|
||||
data.client_branch_emp_list = [data.client_branch_emp_list];
|
||||
} else {
|
||||
// Handle the case where it's neither an array nor an object
|
||||
console.error('client_branch_emp_list is not an array or object:', data.client_branch_emp_list);
|
||||
data.client_branch_emp_list = []; // Ensure it is at least an empty array
|
||||
}
|
||||
|
||||
console.log('Converted client_branch_emp_list:', data.client_branch_emp_list);
|
||||
updateCarouselWithData(data, 1);
|
||||
try {
|
||||
// Ensure enrollment_data is not empty or invalid
|
||||
if (!enrollment_data || enrollment_data === 'null' || enrollment_data === '""') {
|
||||
throw new Error('Invalid JSON data received.');
|
||||
}
|
||||
} else {
|
||||
console.error('Parsed data is not an object:', data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error parsing JSON:', e);
|
||||
}
|
||||
} else {
|
||||
// Fetch the session data from PHP
|
||||
var enrollment_data = '<?php echo addslashes($_SESSION['enrollment_data']); ?>';
|
||||
try {
|
||||
// Parse JSON data
|
||||
var data = JSON.parse(enrollment_data);
|
||||
console.log('Parsed data:', data);
|
||||
|
||||
// Ensure data is an object and client_branch_emp_list is treated as an array
|
||||
if (data && typeof data === 'object') {
|
||||
if (Array.isArray(data.client_branch_emp_list)) {
|
||||
console.log('client_branch_emp_list:', data.client_branch_emp_list);
|
||||
updateCarouselWithData(data, 2);
|
||||
} else {
|
||||
// Convert client_branch_emp_list to an array if it's not already
|
||||
if (data.client_branch_emp_list && typeof data.client_branch_emp_list === 'object') {
|
||||
// If it's an object but not an array, wrap it in an array
|
||||
data.client_branch_emp_list = [data.client_branch_emp_list];
|
||||
} else {
|
||||
// Handle the case where it's neither an array nor an object
|
||||
console.error('client_branch_emp_list is not an array or object:', data.client_branch_emp_list);
|
||||
data.client_branch_emp_list = []; // Ensure it is at least an empty array
|
||||
}
|
||||
// Parse JSON data
|
||||
var data = JSON.parse(enrollment_data);
|
||||
console.log('Parsed data:', data);
|
||||
|
||||
console.log('Converted client_branch_emp_list:', data.client_branch_emp_list);
|
||||
updateCarouselWithData(data, 2);
|
||||
// Ensure parsed data is always treated as an array
|
||||
if (!Array.isArray(data)) {
|
||||
data = data && typeof data === 'object' ? [data] : [];
|
||||
}
|
||||
} else {
|
||||
console.error('Parsed data is not an object:', data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error parsing JSON:', e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function updateCarouselWithData(data, open_close) {
|
||||
var itemsPerSlide = 3; // Number of items per slide
|
||||
var currentItem = 0; // Counter for items
|
||||
var isActive = true; // Variable to set the first item as active
|
||||
var carouselInner = $('.carousel-inner');
|
||||
|
||||
// Clear existing carousel items
|
||||
carouselInner.empty();
|
||||
|
||||
// Check if data.client_branch_emp_list is valid
|
||||
if (Array.isArray(data.client_branch_emp_list) && data.client_branch_emp_list.length > 0) {
|
||||
console.log("Processing array...");
|
||||
// Handle the case where data.client_branch_emp_list is an array
|
||||
var items = data.client_branch_emp_list[0];
|
||||
console.log("Items data:", items);
|
||||
|
||||
// Convert items object to an array
|
||||
var client_list = Object.values(items);
|
||||
|
||||
// Validate if client_list is an array
|
||||
if (Array.isArray(client_list)) {
|
||||
console.log(client_list);
|
||||
for (var i = 0; i < client_list.length; i++) {
|
||||
var client = client_list[i];
|
||||
// console.log(item.branches);
|
||||
var branch_list = client.branches;
|
||||
for (var j = 0; j < branch_list.length; j++) {
|
||||
var branch = branch_list[j];
|
||||
console.log(branch);
|
||||
|
||||
if(open_close == 1){
|
||||
if(branch.client_policies.length > 0){
|
||||
if (currentItem % itemsPerSlide === 0) {
|
||||
if (!isActive) carouselInner.append('</div>'); // Close previous carousel item
|
||||
carouselInner.append('<div class="carousel-item' + (isActive ? ' active' : '') + '">');
|
||||
isActive = false;
|
||||
}
|
||||
// Generate HTML for each item
|
||||
var itemHtml = `
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item" data-client="${client.short_name}" data-branch="${branch.branch_name }">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random" >
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 " >
|
||||
<h3 class="my-2 py-1" ><span data-plugin="counterup" style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;" onclick="enrollment_list(this, 'emp_count_view_click')">${branch.employees.length}</span></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100" >
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info" style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;">${client.short_name} - ${branch.branch_name} </h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 text-center" >
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success mr-2"></span>
|
||||
<span class="text-nowrap">Emp Count</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" >
|
||||
<input type="text" class="client_id" value="${client.client_id}" hidden>
|
||||
<input type="text" class="client_branch_id" value="${branch.client_branch_id}" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_logged_in_view_click')">${branch.emp_login}</span><br>
|
||||
<span class="text-nowrap " style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"> ${branch.employees.length - (branch.emp_login || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;margin-left: -13px;">Not Logged-In</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_enrolled_view_click')">${branch.employees.length - (branch.emp_enroll || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_enrolled_view_click')">${(branch.emp_enroll || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
carouselInner.find('.carousel-item').last().append(itemHtml);
|
||||
currentItem++;
|
||||
}
|
||||
}else{
|
||||
if(branch.client_policies.length == 0){
|
||||
if (currentItem % itemsPerSlide === 0) {
|
||||
if (!isActive) carouselInner.append('</div>'); // Close previous carousel item
|
||||
carouselInner.append('<div class="carousel-item' + (isActive ? ' active' : '') + '">');
|
||||
isActive = false;
|
||||
}
|
||||
// Generate HTML for each item
|
||||
var itemHtml = `
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item" data-client="${client.short_name}" data-branch="${branch.branch_name }">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random" >
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 " >
|
||||
<h3 class="my-2 py-1" ><span data-plugin="counterup" style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;" onclick="enrollment_list(this, 'emp_count_view_click')">${branch.employees.length}</span></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100" >
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info" style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;">${client.short_name} - ${branch.branch_name} </h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 text-center" >
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success mr-2"></span>
|
||||
<span class="text-nowrap">Emp Count</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" >
|
||||
<input type="text" class="client_id" value="${client.client_id}" hidden>
|
||||
<input type="text" class="client_branch_id" value="${branch.client_branch_id}" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_logged_in_view_click')">${branch.emp_login}</span><br>
|
||||
<span class="text-nowrap " style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"> ${branch.employees.length - (branch.emp_login || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;margin-left: -13px;">Not Logged-In</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_enrolled_view_click')">${branch.employees.length - (branch.emp_enroll || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_enrolled_view_click')">${(branch.emp_enroll || 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
carouselInner.find('.carousel-item').last().append(itemHtml);
|
||||
currentItem++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Create a new carousel item every `itemsPerSlide` items
|
||||
console.log('Final client_branch_emp_list:', data);
|
||||
updateCarouselWithData(data, 1);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error parsing JSON:', error.message, error);
|
||||
}
|
||||
|
||||
// Close the last carousel item if it was opened
|
||||
if (currentItem % itemsPerSlide !== 0) carouselInner.append('</div>');
|
||||
} else {
|
||||
console.error('Expected an array for items, but got:', client_list);
|
||||
|
||||
// Fetch the session data from PHP
|
||||
var enrollment_data = '<?php echo addslashes(json_encode($client_branch_emp_list, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT)); ?>';
|
||||
console.log('Raw enrollment_data:', enrollment_data);
|
||||
|
||||
try {
|
||||
// Ensure enrollment_data is valid before parsing
|
||||
if (!enrollment_data || enrollment_data === 'null' || enrollment_data === '""') {
|
||||
throw new Error('Invalid JSON data received.');
|
||||
}
|
||||
|
||||
// Parse JSON data
|
||||
var data = JSON.parse(enrollment_data);
|
||||
console.log('Parsed data:', data);
|
||||
|
||||
// Ensure `data` is always an array
|
||||
data = Array.isArray(data) ? data : (data && typeof data === 'object' ? [data] : []);
|
||||
|
||||
console.log('Final client_branch_emp_list:', data);
|
||||
updateCarouselWithData(data, 2);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error parsing JSON:', error.message, error);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (typeof data.client_branch_emp_list === 'object') {
|
||||
console.error('client_branch_emp_list is an object, not an array:', data.client_branch_emp_list);
|
||||
} else {
|
||||
console.error('client_branch_emp_list is missing or not in the expected format:', data.client_branch_emp_list);
|
||||
}
|
||||
random_color_set();
|
||||
|
||||
// Initialize or refresh carousel if needed
|
||||
$('#carouselExampleControls').carousel('dispose').carousel();
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
random_color_set();
|
||||
});
|
||||
|
||||
function remove_empty_carousel() {
|
||||
|
||||
}
|
||||
|
||||
function random_color_set() {
|
||||
// Array of predefined colors
|
||||
var colors = ['#EBE8FF', '#FFECE5', '#FFE8F5'];
|
||||
// '#6ADBE3'
|
||||
// Array of predefined background images
|
||||
var images = [
|
||||
'/public/assets/images/mask_group.png',
|
||||
'/public/assets/images/mask_group_orange.png',
|
||||
'/public/assets/images/mask_group_pink.png',
|
||||
];
|
||||
// '/public/assets/images/mask_group_blue.png'
|
||||
|
||||
// Counter to keep track of the current index
|
||||
var index = 0;
|
||||
|
||||
// Base URL for the images
|
||||
var baseUrl = '<?php echo base_url() ?>';
|
||||
|
||||
// Apply a color and image from the arrays to each card-header in sequence
|
||||
document.querySelectorAll('.add_card_background_random').forEach(function(header) {
|
||||
header.style.backgroundColor = colors[index % colors.length];
|
||||
header.style.backgroundImage = `url(${baseUrl + images[index % images.length]})`;
|
||||
header.style.backgroundSize = 'cover'; // Ensure the image covers the entire div
|
||||
header.style.backgroundPosition = 'center'; // Center the image within the div
|
||||
index++;
|
||||
});
|
||||
}
|
||||
|
||||
function enrollment_list(current_element, type) {
|
||||
var clientId = $(current_element).closest('.carousel-slide-item').find('.client_id').val();
|
||||
var branchId = $(current_element).closest('.carousel-slide-item').find('.client_branch_id').val();
|
||||
|
||||
var baseUrl = '<?php echo base_url(); ?>'; // Adjust this to your actual base URL if needed
|
||||
var url = baseUrl + 'employee/enrollment-list'; // Change this to the actual URL of your enroller_list page
|
||||
|
||||
var params = new URLSearchParams({
|
||||
client_id: clientId,
|
||||
branch_id: branchId,
|
||||
type: type
|
||||
});
|
||||
|
||||
// Redirect to the constructed URL with parameters
|
||||
window.location.href = `${url}?${params.toString()}`;
|
||||
}
|
||||
|
||||
function updateCarouselWithData(data, open_close) {
|
||||
var itemsPerSlide = 3; // Number of items per slide
|
||||
var currentItem = 0; // Counter for items
|
||||
var isActive = true; // Variable to set the first item as active
|
||||
var carouselInner = $('.carousel-inner');
|
||||
|
||||
// Clear existing carousel items
|
||||
carouselInner.empty();
|
||||
|
||||
// Check if data.client_branch_emp_list is valid
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
|
||||
console.log("Processing array........................................");
|
||||
// Handle the case where data.client_branch_emp_list is an array
|
||||
var items = data[0];
|
||||
console.log("Items data:", items);
|
||||
|
||||
// Convert items object to an array
|
||||
var client_list = Object.values(items);
|
||||
|
||||
// Validate if client_list is an array
|
||||
if (Array.isArray(client_list)) {
|
||||
|
||||
console.log(client_list);
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
|
||||
let client = data[i];
|
||||
|
||||
if (open_close == 1 && client.open_or_close_enrollment == 1) {
|
||||
|
||||
if (currentItem % itemsPerSlide === 0) {
|
||||
if (!isActive) carouselInner.append('</div>'); // Close previous carousel item
|
||||
carouselInner.append('<div class="carousel-item' + (isActive ? ' active' : '') + '">');
|
||||
isActive = false;
|
||||
}
|
||||
// Generate HTML for each item
|
||||
var itemHtml = `
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item" data-client="${client.short_name}" data-branch="${client.branch_name }">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random" >
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 " >
|
||||
<h3 class="my-2 py-1" ><span data-plugin="counterup" style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;" onclick="enrollment_list(this, 'emp_count_view_click')">${client.total_employees}</span></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100" >
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info" style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;">${client.short_name} - ${client.branch_name} </h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 text-center" >
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success mr-2"></span>
|
||||
<span class="text-nowrap">Emp Count</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" >
|
||||
<input type="text" class="client_id" value="${client.client_id}" hidden>
|
||||
<input type="text" class="client_branch_id" value="${client.client_branch_id}" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_logged_in_view_click')">${client.logged_in_count ?? 0}</span><br>
|
||||
<span class="text-nowrap " style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"> ${client.not_logged_in_count ?? 0}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;margin-left: -13px;">Not Logged-In</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_enrolled_view_click')">${client.draft_count ?? 0}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_enrolled_view_click')">${(client.enrolled_count ?? 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
carouselInner.find('.carousel-item').last().append(itemHtml);
|
||||
currentItem++;
|
||||
|
||||
} else {
|
||||
|
||||
if (currentItem % itemsPerSlide === 0) {
|
||||
if (!isActive) carouselInner.append('</div>'); // Close previous carousel item
|
||||
carouselInner.append('<div class="carousel-item' + (isActive ? ' active' : '') + '">');
|
||||
isActive = false;
|
||||
}
|
||||
// Generate HTML for each item
|
||||
var itemHtml = `
|
||||
<div class="col-xl-3 col-md-6 d-inline-block scroll-item carousel-slide-item" data-client="${client.short_name}" data-branch="${client.branch_name }">
|
||||
<div class="card" style="box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);">
|
||||
<div class="card-header add_card_background_random" >
|
||||
<div class="row">
|
||||
<div class="col-8 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 " >
|
||||
<h3 class="my-2 py-1" ><span data-plugin="counterup" style="font-size: 2.0rem;background-color: white;border-radius: 6px;height: 30;padding: 4px 11px 4px 11px;" onclick="enrollment_list(this, 'emp_count_view_click')">${client.total_employees}</span></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100" >
|
||||
<h5 class="mt-0 text-truncate" title="Branch Info" style="font-weight: 400 !important;font-size: 20px !important;line-height: 36px;color: black !important;">${client.short_name} - ${client.branch_name} </h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-3 center_text emp-count-view-click" >
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-100 text-center" >
|
||||
<p class="mb-0 text-muted">
|
||||
<span class="text-success mr-2"></span>
|
||||
<span class="text-nowrap">Emp Count</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body" >
|
||||
<input type="text" class="client_id" value="${client.client_id}" hidden>
|
||||
<input type="text" class="client_branch_id" value="${client.client_branch_id}" hidden>
|
||||
<div class="row emp-status" style="margin-top: -9px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_logged_in_view_click')">${client.logged_in_count}</span><br>
|
||||
<span class="text-nowrap " style="color: currentColor;font-size: 15px;">Logged-In</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_logged_in_view_click')"> ${client.not_logged_in_count ?? 0}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;margin-left: -13px;">Not Logged-In</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row emp-status" style="margin-top: 5px;">
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_not_enrolled_view_click')">${client.draft_count ?? 0}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Draft</span>
|
||||
</div>
|
||||
<div class="col-6 emp-count-view-click" >
|
||||
<span style="font-size: large;color: black !important;" class="number_css" onclick="enrollment_list(this, 'emp_enrolled_view_click')">${(client.enrolled_count ?? 0)}</span><br>
|
||||
<span class="text-nowrap" style="color: currentColor;font-size: 15px;">Enrolled</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
carouselInner.find('.carousel-item').last().append(itemHtml);
|
||||
currentItem++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Close the last carousel item if it was opened
|
||||
if (currentItem % itemsPerSlide !== 0) carouselInner.append('</div>');
|
||||
|
||||
} else {
|
||||
console.error('Expected an array for items, but got:', client_list);
|
||||
}
|
||||
|
||||
} else if (typeof data === 'object') {
|
||||
console.error('client_branch_emp_list is an object, not an array:', data);
|
||||
} else {
|
||||
console.error('client_branch_emp_list is missing or not in the expected format:', data);
|
||||
}
|
||||
random_color_set();
|
||||
|
||||
// Initialize or refresh carousel if needed
|
||||
$('#carouselExampleControls').carousel('dispose'); // Properly dispose of the instance
|
||||
$('#carouselExampleControls').carousel(); // Reinitialize it
|
||||
|
||||
}
|
||||
|
||||
function random_color_set() {
|
||||
// Array of predefined colors
|
||||
var colors = ['#EBE8FF', '#FFECE5', '#FFE8F5'];
|
||||
// '#6ADBE3'
|
||||
// Array of predefined background images
|
||||
var images = [
|
||||
'/public/assets/images/mask_group.png',
|
||||
'/public/assets/images/mask_group_orange.png',
|
||||
'/public/assets/images/mask_group_pink.png',
|
||||
];
|
||||
// '/public/assets/images/mask_group_blue.png'
|
||||
|
||||
// Counter to keep track of the current index
|
||||
var index = 0;
|
||||
|
||||
// Base URL for the images
|
||||
var baseUrl = '<?php echo base_url() ?>';
|
||||
|
||||
// Apply a color and image from the arrays to each card-header in sequence
|
||||
document.querySelectorAll('.add_card_background_random').forEach(function(header) {
|
||||
header.style.backgroundColor = colors[index % colors.length];
|
||||
header.style.backgroundImage = `url(${baseUrl + images[index % images.length]})`;
|
||||
header.style.backgroundSize = 'cover'; // Ensure the image covers the entire div
|
||||
header.style.backgroundPosition = 'center'; // Center the image within the div
|
||||
index++;
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -52,6 +52,9 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var si_amt_parent_policy = new Set();
|
||||
var si_amt_base_policy = new Set();
|
||||
|
||||
function loadModal(client_policy_id, base_policy_id) {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
@ -65,7 +68,7 @@ function loadModal(client_policy_id, base_policy_id) {
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
};
|
||||
|
||||
var si_amt_base_policy = new Set();
|
||||
|
||||
|
||||
function checkExistingMapping(client_policy_id, base_policy_id) {
|
||||
$.ajax({
|
||||
@ -78,27 +81,17 @@ function checkExistingMapping(client_policy_id, base_policy_id) {
|
||||
success: function(response) {
|
||||
if (response.status === true && response.code === 200 && response.data.length > 0) {
|
||||
// Clear existing rows except the first one
|
||||
$('.si-mapping-row:not(:first)').remove();
|
||||
$('.si-mapping-row:not(:first)').empty();
|
||||
|
||||
// First, ensure base policy and parent policy data is loaded
|
||||
fetchBasePolicy(client_policy_id, base_policy_id);
|
||||
fetchParentPolicy(client_policy_id, base_policy_id);
|
||||
|
||||
// Wait for dropdowns to be populated
|
||||
setTimeout(() => {
|
||||
fetchBasePolicy(client_policy_id, base_policy_id).then(()=>{
|
||||
fetchParentPolicy(client_policy_id, base_policy_id).then(()=>{
|
||||
// setTimeout(() => {
|
||||
response.data.forEach((mapping, index) => {
|
||||
if (index === 0) {
|
||||
// Handle first row
|
||||
const firstRow = $('.si-mapping-row:first');
|
||||
|
||||
// Clear existing values
|
||||
firstRow.find('select[name="choose_si_amount_from_base_policy"]')
|
||||
.val('')
|
||||
.trigger('change');
|
||||
firstRow.find('select[name="choose_si_amount_for_policy[]"]')
|
||||
.val([])
|
||||
.trigger('change');
|
||||
|
||||
// Set base policy SI amount
|
||||
firstRow.find('select[name="choose_si_amount_from_base_policy"]')
|
||||
.val(mapping.base_policy_si_amount)
|
||||
@ -113,22 +106,13 @@ function checkExistingMapping(client_policy_id, base_policy_id) {
|
||||
// Store pk value
|
||||
firstRow.find('input[name="primary_key"]').val(mapping.pk);
|
||||
} else {
|
||||
// Add new row for subsequent mappings
|
||||
addRow();
|
||||
$('#addButton').trigger("click");
|
||||
// For subsequent mappings, add a new row WITHOUT triggering the add button
|
||||
addSIMappingRow();
|
||||
|
||||
// Wait for the new row to be properly initialized
|
||||
setTimeout(() => {
|
||||
// setTimeout(() => {
|
||||
const newRow = $('.si-mapping-row:last');
|
||||
|
||||
// Clear existing values
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"]')
|
||||
.val('')
|
||||
.trigger('change');
|
||||
newRow.find('select[name="choose_si_amount_for_policy[]"]')
|
||||
.val([])
|
||||
.trigger('change');
|
||||
|
||||
// Set base policy SI amount
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"]')
|
||||
.val(mapping.base_policy_si_amount)
|
||||
@ -142,11 +126,17 @@ function checkExistingMapping(client_policy_id, base_policy_id) {
|
||||
|
||||
// Store pk value
|
||||
newRow.find('input[name="primary_key"]').val(mapping.pk);
|
||||
}, 500);
|
||||
// }, 500);
|
||||
}
|
||||
});
|
||||
}, 1000); // Wait for fetchBasePolicy and fetchParentPolicy to complete
|
||||
}else{
|
||||
// }, 1000);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Wait for dropdowns to be populated
|
||||
// Wait for fetchBasePolicy and fetchParentPolicy to complete
|
||||
} else {
|
||||
fetchBasePolicy(client_policy_id, base_policy_id);
|
||||
fetchParentPolicy(client_policy_id, base_policy_id);
|
||||
}
|
||||
@ -159,7 +149,7 @@ function checkExistingMapping(client_policy_id, base_policy_id) {
|
||||
}
|
||||
|
||||
function fetchBasePolicy(client_policy_id, base_policy_id) {
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
url: '<?php echo base_url("util/getPolicySIRacketData")?>',
|
||||
method: 'GET',
|
||||
data: {
|
||||
@ -180,17 +170,17 @@ function fetchBasePolicy(client_policy_id, base_policy_id) {
|
||||
}
|
||||
|
||||
// Convert Set back to an array to use in the dropdown
|
||||
si_amt_base_policy = Array.from(si_amt_base_policy);
|
||||
console.log("Unique SI amounts:", si_amt_base_policy); // Check the result
|
||||
var si_amt_base_policy_array = Array.from(si_amt_base_policy);
|
||||
console.log("Unique SI amounts:", si_amt_base_policy_array); // Check the result
|
||||
|
||||
// Clear existing options in the dropdown
|
||||
// $('#choose_si_amount_from_base_policy').empty();
|
||||
$('#choose_si_amount_from_base_policy').empty();
|
||||
$('#choose_si_amount_from_base_policy').append('<option value="">Select SI Amount</option>');
|
||||
|
||||
// Append the new options
|
||||
for (let i = 0; i < si_amt_base_policy.length; i++) {
|
||||
console.log("Appending option:", si_amt_base_policy[i]); // Log each SI value
|
||||
$('#choose_si_amount_from_base_policy').append(`<option value="${si_amt_base_policy[i]}">${si_amt_base_policy[i]}</option>`);
|
||||
for (let i = 0; i < si_amt_base_policy_array.length; i++) {
|
||||
console.log("Appending option:", si_amt_base_policy_array[i]); // Log each SI value
|
||||
$('#choose_si_amount_from_base_policy').append(`<option value="${si_amt_base_policy_array[i]}">${si_amt_base_policy_array[i]}</option>`);
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -203,9 +193,8 @@ function fetchBasePolicy(client_policy_id, base_policy_id) {
|
||||
});
|
||||
}
|
||||
|
||||
var si_amt_parent_policy = new Set();
|
||||
function fetchParentPolicy(client_policy_id, base_policy_id) {
|
||||
$.ajax({
|
||||
return $.ajax({
|
||||
url: '<?= base_url("util/fetchPolicySIDataForParentPolicy")?>',
|
||||
method: 'GET',
|
||||
data: {
|
||||
@ -224,17 +213,17 @@ function fetchParentPolicy(client_policy_id, base_policy_id) {
|
||||
}
|
||||
|
||||
// Convert Set back to an array to use in the dropdown
|
||||
si_amt_parent_policy = Array.from(si_amt_parent_policy);
|
||||
console.log("Unique SI amounts:", si_amt_parent_policy); // Check the result
|
||||
var si_amt_parent_policy_array = Array.from(si_amt_parent_policy);
|
||||
console.log("Unique SI amounts:", si_amt_parent_policy_array); // Check the result
|
||||
|
||||
// Clear existing options in the dropdown
|
||||
// $('#choose_si_amount_for_policy').empty();
|
||||
$('#choose_si_amount_for_policy').empty();
|
||||
$('#choose_si_amount_for_policy').append('<option value="">Select SI Amount</option>');
|
||||
|
||||
// Append the new options
|
||||
for (let i = 0; i < si_amt_parent_policy.length; i++) {
|
||||
console.log("Appending option:", si_amt_parent_policy[i]); // Log each SI value
|
||||
$('#choose_si_amount_for_policy').append(`<option value="${si_amt_parent_policy[i]}">${si_amt_parent_policy[i]}</option>`);
|
||||
for (let i = 0; i < si_amt_parent_policy_array.length; i++) {
|
||||
console.log("Appending option:", si_amt_parent_policy_array[i]); // Log each SI value
|
||||
$('#choose_si_amount_for_policy').append(`<option value="${si_amt_parent_policy_array[i]}">${si_amt_parent_policy_array[i]}</option>`);
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -256,98 +245,10 @@ $(document).ready(function() {
|
||||
$("textarea.select2-search__field").css('resize', 'none');
|
||||
|
||||
// Function to get all selected base policy values
|
||||
function getSelectedBasePolicies() {
|
||||
var selectedBasePolicies = [];
|
||||
$('.si-mapping-row').each(function() {
|
||||
var selectedBasePolicy = $(this).find('select[name="choose_si_amount_from_base_policy"]').val();
|
||||
if (selectedBasePolicy) {
|
||||
selectedBasePolicies.push(selectedBasePolicy);
|
||||
}
|
||||
});
|
||||
return selectedBasePolicies;
|
||||
}
|
||||
|
||||
function addRow() {
|
||||
// Get selected base policies from all previous rows
|
||||
var selectedBasePolicies = getSelectedBasePolicies();
|
||||
|
||||
// Check if si_amt_base_policy has been populated
|
||||
if (si_amt_base_policy.length === 0) {
|
||||
console.log("SI amounts not yet loaded.");
|
||||
return; // Prevent adding the row if the data isn't ready
|
||||
}
|
||||
|
||||
// Create a new row with the same structure as the existing row
|
||||
var newRow = $('<div class="form-row si-mapping-row">');
|
||||
|
||||
// Generate unique IDs for the new row's selects
|
||||
var uniqueIdForBasePolicy = 'choose_base_policy_' + Date.now();
|
||||
var uniqueIdForSIAmountForPolicy = 'choose_si_amount_for_policy_' + Date.now();
|
||||
|
||||
newRow.append(
|
||||
'<input name = "primary_key" type="hidden" id="'+uniqueIdForBasePolicy+'" value="">'+
|
||||
'<div class="form-group col-md-3">' +
|
||||
'<label>Base Policy SI Amount<span class="text-danger">*</span></label>' +
|
||||
'<select class="form-control" id="' + uniqueIdForBasePolicy + '" name="choose_si_amount_from_base_policy">' +
|
||||
'<option value="">Choose SI Amount</option>' +
|
||||
'</select>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
newRow.append(
|
||||
'<div class="form-group col-md-3">' +
|
||||
'<label>Policy SI Amount</label><br />' +
|
||||
'<select class="form-control" id="' + uniqueIdForSIAmountForPolicy + '" name="choose_si_amount_for_policy[]" multiple>' +
|
||||
'</select>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
newRow.append(
|
||||
'<div class="form-group">' +
|
||||
'<div class="btn-group" style="margin-top: 45px;">' +
|
||||
'<button type="button" class="btn btn-danger remove-row" style="margin-right: 5px;">x</button>' +
|
||||
'<button type="button" class="btn btn-success add-row">+</button>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
// Append the new row to the container
|
||||
$('#si-mapping-container').append(newRow);
|
||||
|
||||
// Loop through and append SI amounts to the new row's 'choose_si_amount_from_base_policy' dropdown
|
||||
si_amt_base_policy.forEach(function(value) {
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"]').append('<option value="'+value+'">'+value+'</option>');
|
||||
});
|
||||
|
||||
// Remove selected base policies from the new row's 'choose_si_amount_from_base_policy' options
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"] option').each(function() {
|
||||
var value = $(this).val();
|
||||
if (selectedBasePolicies.includes(value)) {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
|
||||
// Append the unique SI amounts to 'choose_si_amount_for_policy[]'
|
||||
si_amt_parent_policy.forEach(function(value) {
|
||||
newRow.find('select[name="choose_si_amount_for_policy[]"]').append('<option value="'+value+'">'+value+'</option>');
|
||||
});
|
||||
|
||||
// Re-initialize select2 for the new row's dropdowns
|
||||
newRow.find('select[name="choose_si_amount_for_policy[]"]').select2({
|
||||
placeholder: 'Select SI Amount'
|
||||
});
|
||||
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"]').select2({
|
||||
placeholder: 'Choose SI Amount'
|
||||
});
|
||||
|
||||
$("textarea.select2-search__field").attr('rows', '1');
|
||||
$("textarea.select2-search__field").css('resize', 'none');
|
||||
}
|
||||
|
||||
// Use event delegation to bind the click event for .add-row
|
||||
$(document).on('click', '.add-row', function() {
|
||||
addRow();
|
||||
addSIMappingRow();
|
||||
});
|
||||
|
||||
// Remove an SI Mapping row
|
||||
@ -446,6 +347,9 @@ function submitForm() {
|
||||
});
|
||||
}
|
||||
function resetFormAndRemoveRows() {
|
||||
|
||||
si_amt_parent_policy.clear();
|
||||
si_amt_base_policy.clear();
|
||||
// Reset the form fields
|
||||
$('#si_mapping_form')[0].reset(); // Reset all form fields
|
||||
|
||||
@ -462,5 +366,93 @@ function resetFormAndRemoveRows() {
|
||||
$('#choose_si_amount_for_policy').val('').trigger('change');
|
||||
}
|
||||
|
||||
function getSelectedBasePolicies() {
|
||||
var selectedBasePolicies = [];
|
||||
$('.si-mapping-row').each(function() {
|
||||
var selectedBasePolicy = $(this).find('select[name="choose_si_amount_from_base_policy"]').val();
|
||||
if (selectedBasePolicy) {
|
||||
selectedBasePolicies.push(selectedBasePolicy);
|
||||
}
|
||||
});
|
||||
return selectedBasePolicies;
|
||||
}
|
||||
|
||||
function addSIMappingRow() {
|
||||
// Get selected base policies from all previous rows
|
||||
var selectedBasePolicies = getSelectedBasePolicies();
|
||||
|
||||
// Check if si_amt_base_policy has been populated
|
||||
if (si_amt_base_policy.length === 0) {
|
||||
console.log("SI amounts not yet loaded.");
|
||||
return; // Prevent adding the row if the data isn't ready
|
||||
}
|
||||
|
||||
// Create a new row with the same structure as the existing row
|
||||
var newRow = $('<div class="form-row si-mapping-row">');
|
||||
|
||||
// Generate unique IDs for the new row's selects
|
||||
var uniqueIdForBasePolicy = 'choose_base_policy_' + Date.now();
|
||||
var uniqueIdForSIAmountForPolicy = 'choose_si_amount_for_policy_' + Date.now();
|
||||
|
||||
newRow.append(
|
||||
'<input name="primary_key" type="hidden" value="">'+
|
||||
'<div class="form-group col-md-3">' +
|
||||
'<label>Base Policy SI Amount<span class="text-danger">*</span></label>' +
|
||||
'<select class="form-control" id="' + uniqueIdForBasePolicy + '" name="choose_si_amount_from_base_policy">' +
|
||||
'<option value="">Choose SI Amount</option>' +
|
||||
'</select>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
newRow.append(
|
||||
'<div class="form-group col-md-3">' +
|
||||
'<label>Policy SI Amount</label><br />' +
|
||||
'<select class="form-control" id="' + uniqueIdForSIAmountForPolicy + '" name="choose_si_amount_for_policy[]" multiple>' +
|
||||
'</select>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
newRow.append(
|
||||
'<div class="form-group">' +
|
||||
'<div class="btn-group" style="margin-top: 45px;">' +
|
||||
'<button type="button" class="btn btn-danger remove-row" style="margin-right: 5px;">x</button>' +
|
||||
'<button type="button" class="btn btn-success add-row">+</button>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
// Append the new row to the container
|
||||
$('#si-mapping-container').append(newRow);
|
||||
|
||||
// First, populate all options
|
||||
si_amt_base_policy.forEach(function(value) {
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"]').append('<option value="'+value+'">'+value+'</option>');
|
||||
});
|
||||
|
||||
// Then, remove already selected values from the dropdown
|
||||
selectedBasePolicies.forEach(function(value) {
|
||||
if (value) { // Check if the value is not empty
|
||||
newRow.find('select[name="choose_si_amount_from_base_policy"] option[value="'+value+'"]').remove();
|
||||
}
|
||||
});
|
||||
|
||||
// Append the unique SI amounts to 'choose_si_amount_for_policy[]'
|
||||
si_amt_parent_policy.forEach(function(value) {
|
||||
newRow.find('select[name="choose_si_amount_for_policy[]"]').append('<option value="'+value+'">'+value+'</option>');
|
||||
});
|
||||
|
||||
// Initialize select2 for the new dropdowns
|
||||
newRow.find('select[name="choose_si_amount_for_policy[]"]').select2({
|
||||
placeholder: 'Select SI Amount'
|
||||
});
|
||||
|
||||
// newRow.find('select[name="choose_si_amount_from_base_policy"]').select2({
|
||||
// placeholder: 'Choose SI Amount'
|
||||
// });
|
||||
|
||||
$("textarea.select2-search__field").attr('rows', '1');
|
||||
$("textarea.select2-search__field").css('resize', 'none');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user