-
Notifications
You must be signed in to change notification settings - Fork 2
/
navbar.php
90 lines (82 loc) · 3.41 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
88
89
90
<?php
function current_url()
{
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$validURL = str_replace("&", "&", $url);
$legitURL = explode('/', $validURL);
$legitURL = explode('.', end($legitURL));
return $legitURL[0];
}
//echo "page URL is : ".current_url();
$offer_url = current_url();
?>
<div class="tempat">
<nav class="kepala">
<a href="" class="logo"><i class="fas fa-heart"></i><span>Farmanusa</span></a>
<div class="muka">
<div class="navbar">
<?php
if ($offer_url != 'index'){
echo'
<div>
<a href="index.php"><i class="fas fa-home"></i><span> Home </span></a>
</div>';
}
if($offer_url != 'obat'){
echo'
<div>
<a href="obat.php"><i class="fa-solid fa-pills"></i><span>Obat<span></a>
</div>';
}
if($offer_url != 'apoteker'){
echo'
<div>
<a href="apoteker.php"><i class="fas fa-user-md"></i><span>Apoteker</span></a>
</div>';
}
if($offer_url != 'keranjang'){
echo'
<div>
<a href="keranjang.php"><i class="fas fa-shopping-cart"></i><span>Keranjang</span></a>
</div>';
}
if($offer_url != 'riwayat'){
echo'
<div>
<a href="riwayat.php"><i class="fas fa-history"></i><span>Riwayat Pesanan</></a>
</div>';
}
?>
</div>
<?php
if(isset($_SESSION['user'])){
?>
<div class="user">
<a href="index.php"><i class="fas fa-user"></i><span><?php echo $_SESSION['user']; ?></span></a>
<a class="btn" href="logout.php">Logout</a>
</div>
<?php
}else{
?>
<div class="user">
<a onclick="loggingPop();
document.querySelector('.kepala').classList.toggle('active');
document.querySelector('#menu-btn').style.left = '50px';
document.querySelector('#menu-btn').classList.toggle('fa-times');">
<i class="fas fa-user"></i><span>Login</span></a>
</div>
<?php
}
?>
</div>
<div><i id="menu-btn" class="fas fa-bars"></i></div>
<div class="dark_mode">
<input type="checkbox" class="checkbox" id="toggle" />
<label class="label" for="toggle">
<!-- <i class="fas fa-moon"></i> -->
<!-- <i class="fas fa-sun"></i> -->
<div class="ball"></div>
</label>
</div>
</nav>
</div>