<?php 
    $data = array();
    $data['title'] = $meta_title . " | " . $App->title;
    $data['links'] = [];
    $data['styles'] = ["/public/panel/assets/css/fullcalendar.min.css"];
    $data['header']['scripts'] = [];
    $data['version'] = $App->version;
    $data['csrf_token'] = $csrf_generator->create();
    $data['sidebar_menu'] = $menu->get(array('position'=>'sidebar'));
    $data['sidebar_active_menu'] = $menu->getActiveMenuItemId(trim($_SERVER['REQUEST_URI']));
    $data['footer']['scripts'] = [$App->url.'/public/panel/assets/js/fullcalendar.min.js'];
    $menu_items = $menu->get(array('position'=>'footer'));

    $data['cards']["1"] = 0;
    $data['cards']["2"] = 0;
    $data['cards']["3"] = 0;

    $data['results']["1"] = 0;
    $data['results']["2"] = 0;
    $data['results']["3"] = 0;
    $data['results']["4"] = 0;

    foreach($menu_items as $item){
        if($item['col'] == "1"){
            $data['menu']['footer']["1"][] = $item;
        }
        if($item['col'] == "2"){
            $data['menu']['footer']["2"][] = $item;
        }
        if($item['col'] == "3"){
            $data['menu']['footer']["3"][] = $item;
        }
        if($item['col'] == "4"){
            $data['menu']['footer']["4"][] = $item;
        }
    }
    $data['breadcrumbs'] = array();
    $data['breadcrumbs'][] = array(
        'text' => "Anasayfa",
        'href' => "/panel",
        'index' => 1
    );
    $data['breadcrumbs'][] = array(
        'text' => "Takvim",
        'href' => "/panel/takvim",
        'index' => 2
    );
    $user_courses	    = $course->getUserCourses($session->data['user_id']);
?>
<?php include DIR_PUBLIC."panel/parts/header.php"; ?>
        <main class="content">
            <div class="container-fluid">
                <div class="card">
                    <div class="card-body">
                        <div id="calendar"></div>
                    </div>
                </div>
            </div>
        </main>
<?php include DIR_PUBLIC."panel/parts/footer.php"; ?>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        var calendarEl = document.getElementById('calendar');
        var calendar = new FullCalendar.Calendar(calendarEl, {
          initialView: 'dayGridMonth'
        });
        calendar.render();
      });
</script>