font menu admin

This commit is contained in:
Baptiste 2022-06-15 17:35:34 +02:00
parent 4b8c070f0a
commit bf5396b84f
8 changed files with 156 additions and 51 deletions

54
admin/admin.css Normal file
View file

@ -0,0 +1,54 @@
* {
margin: 0;
padding: 0;
--color1 : rgba(30, 30, 30, 1);
--color2 : rgba(255, 255, 255, 0.07);
color: white;
}
body {
background-color: var(--color1);
}
main {
margin: 50px;
}
nav {
display: block;
width: 100vw;
}
nav ul li {
list-style: none;
display: inline-block;
padding: 15px;
background-color: var(--color2);
border: 2px solid var(--color1);
}
nav ul li a {
text-decoration: none;
color: white;
font-weight: bold;
transition: 3s ease;
}
nav ul li:hover {
transform: scale(1.05);
transition: 0.3s ease;
}
nav ul li.green {
border-bottom: 1px solid green;
}
nav ul li.orange {
border-bottom: 1px solid orange;
}
nav ul li.red {
border-bottom: 1px solid red;
}
nav ul li.white {
border-bottom: 1px solid white;
}

View file

@ -5,3 +5,15 @@ if($user['perm'] < 2) {
header('Location: deco.php'); header('Location: deco.php');
} }
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin / Enigma</title>
</head>
<body>
<main>
</main>
</body>
</html>

View file

@ -37,6 +37,7 @@ if(isset($_POST['send'])) {
<title>Admin / Accès</title> <title>Admin / Accès</title>
</head> </head>
<body> <body>
<main>
<form method="POST"> <form method="POST">
<input type="text" placeholder="identifiant" name="pseudo"> <input type="text" placeholder="identifiant" name="pseudo">
<input type="password" placeholder="mot de passe" name="mdp"> <input type="password" placeholder="mot de passe" name="mdp">
@ -59,7 +60,6 @@ if(isset($_POST['send'])) {
?> ?>
<?= $admin['id'] ?> || <?= $admin['pseudo'] ?> || <?= $admin['perm'] ?> <?= $admin['id'] ?> || <?= $admin['pseudo'] ?> || <?= $admin['perm'] ?>
<?php } ?> <?php } ?>
</main>
</body> </body>
</html> </html>

View file

@ -35,6 +35,7 @@ if(isset($_POST['login'])) {
<title>Admin / index</title> <title>Admin / index</title>
</head> </head>
<body> <body>
<main>
<?php <?php
if(isset($_SESSION['id'])) { if(isset($_SESSION['id'])) {
echo "Connecté sous l'identifiant : ".$user['pseudo']; echo "Connecté sous l'identifiant : ".$user['pseudo'];
@ -51,5 +52,6 @@ if(isset($_POST['login'])) {
echo "<font color='red'>".$error."</font>"; echo "<font color='red'>".$error."</font>";
} }
?> ?>
</main>
</body> </body>
</html> </html>

View file

@ -6,3 +6,15 @@ if($user['perm'] < 1) {
} }
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin / Planning</title>
</head>
<body>
<main>
</main>
</body>
</html>

View file

@ -12,39 +12,40 @@ if(isset($_SESSION['id'])) {
$user_exist = 0; $user_exist = 0;
} }
echo '<link rel="stylesheet" type="text/css" href="admin.css" />';
if($user_exist != 1) { if($user_exist != 1) {
if($page != "index") { if($page != "index") {
header('Location: index.php'); header('Location: index.php');
} }
} else { } else {
$content =
'<li class="green"><a href="index.php">Index</a></li>'
.'<li class="green"><a href="stats.php">Stats</a></li>';
switch ($user['perm']) { switch ($user['perm']) {
case 0:
?>
<a href="index.php">Index</a><br>
<a href="stats.php">Stats</a><br>
<a href="deco.php">Se déconnecter</a><br>
<?php
break;
case 1: case 1:
?> $content = $content.'<li class="orange"><a href="planning.php">Planning</a></li>';
<a href="index.php">Index</a><br>
<a href="planning.php">Planning</a><br>
<a href="stats.php">Stats</a><br>
<a href="deco.php">Se déconnecter</a><br>
<?php
break; break;
case 2: case 2:
?> $content = $content
<a href="index.php">Index</a><br> .'<li class="orange"><a href="planning.php">Planning</a></li>'
<a href="gestion_des_acces.php">Gestion des accès</a><br> .'<li class="red"><a href="gestion_des_acces.php">Gestion des accès</a></li>'
<a href="enigma.php">Enigma</a><br> .'<li class="red"><a href="enigma.php">Enigma</a></li>'
<a href="planning.php">Planning</a><br> .'<li class="red"><a href="stats.php">Stats</a></li>'
<a href="stats.php">Stats</a><br> .'<li class="red"><a href="vacances.php">Vacances</a></li>';
<a href="vacances.php">Vacances</a><br>
<a href="deco.php">Se déconnecter</a><br>
<?php
break; break;
} }
$content = $content.'<li class="white"><a href="deco.php">Se déconnecter</a></li>';
} }
?> ?>
<nav>
<ul>
<?php
if(isset($content)) {
echo $content;
} ?>
</ul>
</nav>

View file

@ -1,3 +1,15 @@
<?php <?php
include "script.php"; include "script.php";
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin / Stats</title>
</head>
<body>
<main>
</main>
</body>
</html>

View file

@ -5,3 +5,15 @@ if($user['perm'] < 2) {
header('Location: deco.php'); header('Location: deco.php');
} }
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Admin / Vacances</title>
</head>
<body>
<main>
</main>
</body>
</html>