-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_item.php
146 lines (134 loc) · 5.89 KB
/
view_item.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
include "proses/connect.php";
$query = mysqli_query($conn, "SELECT *, SUM(harga*jumlah) AS harganya FROM tb_list_order
LEFT JOIN tb_order ON tb_order.id_order = tb_list_order.kode_order
LEFT JOIN tb_daftar_menu ON tb_daftar_menu.id = tb_list_order.menu
LEFT JOIN tb_bayar ON tb_bayar.id_bayar = tb_order.id_order
GROUP BY id_list_order
HAVING tb_list_order.kode_order = $_GET[order]");
$kode = $_GET['order'];
$meja = $_GET['meja'];
$pelanggan = $_GET['pelanggan'];
while ($record = mysqli_fetch_array($query)) {
$result[] = $record;
}
$select_menu = mysqli_query($conn, "SELECT id,nama_menu FROM tb_daftar_menu");
?>
<div class="col-lg-9 mt-2">
<div class="card">
<div class="card-header">
Halaman View Item
</div>
<div class="card-body">
<a href="report" class="btn btn-info mb-3"><i class="bi bi-arrow-left"></i></a>
<div class="row">
<div class="col-lg-3">
<div class="form-floating mb-3">
<input disabled type="text" class="form-control" id="kodeorder" value="<?php echo $kode ?>">
<label for="uploadFoto">Kode Order</label>
</div>
</div>
<div class="col-lg-2">
<div class="form-floating mb-3">
<input disabled type="text" class="form-control" id="meja" value="<?php echo $meja ?>">
<label for="uploadFoto">Meja</label>
</div>
</div>
<div class="col-lg-3">
<div class="form-floating mb-3">
<input disabled type="text" class="form-control" id="pelanggan" value="<?php echo $pelanggan ?>">
<label for="uploadFoto">Pelanggan</label>
</div>
</div>
</div>
<?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">Menu</th>
<th scope="col">Harga</th>
<th scope="col">Qty</th>
<th scope="col">Status</th>
<th scope="col">Catatan</th>
<th scope="col">Total</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
foreach ($result as $row) {
?>
<tr>
<td>
<?php echo $row['nama_menu'] ?>
</td>
<td>
<?php echo number_format($row['harga'], 0, ',', '.') ?>
</td>
<td>
<?php echo $row['jumlah'] ?>
</td>
<td>
<?php
if($row['status'] == 1) {
echo "<span class='badge text-bg-warning'>Masuk ke Dapur</span>";
} else if ($row['status'] == 2) {
echo "<span class='badge text-bg-primary'>Siap Saji</span>";
}
?>
</td>
<td>
<?php echo $row['catatan'] ?>
</td>
<td>
<?php echo number_format($row['harganya'], 0, ',', '.') ?>
</td>
</tr>
<?php
$total += $row['harganya'];
}
?>
<tr>
<td colspan="5" class="fw-bold">
Total Harga
</td>
<td class="fw-bold">
<?php echo number_format($total, 0, ',', '.') ?>
</td>
</tr>
</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>