163 lines
9.5 KiB
PHP
163 lines
9.5 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; }
|
|
.dataTables_length label { height: 21px !important; }
|
|
.text-custom-grey { font-size: 0.65em; color: #6c757d !important; }
|
|
#non-eb-datatable tbody tr:hover { background-color: #e0e0e0; }
|
|
</style>
|
|
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table data-custom-table-css="table" class="table mb-0 nowrap w-100 table-centered" cellspacing="0" id="non-eb-datatable">
|
|
<thead class="bg-light">
|
|
<tr>
|
|
<th>Status </th>
|
|
<th>Policy Type </th>
|
|
<th>Claim Number </th>
|
|
<th>Nhance Ref </th>
|
|
<th>Client </th>
|
|
<th>Insurer </th>
|
|
<th>Loss Date </th>
|
|
<th>Nature of Loss </th>
|
|
|
|
<th style="display:none;">ACM</th>
|
|
<th style="display:none;">Policy No</th>
|
|
<th style="display:none;">Loss Location</th>
|
|
<th style="display:none;">Loss Estimate</th>
|
|
<th style="display:none;">Loss Description</th>
|
|
<th style="display:none;">Intimation Recd</th>
|
|
<th style="display:none;">Intimated to Insurer</th>
|
|
<th style="display:none;">Contact Name</th>
|
|
<th style="display:none;">Contact Number</th>
|
|
<th style="display:none;">Contact Email</th>
|
|
<th style="display:none;">Surveyor</th>
|
|
<th style="display:none;">Loss Assessed</th>
|
|
<th style="display:none;">Settled Amount</th>
|
|
<th style="display:none;">Settlement UTR</th>
|
|
<th style="display:none;">Priority</th>
|
|
|
|
<?php if(in_array(get_role_id(), [1,2,5])): ?>
|
|
<th>ACTION</th>
|
|
<?php endif; ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (isset($ticket_data)): foreach($ticket_data as $row): ?>
|
|
<tr data-id="<?= $row['id']; ?>" style="cursor:pointer;">
|
|
<td>
|
|
<span><?= $row['status'] ?? 'N/A'; ?></span>
|
|
<?php if (!empty($row['ticket_updated_date'])): ?>
|
|
<span class="text-custom-grey"><br><?= "Updated " . $row['ticket_updated_date']; ?></span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?= $row['policy_type_name'] ?? 'N/A'; ?></td>
|
|
<td>
|
|
<?= $row['claim_number'] ?: 'N/A'; ?>
|
|
<?php if (!empty($row['ticket_created_date'])): ?>
|
|
<span class="text-custom-grey"><br><?= "Created " . $row['ticket_created_date']; ?></span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?= $row['nhance_claim_ref_no'] ?: 'N/A'; ?></td>
|
|
<td><?= $row['short_name'] ?: ($row['client_name'] ?? 'N/A'); ?></td>
|
|
<td><?= $row['insurer_short_name'] ?: ($row['insurer_name'] ?: 'N/A'); ?></td>
|
|
<td><?= !empty($row['loss_date']) ? date('d/m/Y', strtotime($row['loss_date'])) : 'N/A'; ?></td>
|
|
<td><?= $row['nature_of_loss'] ?: 'N/A'; ?></td>
|
|
|
|
<td style="display:none;"><?= $row['acm_name'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['policy_no'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['loss_location'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['loss_estimate'] ?? ''; ?></td>
|
|
<td style="display:none;"></td>
|
|
<td style="display:none;"><?= $row['intimation_recd_date'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['intimated_to_insurer_date'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['insured_contact_name'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['insured_contact_number'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['insured_contact_email'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['surveyor_name'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['loss_assessed_value'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['settled_amount'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= $row['settlement_utr'] ?? ''; ?></td>
|
|
<td style="display:none;"><?= isset($priorityType[$row['priority'] ?? 0]) ? $priorityType[$row['priority']] : ''; ?></td>
|
|
|
|
<?php if(in_array(get_role_id(), [1,2,5])): ?>
|
|
<td>
|
|
<div class="btn-group dropdown">
|
|
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"><i class="mdi mdi-dots-horizontal"></i></a>
|
|
<div class="dropdown-menu dropdown-menu-right">
|
|
<a class="dropdown-item" onclick="removeClaim('<?= $row['id'] ?>')"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<?php endif; ?>
|
|
</tr>
|
|
<?php endforeach; endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
var table = $('#non-eb-datatable');
|
|
if (table.length) {
|
|
table.DataTable({
|
|
scrollX: true,
|
|
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: [
|
|
{ text: '<i class="mdi mdi-filter"></i><span class="btn-custom"> Filter </span>', className: 'btn app-btn-primary mr-2', action: function() { openFilterNav(); } },
|
|
{ text: '<i class="mdi mdi-plus"></i><span class="btn-custom"> Add </span>', className: 'btn app-btn-primary mr-2', action: function() { window.location.href = '<?= base_url("non-eb-claim/new/50") ?>'; } },
|
|
{
|
|
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> CSV', className: 'app-btn-primary', title: 'Non-EB-Claim-List' },
|
|
{ extend: 'excel', text: '<i class="mdi mdi-file-excel"></i> EXCEL', title: 'Non-EB-Claim-List', sheetName: 'Claims', exportOptions: { orthogonal: 'sort' }, className: 'app-btn-primary' }
|
|
]
|
|
}
|
|
],
|
|
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></div>',
|
|
searchPlaceholder: "Search",
|
|
emptyTable: '<div class="text-center text-muted">No Data found</div>'
|
|
},
|
|
paging: true, pageLength: 10, ordering: false,
|
|
});
|
|
}
|
|
});
|
|
|
|
// function openPolicyTypeModal() {
|
|
// var modalEl = document.getElementById('policyTypeModal');
|
|
// if (modalEl) {
|
|
// var myModal = new bootstrap.Modal(modalEl);
|
|
// myModal.show();
|
|
// }
|
|
// }
|
|
|
|
function viewClaim(id) { window.location.href = '<?= base_url("non-eb-claim/view/") ?>' + id; }
|
|
|
|
function removeClaim(ticket_id) {
|
|
confirmActionSweertAlert("Do you want to delete this Claim?", "Yes, Proceed!", "No, Cancel").then((confirmed) => {
|
|
if (confirmed) {
|
|
sendAjaxRequestForGlobal('<?= base_url("non-eb-claim/remove") ?>', 'GET', { ticket_id: ticket_id }, function(response) {
|
|
if (response.status === true) { toastr.success(response.message); window.location.reload(); }
|
|
else { toastr.warning(response.message); }
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
$(document).on('click', '#non-eb-datatable tbody tr', function(e) {
|
|
if ($(e.target).closest('td').index() !== $(this).children('td').length - 1) {
|
|
viewClaim($(this).data('id'));
|
|
}
|
|
});
|
|
</script>
|