<?php

namespace Apps\Calendar\Widget\LastEvent;

use Core\Control\Form\Form;
use Core\View\View;
use Core\View\ElementView;

use Apps\Calendar\Entity\CalendarEvent;

class LastEvent {

    /**
     * Constructeur
     */
    function __construct($core = "", $data = "") {
        $this->Core = $core;
    }

    /*     * *
     * Render the html form
     */

    function Render() {

        $event = new CalendarEvent($this->Core);
        
        $view = new View(__DIR__ . "/View/index.tpl", $this->Core);
        
        //TODO PRENDRE LES EVENT DU MOIS
        $view->AddElement(new ElementView("Events", $event->Find(" 1 = 1 Order by DateStart desc")));
        return $view->Render();
    }
}
