-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_penjualan.php
66 lines (60 loc) · 2.23 KB
/
data_penjualan.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
<?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 Penjualan</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 Transaksi Penjualan</a>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Data Penjualan</h6>
</div>
<div class="card-body">
<a class="btn btn-sm btn-primary shadow-sm mb-3" href="tambah_transaksi.php"><i class="fas fa-plus fa-sm text-white-50"></i> Input Transaksi</a>
<table class="table table-bordered" id="dataTable">
<thead>
<tr>
<th>No.</th>
<th>Tanggal</th>
<th>ID Transaksi</th>
<th>Nama Barang</th>
<th>Jumlah</th>
<th>Harga</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php include 'include/config.php';
$query = "select * from transaksi";
$data = mysqli_query($con, $query);
$i = 1;
foreach ($data as $row) : ?>
<tr>
<td><?= $i++; ?></td>
<td><?= $row['tanggal'] ?></td>
<td><?= $row['id_transaksi'] ?></td>
<?php
$data2 = mysqli_query($con, "select nama_barang from barang where id_barang = '" . $row['nama_barang'] . "'");
foreach ($data2 as $row1) : ?>
<td><?= $row1['nama_barang'] ?></td>
<?php endforeach; ?>
<td><?= $row['jumlah'] ?></td>
<td><?= $row['harga'] ?></td>
<td>
<a class="badge badge-success" href="">Lihat</a>
<a class="badge badge-primary" href="">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'; ?>