
<?php
session_start();

if (!isset($_SESSION['email']) || $_SESSION['role'] != 'siswa') {
    // If session is not set, redirect to login
    header("Location: login.php");
    exit();
}


include 'header_siswa.php';
include 'koneksi.php';
$data = mysqli_query($koneksi, "SELECT * FROM aktivitas");
?>

<div class="container mt-4">
    <h2 class="text-center mb-4">Aktivitas Siswa</h2>
    <div class="row">
        <?php while ($d = mysqli_fetch_array($data)) { ?>
            <div class="col-md-6 col-lg-4 mb-4">
                <div class="card shadow-sm">
                    <div class="card-body">
                        <h5 class="card-title"><?php echo $d['nama_aktivitas']; ?></h5>
                        <p class="card-text">
                            <strong>Keterangan:</strong> <?php echo $d['keterangan']; ?><br>
                            <strong>Tanggal Aktivitas:</strong> <?php echo $d['tanggal']; ?><br>
                        </p>
                    </div>
                </div>
            </div>
        <?php } ?>
    </div>
</div>
<p></p>
<p></p>
<p></p>
