From 1263a149b5bf1985a6f54e0ad4e42e9781fe0fc2 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Sat, 18 Apr 2026 18:06:43 +0530 Subject: [PATCH 01/12] FIX_datatable = new helper + new js + new css --- app/Helpers/datatable_view_helper.php | 28 ++++ app/Views/add_image_list.php | 85 +++++++++- app/Views/bds_renewal_report_list.php | 89 ++++++++++- app/Views/cd_master_list.php | 86 +++++++++- app/Views/client_deposit_list.php | 83 +++++++++- app/Views/client_list.php | 93 +++++++++-- app/Views/employee_data_list.php | 147 +++++++++++++++++- app/Views/endorsement_list.php | 90 ++++++++++- app/Views/expense_list.php | 84 +++++++++- app/Views/faq_list.php | 91 ++++++++++- app/Views/frontend_content_list.php | 89 +++++++++-- app/Views/hr_file_upload.php | 74 ++++++++- app/Views/insurer_statement_list.php | 92 ++++++++++- app/Views/invoice_policy_mapping_add.php | 11 +- app/Views/kyc_list.php | 75 ++++++++- app/Views/layout/footer.php | 21 ++- app/Views/leads_list.php | 126 ++++++++++++++- app/Views/nhance_branch_list.php | 75 ++++++++- app/Views/outstanding_report_list.php | 84 +++++++++- app/Views/policy_type_list.php | 83 +++++++++- app/Views/pos_list.php | 77 ++++++++- app/Views/report_bds.php | 2 + app/Views/retail_endorsement_list.php | 116 ++++++++++++-- app/Views/rto_master_list.php | 79 +++++++++- app/Views/thz_list.php | 104 ++++++++++++- app/Views/variance_report_list.php | 87 ++++++++++- app/Views/vehicle_master_list.php | 82 +++++++++- app/Views/vehicle_type_list.php | 87 +++++++++-- .../assets/js/pages/nhance-list-datatable.js | 111 +++++++++++++ 29 files changed, 2193 insertions(+), 158 deletions(-) create mode 100644 app/Helpers/datatable_view_helper.php create mode 100644 public/assets/js/pages/nhance-list-datatable.js diff --git a/app/Helpers/datatable_view_helper.php b/app/Helpers/datatable_view_helper.php new file mode 100644 index 00000000..3089f4b1 --- /dev/null +++ b/app/Helpers/datatable_view_helper.php @@ -0,0 +1,28 @@ + $headerLabels + * @param array $maxLenPerCol Same length as $headerLabels + * @param array $minPx + * @param array $maxPx + * @return array + */ +function nhance_dt_column_widths_px(array $headerLabels, array $maxLenPerCol, array $minPx, array $maxPx): array +{ + $n = count($headerLabels); + $out = []; + for ($i = 0; $i < $n; $i++) { + $chars = max($maxLenPerCol[$i] ?? 0, mb_strlen($headerLabels[$i])); + $px = (int) round($chars * 7.0 + 26); + $out[] = min( + (int) ($maxPx[$i] ?? 640), + max((int) ($minPx[$i] ?? 48), $px) + ); + } + + return $out; +} diff --git a/app/Views/add_image_list.php b/app/Views/add_image_list.php index 4417e947..43b32fe5 100755 --- a/app/Views/add_image_list.php +++ b/app/Views/add_image_list.php @@ -1,3 +1,27 @@ +
@@ -22,7 +85,7 @@
--> - +
@@ -338,7 +401,8 @@ $('#add_image_id').val(''); $('#client_id').val(null).trigger('change'); $('#advertise_image').val(''); - table = $('#tickets-table').DataTable({ + nhanceListDataTableBeforeInit(); + table = $('#add-image-list-table').DataTable(nhanceMergeListDataTableOptions({ // dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, button right // "<'row'<'col-sm-12'tr>>" + // "<'row'<'col-sm-5'i><'col-sm-7'p>>", @@ -372,15 +436,22 @@ next: '►' } }, - paging: true - }); + paging: true, + columnDefs: [ + + { targets: , width: 'px' }, + + ], + })); + nhanceListDataTableAfterInit(); + nhanceListDataTableBindAdjust(table); function applyBottomRowDropup() { if (!table) return; const currentRows = table.rows({ page: 'current' }).nodes().toArray(); - $('#tickets-table tbody tr').removeClass('nh-force-dropup'); - $('#tickets-table tbody tr td.table-action-cell .btn-group.dropdown').removeClass('dropup'); + $('#add-image-list-table tbody tr').removeClass('nh-force-dropup'); + $('#add-image-list-table tbody tr td.table-action-cell .btn-group.dropdown').removeClass('dropup'); const targetCount = Math.min(2, currentRows.length); for (let i = 0; i < targetCount; i++) { @@ -392,7 +463,7 @@ } applyBottomRowDropup(); - $('#tickets-table').on('draw.dt', applyBottomRowDropup); + $('#add-image-list-table').on('draw.dt', applyBottomRowDropup); }); // ✅ Define your modal function separately diff --git a/app/Views/bds_renewal_report_list.php b/app/Views/bds_renewal_report_list.php index 16bb337a..40464f77 100644 --- a/app/Views/bds_renewal_report_list.php +++ b/app/Views/bds_renewal_report_list.php @@ -1,3 +1,41 @@ + $row) { + $bds_col_max_len[0] = max($bds_col_max_len[0], mb_strlen((string) ($index + 1))); + $rm = empty($row['policy_end_date']) ? ' - ' : date('M-Y', strtotime((string) $row['policy_end_date'])); + $bds_col_max_len[1] = max($bds_col_max_len[1], mb_strlen($rm)); + $bds_col_max_len[2] = max($bds_col_max_len[2], mb_strlen((string) ($issuer[$row['issuer']] ?? ' - '))); + $bds_col_max_len[3] = max($bds_col_max_len[3], mb_strlen((string) ($row['policy_no'] ?? ' - '))); + $bds_col_max_len[4] = max($bds_col_max_len[4], mb_strlen((string) ($row['policy_type'] ?? ' - '))); + $bds_col_max_len[5] = max($bds_col_max_len[5], mb_strlen((string) ($row['insurer_name'] ?? ' - '))); + $bds_col_max_len[6] = max($bds_col_max_len[6], mb_strlen((string) ($row['insurer_branch_name'] ?? ' - '))); + $bds_col_max_len[7] = max($bds_col_max_len[7], mb_strlen((string) ($row['client_name'] ?? ' - '))); + $bds_col_max_len[8] = max($bds_col_max_len[8], mb_strlen((string) ($client_type[$row['client_type'] ?? ''] ?? '-'))); + $bds_col_max_len[9] = max($bds_col_max_len[9], mb_strlen((string) ($row['revenue_type'] ?? ' - '))); + $bds_col_max_len[10] = max($bds_col_max_len[10], mb_strlen(empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime((string) $row['policy_issue_date'])))); + $bds_col_max_len[11] = max($bds_col_max_len[11], mb_strlen(empty($row['policy_start_date']) ? '' : date('d/m/Y', strtotime((string) $row['policy_start_date'])))); + $bds_col_max_len[12] = max($bds_col_max_len[12], mb_strlen(empty($row['policy_end_date']) ? '' : date('d/m/Y', strtotime((string) $row['policy_end_date'])))); + $bds_col_max_len[13] = max($bds_col_max_len[13], mb_strlen((string) ($row['vehicle_no'] ?? ' - '))); + $bds_col_max_len[14] = max($bds_col_max_len[14], mb_strlen((string) ucfirst((string) ($row['lead_status'] ?? ' - ')))); +} +$bds_col_min_px = array_fill(0, $bds_col_count, 80); +$bds_col_min_px[0] = 48; +$bds_col_max_px = array_fill(0, $bds_col_count, 360); +$bds_col_max_px[0] = 64; +$bds_col_width_px = nhance_dt_column_widths_px($bds_header_labels, $bds_col_max_len, $bds_col_min_px, $bds_col_max_px); +?> + +
@@ -28,7 +98,7 @@ table.dataTable tbody td {
-->
-
Advertisement Image Name 
+
- @@ -114,11 +184,11 @@ table.dataTable tbody td { // Datatable document ready $(document).ready(function() { - var ticketsTable = $('#scroll-horizontal-datatable'); + var ticketsTable = $('#bds-renewal-report-list-table'); if (ticketsTable.length) { - ticketsTable.DataTable({ - scrollX: true, + nhanceListDataTableBeforeInit(); + var nhBdsRenewalTable = ticketsTable.DataTable(nhanceMergeListDataTableOptions({ // dom: "<'row'<'col-sm-2'f><'col-sm-10 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 @@ -163,7 +233,14 @@ $(document).ready(function() { paging: true, // Enable pagination pageLength: 20, // Set default number of rows per page (optional) ordering: true, - }); + columnDefs: [ + + { targets: , width: 'px' }, + + ], + })); + nhanceListDataTableAfterInit(); + nhanceListDataTableBindAdjust(nhBdsRenewalTable); } else { console.error("Table atet found."); } diff --git a/app/Views/cd_master_list.php b/app/Views/cd_master_list.php index 906d86d3..81f68346 100755 --- a/app/Views/cd_master_list.php +++ b/app/Views/cd_master_list.php @@ -1,3 +1,34 @@ + $row) { + $cdm_col_max_len[0] = max($cdm_col_max_len[0], mb_strlen((string) ($index + 1))); + $clientCell = ($row['client_name'] ?? '') . '( ' . ($row['short_name'] ?? '') . ' )'; + $cdm_col_max_len[1] = max($cdm_col_max_len[1], mb_strlen($clientCell)); + $cdm_col_max_len[2] = max($cdm_col_max_len[2], mb_strlen((string) ($row['insurer_name'] ?? ''))); + $cdm_col_max_len[3] = max($cdm_col_max_len[3], mb_strlen((string) ($row['insurer_branch_name'] ?? ''))); + $od = ! empty($row['opening_date']) ? date('d-m-Y', strtotime((string) $row['opening_date'])) : ''; + $cdm_col_max_len[4] = max($cdm_col_max_len[4], mb_strlen($od)); + $cdm_col_max_len[5] = max($cdm_col_max_len[5], mb_strlen((string) ($row['cd_ac_no'] ?? ''))); + $cdm_col_max_len[6] = max($cdm_col_max_len[6], mb_strlen((string) ($row['opening_bal'] ?? ''))); + $du = ! empty($row['created_at']) + ? (date('d-M-Y h:i A', strtotime((string) $row['created_at'])) . ' by ' . ($row['user_name'] ?? '')) + : ''; + $cdm_col_max_len[7] = max($cdm_col_max_len[7], mb_strlen($du)); + $cdm_col_max_len[8] = max($cdm_col_max_len[8], 4); +} +$cdm_col_min_px = [48, 140, 120, 140, 100, 120, 100, 200, 72]; +$cdm_col_max_px = [64, 400, 320, 360, 120, 200, 160, 480, 88]; +$cdm_col_width_px = nhance_dt_column_widths_px($cdm_header_labels, $cdm_col_max_len, $cdm_col_min_px, $cdm_col_max_px); +?> + +
@@ -28,7 +97,7 @@
--> -
@@ -83,7 +153,7 @@ table.dataTable tbody td { $row) { ?>
+
+
@@ -80,8 +149,8 @@ $(document).ready(function() { - var table = $('#scroll-horizontal-datatable').DataTable({ - scrollX: true, + nhanceListDataTableBeforeInit(); + var table = $('#scroll-horizontal-datatable').DataTable(nhanceMergeListDataTableOptions({ // dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // "<'row'<'col-sm-12'tr>>" + // "<'row'<'col-sm-5'i><'col-sm-7'p>>", @@ -141,7 +210,12 @@ }, paging: true, pageLength: 10, - order: [[0, 'desc']] + order: [[0, 'desc']], + columnDefs: [ + + { targets: , width: 'px' }, + + ], // scrollX: true, // dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // "<'row'<'col-sm-12'tr>>" + @@ -169,7 +243,9 @@ // searchPlaceholder: "Search..." // }, // paging: true, - }); + })); + nhanceListDataTableAfterInit(); + nhanceListDataTableBindAdjust(table); function applyBottomRowDropup() { if (!table) return; diff --git a/app/Views/client_deposit_list.php b/app/Views/client_deposit_list.php index c5302d9e..e02041cc 100755 --- a/app/Views/client_deposit_list.php +++ b/app/Views/client_deposit_list.php @@ -1,3 +1,72 @@ +insurer_name ?? ''))); + $cd_col_max_len[1] = max($cd_col_max_len[1], mb_strlen((string) ($value->insurer_branch_name ?? ''))); + $cd_col_max_len[2] = max($cd_col_max_len[2], mb_strlen((string) ($value->cd_master_account_no ?? ''))); + $insurerId = $value->insurer_id; + $cd_ac_pk = $value->cd_ac_pk; + $balStr = 'N/A'; + if (isset($balances[$insurerId . '-' . $cd_ac_pk])) { + $balStr = (string) ($balances[$insurerId . '-' . $cd_ac_pk]->balance ?? ''); + } + $balDisplay = '₹ ' . $balStr; + $cd_col_max_len[3] = max($cd_col_max_len[3], mb_strlen($balDisplay)); + $cd_col_max_len[4] = max($cd_col_max_len[4], mb_strlen('View Deposit')); +} +$cd_col_min_px = [100, 120, 120, 100, 120]; +$cd_col_max_px = [240, 280, 280, 200, 160]; +$cd_col_width_px = nhance_dt_column_widths_px($cd_header_labels, $cd_col_max_len, $cd_col_min_px, $cd_col_max_px); +?> + -
+
-

+
diff --git a/app/Views/kyc_list.php b/app/Views/kyc_list.php index 7754f2a8..ec621cd3 100755 --- a/app/Views/kyc_list.php +++ b/app/Views/kyc_list.php @@ -1,3 +1,22 @@ + + +
@@ -50,7 +107,7 @@
-->

S.No 
+ id="kyc-list-table"> @@ -83,7 +140,7 @@ + + + diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index 42f32f88..c9459190 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -1,3 +1,55 @@ + $row) { + $leads_col_max_len[0] = max($leads_col_max_len[0], mb_strlen((string) ($index + 1))); + $leads_col_max_len[1] = max($leads_col_max_len[1], mb_strlen((string) ($lead_type[$row['lead_type'] ?? ''] ?? '-'))); + $leads_col_max_len[2] = max($leads_col_max_len[2], mb_strlen((string) ($issuer[$row['issuer'] ?? ''] ?? '-'))); + $leads_col_max_len[3] = max($leads_col_max_len[3], mb_strlen((string) ($client_type[$row['client_type'] ?? ''] ?? '-'))); + $clientBranch = (isset($row['client_type']) && (int) $row['client_type'] === 2) + ? (string) ($row['client_name'] ?? '-') + : (string) (($row['client_short_name'] ?? '-') . ' - ' . ($row['branch_name'] ?? '-')); + $leads_col_max_len[4] = max($leads_col_max_len[4], mb_strlen($clientBranch)); + $leads_col_max_len[5] = max($leads_col_max_len[5], mb_strlen((string) ($row['entity_type'] ?? '-'))); + $leads_col_max_len[6] = max($leads_col_max_len[6], mb_strlen((string) ($row['branch_name'] ?? '-'))); + $leads_col_max_len[7] = max($leads_col_max_len[7], mb_strlen((string) ($row['branch_code'] ?? '-'))); + $leads_col_max_len[8] = max($leads_col_max_len[8], mb_strlen((string) ($row['contact_person_name'] ?? '-'))); + $leads_col_max_len[9] = max($leads_col_max_len[9], mb_strlen((string) ($row['contact_person_mobile'] ?? '-'))); + $leads_col_max_len[10] = max($leads_col_max_len[10], mb_strlen((string) ($row['policy_type'] ?? '-'))); + $leads_col_max_len[11] = max($leads_col_max_len[11], mb_strlen((string) ($lead_status[$row['status'] ?? ''] ?? '-'))); + $leads_col_max_len[12] = max($leads_col_max_len[12], 4); + } +} + +$leads_col_min_px = [48, 72, 88, 72, 120, 88, 96, 72, 120, 100, 120, 96, 52]; +$leads_col_max_px = [64, 220, 180, 140, 520, 200, 240, 120, 280, 130, 280, 200, 72]; +$leads_col_width_px = []; +for ($i = 0; $i < $leads_col_count; $i++) { + $chars = max($leads_col_max_len[$i], mb_strlen($leads_header_labels[$i])); + $px = (int) round($chars * 7.0 + 26); + $leads_col_width_px[$i] = min( + $leads_col_max_px[$i], + max($leads_col_min_px[$i], $px) + ); +} +?> @@ -134,7 +240,7 @@
-
Name
+
@@ -716,10 +822,11 @@ // Datatable document ready $(document).ready(function() { - var ticketsTable = $('#tickets-table'); + var ticketsTable = $('#leads-list-table'); if (ticketsTable.length) { - table = ticketsTable.DataTable({ + nhanceListDataTableBeforeInit(); + table = ticketsTable.DataTable(nhanceMergeListDataTableOptions({ // dom: "<'row'<'col-sm-7'f><'col-sm-5 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 @@ -778,14 +885,21 @@ paging: true, // Enable pagination pageLength: 10, // Set default number of rows per page (optional) // ordering: false, - }); + columnDefs: [ + + { targets: , width: 'px' }, + + ], + })); + nhanceListDataTableAfterInit(); + nhanceListDataTableBindAdjust(table); function applyBottomRowDropup() { if (!table) return; const currentRows = table.rows({ page: 'current' }).nodes().toArray(); - $('#tickets-table tbody tr').removeClass('nh-force-dropup'); - $('#tickets-table tbody tr td.table-action-cell .btn-group.dropdown').removeClass('dropup'); + $('#leads-list-table tbody tr').removeClass('nh-force-dropup'); + $('#leads-list-table tbody tr td.table-action-cell .btn-group.dropdown').removeClass('dropup'); const targetCount = Math.min(2, currentRows.length); for (let i = 0; i < targetCount; i++) { diff --git a/app/Views/nhance_branch_list.php b/app/Views/nhance_branch_list.php index bd302e8a..4addfaf9 100644 --- a/app/Views/nhance_branch_list.php +++ b/app/Views/nhance_branch_list.php @@ -1,8 +1,66 @@ + @@ -10,7 +68,7 @@
-
+
@@ -96,9 +154,9 @@ \ No newline at end of file + diff --git a/app/Views/tpa_list.php b/app/Views/tpa_list.php index c369c606..6f907c54 100755 --- a/app/Views/tpa_list.php +++ b/app/Views/tpa_list.php @@ -1,3 +1,23 @@ + +
@@ -50,7 +97,7 @@
-->
S.No.
+ id="tpa-list-table"> @@ -87,7 +134,10 @@ \ No newline at end of file diff --git a/app/Views/frontend_content_list.php b/app/Views/frontend_content_list.php index b0b38da8..695feb65 100644 --- a/app/Views/frontend_content_list.php +++ b/app/Views/frontend_content_list.php @@ -90,7 +90,7 @@ $fec_col_width_px = nhance_dt_column_widths_px($fec_header_labels, $fec_col_max_ $row) { ?> - + diff --git a/app/Views/insurer_export_templete.php b/app/Views/insurer_export_templete.php index 73d725e1..5edcc832 100755 --- a/app/Views/insurer_export_templete.php +++ b/app/Views/insurer_export_templete.php @@ -111,7 +111,7 @@ $value ){ ?> - + diff --git a/app/Views/insurer_list.php b/app/Views/insurer_list.php index 755a514c..b0611e6b 100755 --- a/app/Views/insurer_list.php +++ b/app/Views/insurer_list.php @@ -65,6 +65,17 @@ $ins_col_width_px = nhance_dt_column_widths_px($ins_header_labels, $ins_col_max_ overflow: visible; text-overflow: clip; } +#insurer-list-table tbody td { + padding: 5px 11px !important; + font-size: 13px; + line-height: 1.25; +} +#insurer-list-table_wrapper .dataTables_scrollHead table thead th, +#insurer-list-table thead th { + padding: 5px 2.35rem 5px 11px !important; + font-size: 13px; + line-height: 1.25; +}
diff --git a/app/Views/invoice_template.php b/app/Views/invoice_template.php index 865ab921..3a61a602 100644 --- a/app/Views/invoice_template.php +++ b/app/Views/invoice_template.php @@ -359,7 +359,7 @@ body { $page_break_class = (($serial % $records_per_page) == 0 && $serial != count($policies)) ? 'page-break' : ''; ?>
- + diff --git a/app/Views/leads_list.php b/app/Views/leads_list.php index c9459190..b496dfe4 100644 --- a/app/Views/leads_list.php +++ b/app/Views/leads_list.php @@ -264,7 +264,7 @@ for ($i = 0; $i < $leads_col_count; $i++) { $row) {?> - - + - + diff --git a/app/Views/policy_transaction_endorsement_list_2.php b/app/Views/policy_transaction_endorsement_list_2.php index 8e26b2c3..38b7afb4 100644 --- a/app/Views/policy_transaction_endorsement_list_2.php +++ b/app/Views/policy_transaction_endorsement_list_2.php @@ -325,7 +325,7 @@ table.dataTable thead th { $row) { ?> - + diff --git a/app/Views/pos_list.php b/app/Views/pos_list.php index 7a872e19..d989318f 100644 --- a/app/Views/pos_list.php +++ b/app/Views/pos_list.php @@ -111,7 +111,7 @@ $pos_col_width_px = nhance_dt_column_widths_px($pos_header_labels, $pos_col_max_ $row) { ?> - + diff --git a/app/Views/rto_master_list.php b/app/Views/rto_master_list.php index 1f1b8084..e5b2b2dd 100644 --- a/app/Views/rto_master_list.php +++ b/app/Views/rto_master_list.php @@ -85,7 +85,7 @@ $rto_col_width_px = nhance_dt_column_widths_px($rto_header_labels, $rto_col_max_ $row) { ?> - + diff --git a/app/Views/thz_list.php b/app/Views/thz_list.php index e53ce222..1aa69b4c 100644 --- a/app/Views/thz_list.php +++ b/app/Views/thz_list.php @@ -166,7 +166,7 @@ beccause = dataTables_length and dataTables_paginate need in same line thats why $row){ ?> - + - + diff --git a/app/Views/vehicle_master_list.php b/app/Views/vehicle_master_list.php index b880c50e..6e29f5b8 100644 --- a/app/Views/vehicle_master_list.php +++ b/app/Views/vehicle_master_list.php @@ -60,15 +60,15 @@ $vm_col_width_px = nhance_dt_column_widths_px($vm_header_labels, $vm_col_max_len ?>
@@ -170,8 +222,10 @@ input:checked + .slider:before { id="client_logo" name="client_logo" accept="image/jpeg, image/jpg, image/png" onchange="PreviewImage0(event);" - data-parsley-max-file-size="200" - data-parsley-file-extension="jpg,jpeg,png" + data-parsley-client-max-file-size="200" + data-parsley-client-file-extension="jpg,jpeg,png" + data-parsley-client-max-file-size-message="Maximum file size allowed is 200KB." + data-parsley-client-file-extension-message="Only JPG, JPEG, PNG files are allowed." data-parsley-errors-container="#client_logo_error_container" />
@@ -198,25 +252,29 @@ input:checked + .slider:before {
- +
- +
- +
@@ -473,35 +471,54 @@ $gst_total = 0; $(document).ready(function() { var ticketsTable = $('#employee-data-list-table'); - if (ticketsTable.length) { - nhanceListDataTableBeforeInit(); - var nhEmpDataTable = ticketsTable.DataTable(nhanceMergeListDataTableOptions({ - // dom: "<'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 align-items-center'<'col-5 text-start'i><'col-7 d-flex justify-content-end align-items-center'<'me-2'l>p>>", + if (ticketsTable.length) { + var _dtDefScroll = { + scrollX: $.fn.dataTable.defaults.scrollX, + scrollY: $.fn.dataTable.defaults.scrollY, + scrollCollapse: $.fn.dataTable.defaults.scrollCollapse + }; + $.extend($.fn.dataTable.defaults, { scrollX: false, scrollY: false, scrollCollapse: false }); + + var nhEmpDataTable = ticketsTable.DataTable({ + dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + + "<'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>>", lengthMenu: [[10, 20, 50, 100], [10, 20, 50, 100]], + scrollX: false, + scrollY: false, + scrollCollapse: false, + initComplete: function () { + var $wrap = $(this.api().table().container()); + var $body = $wrap.find('.dataTables_scrollBody'); + var $head = $wrap.find('.dataTables_scrollHead'); + if ($body.length && $head.length) { + $body.off('scroll.nhEmpHScroll').on('scroll.nhEmpHScroll', function () { + $head.scrollLeft($(this).scrollLeft()); + }); + $head.off('scroll.nhEmpHScroll').on('scroll.nhEmpHScroll', function () { + $body.scrollLeft($(this).scrollLeft()); + }); + } + }, buttons: [ { extend: 'collection', text: ' Export ', className: 'btn app-btn-secondary ', buttons: [ - { - extend: 'csv', - text: ' CSV ', - className: 'app-btn-primary ', - title: 'Members', - }, - { - extend: 'excel', - text: ' EXCEL ', - className: 'app-btn-primary ', - title: 'Members', - sheetName: 'Members' - } + { + extend: 'csv', + text: ' CSV ', + className: 'app-btn-primary ', + title: 'Members', + }, + { + extend: 'excel', + text: ' EXCEL ', + className: 'app-btn-primary ', + title: 'Members', + sheetName: 'Members' + } ] } ], @@ -517,16 +534,28 @@ $gst_total = 0; searchPlaceholder: "Search", emptyTable: '
No Data found
' }, - paging: true, // Enable pagination - pageLength: 25, // Set default number of rows per page (optional) + paging: true, + pageLength: 25, + autoWidth: false, + responsive: false, columnDefs: [ { targets: , width: 'px' }, ], - })); - nhanceListDataTableAfterInit(); - nhanceListDataTableBindAdjust(nhEmpDataTable); + }); + + $.extend($.fn.dataTable.defaults, _dtDefScroll); + + nhEmpDataTable.on('draw.dt', function () { + nhEmpDataTable.columns.adjust(); + }); + $(window).on('resize', function () { + nhEmpDataTable.columns.adjust(); + }); + setTimeout(function () { + nhEmpDataTable.columns.adjust(); + }, 0); } else { console.error("Table not found."); } diff --git a/app/Views/insurer_basic_info.php b/app/Views/insurer_basic_info.php index ce0720ba..b3af15ed 100755 --- a/app/Views/insurer_basic_info.php +++ b/app/Views/insurer_basic_info.php @@ -170,8 +170,10 @@ input:checked + .slider:before {
@@ -204,8 +206,8 @@ input:checked + .slider:before { + \ No newline at end of file
Name
+ $log): ?>
View | diff --git a/app/Views/nhance_branch_list.php b/app/Views/nhance_branch_list.php index 4addfaf9..dc0190c1 100644 --- a/app/Views/nhance_branch_list.php +++ b/app/Views/nhance_branch_list.php @@ -81,7 +81,7 @@ $nb_col_width_px = nhance_dt_column_widths_px($nb_header_labels, $nb_col_max_len $row) { ?>

diff --git a/app/Views/tpa_list.php b/app/Views/tpa_list.php index 6f907c54..8b17f04c 100755 --- a/app/Views/tpa_list.php +++ b/app/Views/tpa_list.php @@ -85,6 +85,17 @@ $tpa_col_width_px = nhance_dt_column_widths_px($tpa_header_labels, $tpa_col_max_ overflow: visible; text-overflow: clip; } +#tpa-list-table tbody td { + padding: 5px 11px !important; + font-size: 13px; + line-height: 1.25; +} +#tpa-list-table_wrapper .dataTables_scrollHead table thead th, +#tpa-list-table thead th { + padding: 5px 2.35rem 5px 11px !important; + font-size: 13px; + line-height: 1.25; +}
diff --git a/app/Views/variance_report_list.php b/app/Views/variance_report_list.php index 307c5d3d..446b0930 100644 --- a/app/Views/variance_report_list.php +++ b/app/Views/variance_report_list.php @@ -376,7 +376,7 @@ $vr_col_width_px = nhance_dt_column_widths_px($vr_header_labels, $vr_col_max_len $row){ ?>