CHANGE_LGBTQ_ENABLE_AND_EMAIL_AND_MOBILE_EDIT : RV

This commit is contained in:
VENKATESHWARAN 2025-01-20 10:35:59 +05:30
parent 3a06679907
commit ec02c49d87
6 changed files with 53 additions and 10 deletions

View File

@ -1062,7 +1062,7 @@ class ClientController extends AdminController
$data['disclaimer'] = $this->request->getPost('disclaimer');
$data['is_member_modify_allowed'] = $this->request->getPost('is_member_modify_allowed') ? 1 : 0;
$data['enrolment_visibility'] = $this->request->getPost('enrolment_visibility') ? 1 : 0;
$data['is_lgbtq'] = $this->request->getPost('is_lgbtq') ? 1 : 0;
if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) {
@ -1194,6 +1194,8 @@ class ClientController extends AdminController
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
// $data['is_member_modify_allowed'] = $this->request->getPost('is_member_modify_allowed') ? 1 : 0;
$data['is_lgbtq'] = $this->request->getPost('is_lgbtq') ? 1 : 0;
if ($data['inception_type'] == 2) {
$data['open_date'] = change_date_format($this->request->getPost('open_date'), 'd-m-Y', 'Y-m-d');
$data['close_date'] = change_date_format($this->request->getPost('close_date'), 'd-m-Y', 'Y-m-d');

View File

@ -2140,6 +2140,8 @@ class EmployeeController extends AdminController
//get policy details
$policy_details = $this->clientPolicyModel->getPolicyDetails($client_id,$policy_id);
$policy_terms = (array)$policy_details[0];
$is_lgbtq = $policy_terms['is_lgbtq'];
// dd($policy_terms);
$policy_terms = json_decode($policy_terms['policy_terms']);
$policy_terms = (array) $policy_terms;// convert obj to array
@ -2147,7 +2149,7 @@ class EmployeeController extends AdminController
//get file array or construnct dummy file array here
$file = ['id' => null,'client_id' => $client_id,'policy_id' => $policy_id,'action' => 'inception','client_branch_id' => $branch_id,'created_by' => 1];
//get familiy details in inception file format array from post method
$result = check_dependent_conflict($family_details, $policy_terms, $file['action']);
$result = check_dependent_conflict($family_details, $policy_terms, $file['action'],$is_lgbtq);
return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => ['policy_terms' => $policy_terms['family_floaters'],'result' => $result] ], 200);

View File

@ -977,6 +977,8 @@ class EmployeeServiceController extends AdminController
// get policy and rack details
$policy_terms = $this->clientPolicyModel->getPolicyDetails($file['client_id'],$file['policy_id']);
$policy_details = (array)$policy_terms[0];
$is_lgbtq = $policy_details['is_lgbtq'];
// dd($this->clientPolicyModel->getLastQuery());
$policy_terms = json_decode($policy_terms[0]->policy_terms);
$policy_terms = (array) $policy_terms;// convert obj to array
@ -1071,7 +1073,7 @@ class EmployeeServiceController extends AdminController
if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception'|| $file['action'] == 'missed_inception' || $file['action'] == 'enrollment')
{
$res = check_dependent_conflict($family,$policy_terms,$file['action']);
$res = check_dependent_conflict($family,$policy_terms,$file['action'],$is_lgbtq);
// dd($res);
if(!$res['status'])
{

View File

@ -534,7 +534,7 @@ if (!function_exists('name_and_empid_check_in_db'))
if (!function_exists('check_dependent_conflict'))
{
function check_dependent_conflict($family_data,$policy_terms,$actionArr)
function check_dependent_conflict($family_data,$policy_terms,$actionArr,$is_lgbtq)
{
$result = ['status' => true];
@ -624,10 +624,13 @@ if (!function_exists('check_dependent_conflict'))
// print_r(array_values(array_count_values($overall_famility_relationships)));
// print_r(in_array(2,array_values(array_count_values($overall_famility_relationships))));
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
if($is_lgbtq == 0)
{
$result['status'] = false;
$result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
if($self_gender && $spouse_gender && $self_gender == $spouse_gender)
{
$result['status'] = false;
$result['error_data'][] = ['code' => 4,'col_name' => 'gender','msg' => 'Rule conflict: Self and Spouse cannot be same gender','row_id' => (isset($self_emp_row_id) ? $self_emp_row_id : $family_data[0][0])];
}
}
if(($allowed_spouse_count < $received_spouse_count) || ($allowed_child_count < $received_child_count) )

View File

@ -201,6 +201,15 @@
<label for="is_member_modify_allowed" style="position: relative;bottom: 5px;left: 85px;"> In Enrollment Member Data Modification Allowed</label>
</div> -->
<div class="form-group col-md-4">
<label class="switch" style="position: relative;top: 43px;left: 20px;">
<input id="is_lgbtq" type="checkbox" name="is_lgbtq">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="is_lgbtq" style="position: relative;bottom: 5px;left: 85px;"> Is LGBTQ Enable</label>
</div>
</div>
<div id="policy_fields"></div>
@ -871,6 +880,12 @@ $('body').on('click', '.btnPolicyEdit', function() {
$('#policy_visibility').prop('checked', false);
}
if (res.data.is_lgbtq == 1) {
$('#is_lgbtq').prop('checked', true);
} else {
$('#is_lgbtq').prop('checked', false);
}
// Member Modify Data Enable or Disable
// if (res.data.is_member_modify_allowed == 1) {
// $('#is_member_modify_allowed').prop('checked', true);
@ -1932,6 +1947,11 @@ function getClientPolicyDataForEdit(client_policy_id) {
$('#policy_visibility').prop('checked', false);
}
if (res.data.is_lgbtq == 1) {
$('#is_lgbtq').prop('checked', true);
} else {
$('#is_lgbtq').prop('checked', false);
}
if (res.data.policy_type_id == '4' || res.data.policy_type_id == '5') {

View File

@ -141,15 +141,15 @@
<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 if(($employee['emp_status'] == 'draft' || $employee['emp_status'] == 'enrolled') && ($employee['status'] == 'draft' || $employee['status'] == 'enrolled')) { ?>
<?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'];?>')" ><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<?php } ?>
<?php if($employee['policy_type'] == 'GMC' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
<?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['policy_type'] == 'GMC' && $employee['relationship'] == 'Self' && $employee['emp_status'] == 'active' && $employee['status'] == 'active' && !empty($employee['tpa_id'])) { ?>
<?php if(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 } ?>
@ -339,6 +339,16 @@
$('#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);
}
var myModal = new bootstrap.Modal(document.getElementById('emp_modal'));
myModal.show();
@ -351,6 +361,10 @@
$('#email_corporate').val('');
$('#mobile').val('');
$('#name').prop('disabled', false);
$('#gender').prop('disabled', false);
$('#dob').prop('disabled', false);
toastr.warning(res.message, 'WARNING');
}
},