-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
51 lines (47 loc) · 1.63 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>RIF SHOP</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
</head>
<body>
<center>
<br><br><br><br><br><br><br><br>
<form method="post" action="transaksi.php">
<table border="1" width="500">
<tr>
<td colspan="3" align="center"><h2>FORM PEMBELIAN</h2></td>
</tr>
<tr align="center">
<td style="width: 300px"><b>NAMA PRODUK</b></td>
<td style="width: 140px"><b>HARGA</b></td>
<td style="width: 60px"><b>QTY</b></td>
</tr>
<?php
include 'config.php';
$sql='SELECT * FROM items';
$query=mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($query)){
?>
<tr>
<td><?php echo $row['nama']; ?></td>
<td> Rp. <?php echo number_format((float)$row['harga'], 0); ?></td>
<td>
<input type="number" name="qty[]" style="width: 60px" value="" />
</td>
<input type="hidden" name="nama[]" value=" <?php echo $row['nama']; ?> " />
<input type="hidden" name="harga[]" value=" <?php echo $row['harga']; ?> " />
</tr>
<?php } ?>
<tr>
<td colspan="3" align="center" style="padding: 5px 0;">
<button type="submit" name="submit" value="" style="width: 60px;">beli</button>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>