<?php
require_once 'model.php';
$db = new Model();

$t = $_POST["t"] ?? null;

header('Content-Type: application/json');
if (!empty($t)) {
    switch ($t) {
        case 'event_s':
            $data = $db->GetEventById($_POST["eventId"]);
            echo json_encode($data);
            break;

        default:
            echo json_encode("Another");
            break;
    }
}else {
    echo json_encode($t);
}