<?PHP
// Par : Ahmed ZERZIH
//Reoleweb
//
//Cette classe gère l'affichage du menu de navigation
//Elle fait appel a la classe Vue\NavBarHtml.php pour l'affichage Html
namespace Classe;



use mysqlDB;
use Views\FooterHtml as ViewsFooterHtml;
use Views\NavBarHtml as ViewsNavBarHtml;
use Views\SideBarHtml as ViewsSideBarHtml;
use Views\DashboardHtml;

class Navbar
{

	private $idUser;
	// Removed department functionality - no longer needed
	// private $dep;
	// private Departement $departement;
	private Users $user;
	public $nom;
	public $NomSiteCap;
	private mysqlDB $conn;

	public function __construct($conn)
	{
		include_once("FunctionClasse.php");
		include("Parametre/" . getPath(1) . "/" . getPath(1) . ".php");

		$this->conn = $conn;
		if (isset($_SESSION[$NomSite]['idUser'])){
			$this->idUser = $_SESSION[$NomSite]['idUser'];
			// Removed department functionality - no longer needed
			// $this->dep = $_SESSION[$NomSite]['idDepartement'];
			// $this->departement = new Departement($conn, $this->dep);
	
			$this->user = new Users($conn, $this->idUser);
			$this->nom = "menu";
		}
	}

	public function getHeader($pathPrefix = '')
	{
		// Removed department functionality - no longer needed
		$navBarHtml = new ViewsNavBarHtml();
		$navBarHtml->showMenu(null, $this->user, $pathPrefix);
	}
	public function getSideBar()
	{
		// Removed department functionality - no longer needed
		$navBarHtml = new ViewsSideBarHtml();
		$navBarHtml->showSideBar(null, $this->user);
	}
	public function getFooter()
	{
		$navBarHtml = new ViewsFooterHtml();
		$navBarHtml->showFooter();
	}
	public function getDashBoard($NomSiteCap)
	{

		$userClass = new AnnonceClient($this->conn);
		$userClass->afficherDashBoard($NomSiteCap);
	}
}
