forked from rizkadwisaputra/inventorybarang
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpembelian.php
More file actions
67 lines (64 loc) · 3.18 KB
/
pembelian.php
File metadata and controls
67 lines (64 loc) · 3.18 KB
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
<?php
$pembelian = new \Ataslangit\DB\Pembelian();
if (isset($_GET['hapus'])) {
$pembelian->hapus_pembelian($_GET['hapus']);
echo "<script>location='index.php?page=pembelian';</script>";
}
?>
<div class="row">
<div class="col-md-12">
<!-- Advanced Tables -->
<div class="panel panel-default">
<div class="panel-heading">
Data Pembelian
</div>
<div class="panel-body">
<div class="table">
<table class="table table-striped table-bordered table-hover" id="tabelku">
<thead>
<tr>
<th>No</th>
<th>Kd Pembelian</th>
<th>Tgl Pembelian</th>
<th>Kd Supplier</th>
<th>Nama Supplier</th>
<th>Jumlah Pembelian</th>
<th>Total Pembelian</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
<?php
$pem = $pembelian->tampil_pembelian();
foreach ($pem as $index => $data) {
$jumlahb = $pembelian->hitung_item_pembelian($data['kd_pembelian']); ?>
<tr class="odd gradeX">
<td><?= $index + 1; ?></td>
<td><?= $data['kd_pembelian']; ?></td>
<td><?= $data['tgl_pembelian']; ?></td>
<td><?= $data['kd_supplier']; ?></td>
<td><?= $data['nama_supplier']; ?></td>
<td><?= $jumlahb['jumlah']; ?></td>
<td>Rp. <?= number_format($data['total_pembelian']); ?></td>
<td>
<a href="nota/cetakdetailpembelian.php?kdpembelian=<?= $data['kd_pembelian']; ?>" target="_BLANK" class="btn btn-info btn-xs"><i class="fa fa-search"></i> Detail</a>
<?php
$cek = $pembelian->cek_hapuspembelian($data['kd_pembelian']);
if ($cek === true) : ?>
<a href="index.php?page=pembelian&hapus=<?= $data['kd_pembelian']; ?>" class="btn btn-danger btn-xs" id="alertHapus"><i class="fa fa-trash"></i> Hapus</a>
<?php endif ?>
<?php if ($cek === false) : ?>
<a href="index.php?page=pembelian&hapus=<?= $data['kd_pembelian']; ?>" class="btn btn-danger btn-xs" id="alertHapus" disabled="disabled"><i class="fa fa-trash"></i> Hapus</a>
<?php endif ?>
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
</div>
</div>
<!--End Advanced Tables -->
</div>
</div>