162 lines
6.3 KiB
PHP
162 lines
6.3 KiB
PHP
<style>
|
|
.table th, .table td {
|
|
padding: 8px;
|
|
}
|
|
|
|
table.dataTable tbody td {
|
|
padding: 4px 4px !important;
|
|
}
|
|
|
|
.dataTables_filter {
|
|
position: absolute;
|
|
}
|
|
|
|
.right-align-input {
|
|
text-align: right;
|
|
}
|
|
|
|
#scroll-horizontal-datatable tbody tr:hover {
|
|
background-color: #e0e0e0;
|
|
}
|
|
|
|
.dataTables_length label {height: 21px !important;}
|
|
|
|
</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 data-custom-table-css="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 onclick = "redirectToClaimList(<?=$row['ACM_ID'] ?>)"><?= $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>>",
|
|
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]],
|
|
buttons: [
|
|
{
|
|
extend: 'collection',
|
|
text: '<span class=" btn-custom"> Export </span><i class="mdi mdi-menu-down"></i>',
|
|
className: 'btn app-btn-secondary ',
|
|
buttons: [
|
|
{ extend: 'csv', text: '<i class="mdi mdi-file-delimited " ></i><span class=" btn-custom"> CSV </span>', title: 'Insurer-Wise-Report-List', className: 'app-btn-primary ' },
|
|
{ extend: 'excel', text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>', title: 'Insurer-Wise-Report-List', className: 'app-btn-primary ', sheetName: 'Insurer-Wise-Report-List', exportOptions: { orthogonal: 'sort' } }
|
|
],
|
|
}
|
|
],
|
|
language: {
|
|
search: `
|
|
<div class="datatable-search-wrapper" style="position:relative; display:inline-block;">
|
|
_INPUT_
|
|
<i class="mdi mdi-magnify datatable-search-icon"
|
|
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666;"></i>
|
|
<i class="mdi mdi-close-circle datatable-clear-icon"
|
|
style="position:absolute; right:10px; top:50%; transform:translateY(-50%); color:#666; display:none;"></i>
|
|
</div>`,
|
|
searchPlaceholder: "Search",
|
|
emptyTable: '<div class="text-center text-muted">No Data found</div>'
|
|
},
|
|
paging: true,
|
|
pageLength: 10,
|
|
ordering: false
|
|
});
|
|
} else {
|
|
console.error("Table not found.");
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<script>
|
|
function redirectToClaimList(id) {
|
|
// alert("Redirecting to claim list..."+id);
|
|
|
|
data = {
|
|
is_dashboard: 2,
|
|
ids : id
|
|
}
|
|
|
|
redirectWithPost("<?= base_url("ticket/list") ?>", data);
|
|
|
|
}
|
|
|
|
function redirectWithPost(url, data = {}) {
|
|
const form = document.createElement('form');
|
|
form.method = 'POST';
|
|
form.action = url;
|
|
|
|
for (const key in data) {
|
|
if (data.hasOwnProperty(key)) {
|
|
const input = document.createElement('input');
|
|
input.type = 'hidden';
|
|
input.name = key;
|
|
input.value = data[key];
|
|
form.appendChild(input);
|
|
}
|
|
}
|
|
|
|
document.body.appendChild(form);
|
|
form.submit();
|
|
}
|
|
</script>
|