Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
674c6444a2
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2,8 +2,7 @@
|
||||
|
||||
|
||||
<div class="row float-right" style="padding-bottom: 10px; position: relative;right: 13px;">
|
||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span
|
||||
class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" id="table_list">
|
||||
@ -29,9 +28,7 @@
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||
<button type="button" id="btnPolicyBack"
|
||||
class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list"
|
||||
aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||
<button type="button" id="btnPolicyBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -41,8 +38,7 @@
|
||||
<input type="hidden" name="PrimaryKey" id="policy_PrimaryKey" />
|
||||
<input type="hidden" id="policy_form_action" />
|
||||
<input type="hidden" name="policy_type_id" id="policy_type_id" />
|
||||
<input type="hidden" name="client_id" id="client_id_policy"
|
||||
value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||
<input type="hidden" name="client_id" id="client_id_policy" value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
@ -96,20 +92,16 @@
|
||||
|
||||
<div class="form-row" id="second" style="display: none;">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_start_date">Policy Start Date<span
|
||||
class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Start Date "
|
||||
name="policy_start_date" id="start_date" required>
|
||||
<label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter End Date "
|
||||
name="policy_end_date" id="end_date" required>
|
||||
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4" id="policy_status_field">
|
||||
<label for="policy_status">Policy Status</label>
|
||||
<input value="" type="text" class="form-control" placeholder="Policy Status"
|
||||
id="policy_status" readonly>
|
||||
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -118,10 +110,8 @@
|
||||
</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="button" class="btn btn-secondary waves-effect btnBack"
|
||||
id="btnBack">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect btnBack" id="btnBack">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -265,9 +255,10 @@ $(document).ready(function() {
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
||||
} else {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="pointer-events:none; background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
}
|
||||
policyTable += ` </div>
|
||||
policyTable += `
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -378,7 +369,15 @@ $("#policy_form").submit(function(event) {
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
|
||||
`;
|
||||
if (item.open_for_enrollment == 0) {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
||||
} else {
|
||||
policyTable +=
|
||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||
}
|
||||
policyTable += `
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@ -582,11 +581,20 @@ $('body').on('click', '.btnPolicyEdit', function() {
|
||||
|
||||
$('body').on('click', '.btnOpenEnroll', function() {
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to approve this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: "Yes, delete it!"
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
var client_policy_id = $(this).attr('data-id');
|
||||
var policy_id = $(this).attr('id');
|
||||
var client_id = $('#client_id_policy').val()
|
||||
|
||||
|
||||
// console.log('client_policy_id', client_policy_id);
|
||||
|
||||
if (client_policy_id) {
|
||||
@ -602,6 +610,7 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
},
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
if (res.open_for_enrollment) {
|
||||
var json_decode = JSON.parse(res.open_for_enrollment);
|
||||
@ -613,8 +622,17 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
if ($(element).data('id') == client_policy_id) {
|
||||
$(element).css({
|
||||
'background-color': 'lightgrey',
|
||||
'pointer-events': 'none'
|
||||
});
|
||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.btnOpenEnroll').each(function(index, element) {
|
||||
if ($(element).data('id') == client_policy_id) {
|
||||
$(element).css({
|
||||
'background-color': '',
|
||||
});
|
||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -648,6 +666,10 @@ $('body').on('click', '.btnOpenEnroll', function() {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function appendPolicyFormFields(policy_type, data = false) {
|
||||
@ -1154,5 +1176,4 @@ $(document).ready(function(){
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -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>
|
||||
Loading…
Reference in New Issue
Block a user