-
Notifications
You must be signed in to change notification settings - Fork 2
/
header4profile.php
166 lines (133 loc) · 6.91 KB
/
header4profile.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/**
* Header Navbar only for the profile page that uses the header4profile.css where the header is not sticky and occupies only width equal to the profile div content.
*
* @version PHP 8.0.12
* @since June 2022
* @author AtharvaShah
*/
include_once("connection.php");
if(empty($_SESSION))
{
header("Location: login.php");
}
if(isset($_SESSION['user_id']))
{
$id = $_SESSION['user_id'];
$query = "select `profile_pic` from users where user_id = '$id'";
$result = mysqli_query($con,$query);
if($result && mysqli_num_rows($result) > 0){
$pic = mysqli_fetch_array($result);
$pfp= $pic[0];
}
}
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<!-- custom css link -->
<link href="CSS/header4profile.css" rel="stylesheet" crossorigin="anonymous">
<style type="text/css">
/* ============ desktop view ============ */
@media all and (min-width: 992px) {
.navbar .nav-item .dropdown-menu {
display: none !important;
}
.navbar .nav-item:hover .dropdown-menu {
display: block !important;
}
.navbar .nav-item .dropdown-menu {
margin-top: 0 !important;
}
}
/* ============ desktop view .end// ============ */
</style>
</head>
<!-- <div class="container"> -->
<!-- ============= COMPONENT ============== -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="welcome.php"><img src="images/website/logo.png" height="50" width="50"/></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main_nav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="main_nav">
<ul class="navbar-nav" id="centerHeader">
<!-- Browse Media Dropdown-->
<li class="nav-item dropdown">
<li class="nav-link" href="#" data-bs-toggle="dropdown">Browse</li>
<ul class="dropdown-menu dropdown-menu-right" id="browse">
<li><a class="dropdown-item" href="MediaAPIs/Book/index.php">
<span>📕 Book</span>
</a></li>
<li><a class="dropdown-item" href="MediaAPIs/Movie/index.php">
<span>📽 Movie</span>
</a></li>
<li><a class="dropdown-item" href="MediaAPIs/Music/index.php">
<span>🎧 Music</span>
</a></li>
<li><a class="dropdown-item" href="MediaAPIs/TV/index.php">
<span>📺 TV</span>
</a></li>
<li><a class="dropdown-item" href="MediaAPIs/Videogame/index.php">
<span>🎮 Videogame</span>
</a></li>
</ul>
</li>
<!-- DIARY, FEED AND SEARHC USERS -->
<li class="nav-item"><a class="nav-link" href="diary.php">Diary</a></li>
<li class="nav-item"><a class="nav-link" href="feed.php">Feed</a></li>
<li class="nav-item"><a class="nav-link" href="search_users.php">Search Users</a></li>
<!-- Your Media Dropdown -->
<li class="nav-item dropdown">
<li class="nav-link" href="#" data-bs-toggle="dropdown">Media</li>
<ul class="dropdown-menu dropdown-menu-end" id="media">
<li><a class="dropdown-item" href="media_book.php">
<span>📕 Book</span>
</a></li>
<li><a class="dropdown-item" href="media_movie.php">
<span>📽 Movie</span>
</a></li>
<li><a class="dropdown-item" href="media_music.php">
<span>🎧 Music</span>
</a></li>
<li><a class="dropdown-item" href="media_tv.php">
<span>📺 TV</span>
</a></li>
<li><a class="dropdown-item" href="media_videogame.php">
<span>🎮 Videogame</span>
</a></li>
</ul>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<!-- Your Account Dropdown -->
<li class="nav-item dropdown">
<li class="nav-link" href="#" data-bs-toggle="dropdown"> <img src="<?php echo $pfp;?>" id="myProfilePic"> </li>
<ul class="dropdown-menu dropdown-menu-end" id="your-account">
<li><a class="dropdown-item" href="profile.php">
<span><img src="images/Icons/profile.png" class='header-icon'>Profile</span>
</a></li>
<li><a class="dropdown-item" href="edit_profile.php">
<span><img src="images/Icons/settings.png" class='header-icon'>Settings</span>
</a></li>
<li><a class="dropdown-item" href="Exports/import_export.php">
<span><img src="images/Icons/importexport.png" class='header-icon'>Import/Export</span>
</a></li>
<li><a class="dropdown-item" href="logout.php">
<span><img src="images/Icons/logout.png" class='header-icon'>Logout</span>
</a></li>
</ul>
<li><a href="notifications.php"><img src="images/Icons/notification.png" id="notif-bellcon" alt="notifications"></a></li>
</li>
</ul>
</div>
<!-- navbar-collapse.// -->
</div>
<!-- container-fluid.// -->
</nav>
<!-- ============= COMPONENT END// ============== -->