nhance/app/Views/claims_report_acc_manager_wise.php
2025-02-05 09:48:31 +05:30

104 lines
3.8 KiB
PHP

<style>
.table th, .table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.col-12 {
max-width: 98% !important;
}
.dataTables_filter {
position: absolute;
}
.right-align-input {
text-align: right;
}
</style>
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="padding-bottom: 10px;">
<div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Account Manger Claim Status List</h4>
</div>
</div>
<div class="table-responsive">
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light">
<?php if ($policy_type != 1) {?>
<tr>
<th style="text-align: center;" colspan="8">OPEN</th>
<th style="text-align: center;" colspan="5" >CLEARED</th>
</tr>
<?php } ?>
<tr>
<?php foreach ($column_order as $col_name): ?>
<th><?= str_replace('_', ' ', $col_name) ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($account_manager_wise_data as $row): ?>
<tr>
<?php foreach ($column_order as $col_name): ?>
<td><?= $row[$col_name] ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th>Grand Total</th>
<?php
$totals = array_fill_keys($column_order, 0);
foreach ($account_manager_wise_data as $row) {
foreach ($column_order as $col_name) {
$totals[$col_name] += is_numeric($row[$col_name]) ? $row[$col_name] : 0;
}
}
foreach ($column_order as $col_name) {
if ($col_name !== 'ACM_NAME') {
echo "<th>{$totals[$col_name]}</th>";
}
}
?>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) {
ticketsTable.DataTable({
scrollX: true,
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>>",
buttons: [
{ extend: 'csv', text: 'CSV', title: 'Insurer-Wise-Report-List' },
{ extend: 'excel', text: 'Excel', title: 'Insurer-Wise-Report-List', exportOptions: { orthogonal: 'sort' } }
],
language: { search: "_INPUT_", searchPlaceholder: "Search..." },
paging: true,
pageLength: 10,
ordering: false
});
} else {
console.error("Table not found.");
}
});
</script>