FIX_PAYMENT METHOD FILTER, FEAT_ TABLE FILTER FOR EMAIL ADDED
This commit is contained in:
parent
cc888d769a
commit
8bd80a6896
@ -28,7 +28,7 @@
|
||||
<table id="datatable-buttons" class="table table-striped nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th hidden>id</th>
|
||||
<!-- <th hidden>id</th> -->
|
||||
<th>Customer Name</th>
|
||||
<th>Sent Date</th>
|
||||
<th>Membership ID</th>
|
||||
@ -55,6 +55,8 @@
|
||||
"searching": true,
|
||||
"autoWidth":true
|
||||
});
|
||||
|
||||
|
||||
var $select_data = '<?php echo $selected_data; ?>';
|
||||
var dateRangeFilter = $('input.input-daterange-datepicker').daterangepicker({
|
||||
locale: {
|
||||
@ -154,9 +156,13 @@
|
||||
item.mode,
|
||||
status
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
table.draw();
|
||||
regenerateFilters(table);
|
||||
$('#modal_table').show();
|
||||
|
||||
// table.draw();
|
||||
} else {
|
||||
tableBody.append('<tr><td colspan="6" class="text-center">No data available</td></tr>');
|
||||
@ -169,6 +175,32 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
function regenerateFilters(table) {
|
||||
$('#datatable-buttons thead tr:eq(1)').remove();
|
||||
$('#datatable-buttons thead tr').clone(true).appendTo('#datatable-buttons thead');
|
||||
|
||||
$('#datatable-buttons thead tr:eq(1) th').each(function(i) {
|
||||
var title = $(this).text();
|
||||
var column = table.column(i);
|
||||
|
||||
var uniqueValues = column.data().unique().sort();
|
||||
|
||||
var select = $('<select class="form-control form-control-sm"><option value="">Search ' + title + '</option></select>')
|
||||
.appendTo($(this).empty())
|
||||
.on('change', function() {
|
||||
var val = $.fn.dataTable.util.escapeRegex($(this).val());
|
||||
column
|
||||
.search(val ? '^' + val + '$' : '', true, false)
|
||||
.draw();
|
||||
});
|
||||
|
||||
uniqueValues.each(function(d) {
|
||||
if (d) {
|
||||
select.append('<option value="' + d + '">' + d + '</option>');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -179,8 +179,8 @@
|
||||
paymentMethod = 'Cash on delivery';
|
||||
}
|
||||
table.column(3)
|
||||
.search(paymentMethod, true, false)
|
||||
.draw();
|
||||
.search('^' + paymentMethod + '$', true, false) // Use regex for exact match
|
||||
.draw();
|
||||
|
||||
updateTotal();
|
||||
});
|
||||
|
||||
@ -102,31 +102,31 @@
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="3" checked> Customer Name
|
||||
</div><br>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="4" checked> GST
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="4" checked> Count
|
||||
</div><br>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="5" checked> Discount
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="5" checked> Invoice Type
|
||||
</div><br>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="6" checked> Count
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="6" checked> Status
|
||||
</div><br>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="7" checked> OT Charges
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="7" checked> Payment
|
||||
</div><br>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="8" checked> Total
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="8" checked> Discount
|
||||
</div><br>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="9" checked>Status
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="9" checked> OT Charges
|
||||
</div><br>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="10" checked>Type of Invoice
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="10" checked> GST
|
||||
</div><br>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="11" checked>Payment
|
||||
<input type="checkbox" class="form-check-input column-toggle" data-column="11" checked> Total
|
||||
</div><br>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user