-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsiswa_cadangan.php
82 lines (67 loc) · 2.47 KB
/
siswa_cadangan.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
<?php
session_start();
include 'koneksi.php';
// fungsi cek sesi
if(isset($_SESSION['sesi'])){
$header = "- Siswa Cadangan";
include 'header.php';
?>
<!-- container -->
<div class="container">
<div class="card my-2">
<h3 class="card-header text-center">Data Siswa Cadangan</h3>
<div class="card-body container ">
<!-- Tabel Siswa Cadangan -->
<table class="table table-bordered nowrap" id="dataTable">
<thead class="thead-dark">
<tr>
<th>NO</th>
<th>NISN</th>
<th>NAMA SISWA</th>
<th>ASAL SEKOLAH</th>
<th>STATUS PENERIMAAN</th>
<th>DETAIL SISWA</th>
</tr>
</thead>
<tbody>
<?php
// mengambil data tabel pendaftaran dengan kondisi status Cadangan
$query = mysqli_query($db, "SELECT * FROM pendaftaran WHERE status='Cadangan'");
$data = mysqli_fetch_array($query);
// cek kolom dari pendaftaran
if(mysqli_num_rows($query) >0) {
$no = 1;
// loop data tabel pendaftaran kondisi cadangan
do{
?>
<tr>
<td><?=$no++;?></td>
<td><?=$data['nisn'];?></td>
<td><?=$data['nama'];?></td>
<td><?=$data['asal_sekolah'];?></td>
<td><?=$data['status'];?></td>
<td>
<a role="button" name="submit" href="detail.php?id=<?=$data['id'];?>" class="btn btn-sm btn-secondary">Lihat Detail</a>
</td>
</tr>
<?php
}while($data = mysqli_fetch_assoc($query));
}else{
// jika false
echo "<tr><td colspan='7'><center>Belum ada data!</center></td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php
include 'footer.php';
} else {
echo "<script>
alert('Silahkan Login Terlebih Dahulu!');
window.location = 'login.php';
</script>";
}
?>