FIX_Issues
This commit is contained in:
parent
7ad48bb0dc
commit
742336d6b0
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
helper('datatable_view');
|
||||||
$batch_header_labels = [
|
$batch_header_labels = [
|
||||||
'S.No', 'Batch Code', 'File Name', 'Client', 'Client Branch', 'Client Policy',
|
'S.No', 'Batch Code', 'File Name', 'Client', 'Client Branch', 'Client Policy',
|
||||||
'Event Type', 'Insurer/ TPA', 'Action', 'Count', '(₹)Amount', 'User/Time', 'Status', 'Action',
|
'Event Type', 'Insurer/ TPA', 'Action', 'Count', '(₹)Amount', 'User/Time', 'Status', 'Action',
|
||||||
|
|||||||
@ -242,6 +242,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("scroll-horizontal-datatable");
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
|
|
||||||
@ -329,6 +330,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,10 +10,19 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var pageHideMainNavTitle = true;
|
||||||
|
var pageTitle = 'Client Details - <?= $client['client_name'] ?> ( <?= $client['short_name'] ?> ) ';
|
||||||
|
var pageBackButton = '<a href="<?= base_url("client/list"); ?>" class="topbar-icon-btn" data-toggle="tooltip" data-placement="top" title="Back to Client List" aria-label="Back to Client List"><i class="ri-arrow-left-s-line"></i></a>';
|
||||||
|
if (typeof window.applyTopNavbarTitle === 'function') {
|
||||||
|
window.applyTopNavbarTitle();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class="row" id="client_info">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
<div id="client_info">
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div id="accordion" class="mb-3">
|
<div id="accordion" class="mb-3">
|
||||||
@ -23,12 +32,17 @@
|
|||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
|
|
||||||
<h4 style="position: relative; left: 18px; top: 2px;">
|
<h4 style="position: relative; left: 18px; top: 2px;">
|
||||||
|
<!--
|
||||||
<span class="client_info_close fs-6" id="close_btn">
|
<span class="client_info_close fs-6" id="close_btn">
|
||||||
<i class="mdi mdi-chevron-left" style="font-size: 28px;cursor:pointer;"></i>
|
<i class="mdi mdi-chevron-left" style="font-size: 28px;cursor:pointer;"></i>
|
||||||
</span>
|
</span>
|
||||||
|
-->
|
||||||
<span>
|
<span>
|
||||||
|
<!--
|
||||||
Client Basic Info -
|
Client Basic Info -
|
||||||
<strong> <?= $client['client_name'] ?> ( <?= $client['short_name'] ?> ) </strong>
|
<strong> <?= $client['client_name'] ?> ( <?= $client['short_name'] ?> ) </strong>
|
||||||
|
-->
|
||||||
|
Client Basic Information
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</h4>
|
</h4>
|
||||||
@ -228,8 +242,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -205,6 +205,10 @@ table.dataTable thead th {
|
|||||||
<?php if(in_array(get_role_id(), [1, 5])) { ?>
|
<?php if(in_array(get_role_id(), [1, 5])) { ?>
|
||||||
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
<a class="dropdown-item" data-id="<?= $row->id;?>" onclick="removeClient(this)"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<a class="dropdown-item" href="javascript:void(0);" onclick="openClientDetailsPage(<?= $row->id ?>)">
|
||||||
|
<i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>Open Client Details
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -257,6 +261,7 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
/**
|
||||||
const table = document.getElementById("client-list-table");
|
const table = document.getElementById("client-list-table");
|
||||||
|
|
||||||
// Create custom dropdown
|
// Create custom dropdown
|
||||||
@ -344,9 +349,9 @@ table.dataTable thead th {
|
|||||||
activeDropdown = null;
|
activeDropdown = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
// Open client details page
|
// Open client details page
|
||||||
function openClientDetailsPage(clientId) {
|
window.openClientDetailsPage = function(clientId) {
|
||||||
$('.loader').fadeIn();
|
$('.loader').fadeIn();
|
||||||
$('.loader-mask').fadeIn();
|
$('.loader-mask').fadeIn();
|
||||||
|
|
||||||
@ -369,7 +374,7 @@ table.dataTable thead th {
|
|||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -91,9 +91,9 @@ if ($emp_show_branch) {
|
|||||||
$emp_header_labels[] = 'Branch';
|
$emp_header_labels[] = 'Branch';
|
||||||
}
|
}
|
||||||
$emp_header_labels = array_merge($emp_header_labels, [
|
$emp_header_labels = array_merge($emp_header_labels, [
|
||||||
'Name', 'EMP Code', 'Relationship', 'Gender', 'Email', 'Mobile', 'Date of Birth',
|
'Name ', 'EMP Code ', 'Relationship ', 'Gender ', 'Email', 'Mobile', 'Date of Birth',
|
||||||
'Policy name', 'Insurer name', 'TPA ID', 'Risk ID', 'Policy status',
|
'Policy name ', 'Insurer name ', 'TPA ID ', 'Risk ID ', 'Policy status ',
|
||||||
'(₹)Sum Insured', '(₹)Premium', '(₹)Pro Rata Premium', '(₹)GST', 'Action',
|
'(₹)Sum Insured ', '(₹)Premium ', '(₹)Pro Rata Premium ', '(₹)GST ', 'Action ',
|
||||||
]);
|
]);
|
||||||
$emp_col_count = count($emp_header_labels);
|
$emp_col_count = count($emp_header_labels);
|
||||||
$emp_col_max_len = array_fill(0, $emp_col_count, 0);
|
$emp_col_max_len = array_fill(0, $emp_col_count, 0);
|
||||||
@ -157,8 +157,20 @@ if (isset($employees)) {
|
|||||||
$emp_col_max_len[$emp_col_count - 6] = max($emp_col_max_len[$emp_col_count - 6], mb_strlen('Total'));
|
$emp_col_max_len[$emp_col_count - 6] = max($emp_col_max_len[$emp_col_count - 6], mb_strlen('Total'));
|
||||||
$emp_col_min_px = array_fill(0, $emp_col_count, 80);
|
$emp_col_min_px = array_fill(0, $emp_col_count, 80);
|
||||||
$emp_col_max_px = array_fill(0, $emp_col_count, 360);
|
$emp_col_max_px = array_fill(0, $emp_col_count, 360);
|
||||||
$emp_col_min_px[0] = 48;
|
$emp_col_min_px[0] = 64;
|
||||||
$emp_col_max_px[0] = 72;
|
$emp_col_max_px[0] = 88;
|
||||||
|
|
||||||
|
$emp_dynamic_idx = 1;
|
||||||
|
if ($emp_show_client_branch || $emp_show_branch) {
|
||||||
|
$emp_col_min_px[$emp_dynamic_idx] = max($emp_col_min_px[$emp_dynamic_idx], 120);
|
||||||
|
$emp_col_max_px[$emp_dynamic_idx] = max($emp_col_max_px[$emp_dynamic_idx], 190);
|
||||||
|
$emp_dynamic_idx++;
|
||||||
|
}
|
||||||
|
$emp_col_min_px[$emp_dynamic_idx] = max($emp_col_min_px[$emp_dynamic_idx], 110); // Name
|
||||||
|
$emp_dynamic_idx++;
|
||||||
|
$emp_col_min_px[$emp_dynamic_idx] = max($emp_col_min_px[$emp_dynamic_idx], 100); // EMP Code
|
||||||
|
$emp_col_max_px[$emp_dynamic_idx] = max($emp_col_max_px[$emp_dynamic_idx], 140);
|
||||||
|
|
||||||
$emp_col_min_px[$emp_col_count - 1] = 72;
|
$emp_col_min_px[$emp_col_count - 1] = 72;
|
||||||
$emp_col_max_px[$emp_col_count - 1] = 96;
|
$emp_col_max_px[$emp_col_count - 1] = 96;
|
||||||
$emp_col_width_px = nhance_dt_column_widths_px($emp_header_labels, $emp_col_max_len, $emp_col_min_px, $emp_col_max_px);
|
$emp_col_width_px = nhance_dt_column_widths_px($emp_header_labels, $emp_col_max_len, $emp_col_min_px, $emp_col_max_px);
|
||||||
@ -183,6 +195,11 @@ $gst_total = 0;
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
|
#employee-data-list-table,
|
||||||
|
#employee-data-list-table_wrapper .dataTables_scrollHead table,
|
||||||
|
#employee-data-list-table_wrapper .dataTables_scrollBody table {
|
||||||
|
table-layout: fixed !important;
|
||||||
|
}
|
||||||
#employee-data-list-table tbody td:not(:last-child) {
|
#employee-data-list-table tbody td:not(:last-child) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
@ -201,6 +218,15 @@ $gst_total = 0;
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
}
|
}
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting:before,
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting:after,
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting_asc:before,
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting_asc:after,
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting_desc:before,
|
||||||
|
#employee-data-list-table_wrapper table.dataTable thead .sorting_desc:after {
|
||||||
|
right: 0.55rem !important;
|
||||||
|
opacity: 1 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="client_list">
|
<div class="row" id="client_list">
|
||||||
@ -213,7 +239,7 @@ $gst_total = 0;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table data-custom-table-css="table" class="table table-hover m-0 table-centered nowrap w-100 dt-responsive" cellspacing="0" id="employee-data-list-table">
|
<table data-custom-table-css="table" class="table table-hover m-0 table-centered nowrap w-100" cellspacing="0" id="employee-data-list-table">
|
||||||
<thead class="bg-light">
|
<thead class="bg-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="font-weight-medium">S.No </th>
|
<th class="font-weight-medium">S.No </th>
|
||||||
@ -240,7 +266,7 @@ $gst_total = 0;
|
|||||||
<th class="font-weight-medium">Policy status </th>
|
<th class="font-weight-medium">Policy status </th>
|
||||||
<th class="font-weight-medium">(₹)Sum Insured </th>
|
<th class="font-weight-medium">(₹)Sum Insured </th>
|
||||||
<th class="font-weight-medium">(₹)Premium </th>
|
<th class="font-weight-medium">(₹)Premium </th>
|
||||||
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">(₹)Pro Rata <br> Premium </th>
|
<th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">(₹)Pro Rata Premium </th>
|
||||||
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">(₹)GST </th>
|
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">(₹)GST </th>
|
||||||
<th class="font-weight-medium" > Action </th>
|
<th class="font-weight-medium" > Action </th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -344,29 +370,17 @@ $gst_total = 0;
|
|||||||
|
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<?php for ($i = 0; $i < $emp_col_count; $i++) : ?>
|
||||||
<?php if (isset($getData)) {
|
<?php if ($i === ($emp_col_count - 4)) : ?>
|
||||||
if ($getData['client_id'] == '0' && $getData['policy_id'] == '0' && $getData['branch_id'] == '0' && ($getData['emp_code'] != "" || $getData['emp_name'] != "" || $getData['status'] != "")) { ?>
|
<th>Total</th>
|
||||||
|
<?php elseif ($i === ($emp_col_count - 3)) : ?>
|
||||||
|
<th><?php echo format_indian_number($pro_rata_total); ?></th>
|
||||||
|
<?php elseif ($i === ($emp_col_count - 2)) : ?>
|
||||||
|
<th><?php echo format_indian_number($gst_total); ?></th>
|
||||||
|
<?php else : ?>
|
||||||
<th></th>
|
<th></th>
|
||||||
<?php }
|
<?php endif; ?>
|
||||||
if ($getData['client_id'] != '0' && $getData['branch_id'] == '0') { ?>
|
<?php endfor; ?>
|
||||||
<th></th>
|
|
||||||
<?php } } ?>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
<th>Total</th>
|
|
||||||
<th><?php echo format_indian_number($pro_rata_total); ?></th>
|
|
||||||
<th><?php echo format_indian_number($gst_total); ?></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -239,6 +239,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("scroll-horizontal-datatable");
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
@ -328,6 +329,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -338,11 +340,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
if (ticketsTable.length) {
|
if (ticketsTable.length) {
|
||||||
ticketsTable.DataTable({
|
ticketsTable.DataTable({
|
||||||
// dom:
|
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" +
|
||||||
// "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
|
||||||
// "<'row'<'col-sm-12'tr>>" +
|
|
||||||
// "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
|
||||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
|
||||||
"<'row'<'col-sm-12'tr>>" +
|
"<'row'<'col-sm-12'tr>>" +
|
||||||
"<'row align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>",
|
"<'row align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>",
|
||||||
lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]],
|
lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]],
|
||||||
@ -409,110 +407,23 @@ $(document).ready(function () {
|
|||||||
} else {
|
} else {
|
||||||
console.error("Table not found.");
|
console.error("Table not found.");
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
|
getURLParams();
|
||||||
$(document).ready(function() {
|
|
||||||
getURLParams()
|
|
||||||
$('#client_id').select2();
|
$('#client_id').select2();
|
||||||
$('#insurer_id').select2();
|
$('#insurer_id').select2();
|
||||||
$('#policy_type_id').select2();
|
$('#policy_type_id').select2();
|
||||||
})
|
|
||||||
|
|
||||||
function fetchEmpolyeeList(event) {
|
|
||||||
event.preventDefault(); // Prevent default action
|
|
||||||
|
|
||||||
var start_date = $('#startDate').val();
|
|
||||||
var end_date = $('#endDate').val();
|
|
||||||
var client_id = $('#client_id').val();
|
|
||||||
var insurer_id = $('#insurer_id').val();
|
|
||||||
var policy_type_id = $('#policy_type_id').val();
|
|
||||||
var date_type = $('#date_type').val();
|
|
||||||
var issuer = $('#issuer').val();
|
|
||||||
|
|
||||||
console.log(start_date + '-' + end_date);
|
|
||||||
|
|
||||||
var queryParams = {
|
|
||||||
start_date: start_date,
|
|
||||||
end_date: end_date,
|
|
||||||
client_id: client_id,
|
|
||||||
insurer_id: insurer_id,
|
|
||||||
policy_type_id: policy_type_id,
|
|
||||||
date_type: date_type,
|
|
||||||
issuer: issuer,
|
|
||||||
};
|
|
||||||
|
|
||||||
const queryString = objectToQueryString(queryParams);
|
|
||||||
const apiURL = $('#get-emp-list').attr('href') + "?" + queryString;
|
|
||||||
console.log(apiURL);
|
|
||||||
window.location.href = apiURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
function objectToQueryString(obj) {
|
|
||||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getURLParams() {
|
|
||||||
const url = new URL(window.location.href);
|
|
||||||
const params = new URLSearchParams(url.search);
|
|
||||||
|
|
||||||
const startDate = params.get('start_date') || 0; // Default to 0 if not found
|
|
||||||
const endDate = params.get('end_date') || 0; // Default to 0 if not found
|
|
||||||
const client_id = params.get('client_id') || 0; // Default to 0 if not found
|
|
||||||
const insurer_id = params.get('insurer_id') || 0; // Default to 0 if not found
|
|
||||||
const policy_type_id = params.get('policy_type_id') || 0; // Default to 0 if not found
|
|
||||||
const date_type = params.get('date_type') || 0; // Default to 0 if not found
|
|
||||||
const issuer = params.get('issuer') || 0; // Default to 0 if not found
|
|
||||||
|
|
||||||
hideDateField(date_type)
|
|
||||||
|
|
||||||
console.log('startDate', startDate)
|
|
||||||
console.log('endDate', endDate)
|
|
||||||
console.log('client_id', client_id)
|
|
||||||
console.log('insurer_id', insurer_id)
|
|
||||||
console.log('policy_type_id', policy_type_id)
|
|
||||||
console.log('date_type', date_type)
|
|
||||||
console.log('issuer', issuer)
|
|
||||||
|
|
||||||
// Log the values or use them as needed
|
|
||||||
console.log('Start Date:', startDate);
|
|
||||||
console.log('End Date:', endDate);
|
|
||||||
|
|
||||||
if (startDate != 0 && endDate != 0) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$('#start_date').val(startDate)
|
|
||||||
$('#end_date').val(endDate)
|
|
||||||
$('#client_id').val(client_id).change()
|
|
||||||
$('#insurer_id').val(insurer_id).change()
|
|
||||||
$('#policy_type_id').val(policy_type_id).change()
|
|
||||||
$('#date_type').val(date_type)
|
|
||||||
$('#issuer').val(issuer)
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
|
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
const params = new URLSearchParams(url.search);
|
const params = new URLSearchParams(url.search);
|
||||||
|
|
||||||
// Get start and end dates from URL parameters, or use default values
|
|
||||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
||||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
||||||
|
|
||||||
// Parse the dates to moment objects
|
|
||||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
var start = moment(startDateParam, 'DD-MM-YYYY');
|
||||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
var end = moment(endDateParam, 'DD-MM-YYYY');
|
||||||
|
|
||||||
// var start = moment().subtract(29, 'days');
|
function cb(startDate, endDate) {
|
||||||
// var end = moment();
|
$('#reportrange').html(startDate.format('D-MM-YYYY') + ' - ' + endDate.format('D-MM-YYYY'));
|
||||||
|
$('#startDate').val(startDate.format('DD-MM-YYYY'));
|
||||||
function cb(start, end) {
|
$('#endDate').val(endDate.format('DD-MM-YYYY'));
|
||||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
|
||||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
|
||||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#reportrange').daterangepicker({
|
$('#reportrange').daterangepicker({
|
||||||
@ -525,18 +436,24 @@ $(function() {
|
|||||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month')
|
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
.endOf('month')
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
});
|
}, cb);
|
||||||
|
|
||||||
$(document).ready(function() {
|
cb(start, end);
|
||||||
getURLParams()
|
|
||||||
$('#client_id').select2();
|
$('#clear-filters').on('click', function() {
|
||||||
$('#insurer_id').select2();
|
$('#client_id').val('0').change();
|
||||||
$('#policy_type_id').select2();
|
$('#insurer_id').val('0').change();
|
||||||
})
|
$('#policy_type_id').val('0').change();
|
||||||
|
$('#date_type').val('0');
|
||||||
|
$('#issuer').val('0');
|
||||||
|
$('#date_div').hide();
|
||||||
|
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
||||||
|
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
||||||
|
cb(moment().subtract(29, 'days'), moment());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function fetchEmpolyeeList(event) {
|
function fetchEmpolyeeList(event) {
|
||||||
event.preventDefault(); // Prevent default action
|
event.preventDefault(); // Prevent default action
|
||||||
@ -568,7 +485,9 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function objectToQueryString(obj) {
|
function objectToQueryString(obj) {
|
||||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
return Object.keys(obj).map(function(key) {
|
||||||
|
return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
|
||||||
|
}).join('&');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getURLParams() {
|
function getURLParams() {
|
||||||
@ -599,78 +518,17 @@ $(function() {
|
|||||||
|
|
||||||
if (startDate != 0 && endDate != 0) {
|
if (startDate != 0 && endDate != 0) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('#start_date').val(startDate)
|
$('#startDate').val(startDate);
|
||||||
$('#end_date').val(endDate)
|
$('#endDate').val(endDate);
|
||||||
$('#client_id').val(client_id).change()
|
$('#client_id').val(client_id).change();
|
||||||
$('#insurer_id').val(insurer_id).change()
|
$('#insurer_id').val(insurer_id).change();
|
||||||
$('#policy_type_id').val(policy_type_id).change()
|
$('#policy_type_id').val(policy_type_id).change();
|
||||||
$('#date_type').val(date_type)
|
$('#date_type').val(date_type);
|
||||||
$('#issuer').val(issuer)
|
$('#issuer').val(issuer);
|
||||||
}, 1000)
|
}, 300);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
|
||||||
|
|
||||||
const url = new URL(window.location.href);
|
|
||||||
const params = new URLSearchParams(url.search);
|
|
||||||
|
|
||||||
// Get start and end dates from URL parameters, or use default values
|
|
||||||
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
|
|
||||||
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
|
|
||||||
|
|
||||||
// Parse the dates to moment objects
|
|
||||||
var start = moment(startDateParam, 'DD-MM-YYYY');
|
|
||||||
var end = moment(endDateParam, 'DD-MM-YYYY');
|
|
||||||
|
|
||||||
// var start = moment().subtract(29, 'days');
|
|
||||||
// var end = moment();
|
|
||||||
|
|
||||||
function cb(start, end) {
|
|
||||||
$('#reportrange').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
|
|
||||||
$('#startDate').val(start.format('DD-MM-YYYY'));
|
|
||||||
$('#endDate').val(end.format('DD-MM-YYYY'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#reportrange').daterangepicker({
|
|
||||||
startDate: start,
|
|
||||||
endDate: end,
|
|
||||||
locale: {
|
|
||||||
format: 'DD-MM-YYYY'
|
|
||||||
},
|
|
||||||
ranges: {
|
|
||||||
'Today': [moment(), moment()],
|
|
||||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
|
||||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
|
||||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
|
||||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
|
||||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month')
|
|
||||||
.endOf('month')
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}, cb);
|
|
||||||
|
|
||||||
cb(start, end);
|
|
||||||
|
|
||||||
$('#clear-filters').on('click', function() {
|
|
||||||
// Reset all select dropdowns to the first option
|
|
||||||
$('#client_id').val('0').change();
|
|
||||||
$('#insurer_id').val('0').change();
|
|
||||||
$('#policy_type_id').val('0').change();
|
|
||||||
$('#date_type').val('0');
|
|
||||||
$('#issuer').val('0');
|
|
||||||
$('#date_div').hide()
|
|
||||||
|
|
||||||
// Reset the date range picker to default
|
|
||||||
$('#reportrange').data('daterangepicker').setStartDate(moment().subtract(29, 'days'));
|
|
||||||
$('#reportrange').data('daterangepicker').setEndDate(moment());
|
|
||||||
cb(start, end); // Update the displayed date range
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function hideDateField(input = null) {
|
function hideDateField(input = null) {
|
||||||
let val = $('#date_type').val();
|
let val = $('#date_type').val();
|
||||||
|
|
||||||
|
|||||||
@ -614,6 +614,7 @@ $isl_col_width_px = nhance_dt_column_widths_px($isl_header_labels, $isl_col_max_
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
/**
|
||||||
const table = document.getElementById("insurer-statement-list-table");
|
const table = document.getElementById("insurer-statement-list-table");
|
||||||
|
|
||||||
// Create custom dropdown
|
// Create custom dropdown
|
||||||
@ -690,6 +691,7 @@ $isl_col_width_px = nhance_dt_column_widths_px($isl_header_labels, $isl_col_max_
|
|||||||
activeDropdown = null;
|
activeDropdown = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -138,7 +138,9 @@ $kyc_col_width_px = nhance_dt_column_widths_px($kyc_header_labels, $kyc_col_max_
|
|||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("kyc-list-table");
|
const table = document.getElementById("kyc-list-table");
|
||||||
|
|
||||||
@ -226,6 +228,7 @@ $kyc_col_width_px = nhance_dt_column_widths_px($kyc_header_labels, $kyc_col_max_
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|||||||
@ -1453,35 +1453,6 @@ $(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function nhApplyMenuScrollLimit($menu, usableSpace) {
|
|
||||||
if (!$menu || !$menu.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var $items = $menu.children('.dropdown-item:visible, a:visible, button:visible');
|
|
||||||
var visibleItems = 3;
|
|
||||||
var fixedMenuMax = 0;
|
|
||||||
if ($items.length) {
|
|
||||||
$items.slice(0, visibleItems).each(function () {
|
|
||||||
fixedMenuMax += $(this).outerHeight(true) || 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!fixedMenuMax) {
|
|
||||||
fixedMenuMax = 132; // safe default for 3 items
|
|
||||||
}
|
|
||||||
fixedMenuMax += 14; // include menu paddings/borders
|
|
||||||
var viewportMax = Math.max(140, usableSpace - 12);
|
|
||||||
var finalMax = Math.max(132, Math.min(fixedMenuMax, viewportMax));
|
|
||||||
|
|
||||||
$menu.css({
|
|
||||||
maxHeight: finalMax + 'px',
|
|
||||||
overflowY: 'auto',
|
|
||||||
overflowX: 'hidden',
|
|
||||||
scrollBehavior: 'smooth',
|
|
||||||
overscrollBehavior: 'contain',
|
|
||||||
zIndex: '20050'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function nhNormalizeActionCells(tableApi) {
|
function nhNormalizeActionCells(tableApi) {
|
||||||
if (!tableApi) {
|
if (!tableApi) {
|
||||||
return;
|
return;
|
||||||
@ -1584,12 +1555,16 @@ $(function(){
|
|||||||
$dd.data('nh-auto-dropup', 1);
|
$dd.data('nh-auto-dropup', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep height capped to ~3 items and allow vertical scroll for extra actions.
|
// Keep action menu fully expanded (no inner scroll).
|
||||||
if ($menu.length && menuHeight > 0) {
|
if ($menu.length && menuHeight > 0) {
|
||||||
var usableSpace = openUp ? above : below;
|
$menu.css({
|
||||||
nhApplyMenuScrollLimit($menu, usableSpace);
|
maxHeight: '',
|
||||||
$menu.addClass('nh-action-menu-elevated');
|
overflowY: '',
|
||||||
$menu.scrollTop(0);
|
overflowX: '',
|
||||||
|
scrollBehavior: '',
|
||||||
|
overscrollBehavior: '',
|
||||||
|
zIndex: '20050'
|
||||||
|
}).addClass('nh-action-menu-elevated');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -367,6 +367,7 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
<?php include('policy_transaction_endorsement_form_2.php'); ?>
|
<?php include('policy_transaction_endorsement_form_2.php'); ?>
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
@ -446,6 +447,7 @@ table.dataTable thead th {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
var client_list = '';
|
var client_list = '';
|
||||||
|
|||||||
@ -426,7 +426,7 @@ table.dataTable tbody td {
|
|||||||
function closeFilterNav() {
|
function closeFilterNav() {
|
||||||
document.getElementById("filter-sidebar").style.width = "0";
|
document.getElementById("filter-sidebar").style.width = "0";
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
@ -518,6 +518,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -195,6 +195,7 @@ $pt_col_width_px = nhance_dt_column_widths_px($pt_header_labels, $pt_col_max_len
|
|||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("policy-type-list-table");
|
const table = document.getElementById("policy-type-list-table");
|
||||||
|
|
||||||
@ -276,6 +277,7 @@ $pt_col_width_px = nhance_dt_column_widths_px($pt_header_labels, $pt_col_max_len
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -598,6 +598,7 @@ $pos_col_width_px = nhance_dt_column_widths_px($pos_header_labels, $pos_col_max_
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("pos-list-table");
|
const table = document.getElementById("pos-list-table");
|
||||||
|
|
||||||
@ -685,4 +686,5 @@ $pos_col_width_px = nhance_dt_column_widths_px($pos_header_labels, $pos_col_max_
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
@ -590,6 +590,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("scroll-horizontal-datatable");
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
|
|
||||||
@ -676,4 +677,5 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
@ -144,6 +144,7 @@ $tpa_col_width_px = nhance_dt_column_widths_px($tpa_header_labels, $tpa_col_max_
|
|||||||
|
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("tpa-list-table");
|
const table = document.getElementById("tpa-list-table");
|
||||||
if (!table) {
|
if (!table) {
|
||||||
@ -234,6 +235,7 @@ $tpa_col_width_px = nhance_dt_column_widths_px($tpa_header_labels, $tpa_col_max_
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -757,6 +757,9 @@ div.dataTables_wrapper table.dataTable tbody td.table-action-cell .dropdown-menu
|
|||||||
border: 1px solid rgba(0, 0, 0, 0.12) !important;
|
border: 1px solid rgba(0, 0, 0, 0.12) !important;
|
||||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
|
||||||
z-index: 1080 !important;
|
z-index: 1080 !important;
|
||||||
|
max-height: none !important;
|
||||||
|
overflow-y: visible !important;
|
||||||
|
overflow-x: visible !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.dataTables_wrapper table.dataTable tbody td.table-action-cell .dropdown-menu .dropdown-item {
|
div.dataTables_wrapper table.dataTable tbody td.table-action-cell .dropdown-menu .dropdown-item {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user