<?php
include 'includes/database.php';
include 'includes/functions.php';
$conn = new Functions();

$conn->query("SELECT id, name FROM classes");
$classes = $conn->fetchMultiple();

$conn->query("SELECT id, subject_name FROM subjects");
$subjects = $conn->fetchMultiple();

$conn->query("SELECT id, name FROM terms");
$terms = $conn->fetchMultiple();

echo json_encode([
    'classes' => $classes,
    'subjects' => $subjects,
    'terms' => $terms
]);
