<?php
include_once '../../controllers/MateriaController.php';

$materiaController = new MateriaController();
$materia_id = $_GET['materia_id'];
$materia = $materiaController->obtenerMateriaPorId($materia_id);

$semestres = [];
if ($materia) {
    $semestres[] = $materia['semestre'];
}

header('Content-Type: application/json');
echo json_encode(['semestres' => $semestres]);
?>
