-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsweetalert.php
35 lines (29 loc) · 1.09 KB
/
sweetalert.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!-- Footer Link -->
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- This script for delete confirm item -->
<script>
$(document).ready(function() {
$('.delete').click(function(e) {
e.preventDefault();
var link = $(this).attr('href');
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = link;
Swal.fire(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
});
});
</script>