diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index cf931aa6..b5d1706c 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -5307,6 +5307,18 @@ class ClientController extends AdminController } $data['family_floaters']['elders_count'] = $this->request->getPost("elder_member_count") ? $this->request->getPost("elder_member_count") : 0; + + // OPD policy terms fields for policy_type_id = 72 + $data['mode_of_serviceability'] = $policy_terms['mode_of_serviceability'] ?? ''; + $data['eligibility'] = $policy_terms['eligibility'] ?? ''; + $data['total_sum_insured_limit'] = $policy_terms['total_sum_insured_limit'] ?? 'INR 15000'; + $data['in_person_doctor_consultation'] = $policy_terms['in_person_doctor_consultation'] ?? ''; + $data['prescribed_lab_test_pathology_radiology'] = $policy_terms['prescribed_lab_test_pathology_radiology'] ?? ''; + $data['prescribed_pharmacy'] = $policy_terms['prescribed_pharmacy'] ?? ''; + $data['dental'] = $policy_terms['dental'] ?? ''; + $data['vision'] = $policy_terms['vision'] ?? ''; + $data['vaccination_for_children_and_adults'] = $policy_terms['vaccination_for_children_and_adults'] ?? ''; + $data['special_condition_label'] = $policy_terms['special_condition_label'] ?? []; $data['special_condition_input'] = $policy_terms["special_condition_input"] ?? []; @@ -5364,6 +5376,7 @@ class ClientController extends AdminController $values = $data['special_condition_input'] ?? []; $special_conditions = []; + $display_fields = []; foreach ($labels as $i => $label) { $value = $values[$i] ?? ''; @@ -5376,7 +5389,39 @@ class ClientController extends AdminController $special_conditions[$label] = $value; } - return $special_conditions; + $labelMap = [ + 'mode_of_serviceability' => 'Mode Of Serviceability', + 'eligibility' => 'Eligibility', + 'total_sum_insured_limit' => 'Total Sum Insured Limit', + 'in_person_doctor_consultation' => 'In Person Doctor Consultation', + 'prescribed_lab_test_pathology_radiology' => 'Prescribed Lab Test Pathology Radiology', + 'prescribed_pharmacy' => 'Prescribed Pharmacy', + 'dental' => 'Dental', + 'vision' => 'Vision', + 'vaccination_for_children_and_adults' => 'Vaccination For Children And Adults', + ]; + + foreach ($data as $key => $value) { + if (!str_ends_with($key, '_display')) { + continue; + } + + if (empty($value)) { + continue; + } + + $baseKey = substr($key, 0, -8); + $baseValue = $data[$baseKey] ?? ''; + + if (trim((string)$baseValue) === '') { + continue; + } + + $label = $labelMap[$baseKey] ?? ucwords(str_replace('_', ' ', $baseKey)); + $display_fields[$label] = $baseValue; + } + + return array_merge($display_fields, $special_conditions); } public function checkPolicyType($policy_type_id, $client_branch_id, $client_id) diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 4087b301..75fd9800 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -420,7 +420,7 @@ class MasterController extends AdminController 'state' => [ 'label' => 'State', - 'rules' => 'required|regex_match[/^[a-zA-Z\s\-]+$/]', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-\_\.\s]+$/]', 'errors' => [ 'required' => 'State is required.', 'regex_match' => 'State name can only contain letters, spaces, and hyphens.' @@ -661,7 +661,7 @@ class MasterController extends AdminController 'state' => [ 'label' => 'State', - 'rules' => 'required|regex_match[/^[a-zA-Z\s\-]+$/]', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-\_\.\s]+$/]', 'errors' => [ 'required' => 'State is required.', 'regex_match' => 'State name can only contain letters, spaces, and hyphens.' @@ -1057,7 +1057,7 @@ class MasterController extends AdminController 'state' => [ 'label' => 'State', - 'rules' => 'required|regex_match[/^[a-zA-Z\s\-]+$/]', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-\_\.\s]+$/]', 'errors' => [ 'required' => 'State is required.', 'regex_match' => 'State name can only contain letters, spaces, and hyphens.' @@ -1370,7 +1370,7 @@ class MasterController extends AdminController 'state' => [ 'label' => 'State', - 'rules' => 'required|regex_match[/^[a-zA-Z\s\-]+$/]', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-\_\.\s]+$/]', 'errors' => [ 'required' => 'State is required.', 'regex_match' => 'State name can only contain letters, spaces, and hyphens.' @@ -3590,7 +3590,7 @@ class MasterController extends AdminController ], 'state' => [ 'label' => 'State', - 'rules' => 'required|regex_match[/^[a-zA-Z\s\-]+$/]', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-\_\.\s]+$/]', 'errors' => [ 'required' => 'State is required.', 'regex_match' => 'State name can only contain letters, spaces, and hyphens.' diff --git a/app/Views/other_policy_terms.php b/app/Views/other_policy_terms.php index 8e0b4360..9074f760 100755 --- a/app/Views/other_policy_terms.php +++ b/app/Views/other_policy_terms.php @@ -395,6 +395,8 @@ +
+