-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic_header.php
More file actions
69 lines (55 loc) · 1.11 KB
/
dynamic_header.php
File metadata and controls
69 lines (55 loc) · 1.11 KB
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
<?php
require_once __DIR__ . '/config/menu.php';
$current_page = basename($_SERVER['PHP_SELF']);
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<style>
.navbar {
display:flex;
justify-content:space-between;
align-items:center;
background:#1f2937;
padding:10px 20px;
}
.nav-left {
display:flex;
align-items:center;
gap:20px;
}
.nav-right {
display:flex;
align-items:center;
gap:15px;
}
.navbar a {
color:white;
text-decoration:none;
padding:8px 12px;
}
.navbar a.active {
background:#2563eb;
border-radius:5px;
}
.cards {
display:flex;
gap:20px;
margin-top:20px;
}
.card {
background:white;
padding:20px;
border-radius:8px;
box-shadow:0 2px 8px rgba(0,0,0,0.1);
}
</style>
<div class="navbar">
<?php foreach ($menu as $item): ?>
<?php
$is_active = ($current_page == basename($item['link'])) ? "active" : "";
?>
<a class="<?= $is_active ?>" href="<?= $item['link'] ?>">
<i class="<?= $item['icon'] ?>"></i>
<?= $item['title'] ?>
</a>
<?php endforeach; ?>
</div>