-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_barang.php
62 lines (57 loc) · 2.03 KB
/
data_barang.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
<?php include 'include/header.php'; ?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Data Barang</h1>
<a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Cetak Laporan</a>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Data Barang</h6>
</div>
<div class="card-body">
<a class="btn btn-sm btn-primary shadow-sm mb-3" href="tambah_barang.php"><i class="fas fa-plus fa-sm text-white-50"></i> Tambah Barang</a>
<table class="table table-bordered" id="dataTable">
<thead>
<tr>
<th>No.</th>
<th>ID Barang</th>
<th>Nama Barang</th>
<th>Harga Awal</th>
<th>Harga Jual</th>
<th>Jumlah</th>
<th>Sisa</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php include 'include/config.php';
$query = "SELECT * FROM barang";
$data = mysqli_query($con, $query);
$i = 1;
foreach ($data as $row) : ?>
<tr>
<td><?= $i++; ?></td>
<td><?= $row['id_barang']; ?></td>
<td><?= $row['nama_barang']; ?></td>
<td><?= $row['harga_awal']; ?></td>
<td><?= $row['harga_jual']; ?></td>
<td><?= $row['jumlah']; ?></td>
<td><?= $row['sisa']; ?></td>
<td>
<a class="badge badge-primary" href="ubah_barang.php?id=<?= $row['id'] ?>">Edit</a>
<a class="badge badge-danger" href="">Hapus</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<?php include 'include/footer.php'; ?>