<?php

$cFile = basename($_SERVER["PHP_SELF"]);

if ($cFile != "index.php")
{
	if (empty($_SESSION["Sid_user"]))
	{
		header ("Location: index.php");
		exit;
	}

	if ($cFile == "utilisateur.php" || $cFile == "utilisateur_switch.php" || $cFile == "utilisateur_suivi.php" || $cFile == "utilisateur_edition.php" || $cFile == "utilisateur_suppression.php" || $cFile == "patient_suivi.php" || $cFile == "menu.php" || $cFile == "module.php" || $cFile == "module_edition.php" || $cFile == "module_suppression.php" || $cFile == "zone.php" || $cFile == "zone_edition.php" || $cFile == "zone_suppression.php" || $cFile == "specialite.php" || $cFile == "specialite_edition.php" || $cFile == "specialite_suppression.php" || $cFile == "bilan.php" || $cFile == "compta.php")
	{
		if (!isset($_SESSION["Sadmin"]))
		{
			header ("Location: index.php");
			exit;
		}
	}

	$cUser = $util->get_utilisateur($_SESSION["Sid_user"]);
	$infobox["Vous &ecirc;tes"] = $cUser["user_nom"] . " " . $cUser["user_prenom"];

	if ($cFile == "rdv.php" || $cFile == "rdv_suppression.php" || $cFile == "rdv_edition.php" || $cFile == "consultation.php" || $cFile == "fiche.php" || $cFile == "dossier_init.php" || $cFile == "dossier_suite.php" || $cFile == "dossier_final.php" || $cFile == "dossier_final.php" || $cFile == "filtre.php" || $cFile == "proposition.php" || $cFile == "consultation_impression.php")
	{
		if (empty($_SESSION["Sid_pat"]))
		{
			header ("Location: suivi.php");
			exit;
		}

		$cPat = $pat->get_patient($_SESSION["Sid_pat"]);
		if (isset($_SESSION["Sadmin"]))
		{
			$patNom = substr($cPat["pat_nom"], 0, 3);
			$patPrenom = substr($cPat["pat_prenom"], 0, 1);
		}
		else
		{
			$patNom = $cPat["pat_nom"];
			$patPrenom = $cPat["pat_prenom"];
		}
		$infobox["Suivi de"] = $patNom . " " . $patPrenom;
	}
}

?>