<DOCTYPE html>
    <html lang="en">

    <head>
        <div class="topnav">
            <a href="halaman_admin.php">Beranda</a>
            <a href="datapesertaadm.php">Data Peserta</a>
            <a href="latihanadm.php">Latihan</a>
            <a href="datalombaadm.php">Lomba</a>
            <a class="active" href="dataraportadm.php">Nilai</a>
            <a href="approveva.php">Approve VA</a>
        </div>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" type="text/css" href="../style.css">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css">
    </head>

    <body>
        <?php
        session_start();

        if ($_SESSION['status'] == "") {
            header("location:../loginpageadmin.php?pesan=gagal");
        }

        ?>
        <div class="container">
            <br>
            <h2>Data Nilai Peserta</h2>
            <table class="table" style="text-align:center">
                <thead>
                    <tr>
                        <th>Nomor</th>
                        <th>Nama Peserta</th>
                        <th>Dribbling</th>
                        <th>Passing</th>
                        <th>Shooting</th>
                        <th>Rebounding</th>
                        <th>Defense</th>
                        <th>Pivot</th>
                        <th>Blocking</th>
                        <th>Lay Up</th>
                        <th>Crossover</th>
                        <th>Triple Threat</th>
                        <th>Leadership</th>
                        <th>Kerjasama</th>
                        <th>Kejujuran</th>
                        <th>Disiplin</th>
                        <th>Sportivitas</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $servername = "localhost";
                    $username = "root";
                    $password = "";
                    $database = "membership";

                    $connection = new mysqli($servername, $username, $password, $database);

                    if ($connection->connect_error) {
                        die("Gagal Koneksi" . $connection->connect_error);
                    }

                    $sql = "SELECT * FROM raport ";
                    $result = $connection->query($sql);

                    if (!$result) {
                        die("Invalid query: " . $connection->error);
                    }

                    while ($row = $result->fetch_assoc()) {
                        echo "
                        <tr>
                        <td>$row[id]</td>
                        <td>$row[nama_peserta]</td>
                        <td>$row[dribbling]</td>
                        <td>$row[passing]</td>
                        <td>$row[shooting]</td>
                        <td>$row[rebounding]</td>
                        <td>$row[defense]</td>
                        <td>$row[pivot]</td>
                        <td>$row[blocking]</td>
                        <td>$row[layup]</td>
                        <td>$row[crossover]</td>
                        <td>$row[tripleth]</td>
                        <td>$row[leadership]</td>
                        <td>$row[kerjasama]</td>
                        <td>$row[kejujuran]</td>
                        <td>$row[disiplin]</td>
                        <td>$row[sportivitas]</td>
                    </tr>
                        ";
                    }
                    ?>

                </tbody>
            </table>
        </div>
    </body>

    </html>