Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
Srinivas-Saravanan 2025-02-12 14:53:00 +05:30
commit ea9fb8dbc7
2 changed files with 40 additions and 12 deletions

View File

@ -140,23 +140,25 @@
<script> <script>
var client_list = []; var filter_client_list = [];
var branch_list = []; var filter_branch_list = [];
$(document).ready(function() { $(document).ready(function() {
$('#filter_client_id').select2(); $('#filter_client_id').select2();
$('#filter_client_branch_id').select2(); $('#filter_client_branch_id').select2();
$('#filter_policy_type').select2(); $('#filter_policy_type').select2();
getfilterClientAndBranch()
}); });
$(document).ready(function() { $(document).ready(function() {
$('#filter_client_id').change(function() { $('#filter_client_id').change(function() {
let client_id = $(this).val(); let client_id = $(this).val();
if (branch_list != '') { if (filter_branch_list != '') {
// console.log(branch_list[client_id]); // console.log(branch_list[client_id]);
let data = branch_list[client_id]; let data = filter_branch_list[client_id];
appendBranch(data); appendfilterBranch(data);
} }
}) })
@ -225,7 +227,7 @@ function fetchTicketListData() {
} }
//function for fetch client, branch //function for fetch client, branch
function getClientAndBranchAndPolicy() { function getfilterClientAndBranch() {
$.ajax({ $.ajax({
url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>', url: '<?= base_url("/util/getClientAndBranchAndPolicy") ?>',
type: "GET", type: "GET",
@ -234,9 +236,9 @@ function getClientAndBranchAndPolicy() {
console.log('getClientAndBranchAndPolicy', res); console.log('getClientAndBranchAndPolicy', res);
if (res.status == true) { if (res.status == true) {
client_list = res.client_data; filter_client_list = res.client_data;
branch_list = res.branch_data; filter_branch_list = res.branch_data;
appendClients(res.client_data); appendfilterClients(res.client_data);
} else { } else {
console.log('No data found'); console.log('No data found');
} }
@ -252,7 +254,7 @@ function getClientAndBranchAndPolicy() {
//----- END AJAX FUNCTIONS -------------------------------------------------------------------------------- //----- END AJAX FUNCTIONS --------------------------------------------------------------------------------
function appendClients(data) { function appendfilterClients(data) {
$('#filter_client_id').empty(); $('#filter_client_id').empty();
@ -272,7 +274,7 @@ function appendClients(data) {
} }
function appendBranch(data) { function appendfilterBranch(data) {
$('#filter_client_branch_id').empty(); $('#filter_client_branch_id').empty();

View File

@ -1654,6 +1654,32 @@ $('.policy_type_id').change(function() {
$('.freashDiv').show(); $('.freashDiv').show();
} else { } else {
$('.freashDiv').hide(); // Optional: Hide when `policy_type_id` is not 2 $('.freashDiv').hide(); // Optional: Hide when `policy_type_id` is not 2
}}); }});
function appendThreeYearsClaims()
{
html = `
<div class="form-group col-md-3">
<label for="first_year_${increment}">Year<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_year_${increment}" name="first_year[]">
</div>
<div class="form-group col-md-3">
<label for="first_claim_amount_${increment}">Claim Amount / Settled Amount<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_amount_${increment}" name="first_claim_amount[]">
</div>
<div class="form-group col-md-3">
<label for="first_claim_status_${increment}">Claim Status<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_claim_status_${increment}" name="first_claim_status[]">
</div>
<div class="form-group col-md-3">
<label for="first_casue_of_death_${increment}">Nature / Casue Of Death <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_casue_of_death_${increment}" name="first_casue_of_death[]">
</div>
<div class="form-group col-md-3">
<label for="first_death_date_${increment}">Date of Death<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_death_date_${increment}" name="first_death_date[]">
</div>
`;
}
</script> </script>