CHANGE_DROPDOWN_VALUES_IN VIEW INCEPTION

This commit is contained in:
Srinivas-Saravanan 2025-01-08 15:21:17 +05:30
parent a494f3a567
commit d5b71addcd
3 changed files with 86 additions and 85 deletions

View File

@ -291,7 +291,8 @@ class EmployeeController extends AdminController
//for TPA/insurer upload
$data['events'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement'];
//for inception upload
$data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement','enrollment' => 'Enrolment'];
// $data['actions'] = ['inception' => 'Inception (Employee + Dependents)', 'missed_inception' => 'Missed Inception (Employee + Dependents)', 'addition' => 'Addition (Employee + Dependents)', 'dependent_addition' => 'Dependent Addition (Only Dependents)', 'deletion' => 'Deletion', 'correction' => 'Correction', 'si_enhancement' => 'SI Enhancement','enrollment' => 'Enrolment'];
$data['actions'] = ['enrollment' => 'Enrolment'];
$data['import_or_export'] = ['import' => 'Import', 'export' => 'Export'];
$data['insurer_or_tpa'] = ['insurer' => 'Insurer', 'tpa' => 'TPA'];

View File

@ -58,13 +58,14 @@ option:disabled {
<label>Event</label> <br />
<select name="upload-action-type" class="form-control"
id="upload-action-type" required>
<option value="">Select</option>
<!-- <option value="">Select</option> -->
<?php
if(isset($actions) && count($actions))
{
foreach($actions as $key => $action)
{
echo "<option value='$key'" . ($key == "si_enhancement" ? " class='si-enhancement-option'" : "") . ">$action</option>";
// echo "<option value='$key'" . ($key == "si_enhancement" ? " class='si-enhancement-option'" : "") . ">$action</option>";
echo "<option selected value='$key'>$action</option>";
}
}
?>
@ -97,7 +98,7 @@ option:disabled {
</div>
<div class="form-group col-md-2"
<!-- <div class="form-group col-md-2"
style="margin-top: 26px;position: relative;left: 65px;"> OR </div>
<div class="form-group col-md-4" style="margin-top: 18px;">
@ -105,7 +106,7 @@ option:disabled {
id="fetch_enrolled_data" data-toggle="modal"
data-target="#full-width-modal" title="Download Sample Excel">Fetch
Enrolled Data</a>
</div>
</div> -->
</div>
@ -345,14 +346,15 @@ $(window).on("load", function() {
client_id_param = params.get('client_id');
client_policy_param = params.get('client_policy_id');
client_branch_id_param = params.get('client_branch_id');
inception_param = params.get('actions');
// inception_param = params.get('actions');
inception_param = $('#upload-action-type').val()
// console.log('client_id:', client_id_param);
// console.log('client_policy_id:', client_policy_param);
// console.log('inception_param:', inception_param);
console.log('inception_param:', inception_param);
if(inception_param != null){
$('#upload-action-type').val('inception').change()
// $('#upload-action-type').val('inception').change()
var selectedValue = inception_param;
if (selectedValue !== '') {
@ -870,92 +872,90 @@ $('#fetch_enrolled_data').click(function()
})
$(document).ready(function() {
// $(document).ready(function() {
// $('#policy_id').change(function(){
$('#policy_id').change(function(){
// var selectedpolicy = $(this).val();
// console.log('selectedpolicy',selectedpolicy)
// $('#upload-action-type').val('').change();
// $('#file_upload').hide();
// $('#excel_download').removeAttr('href');
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);
// $.ajax({
// url: apiURL,
// method: 'GET',
// headers: {
// "Content-Type": "application/json",
// "X-Requested-With": "XMLHttpRequest"
// },
// success: function(response) {
var apiURL = '<?php echo base_url();?>' + 'util/fetch-emp-count/' + selectedpolicy;
// console.log(apiURL);
$.ajax({
url: apiURL,
method: 'GET',
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest"
},
success: function(response) {
// console.log('responce data emp_count', response);
console.log('responce data emp_count', response);
// if (response.code === 200 && response.dataStatus === true && response.data !== "") {
// try {
// console.log(response.emp_count.length)
// if(response.emp_count > 0){
if (response.code === 200 && response.dataStatus === true && response.data !== "") {
try {
console.log(response.emp_count.length)
if(response.emp_count > 0){
// var select = document.getElementById("upload-action-type");
// for (var i = 0; i < select.options.length; i++) {
// select.options[i].disabled = false;
// if (select.options[i].value === "inception") {
// select.options[i].disabled = true;
// // break;
// }
// }
// }else {
var select = document.getElementById("upload-action-type");
for (var i = 0; i < select.options.length; i++) {
select.options[i].disabled = false;
if (select.options[i].value === "inception") {
select.options[i].disabled = true;
// break;
}
}
}else {
// var select = document.getElementById("upload-action-type");
// for (var i = 0; i < select.options.length; i++) {
// select.options[i].disabled = true;
// if (select.options[i].value === "inception" || select.options[i].value === "enrollment") {
// select.options[i].disabled = false;
// }
// if (select.options[i].value === "" || select.options[i].value === "enrollment") {
// select.options[i].disabled = false;
// }
// }
// }
var select = document.getElementById("upload-action-type");
for (var i = 0; i < select.options.length; i++) {
select.options[i].disabled = true;
if (select.options[i].value === "inception" || select.options[i].value === "enrollment") {
select.options[i].disabled = false;
}
if (select.options[i].value === "" || select.options[i].value === "enrollment") {
select.options[i].disabled = false;
}
}
}
// } catch (error) {
// console.error('Error parsing API response data:', error);
// }
// } else if (response.code === 404 && response.dataStatus === false) {
} catch (error) {
console.error('Error parsing API response data:', error);
}
} else if (response.code === 404 && response.dataStatus === false) {
// console.error('no data found', response);
console.error('no data found', response);
// } else {
// console.error('Something went wrong!');
// }
// },
// error: function(xhr, status, error) {
// console.error('Error fetching data from API:', error);
// var select = document.getElementById("upload-action-type");
// for (var i = 0; i < select.options.length; i++) {
// if (select.options[i].value === "inception" || select.options[i].value === "enrollment" ) {
// select.options[i].disabled = false;
// break;
// }
// }
// }
// });
} else {
console.error('Something went wrong!');
}
},
error: function(xhr, status, error) {
console.error('Error fetching data from API:', error);
var select = document.getElementById("upload-action-type");
for (var i = 0; i < select.options.length; i++) {
if (select.options[i].value === "inception" || select.options[i].value === "enrollment" ) {
select.options[i].disabled = false;
break;
}
}
}
});
// if($('#policy_id').val() == 0){
if($('#policy_id').val() == 0){
// var select = document.getElementById("upload-action-type");
// console.log('select', select)
// for (var i = 0; i < select.options.length; i++) {
// select.options[i].disabled = false;
// console.log(select.options[i])
// }
// }
var select = document.getElementById("upload-action-type");
console.log('select', select)
for (var i = 0; i < select.options.length; i++) {
select.options[i].disabled = false;
console.log(select.options[i])
}
}
})
})
// })
// })
function checkPolicyTermsAndRackRatesHasDefiend(event)

View File

@ -19,16 +19,16 @@
<span class="d-none d-sm-inline-block">Data From Client</span>
</a>
</li>
<li class="nav-item">
<!-- <li class="nav-item">
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab">
<span class="mr-1"><i class="fa fa-file"></i></span>
<span class="d-none d-sm-inline-block">Insurer or TPA Data</span>
</a>
</li>
</li> -->
</ul>
<div class="tab-content">
<?php include('employee_upload.php'); ?>
<?php include('insurer_or_tpa_data.php'); ?>
<?php //include('insurer_or_tpa_data.php'); ?>
</div>
</div>
</div>