-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinventaris_hapus.php
41 lines (37 loc) · 917 Bytes
/
inventaris_hapus.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
<?php
//berkas sistem
require_once './app/config.php';
require_once './app/database.php';
require_once './app/fungsi.php';
_isLogin();
_isLevel([1]);
$error = 0;
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING);
if (!empty($id)) {
$hapus = db_inventaris_del($db_conn, $id);
if ($hapus > 0) {
//berhasil menghapus data inventaris
header('Location: ./inventaris.php');
} else {
$error = 1;
$pesan_error = "Kesalahan dalam menghapus data";
}
} else {
$error = 1;
$pesan_error = "Tidak ada ID dalam parameter GET";
}
?>
<html>
<head>
<title>Hapus Data Inventaris</title>
</head>
<body>
<p><a href="./index.php">Home</a> > <a href="./inventaris.php">Inventaris</a> > Hapus Inventaris</p>
<?php
if ($error == 1) :
echo "<p>$pesan_error</p>";
endif;
?>
</form>
</body>
</html>