-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhapus.php
More file actions
42 lines (26 loc) · 669 Bytes
/
hapus.php
File metadata and controls
42 lines (26 loc) · 669 Bytes
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
<?php
session_start();
require_once "function.php";
if (!isset($_SESSION["akun-admin"])) {
if (isset($_SESSION["akun-user"])) {
echo "<script>
alert('Hapus data hanya berlaku untuk admin!');
location.href = 'index.php';
</script>";
exit;
} else {
header("Location: login.php");
exit;
}
}
if (isset($_GET["id_menu"])) $hapus = hapus_data_menu();
else $hapus = hapus_data_pesanan();
echo $hapus > 0
? "<script>
alert('Data berhasil dihapus!');
location.href = 'index.php';
</script>"
:"<script>
alert('Data gagal dihapus!');
location.href = 'index.php';
</script>";