-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.php
119 lines (111 loc) · 4.51 KB
/
report.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
include "proses/connect.php";
date_default_timezone_set("Asia/Jakarta");
$query = mysqli_query($conn, "SELECT tb_order.*,tb_bayar.*,nama, SUM(harga*jumlah) AS harganya FROM tb_order
LEFT JOIN tb_user ON tb_user.id = tb_order.pelayan
LEFT JOIN tb_list_order ON tb_list_order.kode_order = tb_order.id_order
LEFT JOIN tb_daftar_menu ON tb_daftar_menu.id = tb_list_order.menu
JOIN tb_bayar ON tb_bayar.id_bayar = tb_order.id_order
GROUP BY id_order ORDER BY waktu_order ASC");
while ($record = mysqli_fetch_array($query)) {
$result[] = $record;
}
// $select_kat_menu = mysqli_query ($conn, "SELECT id_kat_menu,kategori_menu FROM tb_kategori_menu");
?>
<div class="col-lg-9 mt-2">
<div class="card">
<div class="card-header">
Halaman Report
</div>
<div class="card-body">
<?php
if (empty($result)) {
echo "Data menu makanan atau minuman tidak ada";
} else {
foreach ($result as $row) {
?>
<?php
}
?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr class="text-nowrap">
<th scope="col">No</th>
<th scope="col">Kode Order</th>
<th scope="col">Waktu Order</th>
<th scope="col">Waktu Bayar</th>
<th scope="col">Pelanggan</th>
<th scope="col">Meja</th>
<th scope="col">Total Harga</th>
<th scope="col">Pelayan</th>
<th scope="col">Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach ($result as $row) {
?>
<tr>
<th scope="row">
<?php echo $no++ ?>
</th>
<td>
<?php echo $row['id_order'] ?>
</td>
<td>
<?php echo $row['waktu_order'] ?>
</td>
<td>
<?php echo $row['waktu_bayar'] ?>
</td>
<td>
<?php echo $row['pelanggan'] ?>
</td>
<td>
<?php echo $row['meja'] ?>
</td>
<td>
<?php echo number_format((int)$row['harganya'], 0, ',', '.') ?>
</td>
<td>
<?php echo $row['nama'] ?>
</td>
<td>
<div class="d-flex">
<a class="btn btn-info btn-sm me-1" href="./?x=viewitem&order=<?php echo $row['id_order']."&meja=".$row['meja']."&pelanggan=".$row['pelanggan'] ?>"><i
class="bi bi-eye"></i></a>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
?>
</div>
</div>
</div>
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(() => {
'use strict'
// Fetch all the forms we want to apply custom Bootstrap validation styles to
const forms = document.querySelectorAll('.needs-validation')
// Loop over them and prevent submission
Array.from(forms).forEach(form => {
form.addEventListener('submit', event => {
if (!form.checkValidity()) {
event.preventDefault()
event.stopPropagation()
}
form.classList.add('was-validated')
}, false)
})
})()
</script>