added function operasi can edit perubatan asal

This commit is contained in:
hafifierahman
2024-11-10 22:31:55 +08:00
parent c4388321aa
commit f59e0a4d4e
5 changed files with 76 additions and 9 deletions
+45
View File
@@ -17,6 +17,51 @@ let editfunc = (pageid) => {
}
let savefunc = (pageid) => {
let amount = document.getElementById("input-" + pageid);
Swal.fire({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
didOpen: function () {
Swal.showLoading();
}
});
$.ajax({
url : updateurl,
method : 'PUT',
data : {
"amount" : amount.value,
"id" : pageid,
"_token": $('meta[name="csrf-token"]').attr('content')
},
success:function(response){
if(response == 0){
Swal.fire({
icon: 'error',
title: 'Perubahan Nilai Perubatan Tidak Berjaya!',
});
return false;
}
Swal.fire({
icon: 'success',
title: 'Perubahan Nilai Perubatan Berjaya!',
showCancelButton: false,
confirmButtonText: "Okay!",
allowEscapeKey: false,
allowOutsideClick: false
}).then((result) => {
if (result.isConfirmed) {
window.location.reload();
}
});
}
});
// let editbtn = document.getElementById('editButton-' + pageid);
// let divbtn = document.getElementById('div-' + pageid);