-
Notifications
You must be signed in to change notification settings - Fork 0
/
TopBar2.php
91 lines (83 loc) · 3.61 KB
/
TopBar2.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
<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="topbar.css">
<body>
<?php
if(!isset($_COOKIE['userid'])){
//header('location:../index1.html');
}
else{
$id = $_COOKIE['userid'];
$utype = $_COOKIE['usertype'];
include('connect.php');
$query = "Select * from $utype where id=$id";
$cmd = mysqli_query($con,$query);
$row = mysqli_fetch_array($cmd);
}
?>
<div id="topsection">
<div class="topbar">
<div id="left">
<img class="logotop" src="Logo.png" alt="Logo">
<span class="webnametop"><b>CollabHub</b></span>
</div>
<div id="navcontain">
<div class="nav lnav">Events</div>
<div class="nav midnav ">Collabs</div>
<div class="nav rnav">Issues</div>
</div>
<?php
if(!$id){
?>
<div id="rightauth">
<div id="signinopt" onclick="document.location.href = 'SignIn.php'">Sign In</div>
<div id="signupopt" onclick="document.location.href = 'SignUp.html'">Sign Up</div>
</div>
<?php
}
else {
?>
<div id="right">
<?php
if($row['pic'] != NULL){
$flag = 1;
?>
<img class="pfp" src="display_img.php?userid=<?php echo $_COOKIE['userid'];?>&usertype=students" alt="pfp">
<?php
}
else {
$flag = 0;
?>
<img class="pfp" src="blank-pfp.png" alt="pfp">
<?php }?>
<span class="username"><?php echo $_COOKIE['username'];?></span>
<i class="bi-caret-down-fill pfparrow"></i>
</div>
<?php
} ?>
</div>
<div id="menu">
<div class="menuopt"><i class="bi-person micon"></i><div class="opttxt">My Profile</div></div>
<div class="menuopt"><i class="bi-calendar-check micon"></i><div class="opttxt">My Events</div></div>
<div class="menuopt"><i class="bi-people micon"></i><div class="opttxt">My Collabs</div></div>
<div class="menuopt"><i class="bi-person-add micon"></i><div class="opttxt">My Team</div></div>
<div class="menuopt"><i class="bi-plus-circle micon"></i><div class="opttxt">Organize</div></div>
<div class="menuopt lastopt" onclick="document.location.href = 'SignOut.php'"><i class="bi-box-arrow-right micon"></i><div class="opttxt">Sign Out</div></div>
</div>
</div>
</body>
<script>
let profile = document.getElementById("right");
console.log("hello");
let profile2 = document.querySelector("#menu");
let another = document.getElementById("menu");
profile.addEventListener("click", function() {
console.log("open");
profile2.classList.toggle("open");
});
// document.addEventListener("click", function() {
// console.log("close");
// profile2.classList.remove("open");
// });
</script>
</html>