<?php
require_once('../../includes/config.php');
header('Content-Type: application/json');

try {
    $stmt = $pdo->query("SELECT id, medium_name FROM mediums WHERE status = 1 ORDER BY medium_name ASC");
    $mediums = $stmt->fetchAll(PDO::FETCH_ASSOC);
    echo json_encode(["status" => true, "data" => $mediums]);
} catch (Exception $e) {
    echo json_encode(["status" => false, "msg" => $e->getMessage()]);
}
?>