-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
55 lines (48 loc) · 1.09 KB
/
view.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
<?php
require 'functions.php';
$siswa = mysqli_query($koneksi, "SELECT * FROM siswa");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title style="display: none;">CETAK</title>
<style>
div {
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<h1 style="text-align: center; text-decoration: underline;">Daftar Siswa</h1>
<div class="card-body">
<table class="table table-bordered table-striped" border="1" cellpadding="1" cellspacing="0">
<tr>
<th>No</th>
<th>NISN</th>
<th>Nama</th>
<th>Kelas</th>
<th>Jurusan</th>
</tr>
<?php $no = 1; ?>
<?php while($data = mysqli_fetch_array($siswa)) : ?>
<tr>
<td><?= $no; ?></td>
<td> <?= $data['nisn']; ?> </td>
<td> <?= $data['nama']; ?> </td>
<td> <?= $data['kelas']; ?> </td>
<td> <?= $data['jurusan']; ?> </td>
</tr>
<?php $no++; ?>
<?php endwhile; ?>
</table>
<script>
window.print();
</script>
</div>
</body>
</html>