<?php
    include('../../xcrud/xcrud.php');
    header('Content-Type: text/html; charset=' . Xcrud_config::$mbencoding);
    $db = Xcrud_db::get_instance();
    $table = "events";
    if ($table > ''){
        $query = "SELECT * FROM events ";
        $db->query($query);
        // echo $query;exit;
        $result = $db->result();
        //print_r($result);exit;
        if($result > ""){
            foreach ($result as $key => $item)
            {   
                $json[] = array(
                            "start" => $item['datum'],
                            "title" => $item['titel'],
                            "url" => $item['url']
                          );
            }
            echo json_encode($json, JSON_UNESCAPED_UNICODE);
        } else {
            echo $query;
        }
    }
?>