nhance/app/Views/bds_renewal_report_list.php

192 lines
9.2 KiB
PHP

<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
.column-header {
margin-right: 10px; /* Adjust this value as needed */
}
table[data-custom-table-css="table"].dataTable thead th {
padding-right: 20px !important;
}
.dataTables_length label {height: 21px !important;}
</style>
<div class="col-12" id="inception_list">
<div class="card">
<div class="card-body" style="background-color: #F5FFFF !important; border-radius: 10px; box-shadow: 4px 4px 4px 4px #00000040;">
<!-- <div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Renewal Policy List</h4>
</div>
</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">
<tr>
<th>
<div class="column-header">S.No&nbsp;</div>
</th>
<th>
<div class="column-header">Renewal Month</div>
</th>
<th>
<div class="column-header">Issuer</div>
</th>
<th>
<div class="column-header">Policy No</div>
</th>
<th>
<div class="column-header">Policy</div>
</th>
<th>
<div class="column-header">Insurer Name</div>
</th>
<th>
<div class="column-header">Insurer Branch</div>
</th>
<th>
<div class="column-header">Insured</div>
</th>
<th>
<div class="column-header">Client Type</div>
</th>
<th>
<div class="column-header">Business Type</div>
</th>
<th>
<div class="column-header">Date of Issue </div>
</th>
<th>
<div class="column-header">Policy Start Date</div>
</th>
<th>
<div class="column-header">Policy Expiry Date</div>
</th>
<th>
<div class="column-header">Vehicle No</div>
</th>
<th>
<div class="column-header">Lead Status</div>
</th>
</tr>
</thead>
<tbody>
<?php foreach($renewal_data as $index => $row) { ?>
<tr>
<td><?php echo $index+1; ?></td>
<td><?php echo empty($row['policy_end_date']) ? ' - ' : date('M-Y', strtotime($row['policy_end_date'])); ?>
<td><?php echo $issuer[$row['issuer']] ?? ' - '; ?></td>
<td><?php echo $row['policy_no'] ?? ' - '; ?></td>
<td><?php echo $row['policy_type'] ?? ' - '; ?></td>
<td><?php echo $row['insurer_name'] ?? ' - '; ?></td>
<td><?php echo $row['insurer_branch_name'] ?? ' - '; ?></td>
<td><?php echo $row['client_name'] ?? ' - ' ?></td>
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td>
<td><?php echo $row['revenue_type'] ?? ' - ' ?></td>
<td><?php echo empty($row['policy_issue_date']) ? '' : date('d/m/Y', strtotime($row['policy_issue_date'])); ?>
</td>
<td><?php echo empty($row['policy_start_date']) ? '' : date('d/m/Y', strtotime($row['policy_start_date'])); ?>
</td>
<td><?php echo empty($row['policy_end_date']) ? '' : date('d/m/Y', strtotime($row['policy_end_date'])); ?>
</td>
<td><?php echo $row['vehicle_no'] ?? ' - ' ?></td>
<td><?php echo ucfirst($row['lead_status'] ?? ' - ') ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
// Datatable document ready
$(document).ready(function() {
var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) {
ticketsTable.DataTable({
scrollX: true,
// 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
dom: "<'row'<'col-sm-2'f><'col-sm-10 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>>",
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: 'Renewal-List',
},
{
extend: 'excel',
text: '<i class="mdi mdi-file-excel " ></i><span class=" btn-custom"> EXCEL </span>',
title: 'Renewal-List',
sheetName: 'Renewal-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, // Enable pagination
pageLength: 20, // Set default number of rows per page (optional)
ordering: true,
});
} else {
console.error("Table atet found.");
}
});
// Global DataTables defaults
$.extend(true, $.fn.dataTable.defaults, {
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
});
</script>