-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
290 lines (277 loc) · 15.3 KB
/
index.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<?php
require 'functions/function.php';
$peminjam = query("SELECT * FROM peminjaman");
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="assets/img/logo.png">
<!-- bootstrap -->
<link rel="stylesheet" href="assets/bootstrap-5.1.3-dist/css/bootstrap.min.css">
<!-- mycss -->
<link rel="stylesheet" href="assets/css/style.css">
<title>Pinjam Lab — Home</title>
</head>
<body>
<!-- navbar -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container-fluid">
<a class="navbar-brand fw-bold" href="#"><span>PINJAM</span>LAB</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Daftar Lab</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="lab/rpl.php">Lab RPL</a></li>
<li><a class="dropdown-item" href="lab/tkj.php">Lab TKJ</a></li>
<li><a class="dropdown-item" href="lab/mm.php">Lab MM</a></li>
<li><a class="dropdown-item" href="lab/dkv.php">Lab DKV</a></li>
<li><a class="dropdown-item" href="lab/animasi.php">Lab Animasi</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="pinjam.php">Pinjam</a>
</li>
<?php
if (isset($_SESSION["login"])) {
echo '<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<img width="20" alt="" src="assets/img/avatar-1.png" class="rounded-circle mr-1 mb-1">
Hi, ' . $_SESSION['login'] . '
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a href="functions/logout.php" class="dropdown-item text-danger">
<img src="assets/icons/box-arrow-right.svg" alt=""> Logout
</a>
</li>
</ul>
</li>';
} else {
echo '<li class="nav-item">
<a class="nav-link" href="form/signup.php" data-bs-toggle="tooltip" title="Login atau Buat Akun"><img src="assets/icons/person-fill.svg" alt=""></a>
</li>';
}
?>
</ul>
</div>
</div>
</nav>
<!-- jumbotron -->
<section id="jumbotron" class="p-2">
<div class="container-fluid rounded p-5">
<div class="row text-center">
<div class="col-lg-6 mb-4 teks">
<h3>PEMINJAMAN LAB
<br>DENGAN MUDAH
</h3>
</div>
<div class="col-lg-6 d-none d-lg-block">
<img src="assets/img/lab.png" width="300px" class="img-fluid" alt="">
</div>
</div>
</div>
</section>
<!-- jadwal lab yang digunakan -->
<section id="jadwal">
<div class="container-fluid">
<div class="row p-2 text-center mt-2 mb-3">
<div class="col">
<h2 class="fw-normal">Jadwal Peminjam</h2>
</div>
</div>
<div class="row p-2 mb-4">
<div class="col">
<div class="table-responsive">
<table class="table table-bordered table-sm">
<tr>
<th class="text-center">Waktu</th>
<th class="text-center">Jadwal Peminjam Hari Ini</th>
</tr>
<tbody>
<tr>
<th colspan="8">Pagi</th>
</tr>
<tr>
<td>08:00 - 09:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '08:00-09:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<td>09:00 - 10:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '09:00-10:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold text-capitalize"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<td>10:00 - 11:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '10:00-11:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<th colspan="8">Siang</th>
</tr>
<tr>
<td>13:00 - 14:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '13:00-14:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<td>14:00 - 15:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '14:00-15:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<td>15:00 - 16:00</td>
<td>
<?php foreach ($peminjam as $pnjm) : ?>
<?php if ($pnjm['waktu_pinjam'] == '15:00-16:00') : ?>
<div class="schedule mb-1">
<p class="mt-2"><span class="fw-bold">Lab <span class="text-capitalize"><?= $pnjm['nama_lab'] ?></span></span>
<br>Dipinjam oleh <span class="fw-bold"><?= $pnjm['nama_peminjam']; ?></span>
</p>
</div>
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<!-- modal hubungi kami -->
<div class="modal fade" id="modalKontak" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fw-bold" id="exampleModalLabel">Kontak Kami</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="" method="post">
<div class="mb-3">
<label for="nama" class="form-label">Nama</label>
<?php if (isset($_SESSION['login'])) {
echo '<input name="nama" type="text" class="form-control" id="nama" required value="' . $_SESSION['login'] . '" autocomplete="off" readonly/>';
} else {
echo '<input name="nama" type="text" class="form-control" id="nama" required autocomplete="off" />';
}
?>
</div>
<div class="mb-3">
<label for="nomer" class="form-label">No Whatsapp</label>
<input name="noWa" type="number" class="form-control" id="nomer" autocomplete="off" />
</div>
<div class="mb-3">
<label for="pesan" class="form-label">Pesan</label>
<textarea name="pesan" class="form-control" id="pesan" rows="3" required></textarea>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn" id="submit">Kirim</button>
</form>
</div>
</div>
</div>
</div>
<!-- footer -->
<footer class="text-dark">
<div class="container-fluid footer-1">
<div class="row">
<div class="col-md-3 mb-3 footer-logo">
<h3><span>PINJAM</span>LAB</h3>
</div>
<div class="col-md-3 mb-2 bantuan">
<h6>Bantuan</h6>
<ul class="list-unstyled">
<li><a href="">Cara Meminjam</a></li>
<li><a href="">Jika Terjadi Kendala</a></li>
<li><a href="">Panduan</a></li>
</ul>
</div>
<div class="col-md-3 mb-3 hubungi-kami">
<div class="mb-2">
<h6>Kontak Kami</h6>
<button type="button" class="btn" data-bs-toggle="modal" data-bs-target="#modalKontak">
Kontak
</button>
</div>
<h6>Temukan Sosial Media Kami</h6>
<div class="d-flex sosial-media">
<div class="p-2"><a href="" data-bs-toggle="tooltip" title="Instagram"><img src="assets/icons/instagram.svg" alt=""></a></div>
<div class="p-2"><a href="" data-bs-toggle="tooltip" title="Facebook"><img src="assets/icons/facebook.svg" alt=""></a></div>
<div class="p-2"><a href="" data-bs-toggle="tooltip" title="Twitter"><img src="assets/icons/twitter.svg" alt=""></a></div>
</div>
</div>
<div class="col-md-3 mb-3 tentang-kami">
<h6>Tentang Kami</h6>
<p>Website ini adalah web peminjaman lab di sekolah, untuk siswa yang ingin meminjam di luar jam sekolah serta atas persetujuan staff dan guru.</p>
</div>
</div>
</div>
<div class="row container-fluid copyright">
<div class="col-md-12">
<div class="footer-copyright text-center">
<p>© Copyright PINJAMLAB - All rights reserved
</p>
</div>
</div>
</div>
</footer>
</body>
<!-- assets -->
<script src="assets/bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</html>