<?php
include('../includes/db.php');

if (isset($_GET['class_id'])) {
    $classId = (int)$_GET['class_id'];
    
    $sections = array();
    $query = $conn->query("SELECT section_id FROM class_section WHERE class_id = $classId AND status = 1");
    
    while ($row = $query->fetch_assoc()) {
        $sections[] = $row['section_id'];
    }
    
    echo json_encode($sections);
}
?>