-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtambah-barang.php
More file actions
81 lines (69 loc) · 2.66 KB
/
Copy pathtambah-barang.php
File metadata and controls
81 lines (69 loc) · 2.66 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
session_start();
// membatasi halaman sebelum login
if (!isset($_SESSION["login"])) {
echo "<script>
alert('login dulu dong');
document.location.href = 'login.php';
</script>";
exit;
}
$title = 'Tambah Barang';
include 'layout/header.php';
// check apakah tombol tambah ditekan
if (isset($_POST['tambah'])) {
if (create_barang($_POST) > 0) {
echo "<script>
alert('Data Barang Berhasil Ditambahkan');
document.location.href = 'index.php';
</script>";
} else {
echo "<script>
alert('Data Barang Gagal Ditambahkan');
document.location.href = 'index.php';
</script>";
}
}
?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><ia class="fas fa-plus"></ia> Tambah Barang</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="index.php">Data Barang</a></li>
<li class="breadcrumb-item active">Tambah Barang</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<form action="" method="post">
<div class="mb-3">
<label for="nama" class="form-label">Nama Barang</label>
<input type="text" class="form-control" id="nama" name="nama" placeholder="Nama barang..." required>
</div>
<div class="mb-3">
<label for="jumlah" class="form-label">Jumlah</label>
<input type="number" class="form-control" id="jumlah" name="jumlah" placeholder="Jumlah barang..." required>
</div>
<div class="mb-3">
<label for="harga" class="form-label">Harga</label>
<input type="number" class="form-control" id="harga" name="harga" placeholder="Harga barang..." required>
</div>
<button type="submit" name="tambah" class="btn btn-primary" style="float: right;">Tambah</button>
</form>
</div>
</section>
<!-- /.content -->
</div>
<?php include 'layout/footer.php'; ?>