-
Notifications
You must be signed in to change notification settings - Fork 13
/
menu.php
85 lines (82 loc) · 4.66 KB
/
menu.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
<!-- Navbar -->
<nav class="navbar navbar-expand navbar-dark">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item d-none d-sm-inline-block">
<a href="index.php" class="nav-link">Home</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="#" class="nav-link">Contact</a>
</li>
</ul>
<!-- SEARCH FORM -->
<form class="form-inline ml-3" action="index.php">
<div class="input-group input-group-sm">
<input class="form-control form-control-navbar bg-gray" type="search" placeholder="Search" aria-label="Search" name="nombre" value="<?php echo $_REQUEST['nombre'] ?? ''; ?>">
<input type="hidden" name="modulo" value="productos">
<div class="input-group-append">
<button class="btn btn-navbar" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Messages Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#" id="iconoCarrito">
<i class="fa fa-cart-plus" aria-hidden="true"></i>
<span class="badge badge-danger navbar-badge" id="badgeProducto"></span>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right" id="listaCarrito">
</div>
</li>
<!-- Notifications Dropdown Menu -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fa fa-user" aria-hidden="true"></i>
</a>
<div class="dropdown-menu dropdown-menu-md dropdown-menu-right">
<?php
if (isset($_SESSION['idCliente']) == false) {
?>
<a href="login.php" class="dropdown-item">
<i class="fas fa-door-open mr-2 text-primary"></i>Loguearse
</a>
<div class="dropdown-divider"></div>
<a href="registro.php" class="dropdown-item">
<i class="fas fa-sign-in-alt mr-2 text-primary"></i>Registrarse
</a>
<?php
} else {
?>
<a href="index.php?modulo=usuario" class="dropdown-item">
<i class="fas fa-user text-primary mr-2"></i>Hola <?php echo $_SESSION['nombreCliente']; ?>
</a>
<form action="index.php" method="post">
<button name="accion" class="btn btn-danger dropdown-item" type="submit" value="cerrar">
<i class="fas fa-door-closed text-danger mr-2"></i>Cerrar sesion
</button>
</form>
<?php
}
?>
</div>
</li>
</ul>
</nav>
<?php
$mensaje = $_REQUEST['mensaje'] ?? '';
if ($mensaje) {
?>
<div class="alert alert-primary alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<?php echo $mensaje; ?>
</div>
<?php
}
?>