-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubah_barang.php
73 lines (67 loc) · 2.84 KB
/
ubah_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
63
64
65
66
67
68
69
70
71
72
73
<?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>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Edit Data Barang</h6>
</div>
<div class="card-body">
<form action="e_barang.php" method="post">
<?php
include 'include/config.php';
$id = $_GET['id'];
$dd = mysqli_query($con, "select * from barang where id='$id'");
foreach ($dd as $rr) : ?>
<div class="form-group">
<label>ID Barang</label>
<input type="hidden" name="id" class="form-control" value="<?= $rr['id'] ?>">
<input type="text" name="id_barang" class="form-control" value="<?= $rr['id_barang'] ?>" readonly>
</div>
<div class="form-group">
<label>Nama Barang</label>
<input type="text" name="nama_barang" class="form-control" placeholder="" value="<?= $rr['nama_barang'] ?>">
</div>
<div class="form-group">
<label>Harga Awal</label>
<input type="number" name="harga_awal" class="form-control" placeholder="ex: 2500" value="<?= $rr['harga_awal'] ?>">
</div>
<div class="form-group">
<label>Harga Jual</label>
<input type="number" name="harga_jual" class="form-control" placeholder="ex: 3000" value="<?= $rr['harga_jual'] ?>">
</div>
<div class="form-group">
<label>Supplier</label>
<select name="id_supplier" class="form-control">
<option value="">--Pilih Supplier--</option>
<?php
$df = mysqli_query($con, "select id_supplier,nama_supplier from supplier order by nama_supplier");
foreach ($df as $rt) : ?>
<?php
if ($rt['id_supplier'] === $rr['id_supplier']) : ?>
<option value="<?= $rt['id_supplier'] ?>" selected>-<?= $rt['nama_supplier'] ?></option>
<?php endif; ?>
<option value="<?= $rt['id_supplier'] ?>">-<?= $rt['nama_supplier'] ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label>Jumlah</label>
<input type="number" name="jumlah" class="form-control" placeholder="ex: 10; 50; etc" value="<?= $rr['sisa'] ?>">
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary">
</div>
<?php endforeach; ?>
</form>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<?php include 'include/footer.php'; ?>