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

This commit is contained in:
VENKATESHWARAN 2026-01-27 18:46:14 +05:30
commit 350cf2d520
4 changed files with 62 additions and 60 deletions

View File

@ -62,7 +62,7 @@ class AppContentManagementController extends AdminController
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = (int) $sanitized_post_data['add_image_id']; $id = ((int) $sanitized_post_data['add_image_id']) ?? null;
$rules = [ $rules = [
'client_id' => [ 'client_id' => [
@ -100,7 +100,7 @@ class AppContentManagementController extends AdminController
$file = $this->request->getFile('advertise_image'); $file = $this->request->getFile('advertise_image');
$client_id = $sanitized_post_data['client_id']; $client_id = $sanitized_post_data['client_id'] ?? null;
//1) original file name for vaildations //1) original file name for vaildations
$fileName = $file->getClientName(); //original file name for vaildations $fileName = $file->getClientName(); //original file name for vaildations
$existing = $this->addImgModel->where('name', $fileName)->where('client_id', $fileName)->where('is_active', 1)->first(); $existing = $this->addImgModel->where('name', $fileName)->where('client_id', $fileName)->where('is_active', 1)->first();
@ -120,7 +120,7 @@ class AppContentManagementController extends AdminController
$file->move($uploadPath, $fileName); $file->move($uploadPath, $fileName);
$id = $sanitized_post_data['add_image_id']; $id = $sanitized_post_data['add_image_id'] ?? null;
$details = ['name' => $fileName,'client_id'=>$client_id]; $details = ['name' => $fileName,'client_id'=>$client_id];
if ($id == 0) { if ($id == 0) {

View File

@ -194,10 +194,10 @@ class BDSReportController extends AdminController
$request_post_data = $this->request->getPost(); $request_post_data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data); $sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
$fromDate = $sanitized_post_data['fromDate']; $fromDate = $sanitized_post_data['fromDate'] ?? null;
$toDate = $sanitized_post_data['toDate']; $toDate = $sanitized_post_data['toDate'] ?? null;
$category = $sanitized_post_data['category']; $category = $sanitized_post_data['category'] ?? null;
$report_type = $sanitized_post_data['report_type']; $report_type = $sanitized_post_data['report_type'] ?? null;
// log_message('error',json_encode($_POST));die(); // log_message('error',json_encode($_POST));die();
if ($report_type == 'insurer') { if ($report_type == 'insurer') {
$life = $category == 'life' ? 1 : 0; $life = $category == 'life' ? 1 : 0;
@ -942,11 +942,11 @@ class BDSReportController extends AdminController
$request_post_data = $this->request->getPost(); $request_post_data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data); $sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
$fromDate = $sanitized_post_data['fromDate']; $fromDate = $sanitized_post_data['fromDate'] ?? null;
$toDate = $sanitized_post_data['toDate']; $toDate = $sanitized_post_data['toDate'] ?? null;
$client_id = $sanitized_post_data['client_id']; $client_id = $sanitized_post_data['client_id'] ?? null;
$client_type = $sanitized_post_data['client_type']; $client_type = $sanitized_post_data['client_type'] ?? null;
$issuer_branch = $sanitized_post_data['issuer_branch']; $issuer_branch = $sanitized_post_data['issuer_branch'] ?? null;
$data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll(); $data['issuer_branch'] = $this->nhanceBranchModel->where('is_active', 1)->findAll();
$data['client_type'] = [1 => 'Group', 2 => 'Individual']; $data['client_type'] = [1 => 'Group', 2 => 'Individual'];

View File

@ -3066,12 +3066,12 @@ class EmployeeController extends AdminController
$request_post_data = $this->request->getPost(); $request_post_data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data); $sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
$client_id = $sanitized_post_data['client_id']; $client_id = $sanitized_post_data['client_id'] ?? null;
$branch_id = $sanitized_post_data['branch_id']; $branch_id = $sanitized_post_data['branch_id'] ?? null;
$policy_id = $sanitized_post_data['client_policy_id']; $policy_id = $sanitized_post_data['client_policy_id'] ?? null;
$selected_employees = (array)$sanitized_post_data['selected']; $selected_employees = (array)$sanitized_post_data['selected'] ?? [];
$si_amt = $sanitized_post_data['si_amt']; $si_amt = $sanitized_post_data['si_amt'] ?? null;
$policy_start_date_unformatted = $sanitized_post_data['policy_start_date']; $policy_start_date_unformatted = $sanitized_post_data['policy_start_date'] ?? null;
$policy_start_date = change_date_format($policy_start_date_unformatted, 'd/M/Y', 'Y-m-d'); $policy_start_date = change_date_format($policy_start_date_unformatted, 'd/M/Y', 'Y-m-d');
@ -3110,7 +3110,7 @@ class EmployeeController extends AdminController
public function unmapEmployees($actionType){ public function unmapEmployees($actionType){
$request_post_data = $this->request->getPost(); $request_post_data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data); $sanitized_post_data = sanitizeInputArrayAdvanced($request_post_data);
$selected_employees = (array)$sanitized_post_data['selected']; $selected_employees = (array)$sanitized_post_data['selected'] ?? [];
if($actionType == 0){ if($actionType == 0){
for($i = 0;$i<count($selected_employees);$i++){log_message('error',$selected_employees[$i]); for($i = 0;$i<count($selected_employees);$i++){log_message('error',$selected_employees[$i]);
$result1 = $this->employeeModel->set(['client_id' => null, 'client_branch_id' => null])->where('id',$selected_employees[$i])->update();log_message('error',$result1); $result1 = $this->employeeModel->set(['client_id' => null, 'client_branch_id' => null])->where('id',$selected_employees[$i])->update();log_message('error',$result1);

View File

@ -456,10 +456,10 @@ class MasterController extends AdminController
'contact_type' => 'insurer', 'contact_type' => 'insurer',
'ref_id' => $insert, 'ref_id' => $insert,
'created_by' => get_session_userid(), 'created_by' => get_session_userid(),
'name' => $sanitized_post_data['name'][$i], 'name' => $sanitized_post_data['name'][$i] ?? null,
'email' => $sanitized_post_data['email'][$i], 'email' => $sanitized_post_data['email'][$i] ?? null,
'mobile' => $sanitized_post_data['mobile'][$i], 'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
'designation' => $sanitized_post_data['designation'][$i] 'designation' => $sanitized_post_data['designation'][$i] ?? null
]; ];
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level); $contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
} }
@ -674,7 +674,7 @@ class MasterController extends AdminController
} }
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$update = $this->insurerBranchModel->update($id, $sanitized_post_data); $update = $this->insurerBranchModel->update($id, $sanitized_post_data);
if($update){ if($update){
@ -688,11 +688,11 @@ class MasterController extends AdminController
'contact_type' => 'insurer', 'contact_type' => 'insurer',
'ref_id' => $id, 'ref_id' => $id,
'created_by' => get_session_userid(), 'created_by' => get_session_userid(),
'name' => $sanitized_post_data['name'][$i], 'name' => $sanitized_post_data['name'][$i] ?? null,
'email' => $sanitized_post_data['email'][$i], 'email' => $sanitized_post_data['email'][$i] ?? null,
'mobile' => $sanitized_post_data['mobile'][$i], 'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
'designation' => $sanitized_post_data['designation'][$i] 'designation' => $sanitized_post_data['designation'][$i] ?? null
]; ];
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level); $contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
} }
} }
@ -927,12 +927,12 @@ class MasterController extends AdminController
$sanitized_post_data['tpa_logo'] = $file_name; $sanitized_post_data['tpa_logo'] = $file_name;
$sanitized_post_data['front_card'] = $front_card_file_name; $sanitized_post_data['front_card'] = $front_card_file_name;
$sanitized_post_data['back_card'] = $back_card_file_name; $sanitized_post_data['back_card'] = $back_card_file_name;
$inssanitized_post_dataert_data['network_hospitals'] = $sanitized_post_data['network_hospitals']; $sanitized_post_data['network_hospitals'] = $sanitized_post_data['network_hospitals'];
$insert = $this->tpaModel->insert($sanitized_post_data); $insert = $this->tpaModel->insert($sanitized_post_data);
$tpa_name = (string) $sanitized_post_data['name']; $tpa_name = ((string) $sanitized_post_data['name']) ?? null;
$short_name = (string) $sanitized_post_data['short_name']; $short_name = ((string) $sanitized_post_data['short_name']) ?? null;
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html'; $filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
$file_directory = WRITEPATH . 'e_card_template/'; $file_directory = WRITEPATH . 'e_card_template/';
@ -1081,10 +1081,10 @@ class MasterController extends AdminController
'contact_type' => 'tpa', 'contact_type' => 'tpa',
'ref_id' => $insert, 'ref_id' => $insert,
'created_by' => get_session_userid(), 'created_by' => get_session_userid(),
'name' => $sanitized_post_data['name'][$i], 'name' => $sanitized_post_data['name'][$i] ?? null,
'email' => $sanitized_post_data['email'][$i], 'email' => $sanitized_post_data['email'][$i] ?? null,
'mobile' => $sanitized_post_data['mobile'][$i], 'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
'designation' => $sanitized_post_data['designation'][$i] 'designation' => $sanitized_post_data['designation'][$i] ?? null
]; ];
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level); $contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
} }
@ -1210,7 +1210,7 @@ class MasterController extends AdminController
$front_card_file_name = file_Upload($this->request->getFile('fc'), $template_bg_path); $front_card_file_name = file_Upload($this->request->getFile('fc'), $template_bg_path);
$back_card_file_name = file_Upload($this->request->getFile('bc'), $template_bg_path); $back_card_file_name = file_Upload($this->request->getFile('bc'), $template_bg_path);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$sanitized_post_data['updated_by'] = get_session_userid(); $sanitized_post_data['updated_by'] = get_session_userid();
@ -1226,13 +1226,13 @@ class MasterController extends AdminController
$sanitized_post_data['back_card'] = $back_card_file_name; $sanitized_post_data['back_card'] = $back_card_file_name;
} }
$sanitized_post_data['network_hospitals'] = $sanitized_post_data['network_hospitals']; $sanitized_post_data['network_hospitals'] = $sanitized_post_data['network_hospitals'] ?? null;
$update = $this->tpaModel->update($id,$sanitized_post_data); $update = $this->tpaModel->update($id,$sanitized_post_data);
$tpa_name = (string) $sanitized_post_data['name']; $tpa_name = ((string) $sanitized_post_data['name']) ?? null;
$short_name = (string) $sanitized_post_data['short_name']; $short_name = ((string) $sanitized_post_data['short_name']) ?? null;
$eCardTemplate = $sanitized_post_data['ecard_content']; $eCardTemplate = $sanitized_post_data['ecard_content'] ?? null;
$filename = strtolower(str_replace(' ', '_', $short_name)) . '.html'; $filename = strtolower(str_replace(' ', '_', $short_name)) . '.html';
$file_directory = WRITEPATH . 'e_card_template/'; $file_directory = WRITEPATH . 'e_card_template/';
@ -1384,7 +1384,7 @@ class MasterController extends AdminController
} }
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$update = $this->tpaBranchModel->update($id, $sanitized_post_data); $update = $this->tpaBranchModel->update($id, $sanitized_post_data);
// print_r($this->request->getPost('name[]')); // print_r($this->request->getPost('name[]'));
@ -1403,10 +1403,10 @@ class MasterController extends AdminController
'contact_type' => 'tpa', 'contact_type' => 'tpa',
'ref_id' => $id, 'ref_id' => $id,
'created_by' => get_session_userid(), 'created_by' => get_session_userid(),
'name' => $sanitized_post_data['name'][$i], 'name' => $sanitized_post_data['name'][$i] ?? null,
'email' => $sanitized_post_data['email'][$i], 'email' => $sanitized_post_data['email'][$i] ?? null,
'mobile' => $sanitized_post_data['mobile'][$i], 'mobile' => $sanitized_post_data['mobile'][$i] ?? null,
'designation' => $sanitized_post_data['designation'][$i] 'designation' => $sanitized_post_data['designation'][$i] ?? null
]; ];
$contacts = $this->levelContactModel->insert($sanitized_post_data_for_level); $contacts = $this->levelContactModel->insert($sanitized_post_data_for_level);
} }
@ -1645,7 +1645,7 @@ class MasterController extends AdminController
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$sanitized_post_data['updated_by'] = get_session_userid(); $sanitized_post_data['updated_by'] = get_session_userid();
$update = $this->kycEntityTypeModel->update($id,$sanitized_post_data); $update = $this->kycEntityTypeModel->update($id,$sanitized_post_data);
if($update){ if($update){
@ -1996,7 +1996,7 @@ class MasterController extends AdminController
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$sanitized_post_data['updated_by'] = get_session_userid(); $sanitized_post_data['updated_by'] = get_session_userid();
$update = $this->policyTypeModel->update($id,$sanitized_post_data); $update = $this->policyTypeModel->update($id,$sanitized_post_data);
if($update){ if($update){
@ -2049,8 +2049,10 @@ class MasterController extends AdminController
public function editPolicies() public function editPolicies()
{ {
$this->myLogger->logme('error','edit Policy general info function called'); $this->myLogger->logme('error','edit Policy general info function called');
$id = $this->request->getPost('PrimaryKey'); $request_post_data = $this->request->getPost();
$data = $this->request->getPost(); $data = sanitizeInputArrayAdvanced($request_post_data);
$id = $data['PrimaryKey'] ?? null;
$data['updated_by'] = get_session_userid(); $data['updated_by'] = get_session_userid();
$update = $this->policesModel->update($id,$data); $update = $this->policesModel->update($id,$data);
if($update){ if($update){
@ -2260,13 +2262,13 @@ class MasterController extends AdminController
if ($insert) { if ($insert) {
$cd_tranction_data = [ $cd_tranction_data = [
'amount' => $sanitized_post_data['opening_bal'], 'amount' => $sanitized_post_data['opening_bal'] ?? null,
'sub_type_id' => 7, 'sub_type_id' => 7,
'client_id' => $sanitized_post_data['client_id'], 'client_id' => $sanitized_post_data['client_id'] ?? null,
'client_policy_id' => null, 'client_policy_id' => null,
'cd_ac_no' => $sanitized_post_data['cd_ac_no'], 'cd_ac_no' => $sanitized_post_data['cd_ac_no'] ?? null,
'endorsement_no' => null, 'endorsement_no' => null,
'insurer_id' => $sanitized_post_data['insurer_id'], 'insurer_id' => $sanitized_post_data['insurer_id'] ?? null,
'description' => 'Opening Amount', 'description' => 'Opening Amount',
'transaction_type' => 'Credit', 'transaction_type' => 'Credit',
'event_name' => null, 'event_name' => null,
@ -2411,8 +2413,8 @@ class MasterController extends AdminController
} }
$data = $this->request->getPost(); $data = $this->request->getPost();
$sanitized_post_data = sanitizeInputArrayAdvanced($data); $sanitized_post_data = sanitizeInputArrayAdvanced($data);
$id = $sanitized_post_data['PrimaryKey']; $id = $sanitized_post_data['PrimaryKey'] ?? null;
$date = (string) $sanitized_post_data['opening_date']; $date = ((string) $sanitized_post_data['opening_date']) ?? null;
$sanitized_post_data['opening_date'] = date('Y-m-d', strtotime($date)); $sanitized_post_data['opening_date'] = date('Y-m-d', strtotime($date));
if ($data) { if ($data) {
@ -2714,11 +2716,11 @@ class MasterController extends AdminController
$fetch_data = [ $fetch_data = [
'insurer_id' => $sanitized_post_data['insurer_id'], 'insurer_id' => $sanitized_post_data['insurer_id'] ?? null ,
'policy_type_id' => $sanitized_post_data['policy_type'], 'policy_type_id' => $sanitized_post_data['policy_type'] ?? null,
'event_name' => $sanitized_post_data['event'], 'event_name' => $sanitized_post_data['event'] ?? null,
'type_name' => 'export', 'type_name' => 'export',
'jsoncolumns' => $sanitized_post_data['json_data'], 'jsoncolumns' => $sanitized_post_data['json_data'] ?? null,
'is_active' => 1, 'is_active' => 1,
'created_by' => get_session_userid(), 'created_by' => get_session_userid(),
]; ];