<?php
    include "../backend/connection.php";
    $configure = new DefaultDatabase();
    $conf = $configure->connect();

    $participants = mysqli_query($conf,"SELECT * FROM participants");

?>
<div class="participants-container">
    <h2>PARTICIPANTS MANAGEMENT</h2>
    <table id="participantsTable">
        <thead>
            <tr>
                <th>Full Name</th>
                <th>Date Of Birth</th>
                <th>Grade</th>
                <th>School</th>
                <th>District</th>
                <th>Category</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            <?php
                while($pupil = mysqli_fetch_array($participants))
                {
            ?>
            <tr>
                <td><?php echo $pupil["first_name"]." ".$pupil["last_name"] ?></td>
                <td><?php echo $pupil["date_of_birth"]?></td>
                <td><?php echo $pupil["grade_section"] ?></td>
                <td><?php echo $pupil["school"] ?></td>
                <td><?php echo $pupil["district"] ?></td>
                <td><?php echo $pupil["category"] ?></td>
                <td>
                    <button class="edit">Edit</button>
                    <button class="delete">Delete</button>
                </td>
            </tr>
            <?php
                }
            ?>
        </tbody>
    </table>
</div>
<script src="./js/participants.js"></script>