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

@ -4,4 +4,16 @@ include "script.php";
if($user['perm'] < 2) {
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,29 +37,29 @@ if(isset($_POST['send'])) {
<title>Admin / Accès</title>
</head>
<body>
<form method="POST">
<input type="text" placeholder="identifiant" name="pseudo">
<input type="password" placeholder="mot de passe" name="mdp">
<select name="perm">
<option value="0">GDA - Perm 0</option>
<option value="1">Bureau - Perm 1</option>
<option value="2">Admin - Perm 2</option>
</select>
<input type="submit" name="send" value="Creer l'acces">
</form>
<?php
if(isset($error)) {
echo "<font color='red'>".$error."</font>";
}
?>
<br><br>
<?php
$req = $db->query('SELECT id, pseudo, perm FROM admin');
while($admin = $req->fetch()) {
?>
<?= $admin['id'] ?> || <?= $admin['pseudo'] ?> || <?= $admin['perm'] ?>
<?php } ?>
<main>
<form method="POST">
<input type="text" placeholder="identifiant" name="pseudo">
<input type="password" placeholder="mot de passe" name="mdp">
<select name="perm">
<option value="0">GDA - Perm 0</option>
<option value="1">Bureau - Perm 1</option>
<option value="2">Admin - Perm 2</option>
</select>
<input type="submit" name="send" value="Creer l'acces">
</form>
<?php
if(isset($error)) {
echo "<font color='red'>".$error."</font>";
}
?>
<br><br>
<?php
$req = $db->query('SELECT id, pseudo, perm FROM admin');
while($admin = $req->fetch()) {
?>
<?= $admin['id'] ?> || <?= $admin['pseudo'] ?> || <?= $admin['perm'] ?>
<?php } ?>
</main>
</body>
</html>

View file

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

View file

@ -5,4 +5,16 @@ if($user['perm'] < 1) {
header('Location: deco.php');
}
?>
?>
<!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;
}
echo '<link rel="stylesheet" type="text/css" href="admin.css" />';
if($user_exist != 1) {
if($page != "index") {
header('Location: index.php');
}
} 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']) {
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:
?>
<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
$content = $content.'<li class="orange"><a href="planning.php">Planning</a></li>';
break;
case 2:
?>
<a href="index.php">Index</a><br>
<a href="gestion_des_acces.php">Gestion des accès</a><br>
<a href="enigma.php">Enigma</a><br>
<a href="planning.php">Planning</a><br>
<a href="stats.php">Stats</a><br>
<a href="vacances.php">Vacances</a><br>
<a href="deco.php">Se déconnecter</a><br>
<?php
$content = $content
.'<li class="orange"><a href="planning.php">Planning</a></li>'
.'<li class="red"><a href="gestion_des_acces.php">Gestion des accès</a></li>'
.'<li class="red"><a href="enigma.php">Enigma</a></li>'
.'<li class="red"><a href="stats.php">Stats</a></li>'
.'<li class="red"><a href="vacances.php">Vacances</a></li>';
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
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

@ -4,4 +4,16 @@ include "script.php";
if($user['perm'] < 2) {
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>