<?php

namespace Controllers;

use Bases\Controller;
use Models\Categorie;
use Models\Menu;

class EmployeController extends Controller
{

    /**
     * Affiche la page du menu pour un employé
     */
    public function index()
    {
        // Protection de la route
        if (empty($_SESSION["role"])) {         
            $this->rediriger("index");
        }   
        
        $menus = (new Menu)->tout();
        $tout_categories = (new Categorie)->toutCategories();

        $this->vue("employes/index", [
            "menus" => $menus,
            "tout_categories" => $tout_categories
        ]);
        
    }
}
