added function operasi can edit perubatan asal
This commit is contained in:
Vendored
+45
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user