-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.php
69 lines (60 loc) · 2.36 KB
/
view.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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>Pencatatan Barang</title>
</head>
<body class="container-fluid">
<br><br><br>
<div class="row">
<div class="span6" style="float: none; margin: 0 auto;">
<center><a href="view.php">Lihat Data</a> | <a href="index.php">Input Data</a></center><br>
<div class="col-md-12 mb-12">
<div class="card">
<div class="card-header">
Form Input Barang
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th>Nomor</th>
<th>Kode Pemesanan</th>
<th>Sayuran</th>
<th>Jumlah</th>
<th>Total harga</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
include 'koneksi.php';
$no = 1;
$data = mysqli_query($koneksi,"SELECT * FROM `tb_sayuran`, `tb_barang` WHERE tb_sayuran.sayuran_id=tb_barang.item");
while($d = mysqli_fetch_array($data)){
?>
<tr>
<th><?php echo $no++; ?></th>
<td><?php echo $d['nama']; ?></td>
<td><?php echo $d['sayur']; ?></td>
<td><?php echo $d['jumlah']; ?></td>
<td><?php
$totalharga = ($d['jumlah'] * $d['harga']) + ($d['jumlah'] * $d['harga']*20/100);
echo $totalharga; ?></td>
<td><!-- <a href="edit.php?id=<?php echo $d['id']; ?>">EDIT</a>| -->
<a href="hapus.php?id=<?php echo $d['id']; ?>">HAPUS</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>