-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.php
87 lines (87 loc) · 4.55 KB
/
navbar.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
<nav class="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm">
<div class="collapse navbar-collapse col-md-5 mx-auto" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<?php if ($_SERVER["REQUEST_URI"] != './home.php') { ?>
<li class="nav-item">
<a class="nav-link" href="home.php">Accueil</a>
</li>
<?php } ?>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="global" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Mon camion
</a>
<div class="dropdown-menu" aria-labelledby="global">
<a class="dropdown-item" href="truckInfo.php">Information</a>
<a class="dropdown-item" href="truckMaintenance.php">Carnet d'entretien</a>
<a class="dropdown-item" href="products.php">Mes produits</a>
<a class="dropdown-item" href="menus.php">Mes menus</a>
<a class="dropdown-item" href="categories.php">Les catégories</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="warehouses" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Mon stock
</a>
<div class="dropdown-menu" aria-labelledby="warehouses">
<a class="dropdown-item" href="ingredientTruck.php">Voir mon stock</a>
<a class="dropdown-item" href="history.php">Historique</a>
<a class="dropdown-item" href="chooseWarehouse.php">Commandes</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="events" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Mes événements
</a>
<div class="dropdown-menu" aria-labelledby="benefits">
<a class="dropdown-item" href="createEvents.php">Créer un nouvel évènement</a>
<a class="dropdown-item" href="viewEvents.php">Voir les évènements</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link " href="viewMessages.php">
Demandes de contact
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cart.php" id="benefits" role="button"
aria-haspopup="true" aria-expanded="false">
<span class="badge badge-pill badge-dark" id="cartQty">
<i class="fas fa-shopping-cart"></i>
<?php
$cart = lastCart($_SESSION["email"]);
$pdo = connectDB();
$queryPrepared = $pdo->prepare("SELECT SUM(quantity) AS count FROM CARTINGREDIENT, CART, USER WHERE idUser = user AND cart = idCart AND emailAddress = :user AND idCart = :cart");
$queryPrepared->execute([
":user" => $_SESSION["email"],
":cart" => $cart
]);
$result = $queryPrepared->fetch(PDO::FETCH_ASSOC);
$count = $result["count"];
if (!empty($count)) {
echo " " . $count;
} else {
echo " 0";
}
?>
</span>
</a>
</li>
</ul>
</div>
<div class="float-right">
<div class="form-inline my-2 my-lg-0 dropdown">
<a class="btn btn-dark my-2 my-sm-0" href="#" id="warehouses" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="far fa-user-circle"></i> Gérer mon compte
</a>
<div class="dropdown-menu dropdown-menu-lg-left" aria-labelledby="warehouses">
<a class="dropdown-item" href="myProfile.php">Mon profil</a>
<a class="dropdown-item" href="myPassword.php">Mot de passe</a>
<a class="dropdown-item" href="functions/logout.php"><i class="fas fa-sign-out-alt"></i> Déconnexion</a>
</div>
</div>
</div>
</nav>