<script>
document.getElementById('deleteannun').onclick = function()
{
swal({
title: "Are you sure?",
text: "You will not be able to recover this announcement!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel please!",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm){
if (isConfirm) {
return true;
} else {
swal("Cancelled", "Your announcement is safe", "error");
return false;
}
});
}
</script>
&#13;
//Connection here
$sql = "SELECT annun_ID, annun_title, annun_author, annun_date, annun_details FROM annun order by annun_ID DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr><td id=\"titleannun\">". $row["annun_title"]. "</td><td>". $row["annun_author"]. " </td><td>" . $row["annun_date"] . "</td><td>" . $row["annun_details"] ."</td>
<td>
<a href='includes/deleteannun.php?title=".$row["annun_title"]."'class=\"btn btn-block btn-danger btn-xs\" ><i class=\"fa fa-trash\" id=\"deleteannun\"></i></a>";
}
} else {
}
&#13;