-
Notifications
You must be signed in to change notification settings - Fork 0
/
del-menu-minuman.php
54 lines (46 loc) · 1.5 KB
/
del-menu-minuman.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
49
50
51
52
53
54
<?php
include "config/db.php";
$id = $_GET["id"];
$id_rest = $_GET["id_rest"];
// $gallery = mysqli_query($connection, "SELECT * FROM tabel_gallery WHERE id=$id");
// $get_gallery = mysqli_fetch_array($gallery);
// $query = mysqli_query($connection, "SELECT * FROM tabel_restoran WHERE id=$id_rest");
// $get_nama = mysqli_fetch_array($query);
// $nama_resto = $get_nama["nama_restoran"];
// // $tanggal = date("Y-m-d");
// $delete_makanan = mysqli_query($connection, "DELETE FROM menu_makanan WHERE id=$id");
$delete_minuman = mysqli_query($connection, "DELETE FROM menu_minuman WHERE id=$id");
// unlink("tmp_upload/".$nama_resto."/gallery/".$get_gallery["nama_file"]);
// delete_files('tmp_upload/'.$nama_resto);
/*
* php delete function that deals with directories recursively
*/
// function delete_files($target) {
// if(is_dir($target)){
// $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned
// foreach( $files as $file ){
// delete_files( $file );
// }
// rmdir( $target );
// } elseif(is_file($target)) {
// unlink( $target );
// }
// }
if($delete){
echo "
<script>
alert('Data dihapus!');
</script>
";
header("Location: delete-menu.php?id=$id_rest");
exit;
}else{
echo "
<script>
alert('Data gagal dihapus!');
</script>
";
header("Location: delete-menu.php?id=$id_rest");
exit;
}
?>