-
Notifications
You must be signed in to change notification settings - Fork 0
/
tampil_detail.php
109 lines (104 loc) · 4.15 KB
/
tampil_detail.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
<?php
session_start();
// Periksa apakah pengguna belum login
if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) {
// Jika belum login, arahkan kembali ke halaman login
header("Location: login.php");
exit();
}
?>
<div class="d-flex flex-column flex-lg-row mt-5 mb-4">
<!-- judul halaman -->
<div class="flex-grow-1 d-flex align-items-center">
<i class="fa-regular fa-user icon-title"></i>
<h3>Siswa</h3>
</div>
<!-- breadcrumbs -->
<div class="ms-5 ms-lg-0 pt-lg-2">
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="" class="text-dark text-decoration-none"><i class="fa-solid fa-house"></i></a></li>
<li class="breadcrumb-item"><a href="?halaman=data" class="text-dark text-decoration-none">Siswa</a></li>
<li class="breadcrumb-item" aria-current="page">Detail</li>
</ol>
</nav>
</div>
</div>
<?php
// mengecek data GET "id_siswa"
if (isset($_GET['id'])) {
// ambil data GET dari tombol detail
$id_siswa = $_GET['id'];
// sql statement untuk menampilkan data dari tabel "tbl_siswa" berdasarkan "id_siswa"
$query = $mysqli->query("SELECT * FROM tbl_siswa WHERE id_siswa='$id_siswa'")
or die('Ada kesalahan pada query tampil data : ' . $mysqli->error);
// ambil data hasil query
$data = $query->fetch_assoc();
}
?>
<div class="bg-white rounded-4 shadow-sm p-4 mb-5">
<!-- judul form -->
<div class="alert alert-primary rounded-4 mb-5" role="alert">
<i class="fa-solid fa-list-ul me-2"></i> Detail Data Siswa
</div>
<!-- tampilkan data -->
<div class="d-flex flex-column flex-xl-row">
<div class="flex-shrink-0 text-center mb-5 mb-xl-0">
<div class="foto-profil-detail">
<img src="images/<?php echo $data['foto_profil']; ?>" class="border border-2 img-fluid rounded-4 shadow" alt="Foto Profil" width="240" height="240">
</div>
</div>
<div class="flex-grow-1 text-muted fw-light ms-xl-5">
<div class="table-responsive">
<table class="table table-striped lh-lg">
<tr>
<td width="200">ID Siswa</td>
<td width="10">:</td>
<td><?php echo $data['id_siswa']; ?></td>
</tr>
<tr>
<td>Tanggal Daftar</td>
<td>:</td>
<td><?php echo tanggal_indo($data['tanggal_daftar']); ?></td>
</tr>
<tr>
<td>Kelas</td>
<td>:</td>
<td><?php echo $data['kelas']; ?></td>
</tr>
<tr>
<td>Nama Lengkap</td>
<td>:</td>
<td><?php echo $data['nama_lengkap']; ?></td>
</tr>
<tr>
<td>Jenis Kelamin</td>
<td>:</td>
<td><?php echo $data['jenis_kelamin']; ?></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><?php echo $data['alamat']; ?></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><?php echo $data['email']; ?></td>
</tr>
<tr>
<td>WhatsApp</td>
<td>:</td>
<td><?php echo $data['whatsapp']; ?></td>
</tr>
</table>
</div>
</div>
</div>
<div class="pt-4 pb-2 mt-5 border-top">
<div class="d-grid gap-3 d-sm-flex justify-content-md-start pt-1">
<!-- button kembali ke halaman tampil data -->
<a href="?halaman=data" class="btn btn-primary rounded-pill py-2 px-4">Kembali</a>
</div>
</div>
</div>