fix skit2

This commit is contained in:
MUHD HAFIFIE
2021-06-09 17:02:19 +08:00
parent 01a616eab0
commit 962238b2f7
4 changed files with 34 additions and 7 deletions
@@ -170,6 +170,7 @@
<div class="float-right mb-3">
<button class="btn btn-primary mt-4 pull-left" onclick="checkallfunc()" disabled>Check All</button>
<button class="btn btn-primary mt-4 pull-left" onclick="uncheckallfunc()" disabled>Uncheck All</button>
<input type="checkbox" id="selectallcheck" onclick="checkallfunction()"/>
</div>
<table class='table table-striped table-hover' id='table-gadaian-belum-serah'>
<thead class="thead-dark">
@@ -288,6 +289,29 @@
location.reload();
});
function checkallfunction(){
let totalmarhun = 0;
if(this.checked) {
// Iterate each checkbox
$(':checkbox').each(function() {
let marhun = Number($(this).data("marhun"));
totalmarhun += marhun;
this.checked = true;
});
$("#btn-serah").prop('disabled', false);
$('#marhunpilih').val(formatter.format(totalmarhun.toFixed(2)));
} else {
$(':checkbox').each(function() {
let marhun = Number($(this).data("marhun"));
totalmarhun -= marhun;
this.checked = false;
});
$('#marhunpilih').val(0);
$("#btn-serah").prop('disabled', true);
}
}
function checkallfunc(){
let totalmarhun = 0;