<?php
require 'koneksi.php';
$con = open_connection();

$query = mysqli_query($con, "SELECT * FROM murid");
?>

<?php require "header.php"; ?>

<div class="container mt-4">

    <h2>Laporan Data Murid</h2>

    <button onclick="window.print()" class="btn btn-success mb-3">
        Cetak PDF
    </button>

    <table class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>ID Murid</th>
                <th>Nama</th>
                <th>NISN</th>
                <th>Kode Kelas</th>
            </tr>
        </thead>

        <tbody>

        <?php while($data = mysqli_fetch_assoc($query)){ ?>

            <tr>
                <td><?= $data['id_murid']; ?></td>
                <td><?= $data['nama']; ?></td>
                <td><?= $data['nisn']; ?></td>
                <td><?= $data['kode_kelas']; ?></td>
            </tr>

        <?php } ?>

        </tbody>

    </table>

</div>
<?php include 'footer.php';?>