-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
76 lines (69 loc) · 2.9 KB
/
create.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
74
75
76
<?php
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/src/init.php';
$bookStatus = getAllBookStatus();
$bookGenre = getAllBookGenre();
if (!empty($_POST)) insertBook($_POST);
?>
<!-- require_once header -->
<?php
$title = 'Add New Book';
require_once __DIR__ . '/src/partials/header.php';
?>
<!-- require_once header -->
<!-- main -->
<div class="container my-4">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h2 class="text-center">Tambah buku</h2>
</div>
<div class="card-body">
<form method="POST" enctype="multipart/form-data">
<div class="mb-3">
<label for="gambar_buku" class="form-label">Gambar Buku</label>
<input type="file" class="form-control" id="gambar_buku" name="gambar_buku" autocomplete="off">
</div>
<div class="mb-3">
<label for="judul_buku" class="form-label">Judul Buku</label>
<input type="text" class="form-control" id="judul_buku" name="judul_buku" required autocomplete="off" placeholder="Masukkan judul buku">
</div>
<div class="mb-3">
<label for="penulis" class="form-label">Penulis</label>
<input type="text" class="form-control" id="penulis" name="penulis" required autocomplete="off" placeholder="Masukkan penulis">
</div>
<div class="mb-3">
<label for="jumlah_halaman" class="form-label">Jumlah halaman</label>
<input type="number" class="form-control" id="jumlah_halaman" name="jumlah_halaman" autocomplete="off" placeholder="Masukkan jumlah halaman">
</div>
<div class="mb-3">
<label for="jumlah_halaman" class="form-label">Genre buku</label>
<select class="form-select" name="genre_buku">
<?php foreach ($bookGenre as $bg) : ?>
<option value="<?= $bg['id_genre'] ?>"><?= $bg['nama_genre'] ?></option>
<?php endforeach ?>
</select>
</div>
<div class="mb-3">
<label for="jumlah_halaman" class="form-label">Status dibaca</label>
<select class="form-select" name="status_dibaca">
<?php foreach ($bookStatus as $bs) : ?>
<option value="<?= $bs['id_status'] ?>"><?= $bs['nama_status'] ?></option>
<?php endforeach ?>
</select>
</div>
<div>
<a href="index.php" type="button" class="btn btn-secondary">Batalkan</a>
<button type="submit" class="btn btn-primary btn-tambah">Tambah</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- main -->
<!-- require_once footer -->
<?php require_once __DIR__ . '/src/partials/footer.php' ?>
<!-- require_once footer -->