-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbebek.php
65 lines (56 loc) · 1.84 KB
/
bebek.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
<?php
include("config.php");
$id = $_GET['id'];
$query = pg_query("SELECT * FROM users WHERE id = '$id'");
$users = pg_fetch_array($query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="1">
<thead>
<tr>
<th>Nama</th>
<th>Harga</th>
<th colspan="3">Pesan</th>
</tr>
</thead>
<tbody>
<?php
$query = pg_query("SELECT * FROM makanan WHERE id_kategori=5");
// $query = mysqli_query($db, $sql);
while($makanan = pg_fetch_array($query))
{
echo "<tr>";
echo "<td>".$makanan['nama']."</td>";
echo "<td>".$makanan['harga']."</td>";
?>
<form action="<?php echo "prosespesanan.php?id_user=".$users['id']."&id_makanan=".$makanan['id']?>" method="POST">
<td>
<input type="number" name="kuantitas" value="0" min="1"/>
</td>
<td>
<input type="text" name="alamat_tujuan" placeholder="Alamat Tujuan" required/>
</td>
<td>
<input type="submit" value="Pesan" name="pesan" />
</td>
</form>
<?php
echo "<tr>";
}
?>
</tbody>
</table>
<br>
<div>
<a href=" <?php echo "kategori.php?id=".$id ?>">Kembali</a>
</div>
</body>
</html>