MERGE_LIVE_POLICY_LIST_ISSUE&EMP_HISTORY
This commit is contained in:
commit
4811c13f09
@ -156,6 +156,8 @@ $routes->group("/employee", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("test-rack-rate", "EmployeeController::testRackRate");
|
||||
$routes->post("test-rack-rate", "EmployeeController::testRackRate");
|
||||
$routes->get('test_members_list', 'EmployeeController::test_members_list');
|
||||
$routes->post('get_emp_history','EmployeeController::getEmpHistory');
|
||||
|
||||
});
|
||||
|
||||
$routes->group("/master", ["filter" => "authMVC"], function ($routes) {
|
||||
|
||||
@ -3675,25 +3675,35 @@ class ClientController extends AdminController
|
||||
public function updatePolicyTermsKey()
|
||||
{
|
||||
$client_id = $this->request->getGet('client_id');
|
||||
$policy_type_id = $this->request->getGet('policy_type_id');
|
||||
|
||||
$query = $this->clientPolicyModel
|
||||
->where("policy_terms IS NOT NULL AND policy_terms <> ''")
|
||||
->where('is_active', 1);
|
||||
|
||||
|
||||
if (!empty($client_id)) {
|
||||
$query->where('client_id', $client_id);
|
||||
}
|
||||
|
||||
if (!empty($policy_type_id)) {
|
||||
$query->where('policy_type_id', $policy_type_id);
|
||||
}
|
||||
|
||||
$data = $query->findAll();
|
||||
|
||||
for ($i = 0; $i < count($data); $i++) {
|
||||
|
||||
// dd($data[$i]);
|
||||
|
||||
if (isset($data[$i]['policy_terms']) && !empty($data[$i]['policy_terms'])) {
|
||||
$policyTerms = json_decode($data[$i]['policy_terms'], true);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// dd($policyTerms);
|
||||
|
||||
$is_addon = $data[$i]['is_addon'];
|
||||
|
||||
$payable_arr = [];
|
||||
@ -3716,7 +3726,7 @@ class ClientController extends AdminController
|
||||
if(in_array($data[$i]['policy_type_id'], [2,3,4,5])){
|
||||
|
||||
// Set default value of copayzonewisecopay to "empty"
|
||||
$ans = isset($policyTerms['copayzonewisecopay']) ? $policyTerms['copayzonewisecopay'] : 'empty';
|
||||
// $ans = isset($policyTerms['copayzonewisecopay']) ? $policyTerms['copayzonewisecopay'] : 'empty';
|
||||
|
||||
// add is_payable_employee for the GMC Policy
|
||||
if (isset($policyTerms['age_ratio'])) {
|
||||
@ -3730,31 +3740,31 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// Add copayzonewisecopay and copayzonewisecopaydata if they exist_
|
||||
if (isset($policyTerms['copayzonewisecopay'])) {
|
||||
// // Add copayzonewisecopay and copayzonewisecopaydata if they exist_
|
||||
// if (isset($policyTerms['copayzonewisecopay'])) {
|
||||
|
||||
if(!isset($policyTerms['co_pay_details'])){
|
||||
// if(!isset($policyTerms['co_pay_details'])){
|
||||
|
||||
$co_pay_details_value = "";
|
||||
if (strtolower($ans) == "nil" || $ans == 0) {
|
||||
$policyTerms['copayzonewisecopay'] = 0;
|
||||
$co_pay_details_value = "";
|
||||
} elseif ($ans != 'empty' && $ans !== 'Nil' && $ans !== null && $ans != '' && $ans != 0) {
|
||||
$policyTerms['copayzonewisecopay'] = 1;
|
||||
$co_pay_details_value = $ans;
|
||||
}
|
||||
// $co_pay_details_value = "";
|
||||
// if (strtolower($ans) == "nil" || $ans == 0) {
|
||||
// $policyTerms['copayzonewisecopay'] = 0;
|
||||
// $co_pay_details_value = "";
|
||||
// } elseif ($ans != 'empty' && $ans !== 'Nil' && $ans !== null && $ans != '' && $ans != 0) {
|
||||
// $policyTerms['copayzonewisecopay'] = 1;
|
||||
// $co_pay_details_value = $ans;
|
||||
// }
|
||||
|
||||
$co_pay_index = array_search('copayzonewisecopay', array_keys($policyTerms));
|
||||
$orderedPolicyTerms[] = [
|
||||
"key" => "co_pay_details",
|
||||
"value" => $co_pay_details_value,
|
||||
"position" => $co_pay_index + 2,
|
||||
];
|
||||
// $co_pay_index = array_search('copayzonewisecopay', array_keys($policyTerms));
|
||||
// $orderedPolicyTerms[] = [
|
||||
// "key" => "co_pay_details",
|
||||
// "value" => $co_pay_details_value,
|
||||
// "position" => $co_pay_index + 2,
|
||||
// ];
|
||||
|
||||
unset($policyTerms['optionalparentalcopay']);
|
||||
// unset($policyTerms['optionalparentalcopay']);
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
// Add ailmentcapping and ailmentcappingdata if they exist
|
||||
if (isset($policyTerms['ailmentcapping'])) {
|
||||
@ -3763,7 +3773,7 @@ class ClientController extends AdminController
|
||||
$orderedPolicyTerms[] = [
|
||||
"key" => "ailment_capping_details",
|
||||
"value" => "",
|
||||
"position" => $aliment_index + 3,
|
||||
"position" => $aliment_index + 2,
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -3797,8 +3807,6 @@ class ClientController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($orderedPolicyTerms as $term) {
|
||||
$position = $term['position'];
|
||||
$key = $term['key'];
|
||||
@ -3810,14 +3818,360 @@ class ClientController extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($policyTerms as $key => $term) {
|
||||
if ($term == "0") {
|
||||
$policyTerms[$key] = "No"; // Use = for assignment
|
||||
} elseif ($term == "1") {
|
||||
$policyTerms[$key] = "Yes"; // Use = for assignment
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($data[$i]['policy_type_id'], [2,3,4,5])){
|
||||
|
||||
if (!isset($policyTerms['waiver_of_90_days_waiting_period'])) {
|
||||
$policyTerms['waiver_of_90_days_waiting_period'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['waiver_of_other_waiting_periods'])) {
|
||||
$policyTerms['waiver_of_other_waiting_periods'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['maternity_benefit'])) {
|
||||
$policyTerms['maternity_benefit'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['well_baby_well_mother_expenses'])) {
|
||||
$policyTerms['well_baby_well_mother_expenses'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['icu_limit'])) {
|
||||
$policyTerms['icu_limit'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['infertility_treatment_coverage'])) {
|
||||
$policyTerms['infertility_treatment_coverage'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['mid_term_addition_of_new_born_newly_wedded_spouse'])) {
|
||||
$policyTerms['mid_term_addition_of_new_born_newly_wedded_spouse'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['non_admissible_contingency_corporate_buffer'])) {
|
||||
$policyTerms['non_admissible_contingency_corporate_buffer'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['terrorism'])) {
|
||||
$policyTerms['terrorism'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['widower_cover'])) {
|
||||
$policyTerms['widower_cover'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['breavement_cover'])) {
|
||||
$policyTerms['breavement_cover'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['enrollment_display_key'])) {
|
||||
$policyTerms['enrollment_display_key'] = $this->existingGMCDisplayValueTransform($policyTerms);
|
||||
}
|
||||
|
||||
} else if($data[$i]['policy_type_id'] == 1){
|
||||
|
||||
if (!isset($policyTerms['medical_expenses_medical_extension'])) {
|
||||
$policyTerms['medical_expenses_medical_extension'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['opd_treatment_cover'])) {
|
||||
$policyTerms['opd_treatment_cover'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['repatriation_of_mortal_remains'])) {
|
||||
$policyTerms['repatriation_of_mortal_remains'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['family_transportation_benefits'])) {
|
||||
$policyTerms['family_transportation_benefits'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['fractures_dislocation_burns'])) {
|
||||
$policyTerms['fractures_dislocation_burns'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['coma'])) {
|
||||
$policyTerms['coma'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['travel_expenses_for_medical_treatment'])) {
|
||||
$policyTerms['travel_expenses_for_medical_treatment'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['daily_cash_allowance'])) {
|
||||
$policyTerms['daily_cash_allowance'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['artifical_limb_and_prosthesis'])) {
|
||||
$policyTerms['artifical_limb_and_prosthesis'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['air_ambulance'])) {
|
||||
$policyTerms['air_ambulance'] = "";
|
||||
}
|
||||
|
||||
if (!isset($policyTerms['enrollment_display_key'])) {
|
||||
$policyTerms['enrollment_display_key'] = $this->existingGPADisplayValueTransform($policyTerms);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// dd($policyTerms);
|
||||
// Re-encode the ordered policy terms
|
||||
$updatedPolicyTerms = json_encode($policyTerms);
|
||||
// dd($updatedPolicyTerms);
|
||||
|
||||
// dd($orderedPolicyTerms, $updatedPolicyTerms);
|
||||
$this->clientPolicyModel->update($data[$i]['id'], ['policy_terms' => $updatedPolicyTerms]);
|
||||
}
|
||||
}
|
||||
|
||||
public function existingGMCDisplayValueTransform($data)
|
||||
{
|
||||
$transformedData = [];
|
||||
|
||||
if (isset($data["waiverofpreexistingdiseases"])) {
|
||||
$transformedData['Waiver of Pre-existing Diseases'] = $data["waiverofpreexistingdiseases"];
|
||||
}
|
||||
|
||||
if (isset($data["waiverof1,2,3&4thyearexclusions"])) {
|
||||
$transformedData['Waiver of 1, 2, 3 & 4th year Exclusions'] = $data["waiverof1,2,3&4thyearexclusions"];
|
||||
}
|
||||
|
||||
if (isset($data["waiverof30dayswaitingperiod"])) {
|
||||
$transformedData['Waiver of 30 days waiting period'] = $data["waiverof30dayswaitingperiod"];
|
||||
}
|
||||
|
||||
if (isset($data["waiver_of_90_days_waiting_period"])) {
|
||||
$transformedData['Waiver of 90 Days Waiting Period'] = $data["waiver_of_90_days_waiting_period"];
|
||||
}
|
||||
|
||||
if (isset($data["waiver_of_other_waiting_periods"])) {
|
||||
$transformedData['Waiver of Other Waiting Periods'] = $data["waiver_of_other_waiting_periods"];
|
||||
}
|
||||
|
||||
if (isset($data["maternity_benefit"])) {
|
||||
$transformedData['Maternity Benefit'] = $data["maternity_benefit"];
|
||||
}
|
||||
|
||||
if (isset($data["9monthwaitingperiodwaived"])) {
|
||||
$transformedData['9-month waiting Period - waived'] = $data["9monthwaitingperiodwaived"];
|
||||
}
|
||||
|
||||
if (isset($data["maternitycoverage"])) {
|
||||
$transformedData['Maternity Coverage'] = $data["maternitycoverage"];
|
||||
}
|
||||
|
||||
if (isset($data["twindelivery"])) {
|
||||
$transformedData['Twin Delivery'] = $data["twindelivery"];
|
||||
}
|
||||
|
||||
if (isset($data["well_baby_well_mother_expenses"])) {
|
||||
$transformedData['Well baby / Well Mother Expenses'] = $data["well_baby_well_mother_expenses"];
|
||||
}
|
||||
|
||||
if (isset($data["preandpostnatal"])) {
|
||||
$transformedData['Pre and Post natal'] = $data["preandpostnatal"];
|
||||
}
|
||||
|
||||
if (isset($data["infertility_treatment_coverage"])) {
|
||||
$transformedData['Infertility Treatment Coverage'] = $data["infertility_treatment_coverage"];
|
||||
}
|
||||
|
||||
if (isset($data["babyday1cover"])) {
|
||||
$transformedData['Baby Day 1 Cover'] = $data["babyday1cover"];
|
||||
}
|
||||
|
||||
if (isset($data["coverfromthedateofjoining"])) {
|
||||
$transformedData['Cover from the date of Joining'] = $data["coverfromthedateofjoining"];
|
||||
}
|
||||
|
||||
if (isset($data["mid_term_addition_of_new_born_newly_wedded_spouse"])) {
|
||||
$transformedData['Mid Term Addition of New Born / Newly Wedded Spouse'] = $data["mid_term_addition_of_new_born_newly_wedded_spouse"];
|
||||
}
|
||||
|
||||
if (isset($data["prehospitalizationcover"])) {
|
||||
$transformedData['Pre Hospitalization Cover'] = $data["prehospitalizationcover"];
|
||||
}
|
||||
|
||||
if (isset($data["posthospitalizationcover"])) {
|
||||
$transformedData['Post Hospitalization Cover'] = $data["posthospitalizationcover"];
|
||||
}
|
||||
|
||||
if (isset($data["congenitaldiseasesinternal"])) {
|
||||
$transformedData['Congenital Diseases - Internal'] = $data["congenitaldiseasesinternal"];
|
||||
}
|
||||
|
||||
if (isset($data["congenitaldiseasesexternal"])) {
|
||||
$transformedData['Congenital Diseases - External'] = $data["congenitaldiseasesexternal"];
|
||||
}
|
||||
|
||||
if (isset($data["copayzonewisecopay"])) {
|
||||
$transformedData['Co-Pay/Zone wise Co Pay'] = $data["copayzonewisecopay"];
|
||||
}
|
||||
|
||||
if (isset($data["roomrentlimit"])) {
|
||||
$transformedData['Room Rent Limit'] = $data["roomrentlimit"];
|
||||
}
|
||||
|
||||
if (isset($data["icu_limit"])) {
|
||||
$transformedData['ICU Limit'] = $data["icu_limit"];
|
||||
}
|
||||
|
||||
if (isset($data["proportionatedeductionclause"])) {
|
||||
$transformedData['Proportionate Deduction Clause'] = $data["proportionatedeductionclause"];
|
||||
}
|
||||
|
||||
if (isset($data["ailmentcapping"])) {
|
||||
$transformedData['Ailment capping'] = $data["ailmentcapping"];
|
||||
}
|
||||
|
||||
if (isset($data["ailment_capping_details"])) {
|
||||
$transformedData['Ailment capping Details'] = $data["ailment_capping_details"];
|
||||
}
|
||||
|
||||
if (isset($data["corporatebuffer"])) {
|
||||
$transformedData['Corporate Buffer'] = $data["corporatebuffer"];
|
||||
}
|
||||
|
||||
if (isset($data["non_admissible_contingency_corporate_buffer"])) {
|
||||
$transformedData['Non-Admissible / Contingency Corporate Buffer'] = $data["non_admissible_contingency_corporate_buffer"];
|
||||
}
|
||||
|
||||
if (isset($data["ambulancecharges"])) {
|
||||
$transformedData['Ambulance Charges'] = $data["ambulancecharges"];
|
||||
}
|
||||
|
||||
if (isset($data["airambulance"])) {
|
||||
$transformedData['Air Ambulance'] = $data["airambulance"];
|
||||
}
|
||||
|
||||
if (isset($data["reasonableandcustomarycharges"])) {
|
||||
$transformedData['Reasonable and Customary Charges'] = $data["reasonableandcustomarycharges"];
|
||||
}
|
||||
|
||||
if (isset($data["daycaretreatment"])) {
|
||||
$transformedData['Day Care Treatment'] = $data["daycaretreatment"];
|
||||
}
|
||||
|
||||
if (isset($data["lasiksurgery"])) {
|
||||
$transformedData['Lasik Surgery'] = $data["lasiksurgery"];
|
||||
}
|
||||
|
||||
if (isset($data["ayushtreatmentcover"])) {
|
||||
$transformedData['AYUSH treatment cover'] = $data["ayushtreatmentcover"];
|
||||
}
|
||||
|
||||
if (isset($data["moderntreatmentsasperirdai"])) {
|
||||
$transformedData['Modern treatments as per IRDAI'] = $data["moderntreatmentsasperirdai"];
|
||||
}
|
||||
|
||||
if (isset($data["opd_treatment"])) {
|
||||
$transformedData['OPD Treatment'] = $data["opd_treatment"];
|
||||
}
|
||||
|
||||
if (isset($data["days_of_discharge"])) {
|
||||
$transformedData['Claim Intimation Clause'] = $data["days_of_discharge"];
|
||||
}
|
||||
|
||||
if (isset($data["days_from_dod"])) {
|
||||
$transformedData['Claim Submission'] = $data["days_from_dod"];
|
||||
}
|
||||
|
||||
if (isset($data["terrorism"])) {
|
||||
$transformedData['Terrorism'] = $data["terrorism"];
|
||||
}
|
||||
|
||||
if (isset($data["widower_cover"])) {
|
||||
$transformedData['Widower Cover'] = $data["widower_cover"];
|
||||
}
|
||||
|
||||
if (isset($data["breavement_cover"])) {
|
||||
$transformedData['Breavement Cover'] = $data["breavement_cover"];
|
||||
}
|
||||
|
||||
return !empty($transformedData) ? $transformedData : [];
|
||||
}
|
||||
|
||||
public function existingGPADisplayValueTransform($data)
|
||||
{
|
||||
$transformedData = [];
|
||||
|
||||
if (isset($data["accidentalDeathBenefit"])) {
|
||||
$transformedData['Accidental Death Benefit'] = $data["accidentalDeathBenefit"];
|
||||
}
|
||||
if (isset($data["permanentTotalDisablement"])) {
|
||||
$transformedData['Permanent Total Disablement'] = $data["permanentTotalDisablement"];
|
||||
}
|
||||
if (isset($data["permanentPartialDisablement"])) {
|
||||
$transformedData['Permanent Partial Disablement'] = $data["permanentPartialDisablement"];
|
||||
}
|
||||
if (isset($data["temporaryTotalDisablementBenefit"])) {
|
||||
$transformedData['Temporary Total Disablement Benefit'] = $data["temporaryTotalDisablementBenefit"];
|
||||
}
|
||||
if (isset($data["medical_expenses_medical_extension"])) {
|
||||
$transformedData['Medical Expenses / Medical Extension (IPD)'] = $data["medical_expenses_medical_extension"];
|
||||
}
|
||||
if (isset($data["opd_treatment_cover"])) {
|
||||
$transformedData['OPD Treatment Cover'] = $data["opd_treatment_cover"];
|
||||
}
|
||||
if (isset($data["ambulanceCharges"])) {
|
||||
$transformedData['Ambulance Charges'] = $data["ambulanceCharges"];
|
||||
}
|
||||
if (isset($data["repatriation_of_mortal_remains"])) {
|
||||
$transformedData['Repatriation of Mortal Remains'] = $data["repatriation_of_mortal_remains"];
|
||||
}
|
||||
if (isset($data["childrenEducationWelfareFund"])) {
|
||||
$transformedData['Children Education Welfare Fund'] = $data["childrenEducationWelfareFund"];
|
||||
}
|
||||
if (isset($data["terrorism"])) {
|
||||
$transformedData['Terrorism'] = $data["terrorism"];
|
||||
}
|
||||
if (isset($data["worldwideCover"])) {
|
||||
$transformedData['Worldwide Cover'] = $data["worldwideCover"];
|
||||
}
|
||||
if (isset($data["family_transportation_benefits"])) {
|
||||
$transformedData['Family Transportation Benefits'] = $data["family_transportation_benefits"];
|
||||
}
|
||||
if (isset($data["fractures_dislocation_burns"])) {
|
||||
$transformedData['Fractures / Dislocation / Burns'] = $data["fractures_dislocation_burns"];
|
||||
}
|
||||
if (isset($data["coma"])) {
|
||||
$transformedData['Coma'] = $data["coma"];
|
||||
}
|
||||
if (isset($data["carriageofDeadBody"])) {
|
||||
$transformedData['Carriage of Dead Body'] = $data["carriageofDeadBody"];
|
||||
}
|
||||
if (isset($data["compassionateVisitExpenses"])) {
|
||||
$transformedData['Compassionate Visit Expenses'] = $data["compassionateVisitExpenses"];
|
||||
}
|
||||
if (isset($data["travel_expenses_for_medical_treatment"])) {
|
||||
$transformedData['Travel expenses for Medical Treatment'] = $data["travel_expenses_for_medical_treatment"];
|
||||
}
|
||||
if (isset($data["daily_cash_allowance"])) {
|
||||
$transformedData['Daily cash Allowance'] = $data["daily_cash_allowance"];
|
||||
}
|
||||
if (isset($data["artifical_limb_and_prosthesis"])) {
|
||||
$transformedData['Artifical Limb and Prosthesis'] = $data["artifical_limb_and_prosthesis"];
|
||||
}
|
||||
if (isset($data["animalSnakeInsectBite"])) {
|
||||
$transformedData['Animal/Snake/Insect Bite'] = $data["animalSnakeInsectBite"];
|
||||
}
|
||||
if (isset($data["air_ambulance"])) {
|
||||
$transformedData['Air Ambulance'] = $data["air_ambulance"];
|
||||
}
|
||||
|
||||
return !empty($transformedData) ? $transformedData : [];
|
||||
}
|
||||
|
||||
public function updateRemainderDate()
|
||||
{
|
||||
// Connect to the database and fetch the data
|
||||
@ -3844,23 +4198,31 @@ class ClientController extends AdminController
|
||||
|
||||
public function sendextraparam()
|
||||
{
|
||||
helper('excel_util_helper');
|
||||
|
||||
// $employeeController = new EmployeeController();
|
||||
// $employeeController->truncateFileData('633');
|
||||
|
||||
// ---------- EMP SERVICE CONTROLLER --------------------------------------------------------------------------------
|
||||
|
||||
$employeeRestController = new EmployeeServiceController();
|
||||
// $employeeRestController->excelFileDataValidation(['file_id' => 823]);
|
||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 644]);
|
||||
// $employeeRestController->employeesOnboardProcess(['file_id' => 835]);
|
||||
// $employeeRestController->employeesEnrollmentInsert(['file_id' => 836]);
|
||||
// $r = Jobs::addJob(['job_name' => 'employeesEnrollmentInsert','payload' => ['file_id' => 721]]);
|
||||
|
||||
|
||||
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
||||
|
||||
// $batch_data = [
|
||||
// 'client_id' => 17,
|
||||
// 'client_policy_id' => 30,
|
||||
// 'client_branch_id' => 18,
|
||||
// 'event_type' => "inception",
|
||||
// ];
|
||||
|
||||
// $batch_data['insurer_or_tpa'] = 'insurer';
|
||||
// $batch_data['insurer_or_tpa'] = 'tpa';
|
||||
|
||||
|
||||
// dd($this->request);
|
||||
// $employeeRestController = new EmployeeServiceController();
|
||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 721]);
|
||||
|
||||
// $r = Jobs::addJob(['job_name' => 'employeesEnrollmentInsert','payload' => ['file_id' => 721]]);
|
||||
|
||||
|
||||
// $dashBoardController = new DashboardController();
|
||||
// $client_policy_data = $this->clientPolicyModel->getPolicyDetailsForRemainder($client_id=159, $client_branch_id=126);
|
||||
@ -3895,6 +4257,7 @@ class ClientController extends AdminController
|
||||
// $EmpDataServiceController->importInceptionFileValidation(['file_id' => 162]);
|
||||
// $EmpDataServiceController->importDeletionValidation(['file_id' => 171]);
|
||||
// $EmpDataServiceController->importDeletionUpdateEndorsementID(['file_id' => 171]);
|
||||
// $EmpDataServiceController->importCorrectionUpdateEndorsementID(['file_id' => 188]);
|
||||
|
||||
// $array = [
|
||||
// "employeeIds" => ["12800", "12798", "12797", "12799"],
|
||||
@ -3911,20 +4274,69 @@ class ClientController extends AdminController
|
||||
|
||||
// $EmpDataServiceController->cashDepositCalculationForDeletion($array);
|
||||
|
||||
// $employeeRestController = new EmployeeServiceController();
|
||||
// $employeeRestController->employeesOnboardPreprocess(['file_id' => 756]);
|
||||
// $result = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($batch_data);
|
||||
// dd(db_connect()->getLastQuery());
|
||||
|
||||
// $employee_data = $this->employeeModel->getEmpFamilybyEmpCode(client_id: 159,client_policy_id: 336,emp_code: "6214",emp_status:[],policy_status:[]);
|
||||
// dd(db_connect()->getLastQuery(), $employee_data);
|
||||
// print_rr( $employee_data); die;
|
||||
// ------------- LEADS CONTROLLER ----------------------------------------------------------
|
||||
|
||||
// $data = update_si_with_auto_si(159, 336, "6214");
|
||||
// dd($data);
|
||||
// $LeadsController = new LeadsController();
|
||||
// $RFQModel = new RFQModel();
|
||||
|
||||
// $EmployeeRestController = new EmployeeRestController();
|
||||
// $EmployeeRestController->calculatePremium(336, "6214", null, 126);
|
||||
// $data = $RFQModel->where('is_active', 1)->where('lead_id', 40)->first();
|
||||
// // dd($data);
|
||||
// $policy_type = 2;
|
||||
// $proposel_name = "Proposal 2";
|
||||
// $insurer_name = "ICICI-P-ICICI002-V1";
|
||||
// $jsonArray = json_decode($data['json'], true);
|
||||
// // dd($jsonArray);
|
||||
|
||||
// $returndata = $LeadsController->convertQCRJsonToPolicyTerms($jsonArray, $policy_type, $proposel_name, $insurer_name);
|
||||
// dd($returndata);
|
||||
|
||||
// -----------BDS REPORT CONTROLLER---------------------------------------------------------------------------------
|
||||
|
||||
// $BDSReportController = new BDSReportController();
|
||||
|
||||
// $data['data'] = $BDSReportController->getBAPInsurerData();
|
||||
|
||||
// return $this->loadLayout('irda_bap_insurer_report_list', $data);
|
||||
|
||||
// $data['data'] = $BDSReportController->getBAPClientData();
|
||||
// return $this->loadLayout('irda_bap_client_report_list', $data);
|
||||
|
||||
// $data['data'] = $BDSReportController->getClientData(1);
|
||||
// return $this->loadLayout('irda_client_report_list', $data);
|
||||
|
||||
// $BDSReportController->getBAPClientData();
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
|
||||
// $email_id = 'venkateshraman786@gmail.com';
|
||||
// $common = ['mail_type'=>'test_mail_cli'];
|
||||
// $bcc = "vitvelz@gmail.com";
|
||||
|
||||
// $data = db_connect()
|
||||
// ->table('jobs')
|
||||
// ->where('id', 2264)
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
|
||||
// $data = json_decode($data[0]['payload'], true);
|
||||
|
||||
// // dd($data);
|
||||
// // Send email and get response
|
||||
// $result = MailHelper::send_email($data[0]);
|
||||
// echo json_encode($result);
|
||||
// log_message('error',json_encode($result));
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
|
||||
// $ticketModel = new TicketMasterModel();
|
||||
// $reportData['data'] = $ticketModel->getTATReport(1);
|
||||
// print_rr($reportData);
|
||||
// $this->loadLayout('tat_report_band_wise_list', $reportData);
|
||||
// $data = $ticketModel->getTATReport(1);
|
||||
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -25,6 +25,9 @@ use App\Models\InsurerExcelExportTemplateModel;
|
||||
use App\Models\InsurerModel;
|
||||
use App\Models\ClientDepositModel;
|
||||
use App\Models\PolicyPremium2Model;
|
||||
use App\Models\AuditHistoryModel;
|
||||
use App\Models\UserModel;
|
||||
|
||||
|
||||
|
||||
use App\Controllers\Jobs;
|
||||
@ -64,6 +67,9 @@ class EmployeeController extends AdminController
|
||||
protected $insurerModel;
|
||||
protected $cashDepositModel;
|
||||
protected $PolicyPremium2Model;
|
||||
protected $auditHistory;
|
||||
protected $userModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -84,6 +90,8 @@ class EmployeeController extends AdminController
|
||||
$this->insurerModel = new InsurerModel();
|
||||
$this->cashDepositModel = new ClientDepositModel();
|
||||
$this->PolicyPremium2Model = new PolicyPremium2Model();
|
||||
$this->auditHistory = new AuditHistoryModel();
|
||||
$this->userModel = new userModel();
|
||||
}
|
||||
|
||||
public function list()
|
||||
@ -2654,4 +2662,55 @@ class EmployeeController extends AdminController
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getEmpHistory(){
|
||||
|
||||
$emp_id = $this->request->getPost('emp_id');
|
||||
|
||||
$data['emp_history'] = $this->auditHistory->select('field_name,old_value,new_value,created_by,created_at')->where('pk',$emp_id)->where('table_name','employees')->orderBy('created_at', 'DESC')->findAll();
|
||||
|
||||
foreach ($data['emp_history'] as &$emp_history) {
|
||||
$emp_history['field_name'] = $this->formatFieldName($emp_history['field_name']);
|
||||
$user = $emp_history['created_by'];
|
||||
|
||||
if ($user != null && $user != '') {
|
||||
$userData = $this->userModel->select('first_name, last_name')->where('id', $user)->where('is_active', 1)->first();
|
||||
if ($userData) {
|
||||
$emp_history['created_by'] = ucwords($userData['first_name'] . ' ' . $userData['last_name']);
|
||||
} else {
|
||||
$emp_history['created_by'] = '-';
|
||||
}
|
||||
} else {
|
||||
$emp_history['created_by'] = '-';
|
||||
}
|
||||
|
||||
|
||||
$emp_history['created_at'] = date("d-m-Y H:i:s", strtotime($emp_history['created_at']));
|
||||
}
|
||||
|
||||
unset($emp_history);
|
||||
|
||||
$emp_pol_pk = $this->employeePolicyModel->select('id')->where('employee_id',$emp_id)->first()['id'];
|
||||
$data['emp_pol_history'] = $this->auditHistory->select('field_name,old_value,new_value,created_by,created_at')->where('pk',$emp_pol_pk)->where('table_name','employee_polices')->findAll();
|
||||
|
||||
return $this->respond(['status' => true, 'data' => $data],200);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function formatFieldName($unformattedString){
|
||||
|
||||
if (str_contains($unformattedString, '_')) {
|
||||
$data = str_replace('_', ' ', $unformattedString);
|
||||
}else{
|
||||
$data = $unformattedString;
|
||||
}
|
||||
|
||||
$format = ucwords($data);
|
||||
|
||||
return $format;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1720,7 +1720,8 @@ class MasterController extends AdminController
|
||||
'excel' => WRITEPATH . 'uploads/excel/',
|
||||
'statements' => WRITEPATH . 'uploads/statements/',
|
||||
'import_excel' => WRITEPATH . 'uploads/import_excel/',
|
||||
'logs' => WRITEPATH . 'uploads/logs/',
|
||||
'logs' => WRITEPATH . 'logs',
|
||||
'session' => WRITEPATH . 'session',
|
||||
'client_kyc_documents' => WRITEPATH . 'uploads/client_kyc_documents/',
|
||||
'tmp' => WRITEPATH . 'tmp/',
|
||||
'e_card_imgs' => ROOTPATH . 'public/e_card_imgs',
|
||||
@ -1729,6 +1730,7 @@ class MasterController extends AdminController
|
||||
'logo' => ROOTPATH . 'public/uploads/logo/',
|
||||
'template_bg' => ROOTPATH . 'public/uploads/template_bg/',
|
||||
'attachments' => WRITEPATH . 'uploads/attachments/',
|
||||
'cache' => WRITEPATH . 'cache',
|
||||
'sample_import_excel' => ROOTPATH . 'public/sample_import_excel',
|
||||
'lead_files' => WRITEPATH . 'uploads/lead_files/',
|
||||
];
|
||||
|
||||
@ -121,8 +121,8 @@ class ClientPolicyModel extends Model
|
||||
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
||||
->select('policy_type.policy_type as policy_type_name')
|
||||
->select('client_branch.branch_name as branch_name')
|
||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id')
|
||||
->join('insurers', 'insurers.id = client_policy.insurer_id', 'left')
|
||||
->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id', 'left')
|
||||
->join('tpa', 'tpa.id = client_policy.tpa_id', 'left')
|
||||
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id', 'left')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||
|
||||
@ -10,10 +10,10 @@
|
||||
<table class="table table-borderless table mb-0" id="table-client-policy">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Insurer</th>
|
||||
<!-- <th>Insurer</th> -->
|
||||
<th>Policy</th>
|
||||
<th>Client Branch</th>
|
||||
<th>TPA</th>
|
||||
<!-- <th>TPA</th> -->
|
||||
<th>Date</th>
|
||||
<th>Enrolment Status</th>
|
||||
<th>Status</th>
|
||||
@ -274,9 +274,11 @@
|
||||
|
||||
<script>
|
||||
$('#inception_type').change(function() {
|
||||
|
||||
var open_data = $('#open_date').parent();
|
||||
var close_data = $('#close_date').parent();
|
||||
var reminder_data = $('#reminder_date').parent();
|
||||
|
||||
if ($(this).prop('checked')) {
|
||||
$(open_data).show();
|
||||
$(close_data).show();
|
||||
@ -359,6 +361,7 @@ $(document).ready(function() {
|
||||
|
||||
|
||||
if (policy_PrimaryKey !== '') {
|
||||
|
||||
var policyTable = '';
|
||||
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
||||
console.log('client_policy_data', data)
|
||||
@ -427,10 +430,10 @@ $(document).ready(function() {
|
||||
policyTable +=
|
||||
`
|
||||
<tr>
|
||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||
<! -- <td>${item.insurer_short} - ${item.insurer_branch_name}</td> -->
|
||||
<td>${policy_name_data}</td>
|
||||
<td>${item.branch_name ? item.branch_name : ' - '}</td>
|
||||
<td>${tpaValue}</td>
|
||||
<! -- <td>${tpaValue}</td> -->
|
||||
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||
@ -679,10 +682,10 @@ $("#policy_form").submit(function(event) {
|
||||
policyTable +=
|
||||
`
|
||||
<tr>
|
||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||
<!-- <td>${item.insurer_short} - ${item.insurer_branch_name}</td> -->
|
||||
<td>${policy_name_data}</td>
|
||||
<td>${item.branch_name ? item.branch_name : ' - '}</td>
|
||||
<td>${tpaValue}</td>
|
||||
<!-- <td>${tpaValue}</td> -->
|
||||
|
||||
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.dataTables_filter{
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@ -40,10 +40,9 @@
|
||||
|
||||
.readonly-select {
|
||||
pointer-events: none;
|
||||
background-color: #f0f0f0;
|
||||
color: #666;
|
||||
background-color: #f0f0f0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@ -96,10 +95,10 @@
|
||||
|
||||
<?php if (isset($getData)) {
|
||||
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
|
||||
<th class="font-weight-medium">Client/Branch</th>
|
||||
<th class="font-weight-medium">Client/Branch</th>
|
||||
<?php }
|
||||
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
|
||||
<th class="font-weight-medium">Branch</th>
|
||||
<th class="font-weight-medium">Branch</th>
|
||||
<?php } } ?>
|
||||
|
||||
<th class="font-weight-medium">Name</th>
|
||||
@ -114,9 +113,11 @@
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">(₹)Sum Insured</th>
|
||||
<th class="font-weight-medium">(₹)Premium</th>
|
||||
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">(₹)Pro Rata <br> Premium</th>
|
||||
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">(₹)GST</th>
|
||||
<th class="font-weight-medium" > Action </th>
|
||||
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">
|
||||
(₹)Pro Rata <br> Premium</th>
|
||||
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">(₹)GST
|
||||
</th>
|
||||
<th class="font-weight-medium"> Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -126,28 +127,30 @@
|
||||
$pro_rata_total = 0;
|
||||
$gst_total = 0;
|
||||
foreach ($employees as $key => $employee) { ?>
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1); ?></b></td>
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1); ?></b></td>
|
||||
|
||||
<?php if (isset($getData)) {
|
||||
<?php if (isset($getData)) {
|
||||
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
|
||||
<td><?php echo $employee['client_short_name'] . ' - ' . $employee['client_branch_name']; ?></td>
|
||||
<?php }
|
||||
<td><?php echo $employee['client_short_name'] . ' - ' . $employee['client_branch_name']; ?>
|
||||
</td>
|
||||
<?php }
|
||||
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
|
||||
<td><?php echo $employee['client_branch_name']; ?></td>
|
||||
<?php } } ?>
|
||||
<td><?php echo $employee['client_branch_name']; ?></td>
|
||||
<?php } } ?>
|
||||
|
||||
<td><?php echo $employee['name']; ?></td>
|
||||
<td><?php echo $employee['emp_code']; ?></td>
|
||||
<td><?php echo $employee['relationship']; ?></td>
|
||||
<td><?php echo $employee['gender']; ?></td>
|
||||
<td><?php echo date('d/m/Y', strtotime($employee['dob'])); ?></td>
|
||||
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : ''; ?> - <?php echo isset($employee['policy_no']) ? $employee['policy_no'] : ''; ?></td>
|
||||
<td><?php echo $employee['insurer_short_name']; ?></td>
|
||||
<td><?php echo $employee['tpa_id']; ?></td>
|
||||
<td><?php echo $employee['uhid']; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
<td><?php echo $employee['name']; ?></td>
|
||||
<td><?php echo $employee['emp_code']; ?></td>
|
||||
<td><?php echo $employee['relationship']; ?></td>
|
||||
<td><?php echo $employee['gender']; ?></td>
|
||||
<td><?php echo date('d/m/Y', strtotime($employee['dob'])); ?></td>
|
||||
<td><?php echo isset($employee['policy_type']) ? $employee['policy_type'] : ''; ?> -
|
||||
<?php echo isset($employee['policy_no']) ? $employee['policy_no'] : ''; ?></td>
|
||||
<td><?php echo $employee['insurer_short_name']; ?></td>
|
||||
<td><?php echo $employee['tpa_id']; ?></td>
|
||||
<td><?php echo $employee['uhid']; ?></td>
|
||||
<td>
|
||||
<?php
|
||||
switch ($employee['status']) {
|
||||
case 'draft':
|
||||
echo '<span class="badge badge-secondary">' . $employee['status'] . '</span>';
|
||||
@ -169,39 +172,54 @@
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo format_indian_number($employee['basic_cover_si']); ?></td>
|
||||
<td><?php echo format_indian_number($employee['premium']); ?></td>
|
||||
<td><?php $pro_rata_total += $employee['rata_premimum']; echo format_indian_number($employee['rata_premimum']); ?></td>
|
||||
<td><?php $gst_total += $employee['gst']; echo format_indian_number($employee['gst']); ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
</td>
|
||||
<td><?php echo format_indian_number($employee['basic_cover_si']); ?></td>
|
||||
<td><?php echo format_indian_number($employee['premium']); ?></td>
|
||||
<td><?php $pro_rata_total += $employee['rata_premimum']; echo format_indian_number($employee['rata_premimum']); ?>
|
||||
</td>
|
||||
<td><?php $gst_total += $employee['gst']; echo format_indian_number($employee['gst']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
if
|
||||
(
|
||||
(in_array($employee['emp_status'], ['draft', 'enrolled', 'active']) && in_array($employee['status'], ['draft', 'enrolled', 'active']))
|
||||
) {
|
||||
?>
|
||||
<a class="dropdown-item" onclick="get_emp_master_data_for_update(this, '<?= $employee['employee_id'];?>', '<?= $employee['status'];?>')" ><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<!-- <a class="dropdown-item" onclick="get_emp_history(this, '<?= $employee['employee_id'];?>')" > <i class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Employee History</a> -->
|
||||
<a class="dropdown-item"
|
||||
onclick="get_emp_master_data_for_update(this, '<?= $employee['employee_id'];?>', '<?= $employee['status'];?>')"><i
|
||||
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a class="dropdown-item"
|
||||
onclick="get_emp_history(this, '<?= $employee['employee_id'];?>')"> <i
|
||||
class="mdi mdi-history mr-2 text-muted font-18 vertical-middle"></i>Employee
|
||||
History</a>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] ?>" class="dropdown-item" target="_blank"><i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View E-Card</a>
|
||||
<?php } ?>
|
||||
<?php if(in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a href="<?= base_url('download-e-card/'). $employee['rand_string'] ?>"
|
||||
class="dropdown-item" target="_blank"><i
|
||||
class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>View
|
||||
E-Card</a>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($employee['relationship'] == 'Self' && in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['email_corporate'] != '' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a class="dropdown-item" onclick="send_mail_for_individual_employee_ecard('<?= $employee['id'];?>')" ><i class="mdi mdi-email-alert mr-2 text-muted font-18 vertical-middle"></i>Send E-Card Mail</a>
|
||||
<?php } ?>
|
||||
<?php if($employee['relationship'] == 'Self' && in_array($employee['policy_type_id'], [2,3,4,5]) && $employee['email_corporate'] != '' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
|
||||
<a class="dropdown-item"
|
||||
onclick="send_mail_for_individual_employee_ecard('<?= $employee['id'];?>')"><i
|
||||
class="mdi mdi-email-alert mr-2 text-muted font-18 vertical-middle"></i>Send
|
||||
E-Card Mail</a>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
|
||||
@ -210,10 +228,10 @@
|
||||
<th></th>
|
||||
<?php if (isset($getData)) {
|
||||
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<?php }
|
||||
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<?php } } ?>
|
||||
<th></th>
|
||||
<th></th>
|
||||
@ -240,7 +258,8 @@
|
||||
|
||||
<!-- modal content -->
|
||||
|
||||
<div id="emp_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div id="emp_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
|
||||
style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -249,22 +268,24 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<form role="form" class="parsley-examples" id="empForm" onsubmit="update_emp_master_data_submit_function(event, this)" enctype="multipart/form-data">
|
||||
<form role="form" class="parsley-examples" id="empForm"
|
||||
onsubmit="update_emp_master_data_submit_function(event, this)" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="employee_primary_id" id="employee_primary_id"/>
|
||||
<input type="hidden" name="employee_primary_id" id="employee_primary_id" />
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="emp_code">Employee Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="emp_code_for_edit" placeholder="Enter Code" readonly>
|
||||
<input type="text" class="form-control" id="emp_code_for_edit" placeholder="Enter Code"
|
||||
readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-8">
|
||||
<label for="name">Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="name" id="name" placeholder="Ente Name">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@ -278,24 +299,30 @@
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="dob">Date of Birth<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="dob" placeholder="Enter DOB" name="dob" required>
|
||||
<input type="text" class="form-control" id="dob" placeholder="Enter DOB" name="dob"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="email">Email<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="email_corporate" placeholder="Enter Email" name="email_corporate" data-parsley-trigger="change" data-parsley-type="email" onchange="validateInput(this, 'employees', 'email_corporate')" required>
|
||||
<input type="text" class="form-control" id="email_corporate" placeholder="Enter Email"
|
||||
name="email_corporate" data-parsley-trigger="change" data-parsley-type="email"
|
||||
onchange="validateInput(this, 'employees', 'email_corporate')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="mobile">Mobile Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mobile" placeholder="Enter Mobile Number" name="mobile" onkeypress = "return onlyNumbers(event)" maxlength="10" minlength="10" onchange="validateInput(this, 'employees', 'mobile')" required>
|
||||
<input type="text" class="form-control" id="mobile" placeholder="Enter Mobile Number"
|
||||
name="mobile" onkeypress="return onlyNumbers(event)" maxlength="10" minlength="10"
|
||||
onchange="validateInput(this, 'employees', 'mobile')" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -305,321 +332,323 @@
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal content for Emp History -->
|
||||
<div class="modal fade" id="emp_history_modal" tabindex="-1" aria-labelledby="emp_history_modal_label" aria-hidden="true">
|
||||
<div class="modal fade" id="emp_history_modal" tabindex="-1" aria-labelledby="emp_history_modal_label"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="emp_history_modal_label">Employee History</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div id = "emp_history_content"></div>
|
||||
</div>
|
||||
<div id="emp_history_content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var dob = flatpickr("#dob", {
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false, // Allows manual input
|
||||
yearSelector: true, // Ensures year can be selected manually
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#tickets-table');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Member-List',
|
||||
},{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Member-List',
|
||||
}],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
var dob = flatpickr("#dob", {
|
||||
dateFormat: "d/m/Y",
|
||||
allowInput: false, // Allows manual input
|
||||
yearSelector: true, // Ensures year can be selected manually
|
||||
});
|
||||
|
||||
function get_emp_master_data_for_update(input, id){
|
||||
})
|
||||
|
||||
get_emp_master_data_for_update_ajax(id)
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#tickets-table');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Member-List',
|
||||
}, {
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Member-List',
|
||||
}],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true, // Enable pagination
|
||||
pageLength: 25 // Set default number of rows per page (optional)
|
||||
});
|
||||
} else {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
function get_emp_master_data_for_update_ajax(id){
|
||||
function get_emp_master_data_for_update(input, id) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
get_emp_master_data_for_update_ajax(id)
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/get_emp_master_data_for_update/');?>'+id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
}
|
||||
|
||||
console.log('get_emp_master_data_for_update response', res)
|
||||
function get_emp_master_data_for_update_ajax(id) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
let data = res.data
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/get_emp_master_data_for_update/');?>' + id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
if(res.status == true){
|
||||
console.log('get_emp_master_data_for_update response', res)
|
||||
|
||||
if(data.relationship == 'Self'){
|
||||
$('#gender').prop('disabled', false)
|
||||
}else{
|
||||
$('#gender').prop('disabled', true)
|
||||
}
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
$('#employee_primary_id').val(data.id);
|
||||
$('#emp_code_for_edit').val(data.emp_code);
|
||||
$('#name').val(data.name);
|
||||
$('#gender').val(data.gender);
|
||||
$('#dob').val(data.formatted_dob);
|
||||
$('#email_corporate').val(data.email_corporate);
|
||||
$('#mobile').val(data.mobile);
|
||||
let data = res.data
|
||||
|
||||
if(data.emp_status == "active"){
|
||||
$('#name').prop('disabled', true);
|
||||
$('#gender').prop('disabled', true);
|
||||
$('#dob').prop('disabled', true);
|
||||
}else{
|
||||
$('#name').prop('disabled', false);
|
||||
$('#gender').prop('disabled', false);
|
||||
$('#dob').prop('disabled', false);
|
||||
}
|
||||
if (res.status == true) {
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
|
||||
myModal.show();
|
||||
if (data.relationship == 'Self') {
|
||||
$('#gender').prop('disabled', false)
|
||||
} else {
|
||||
$('#gender').prop('disabled', true)
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$('#employee_primary_id').val('');
|
||||
$('#emp_code_for_edit').val('');
|
||||
$('#name').val('');
|
||||
$('#gender').val('');
|
||||
$('#dob').val('');
|
||||
$('#email_corporate').val('');
|
||||
$('#mobile').val('');
|
||||
$('#employee_primary_id').val(data.id);
|
||||
$('#emp_code_for_edit').val(data.emp_code);
|
||||
$('#name').val(data.name);
|
||||
$('#gender').val(data.gender);
|
||||
$('#dob').val(data.formatted_dob);
|
||||
$('#email_corporate').val(data.email_corporate);
|
||||
$('#mobile').val(data.mobile);
|
||||
|
||||
if (data.emp_status == "active") {
|
||||
$('#name').prop('disabled', true);
|
||||
$('#gender').prop('disabled', true);
|
||||
$('#dob').prop('disabled', true);
|
||||
} else {
|
||||
$('#name').prop('disabled', false);
|
||||
$('#gender').prop('disabled', false);
|
||||
$('#dob').prop('disabled', false);
|
||||
|
||||
toastr.warning(res.message, 'WARNING');
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update_emp_master_data_submit_function(event, form){
|
||||
|
||||
event.preventDefault(); // Prevent the default form submission
|
||||
|
||||
var isValid = $(form).parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return ;
|
||||
}
|
||||
|
||||
const formData = new FormData(form);
|
||||
|
||||
const submitButton = form.querySelector('button[type="submit"]');
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerText = 'Updating...';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
// AJAX request to update the individual employee
|
||||
$.ajax({
|
||||
url: '<?= base_url('/util/update_emp_data') ?>',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
|
||||
console.log(response)
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(response.status == true){
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
|
||||
$('.close').click();
|
||||
|
||||
$('#employee_primary_id').val('');
|
||||
$('#emp_code_for_edit').val('');
|
||||
$('#name').val('');
|
||||
$('#gender').val('');
|
||||
$('#dob').val('');
|
||||
$('#email_corporate').val('');
|
||||
$('#mobile').val('');
|
||||
|
||||
// window.location.reload();
|
||||
fetchEmpolyeeList();
|
||||
|
||||
}else{
|
||||
toastr.error(response.message, 'ERROR');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
// Handle error
|
||||
console.error('Upload error occurred:');
|
||||
console.error('Status: ', status); // Status of the request
|
||||
console.error('Error: ', error); // Specific error message
|
||||
console.error('XHR Object: ', xhr); // Full XHR object with response details
|
||||
|
||||
// Optionally log server response, if available
|
||||
if (xhr.responseText) {
|
||||
console.error('Response Text: ', xhr.responseText);
|
||||
}
|
||||
|
||||
toastr.warning('Error uploading file', 'WARNING');
|
||||
console.error('Upload error:', error);
|
||||
},
|
||||
complete: function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
// Re-enable the submit button and reset its text
|
||||
submitButton.disabled = false;
|
||||
submitButton.innerText = 'Submit';
|
||||
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
|
||||
myModal.show();
|
||||
|
||||
} else {
|
||||
|
||||
$('#employee_primary_id').val('');
|
||||
$('#emp_code_for_edit').val('');
|
||||
$('#name').val('');
|
||||
$('#gender').val('');
|
||||
$('#dob').val('');
|
||||
$('#email_corporate').val('');
|
||||
$('#mobile').val('');
|
||||
|
||||
$('#name').prop('disabled', false);
|
||||
$('#gender').prop('disabled', false);
|
||||
$('#dob').prop('disabled', false);
|
||||
|
||||
toastr.warning(res.message, 'WARNING');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
function send_mail_for_individual_employee_ecard(id){
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
Swal.fire({
|
||||
title: "Do you want to send Ecard Mail?",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: "Yes,Send",
|
||||
denyButtonText: "Don't Send"
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
|
||||
url: '<?php echo base_url('util/send_mail_for_individual_employee_ecard/');?>'+id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log('send_mail_for_individual_employee_ecard response', res)
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if(res.status == true){
|
||||
toastr.success(res.message, 'SUCCESS');
|
||||
}else{
|
||||
toastr.error(res.message, 'ERROR');
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validateInput(input, table, field){
|
||||
|
||||
let value = $(input).val();
|
||||
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||
|
||||
let message = "Value is duplicate!";
|
||||
if(label){
|
||||
message = label + " already exists!";
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||
if (isDuplicate) {
|
||||
toastr.warning(message, 'WARNING');
|
||||
$(input).val('')
|
||||
}
|
||||
});
|
||||
function update_emp_master_data_submit_function(event, form) {
|
||||
|
||||
event.preventDefault(); // Prevent the default form submission
|
||||
|
||||
var isValid = $(form).parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return;
|
||||
}
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
|
||||
return false;
|
||||
const formData = new FormData(form);
|
||||
|
||||
const submitButton = form.querySelector('button[type="submit"]');
|
||||
submitButton.disabled = true;
|
||||
submitButton.innerText = 'Updating...';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
// AJAX request to update the individual employee
|
||||
$.ajax({
|
||||
url: '<?= base_url('/util/update_emp_data') ?>',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
|
||||
console.log(response)
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if (response.status == true) {
|
||||
toastr.success(response.message, 'SUCCESS');
|
||||
|
||||
$('.close').click();
|
||||
|
||||
$('#employee_primary_id').val('');
|
||||
$('#emp_code_for_edit').val('');
|
||||
$('#name').val('');
|
||||
$('#gender').val('');
|
||||
$('#dob').val('');
|
||||
$('#email_corporate').val('');
|
||||
$('#mobile').val('');
|
||||
|
||||
// window.location.reload();
|
||||
fetchEmpolyeeList();
|
||||
|
||||
} else {
|
||||
toastr.error(response.message, 'ERROR');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
// Handle error
|
||||
console.error('Upload error occurred:');
|
||||
console.error('Status: ', status); // Status of the request
|
||||
console.error('Error: ', error); // Specific error message
|
||||
console.error('XHR Object: ', xhr); // Full XHR object with response details
|
||||
|
||||
// Optionally log server response, if available
|
||||
if (xhr.responseText) {
|
||||
console.error('Response Text: ', xhr.responseText);
|
||||
}
|
||||
|
||||
toastr.warning('Error uploading file', 'WARNING');
|
||||
console.error('Upload error:', error);
|
||||
},
|
||||
complete: function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
// Re-enable the submit button and reset its text
|
||||
submitButton.disabled = false;
|
||||
submitButton.innerText = 'Submit';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function send_mail_for_individual_employee_ecard(id) {
|
||||
|
||||
Swal.fire({
|
||||
title: "Do you want to send Ecard Mail?",
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: "Yes,Send",
|
||||
denyButtonText: "Don't Send"
|
||||
}).then((result) => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
|
||||
url: '<?php echo base_url('util/send_mail_for_individual_employee_ecard/');?>' + id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('send_mail_for_individual_employee_ecard response', res)
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if (res.status == true) {
|
||||
toastr.success(res.message, 'SUCCESS');
|
||||
} else {
|
||||
toastr.error(res.message, 'ERROR');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validateInput(input, table, field) {
|
||||
|
||||
let value = $(input).val();
|
||||
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||
|
||||
let message = "Value is duplicate!";
|
||||
if (label) {
|
||||
message = label + " already exists!";
|
||||
}
|
||||
var modalInstance; // Store the modal instance globally
|
||||
|
||||
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||
if (isDuplicate) {
|
||||
toastr.warning(message, 'WARNING');
|
||||
$(input).val('')
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function onlyNumbers(event) {
|
||||
var charcode;
|
||||
charcode = event.which || event.keyCode;
|
||||
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
|
||||
return false;
|
||||
}
|
||||
var modalInstance; // Store the modal instance globally
|
||||
|
||||
function showModal() {
|
||||
var myModalEl = document.getElementById('emp_history_modal');
|
||||
modalInstance = new bootstrap.Modal(myModalEl, {
|
||||
backdrop: true, // Ensures the backdrop is shown
|
||||
keyboard: true // Allows closing with the Escape key
|
||||
backdrop: true, // Ensures the backdrop is shown
|
||||
keyboard: true // Allows closing with the Escape key
|
||||
});
|
||||
modalInstance.show();
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
if (modalInstance) {
|
||||
modalInstance.hide(); // Hide the modal and its backdrop
|
||||
modalInstance.hide(); // Hide the modal and its backdrop
|
||||
// Manually remove backdrop if it's still visible
|
||||
setTimeout(function () {
|
||||
setTimeout(function() {
|
||||
document.querySelector('.modal-backdrop').classList.remove('show');
|
||||
}, 150); // Wait for animation to finish
|
||||
}, 150); // Wait for animation to finish
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function get_emp_history(input, emp_id) {
|
||||
function get_emp_history(input, emp_id) {
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
let url = '<?= base_url("employee/get_emp_history")?>';
|
||||
let requestData = { emp_id: emp_id };
|
||||
let requestData = {
|
||||
emp_id: emp_id
|
||||
};
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
$('.loader').fadeOut();
|
||||
@ -696,5 +725,4 @@ function closeModal() {
|
||||
// modalInstance.hide();
|
||||
// }
|
||||
// }
|
||||
|
||||
</script>
|
||||
</script>
|
||||
@ -602,18 +602,18 @@
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboards">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/master/insurer/list') ?>">Insurer</a>
|
||||
</li>
|
||||
<li>
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/master/tpa/list') ?>">TPA</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/master/kyc/list') ?>">KYC</a>
|
||||
</li> -->
|
||||
<li>
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/master/policy/list') ?>">Policy</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user