<?php
include_once 'connect.php';

if (isset($_POST['uc_id'])) {
    $uc_id = $_POST['uc_id'];
    $query = "SELECT level_id AS id, level_name FROM school_level ORDER BY level_name ASC";
    $result = $conn->query($query);

    $options = "<option value=''>All School Levels</option>";
    while ($row = $result->fetch_assoc()) {
        $options .= "<option value='" . $row['id'] . "'>" . $row['level_name'] . "</option>";
    }

    echo $options;
}
?>