Last active
July 11, 2023 20:45
-
-
Save mucahidbaris/3f64f517b4ada4de4a6a0a7f892f6fde to your computer and use it in GitHub Desktop.
javascirpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sweat alaert js ile silme işlemi | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$(".btn-danger").on("click",function(){ | |
var id = jQuery(this).prevAll('input[name="id"]').val(); | |
var Data = "id="+id; | |
//alert(Data); | |
swal({ | |
title: "Emin misiniz?", | |
text: "<strong>Kullanıcı Silinecek!</strong>", | |
type: "warning", | |
html: true, | |
showCancelButton: true, | |
confirmButtonColor: "#DD6B55", | |
confirmButtonText: "Evet, silinsin!", | |
cancelButtonText: "Hayır, vazgeç!", | |
closeOnConfirm: false, | |
closeOnCancel: false | |
}, | |
function(isConfirm){ | |
if (isConfirm) { | |
$.ajax({ | |
type: "POST", | |
url: "",//silme işlemi başka sayfada olacaksa dosya adı gir | |
data: Data, | |
}); | |
swal({ | |
title: "Silindi!", | |
text: "<strong>Kullanıcı Başarıyla Silindi.</strong>", | |
type: "success", | |
html: true, | |
timer: 2000}, | |
function(){ | |
location.reload(); | |
} | |
); | |
} else { | |
swal({ | |
title: "İptal", | |
text: "<strong>Kullanıcı Silme İşlemi İptal Edildi.</strong>", | |
type: "error", | |
html: true, | |
timer: 3000 | |
}); | |
} | |
}); | |
}); | |
}) | |
</script> | |
<form action="" onsubmit="return false;"> | |
<input type="hidden" id="id" name="id" value="'.$yaz["id"].'"> | |
<button class="btn btn-danger btn-xs" type="submit" name="sil"><i class="fa fa-window-close"></i></b> | |
</form> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment