Skip to content

Instantly share code, notes, and snippets.

@hasanbasri1993
Created May 18, 2020 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasanbasri1993/9d2820d516f103ee19306b80d12b8b2b to your computer and use it in GitHub Desktop.
Save hasanbasri1993/9d2820d516f103ee19306b80d12b8b2b to your computer and use it in GitHub Desktop.
function selesaikan_ujian(id) {
swal({
title: 'Apa anda yakin?',
text: "aksi ini akan menyelesaikan secara paksa ujian yang sedang berlangsung!",
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes!'
}).then((result) => {
if (result.value) {
$.ajax({
url: 'selesaikan.php',
method: "POST",
data: 'id=' + id,
success: function (data) {
$('#htmlujianselesai').html('1');
toastr.success(data);
}
});
}
})
}
function ulang_ujian(id) {
console.log(id);
swal({
title: 'Apa anda yakin?',
text: "Akan Mengulang Ujian Ini ??",
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes!'
}).then((result) => {
if (result.value) {
$.ajax({
url: 'ulangujian.php',
method: "POST",
data: 'id=' + id,
success: function (data) {
toastr.success("berhasil diulang");
}
});
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment