forked from evemarielouis/BLOGART24
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
109 lines (101 loc) · 4.6 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
// CREE SESSION DE CONNEXION
session_start();
?>
<!DOCTYPE html>
<html lang="fr-FR">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/src/images/logo bibble's header.png" type="image/x-icon" />
<!-- Load CSS -->
<link rel="stylesheet" href="/src/css/header.css">
<!-- Bootstrap CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous" />
<!-- CAPTCHA GOOGLE -->
<script src="https://www.google.com/recaptcha/api.js"></script>
</head>
<?php
//load config
require_once 'config.php';
?>
<body>
<header>
<div class="navigation" id="headNav">
<a href="/index.php">
<img src="/src/images/logo bibble's header.webp" alt="logo Bibbe'S" width="30" height="30">
</a>
<nav class="nav" id="nav">
<ul>
<!-- <li>
<a href="#" class="connected" id="connected">Mon profil <span>→</span></a>
</li> -->
<li>
<a href="/index.php#articles">Articles <span>→</span></a>
</li>
<li>
<a href="#">Témoignages <span>→</span></a>
</li>
<li class="no-border">
<?php
if (isset($_SESSION['numStat'])) {
$session = $_SESSION['numStat']; // STATUT DANS $SESSION
} else {
$session = 4;
}
// SI STAT = ADMIN
if ($session == 1) {
echo '<a href="/views/backend/dashboard.php" id="dashboard"><button class="inscription" id="dashboard" type="submit">Dashboard <span>→</span></button> </a>';
}
// SI STAT = MOD OU MEMBRE
if ($session == 2 || $session == 3) {
echo '<a href="/views/frontend/profil.php" id="profil"><button class="inscription" id="profil" type="submit">Mon Profil <span>→</span></button></a>';
}
// SI PAS DE STAT
if ($session != 1 && $session != 2 && $session != 3) {
echo '<a href="/views/frontend/inscription.php" id="register"><button class="inscription" type="submit">S\'inscrire<span>→</span></button></a>';
}
?>
</li>
<?php
if (isset($_SESSION['numStat'])) {
$session = $_SESSION['numStat']; // STATUT DANS $SESSION
}
// SI STAT = ADMIN
if ($session == 1) {
echo '<li><a href="/views/frontend/profil.php"><button class="connect" type="submit">Mon profil <span>→</span></button></a></li>';
}
// SI PAS DE STAT
if ($session != 1 && $session != 2 && $session != 3) {
echo '<li><a href="/views/frontend/connexion.php"><button class="connect" id="connect" type="submit">Se connecter<span>→</span></button></a></li>';
}
?>
</ul>
</nav>
<div class="search" id="search">
<p>Rechercher...</p>
<img src="/src/images/loupe header.svg" alt="loupe icon">
</div>
<span class="burger" id="burgerMenu">☰</span>
</div>
<h1>BORD'ANIMAUX</h1>
<h2>par l'équipe Bibble's</h2>
</header>
<?php
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
$uri = $_SERVER['REQUEST_URI'];
$page = explode("/", $uri);
$fileName = end($page);
$fileNameExplode = explode(".",$fileName);
$ariane = $fileNameExplode[0];
if ($ariane === "index") {
echo "<div class='ariane'> <a href='/index.php'> Accueil </a> <p> > <p> </div>";
} else if ($ariane === "") {
echo "<div class='ariane'> <a href='/index.php'> Accueil </a> <p> > <p> </div>";
} else {
echo "<div class='ariane'> <a href='/index.php'> Accueil </a> <p> > <p> <a href='$uri'> $ariane <a> </div>";
};
?>
<script src="/src/JS/header.js"></script>
</body>
</html>