-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete-form.php
48 lines (47 loc) · 1.41 KB
/
delete-form.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
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php include "./components/header.php" ?>
<?php
$uri = $_SERVER["REQUEST_URI"];
$array_uri = explode("/", $uri);
$fid = end($array_uri);
$delete_form = deleteForm($fid);
if ($delete_form === 404) {
echo '<script>
Swal.fire({
title: "Failed!",
text: "form not found!",
icon: "error",
showConfirmButton: false,
timer: 2500,
});
setTimeout(() => {
document.location.href = "/project-formify/show-form"
}, 2500);
</script>';
} elseif ($delete_form === 500) {
echo '<script>
Swal.fire({
title: "Failed!",
text: "Failed delete form!",
icon: "error",
showConfirmButton: false,
timer: 2500,
});
setTimeout(() => {
document.location.href = "/project-formify/show-form"
}, 2500);
</script>';
} elseif ($delete_form === 200) {
echo '<script>
Swal.fire({
title: "Success!",
text: "Success delete form!",
icon: "success",
showConfirmButton: false,
timer: 2500,
});
setTimeout(() => {
document.location.href = "/project-formify/show-form"
}, 2500);
</script>';
}
?>