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

$query = mysqli_query($con, "SELECT

p.id_perkembangan,
m.nama AS nama_murid,
a.nama_aspek,
g.nama AS nama_guru,
p.deskripsi,
p.tanggal_penilaian

FROM perkembangan p

JOIN murid m
ON p.id_murid = m.id_murid

JOIN guru g
ON p.id_guru = g.id_guru

JOIN aspek_perkembangan a
ON p.id_aspek = a.id_aspek
");
?>
<?php require 'header.php';?>

<div class="container mt-4">

    <h2>Laporan Perkembangan 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</th>
                <th>Murid</th>
                <th>Aspek</th>
                <th>Guru</th>
                <th>Tanggal</th>
                <th>Deskripsi</th>
            </tr>
        </thead>

        <tbody>

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

            <tr>
                <td><?= $data['id_perkembangan']; ?></td>
                <td><?= $data['nama_murid']; ?></td>
                <td><?= $data['nama_aspek']; ?></td>
                <td><?= $data['nama_guru']; ?></td>
                <td><?= $data['tanggal_penilaian']; ?></td>
                <td><?= $data['deskripsi']; ?></td>
            </tr>

        <?php } ?>

        </tbody>

    </table>

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