CHANGE_OPEN_FOR_ENROLLMENT_TO_SET_CONFORMATION_ALERT_AND_UPDATE_1_AND_0 : RV

This commit is contained in:
VENKATESHWARAN 2024-04-27 10:43:18 +05:30
parent e17fd43594
commit e09d8f4d14
3 changed files with 881 additions and 852 deletions

View File

@ -1457,7 +1457,14 @@ class ClientController extends AdminController
$client_policy_id = $this->request->getGet('client_policy_id');
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$message = 'Policy updated Successfully' ;
if($record['open_for_enrollment'] == 0){
$open_for_enrollment_update_value = 1;
$message = 'Update Open Enrollment Successfully';
}else if($record['open_for_enrollment'] == 1){
$open_for_enrollment_update_value = 0;
$message = 'Update Open Enrollment Successfully';
}
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
$pattern = '/gmc/i';
@ -1508,7 +1515,7 @@ class ClientController extends AdminController
$policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
$json_data ='';
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id )->set('open_for_enrollment', 1)->update();
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id )->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
if ($open_for_enrollment) {
$open_for_enrollment_1 = $this->clientPolicyModel->where('id', $client_policy_id )->find();
$open_for_enrollment_value = $open_for_enrollment_1[0]['open_for_enrollment'];
@ -1517,9 +1524,7 @@ class ClientController extends AdminController
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
}
return $this->respond(['status' => true,'code' => 200, 'message' => 'Policy Status Updated Successfully', 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
return $this->respond(['status' => true,'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
}

File diff suppressed because it is too large Load Diff

View File

@ -665,6 +665,9 @@ $(document).ready(function() {
var selectedpolicy = $(this).val();
console.log('selectedpolicy',selectedpolicy)
$('#upload-action-type').val('').change();
$('#file_upload').hide();
$('#excel_download').removeAttr('href');
var apiURL = '<?php echo base_url();?>' + 'util/fetch-emp-count/' + selectedpolicy;
console.log(apiURL);
@ -729,5 +732,5 @@ $(document).ready(function() {
})
//--------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------
</script>