104 lines
4.6 KiB
PHP
104 lines
4.6 KiB
PHP
<style>
|
|
.digit-motor-list .page-title { color: #02a8b5; font-weight: 600; }
|
|
.digit-motor-list .col-12 { max-width: 98% !important; }
|
|
.digit-motor-list .table th,
|
|
.digit-motor-list .table td { padding: 8px; }
|
|
.digit-motor-list table.dataTable tbody td { padding: 4px 8px !important; }
|
|
.digit-motor-list .dataTables_filter { position: absolute; }
|
|
.digit-motor-list .dataTables_length label { height: 21px !important; }
|
|
.digit-motor-list .status-pill {
|
|
display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
|
|
}
|
|
.digit-motor-list .st-QUOTED { background: #e7f6f7; color: #028a95; }
|
|
.digit-motor-list .st-CREATED { background: #e8eef5; color: #35577A; }
|
|
.digit-motor-list .st-KYC_DONE { background: #e4f2ea; color: #1F7A4D; }
|
|
.digit-motor-list .st-EFFECTIVE { background: #e4f2ea; color: #1F7A4D; }
|
|
.digit-motor-list .st-DRAFT,
|
|
.digit-motor-list .st-FAILED { background: #f5f5f5; color: #666; }
|
|
.digit-motor-list .st-PAID { background: #fff4e0; color: #8A5B00; }
|
|
#digit-motor-datatable tbody tr { cursor: pointer; }
|
|
#digit-motor-datatable tbody tr:hover { background-color: #e0e0e0; }
|
|
</style>
|
|
|
|
<div class="container-fluid digit-motor-list">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box">
|
|
<h4 class="page-title">Digit Motor Quotes</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" id="digit_motor_list_div">
|
|
<?= view('digit_motor/list_table', ['quotes' => $quotes ?? []]) ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="digit-filter-sidebar" class="filter-sidebar" style="height:100%;width:0;position:fixed;z-index:1001;top:0;right:0;background:#f8f9fa;overflow-x:hidden;transition:0.4s;box-shadow:-2px 0 5px rgba(0,0,0,0.1);display:flex;flex-direction:column;">
|
|
<div style="padding:15px 20px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #dee2e6;">
|
|
<h4 class="m-0">Filter</h4>
|
|
<a href="javascript:void(0)" onclick="closeFilterNav()" style="font-size:28px;text-decoration:none;color:#6c757d;">×</a>
|
|
</div>
|
|
<div style="padding:20px;flex-grow:1;overflow-y:auto;">
|
|
<div class="form-group">
|
|
<label>Status</label>
|
|
<select class="form-control" id="filter_status">
|
|
<option value="">All</option>
|
|
<?php if (!empty($statuses)): foreach ($statuses as $k => $v): ?>
|
|
<option value="<?= esc($k) ?>"><?= esc($v) ?></option>
|
|
<?php endforeach; endif; ?>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Enquiry ID</label>
|
|
<input type="text" class="form-control" id="filter_enquiry_id">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Quote number</label>
|
|
<input type="text" class="form-control" id="filter_quote_number">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Registration number</label>
|
|
<input type="text" class="form-control" id="filter_license_plate">
|
|
</div>
|
|
</div>
|
|
<div style="padding:15px 20px;display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #dee2e6;">
|
|
<button type="button" class="btn btn-secondary" onclick="resetFilters()">Clear</button>
|
|
<button type="button" class="btn btn-primary" onclick="applyFilters()">Submit</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function openFilterNav(){ document.getElementById('digit-filter-sidebar').style.width = '350px'; }
|
|
function closeFilterNav(){ document.getElementById('digit-filter-sidebar').style.width = '0'; }
|
|
|
|
function applyFilters(){
|
|
$.ajax({
|
|
url: '<?= base_url('digit-motor/list') ?>',
|
|
type: 'POST',
|
|
data: {
|
|
status: $('#filter_status').val(),
|
|
enquiry_id: $('#filter_enquiry_id').val(),
|
|
quote_number: $('#filter_quote_number').val(),
|
|
license_plate: $('#filter_license_plate').val()
|
|
},
|
|
success: function(html){
|
|
if ($.fn.DataTable && $.fn.DataTable.isDataTable('#digit-motor-datatable')) {
|
|
$('#digit-motor-datatable').DataTable().destroy();
|
|
}
|
|
$('#digit_motor_list_div').html(html);
|
|
closeFilterNav();
|
|
},
|
|
error: function(){
|
|
if (window.toastr) toastr.error('Failed to load filtered list.', 'Error');
|
|
else alert('Failed to load filtered list.');
|
|
}
|
|
});
|
|
}
|
|
|
|
function resetFilters(){
|
|
$('#filter_status,#filter_enquiry_id,#filter_quote_number,#filter_license_plate').val('');
|
|
applyFilters();
|
|
}
|
|
</script>
|