nhance/app/Views/bds_renewal_report_list.php

145 lines
6.6 KiB
PHP

<style>
.table th,
.table td {
padding: 8px;
}
table.dataTable tbody td {
padding: 4px 4px !important;
}
</style>
<div class="row" id="inception_list">
<div class="col-12">
<div class="card">
<div class="card-body">
<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 id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="bg-light">
<tr>
<th>
<div class="column-header">S.No.</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><!-- end col -->
</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
buttons: [{
extend: 'csv',
text: 'CSV',
title: 'Renewal-List',
},
{
extend: 'excel',
text: 'Excel',
title: 'Renewal-List',
exportOptions: {
orthogonal: 'sort'
},
}
],
language: {
search: "_INPUT_",
searchPlaceholder: "Search..."
},
paging: true, // Enable pagination
pageLength: 20, // Set default number of rows per page (optional)
ordering: true,
});
} else {
console.error("Table atet found.");
}
});
</script>