Download library weetalert.min.js, letakkan dalam satu folder sejajar index !
https://drive.google.com/drive/folders/1uXhLjQv998HlVhtzObOPCCt6TbvPhaCV?usp=sharing
Misal letakkan di kode:
<?php
require_once "sweet.php";
echo "<script>Message2('Sukses Logout','login.php',' terimakasih atas kunjungannya...See You Later...');</script>";
?>
isi dari file sweet.php
sweet.php
<head>
<script src="jquery-3.3.1.min.js"></script>
<script src="sweetalert.min.js"></script>
</head>
<script type="text/javascript">
function Message1(myheader,mylink,myvar) {
swal({
title:myheader,
text: myvar,
icon: "success",
button: true
}).then((result) => {
document.location.href=mylink;
});
}
</script>
<script type="text/javascript">
function Message2(myheader,mylink,myvar) {
swal({
title:myheader,
text: myvar,
icon: "warning",
button: true
}).then((result) => {
document.location.href=mylink;
});
}
</script>
<script type="text/javascript">
function welcome() {
swal({
title: "Uji Kompetensi <?php echo $header;?>",
text: "Yth: aaaa \n.............................................................\nTerimakasih Atas Partisipasinya dan Selamat mengerjakan...",
icon: "success",
button: true
}).then((result) => {
document.location.href='iot_.php';
})
}
</script>
<script type="text/javascript">
function contoh(myvar1,mylink) {
swal({
title: "Uji Kompetensi <?php echo $header;?>",
text: "Yth: "+myvar1+" \n.............................................................\nTerimakasih Atas Partisipasinya dan Selamat mengerjakan...",
icon: "success",
button: true
}).then((result) => {
document.location.href=mylink;
});
}
</script>