-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
66 lines (61 loc) · 2.45 KB
/
index.php
File metadata and controls
66 lines (61 loc) · 2.45 KB
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
<?php
// Load data menu
require_once 'stock.php';
require_once 'action/functions.php';
$pageTitle = 'Kantin Bu Wati';
$menus = $menuKantin;
?>
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $pageTitle; ?></title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-4">
<h2><?php echo $pageTitle; ?></h2>
<p>Silakan pilih menu dan jumlah pesanan</p>
<hr>
<form action="dash.php" method="POST">
<div class="mb-3">
<label>Nama Pembeli</label>
<input type="text" class="form-control" name="nama_pembeli" required>
</div>
<div class="mb-3">
<label>Pilih Menu</label>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Pilih</th>
<th>Menu</th>
<th>Harga</th>
<th>Stock</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<?php foreach ($menus as $menu): ?>
<tr>
<td><input type="checkbox" name="menu[]" value="<?php echo $menu['id']; ?>"></td>
<td><?php echo $menu['nama']; ?></td>
<td><?php echo formatRupiah($menu['harga']); ?></td>
<td><?php echo $menu['stock']; ?></td>
<td><input type="number" class="form-control form-control-sm" name="jumlah[<?php echo $menu['id']; ?>]" value="1" min="1" max="<?php echo $menu['stock']; ?>" style="width:70px"></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<div class="mb-3">
<label>Catatan (Opsional)</label>
<textarea class="form-control" name="catatan" rows="2"></textarea>
</div>
<button type="submit" class="btn btn-primary">Pesan Sekarang</button>
</form>
</div>
</body>
</html>