
<!-- SweetAlert v1 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>

<!-- jQuery (required for SweetAlert v1 if not already loaded) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>


<script>
$(document).on('click', '.delete-confirmation-modal', function(e) {
    e.preventDefault();
    var url = $(this).data('url');

    swal({
        title: "Are you sure?",
        text: "You will not be able to recover this payment!",
        type: "error",
        showCancelButton: true,
        confirmButtonColor: "#dc3545",
        confirmButtonText: "Yes, delete it",
        cancelButtonText: "No, cancel.",
        closeOnConfirm: false,
        closeOnCancel: true
    },
    function(isConfirm) {
        if (isConfirm) {
            window.location.href = url;
        }
    });
});
</script>
