prepare("SELECT pseudo, perm FROM admin WHERE id = ?");
$req_user->execute(array($_SESSION['id']));
$user_exist = $req_user->rowcount();
$user = $req_user->fetch();
} else {
$user_exist = 0;
}
echo '';
if($user_exist != 1) {
if($page != "index") {
header('Location: index.php');
}
} else {
$content =
'Index'
.'Stats';
switch ($user['perm']) {
case 1:
$content = $content."Com'ville";
break;
case 2:
$content = $content
."Com'ville"
.'Planning';
break;
case 3:
$content = $content
."Com'ville"
.'Planning'
.'Gestion des accès'
.'Enigma'
.'Matomo';
break;
}
$content = $content.'Se déconnecter';
}
?>