-
Notifications
You must be signed in to change notification settings - Fork 0
/
lihat_kamar.php
563 lines (542 loc) · 25.4 KB
/
lihat_kamar.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<?php include 'proses/koneksi.php'; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="apple-touch-icon" sizes="76x76" href="./assets/img/apple-icon.png" />
<link rel="icon" type="image/png" href="./assets/img/logo.png" />
<title>Add Kamar</title>
<!-- Fonts and icons -->
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900|Roboto+Slab:400,700" />
<!-- Nucleo Icons -->
<link href="./assets/css/nucleo-icons.css" rel="stylesheet" />
<link href="./assets/css/nucleo-svg.css" rel="stylesheet" />
<!-- Font Awesome Icons -->
<script src="https://kit.fontawesome.com/42d5adcbca.js" crossorigin="anonymous"></script>
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet" />
<!-- CSS Files -->
<link id="pagestyle" href="./assets/css/material-dashboard.css?v=3.0.0" rel="stylesheet" />
</head>
<body class="g-sidenav-show bg-gray-200">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<?php if (isset($_GET['status']) && $_GET['status'] == 'berhasil') { ?>
<script>
Swal.fire({
title: "Di Edit",
text: "Data berhasil di Edit",
icon: "success"
}).then((result) => {
window.location.href = 'edit_kamar.php?id=<?php echo $_GET['id'] ?>';
});
</script>
<?php } ?>
<!-- SIDEBAR -->
<?php include 'sidebar.php'; ?>
<!-- SIDEBAR -->
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg">
<!-- Navbar -->
<nav class="navbar navbar-main navbar-expand-lg px-0 mx-4 shadow-none border-radius-xl" id="navbarBlur"
navbar-scroll="true">
<div class="container-fluid py-1 px-3">
<nav aria-label="breadcrumb">
<ol class="breadcrumb bg-transparent mb-0 pb-0 pt-1 px-0 me-sm-6 me-5">
<li class="breadcrumb-item text-sm"><a class="opacity-5 text-dark" href="javascript:;">Pages</a>
</li>
<li class="breadcrumb-item text-sm text-dark active" aria-current="page">Data Kamar</li>
</ol>
<h6 class="font-weight-bolder mb-0">Add Data Kamar</h6>
</nav>
<div class="collapse navbar-collapse mt-sm-0 mt-2 me-md-0 me-sm-4" id="navbar">
<div class="ms-md-auto pe-md-3 d-flex align-items-center">
</div>
</div>
<ul class="navbar-nav justify-content-end">
<li class="nav-item d-flex align-items-center">
</li>
<li class="nav-item d-xl-none ps-3 d-flex align-items-center">
<a href="javascript:;" class="nav-link text-body p-0" id="iconNavbarSidenav">
<div class="sidenav-toggler-inner">
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
<i class="sidenav-toggler-line"></i>
</div>
</a>
</li>
<li class="nav-item px-3 d-flex align-items-center">
<a href="javascript:;" class="nav-link text-body p-0">
<i class="fa fa-cog fixed-plugin-button-nav cursor-pointer"></i>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar -->
<!-- Isi Body -->
<div class="container-fluid py-4">
<a href="dt_kamar.php" class="btn btn-white"><i class="material-icons opacity-10">arrow_back</i></a>
<div class="row">
<div class="col-12">
<div class="card my-4">
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
<div class="bg-gradient-warning shadow-primary border-radius-lg pt-4 pb-3">
<div class="d-flex justify-content-between">
<h6 class="text-white text-capitalize ps-3">Lihat Data Kamar</h6>
</div>
</div>
</div>
<?php
$id = $_GET['id'];
$kueri = mysqli_query($conn, "SELECT * FROM kamar WHERE id_kamar = $id");
$row = mysqli_fetch_array($kueri);
?>
<div class="card-body px-0 pb-3 col-md-9">
<form action="proses/edit_kamar.php" method="GET">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<div class="ms-md-auto pe-md-3 d-flex align-items-center my-2">
<label for="" class="col-form-label ps-4 col-sm-3">Nama Kamar</label>
<div class="input-group input-group-outline">
<input type="text" name="nama" value="<?php echo $row['nama_kamar'] ?>"
class="form-control" onfocus="focused(this)" onfocusout="defocused(this)">
</div>
</div>
<div class="ms-md-auto pe-md-3 d-flex align-items-center my-2">
<label for="" class="col-form-label ps-4 col-sm-3">Lantai</label>
<div class="input-group input-group-outline">
<select name="lantai" id="" class="form-control">
<option selected value="<?php echo $row['lantai'] ?>">
<?php echo $row['lantai'] ?>
</option>
<option value="Lantai 1">Lantai 1</option>
<option value="Lantai 2">Lantai 2</option>
<option value="Lantai 3">Lantai 3</option>
</select>
</div>
</div>
<div class="ms-md-auto pe-md-3 d-flex align-items-center my-2">
<label for="" class="col-form-label ps-4 col-sm-3">Kapasitas</label>
<div class="input-group input-group-outline">
<input type="number" value="<?php echo $row['kapasitas'] ?>"
min="<?php echo $row['kapasitas'] ?>" name="kapasitas" class="form-control"
placeholder="Kapasitas / orang..." onfocus="focused(this)"
onfocusout="defocused(this)">
</div>
</div>
<div class="ms-md-auto pe-md-3 d-flex align-items-center my-2">
<label for="" class="col-form-label ps-4 col-sm-3">Jenis Kamar</label>
<div class="input-group input-group-outline">
<select name="jenis" id="jenis" required class="form-control">
<option value="<?php echo $row['jenis'] ?>">
<?php echo $row['jenis'] ?>
</option>
<option value="Laki Laki">Laki Laki</option>
<option value="Perempuan">Perempuan</option>
</select>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-header">
<h4>Penghuni Kamar</h4>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>No</th>
<th>NIM</th>
<th>Nama</th>
<th>JK</th>
<th>No HP</th>
<th>Prodi</th>
<th>No HP Ortu</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
$q1 = mysqli_query($conn, "SELECT * FROM penghuni WHERE id_kamar = $id");
while ($q2 = mysqli_fetch_array($q1)) {
$idmhs = $q2['id_mhs'];
$q3 = mysqli_query($conn, "SELECT * FROM mahasiswa WHERE id_mhs = $idmhs");
$q4 = mysqli_fetch_array($q3);
?>
<tr>
<td>
<?php echo $no++; ?>
</td>
<td>
<?php echo $q4['nim'] ?>
</td>
<td>
<?php echo $q4['nama_mhs'] ?>
</td>
<td>
<?php echo $q4['jk'] ?>
</td>
<td>
<?php echo $q4['no_hp'] ?>
</td>
<td>
<?php echo $q4['prodi'] ?>
</td>
<td>
<?php echo $q4['no_hp_ortu'] ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</main>
<div class="fixed-plugin">
<a class="fixed-plugin-button text-dark position-fixed px-3 py-2">
<i class="material-icons py-2">settings</i>
</a>
<div class="card shadow-lg">
<div class="card-header pb-0 pt-3">
<div class="float-start">
<h5 class="mt-3 mb-0">Material UI Configurator</h5>
<p>See our dashboard options.</p>
</div>
<div class="float-end mt-4">
<button class="btn btn-link text-dark p-0 fixed-plugin-close-button">
<i class="material-icons">clear</i>
</button>
</div>
<!-- End Toggle Button -->
</div>
<hr class="horizontal dark my-1" />
<div class="card-body pt-sm-3 pt-0">
<!-- Sidebar Backgrounds -->
<div>
<h6 class="mb-0">Sidebar Colors</h6>
</div>
<a href="javascript:void(0)" class="switch-trigger background-color">
<div class="badge-colors my-2 text-start">
<span class="badge filter bg-gradient-primary active" data-color="primary"
onclick="sidebarColor(this)"></span>
<span class="badge filter bg-gradient-dark" data-color="dark"
onclick="sidebarColor(this)"></span>
<span class="badge filter bg-gradient-info" data-color="info"
onclick="sidebarColor(this)"></span>
<span class="badge filter bg-gradient-success" data-color="success"
onclick="sidebarColor(this)"></span>
<span class="badge filter bg-gradient-warning" data-color="warning"
onclick="sidebarColor(this)"></span>
<span class="badge filter bg-gradient-danger" data-color="danger"
onclick="sidebarColor(this)"></span>
</div>
</a>
<!-- Sidenav Type -->
<div class="mt-3">
<h6 class="mb-0">Sidenav Type</h6>
<p class="text-sm">Choose between 2 different sidenav types.</p>
</div>
<div class="d-flex">
<button class="btn bg-gradient-dark px-3 mb-2 active" data-class="bg-gradient-dark"
onclick="sidebarType(this)">Dark</button>
<button class="btn bg-gradient-dark px-3 mb-2 ms-2" data-class="bg-transparent"
onclick="sidebarType(this)">Transparent</button>
<button class="btn bg-gradient-dark px-3 mb-2 ms-2" data-class="bg-white"
onclick="sidebarType(this)">White</button>
</div>
<p class="text-sm d-xl-none d-block mt-2">You can change the sidenav type just on desktop view.</p>
<!-- Navbar Fixed -->
<div class="mt-3 d-flex">
<h6 class="mb-0">Navbar Fixed</h6>
<div class="form-check form-switch ps-0 ms-auto my-auto">
<input class="form-check-input mt-1 ms-auto" type="checkbox" id="navbarFixed"
onclick="navbarFixed(this)" />
</div>
</div>
<hr class="horizontal dark my-3" />
<div class="mt-2 d-flex">
<h6 class="mb-0">Light / Dark</h6>
<div class="form-check form-switch ps-0 ms-auto my-auto">
<input class="form-check-input mt-1 ms-auto" type="checkbox" id="dark-version"
onclick="darkMode(this)" />
</div>
</div>
<hr class="horizontal dark my-sm-4" />
<a class="btn btn-outline-dark w-100" href="">View documentation</a>
</div>
</div>
</div>
<!-- Core JS Files -->
<script src="./assets/js/core/popper.min.js"></script>
<script src="./assets/js/core/bootstrap.min.js"></script>
<script src="./assets/js/plugins/perfect-scrollbar.min.js"></script>
<script src="./assets/js/plugins/smooth-scrollbar.min.js"></script>
<script src="./assets/js/plugins/chartjs.min.js"></script>
<script>
var ctx = document.getElementById("chart-bars").getContext("2d");
new Chart(ctx, {
type: "bar",
data: {
labels: ["M", "T", "W", "T", "F", "S", "S"],
datasets: [
{
label: "Sales",
tension: 0.4,
borderWidth: 0,
borderRadius: 4,
borderSkipped: false,
backgroundColor: "rgba(255, 255, 255, .8)",
data: [50, 20, 10, 22, 50, 10, 40],
maxBarThickness: 6,
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
},
interaction: {
intersect: false,
mode: "index",
},
scales: {
y: {
grid: {
drawBorder: false,
display: true,
drawOnChartArea: true,
drawTicks: false,
borderDash: [5, 5],
color: "rgba(255, 255, 255, .2)",
},
ticks: {
suggestedMin: 0,
suggestedMax: 500,
beginAtZero: true,
padding: 10,
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
color: "#fff",
},
},
x: {
grid: {
drawBorder: false,
display: true,
drawOnChartArea: true,
drawTicks: false,
borderDash: [5, 5],
color: "rgba(255, 255, 255, .2)",
},
ticks: {
display: true,
color: "#f8f9fa",
padding: 10,
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
},
},
},
},
});
var ctx2 = document.getElementById("chart-line").getContext("2d");
new Chart(ctx2, {
type: "line",
data: {
labels: ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [
{
label: "Mobile apps",
tension: 0,
borderWidth: 0,
pointRadius: 5,
pointBackgroundColor: "rgba(255, 255, 255, .8)",
pointBorderColor: "transparent",
borderColor: "rgba(255, 255, 255, .8)",
borderColor: "rgba(255, 255, 255, .8)",
borderWidth: 4,
backgroundColor: "transparent",
fill: true,
data: [50, 40, 300, 320, 500, 350, 200, 230, 500],
maxBarThickness: 6,
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
},
interaction: {
intersect: false,
mode: "index",
},
scales: {
y: {
grid: {
drawBorder: false,
display: true,
drawOnChartArea: true,
drawTicks: false,
borderDash: [5, 5],
color: "rgba(255, 255, 255, .2)",
},
ticks: {
display: true,
color: "#f8f9fa",
padding: 10,
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
},
},
x: {
grid: {
drawBorder: false,
display: false,
drawOnChartArea: false,
drawTicks: false,
borderDash: [5, 5],
},
ticks: {
display: true,
color: "#f8f9fa",
padding: 10,
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
},
},
},
},
});
var ctx3 = document.getElementById("chart-line-tasks").getContext("2d");
new Chart(ctx3, {
type: "line",
data: {
labels: ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
datasets: [
{
label: "Mobile apps",
tension: 0,
borderWidth: 0,
pointRadius: 5,
pointBackgroundColor: "rgba(255, 255, 255, .8)",
pointBorderColor: "transparent",
borderColor: "rgba(255, 255, 255, .8)",
borderWidth: 4,
backgroundColor: "transparent",
fill: true,
data: [50, 40, 300, 220, 500, 250, 400, 230, 500],
maxBarThickness: 6,
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
},
interaction: {
intersect: false,
mode: "index",
},
scales: {
y: {
grid: {
drawBorder: false,
display: true,
drawOnChartArea: true,
drawTicks: false,
borderDash: [5, 5],
color: "rgba(255, 255, 255, .2)",
},
ticks: {
display: true,
padding: 10,
color: "#f8f9fa",
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
},
},
x: {
grid: {
drawBorder: false,
display: false,
drawOnChartArea: false,
drawTicks: false,
borderDash: [5, 5],
},
ticks: {
display: true,
color: "#f8f9fa",
padding: 10,
font: {
size: 14,
weight: 300,
family: "Roboto",
style: "normal",
lineHeight: 2,
},
},
},
},
},
});
</script>
<script>
var win = navigator.platform.indexOf("Win") > -1;
if (win && document.querySelector("#sidenav-scrollbar")) {
var options = {
damping: "0.5",
};
Scrollbar.init(document.querySelector("#sidenav-scrollbar"), options);
}
</script>
<!-- Github buttons -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- Control Center for Material Dashboard: parallax effects, scripts for the example pages etc -->
<script src="./assets/js/material-dashboard.min.js?v=3.0.0"></script>
</body>
</html>