<?php
require 'config.php';
$teacher = $_GET['teacher'];
$term = $_GET['term'];
$stmt = $conn->prepare("SELECT DISTINCT classes FROM end_term_report WHERE Teacher = ? AND term = ?");
$stmt->bind_param("ss", $teacher, $term);
$stmt->execute();
$result = $stmt->get_result();

$classes = [];
while ($row = $result->fetch_assoc()) {
  $classes[] = $row['classes'];
}
echo json_encode($classes);
