<?php
require("../../../config/koneksi.php");
require("../../../config/function.php");
require("../../../config/crud.php");

(isset($_GET['pg'])) ? $pg = $_GET['pg'] : $pg = '';

if ($pg == 'ambil_kelas') {
    $level = $_POST['level'];
    $sql = mysqli_query($koneksi, "SELECT * FROM siswa WHERE level ='$level' GROUP BY kelas");
    echo "<option value=''>Pilih Kelas</option>";
    while ($data = mysqli_fetch_array($sql)) {
        echo "<option value='$data[kelas]'>$data[kelas]</option>";
    }
}