-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
153 lines (146 loc) · 7.53 KB
/
header.php
File metadata and controls
153 lines (146 loc) · 7.53 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Sound Meteor | <?= $pagetitle ?></title>
<link rel="icon" href="./media/meteor.svg">
<link rel="stylesheet" href="./style/fontawesome/all.min.css">
<link rel="stylesheet" href="./style/style.css">
<link rel="stylesheet" href="./style/simplebar/simplebar.css">
<script src="script/api.js"></script>
</head>
<body>
<header>
<nav>
<div class="logo" style="margin-right: 3rem"><a href="./"><img src="./media/SoundMeteor.svg" alt="Logo"></a></div>
<ul class="mobile-hide">
<?php
if (isset($_SESSION['USER'])) :
?>
<li><a href="meteor.php" <?php if ($pagetitle == "Meteor") {
echo "class=\"current-page\"";
} ?>>Meteor</a></li>
<li><a href="comets.php" <?php if ($pagetitle == "Comets") {
echo "class=\"current-page\"";
} ?>>Comets</a></li>
<li><a href="pref.php" <?php if ($pagetitle == "Preferences") {
echo "class=\"current-page\"";
} ?>>Preferences</a></li>
<?php endif; ?>
<li><a href="about.php" <?php if ($pagetitle == "About") {
echo "class=\"current-page\"";
} ?>>About</a></li>
</ul>
</nav>
<div class="login">
<?php
if (!isset($_SESSION['USER'])) {
if ($pagetitle != "Login") {
echo "
<div class=\"button\">
<a href=\"login.php\"><span>Login</span></a>
</div>";
}
} else {
echo "
<div class=\"profile-name mobile-hide\">
" . htmlspecialchars($_SESSION['USER']) . "
</div>
<div class=\"profile-img\" onclick=toggleUserOpen()>
<img src=\"./media/logo.jpg\">
</div>
<form action=\"logout.php\" method=\"post\" class=\"mobile-hide\">
<button type=\"submit\"><i class=\"fa-solid fa-right-from-bracket\"></i></button>
</form>
<div class=\"hamburger-menu mobile-show\" onclick=toggleMenuOpen()>
<div class=\"menu-toggle-icon menu-toggle-closed\" id=\"menu-icon\">
<div class=\"bar\"></div>
<div class=\"bar\"></div>
<div class=\"bar\"></div>
</div>
</div>
";
}
?>
</div>
<div class="nav-overlay">
<nav class="nav-overlay-container">
<div class="logo"><a href="/"><img src="./media/SoundMeteor.svg" alt="Logo"></a></div>
<ul>
<li><a href="meteor.php" <?php if ($pagetitle == "Meteor") {
echo "class=\"current-page\"";
} ?>>Meteor</a></li>
<li><a href="comets.php" <?php if ($pagetitle == "Comets") {
echo "class=\"current-page\"";
} ?>>Comets</a></li>
<li><a href="pref.php" <?php if ($pagetitle == "Preferences") {
echo "class=\"current-page\"";
} ?>>Preferences</a></li>
<li><a href="about.php" <?php if ($pagetitle == "About") {
echo "class=\"current-page\"";
} ?>>About</a></li>
</ul>
</nav>
</div>
<?php if($pagetitle != "Login" && isset($_SESSION['USER'])){ ?>
<div class="usr-backdrop" onclick="toggleUserOpen(); cleanupUserEdit();"></div>
<div class="usr-overlay">
<div class="usr-overlay-container">
<div class="usr-overlay-close" onclick="toggleUserOpen(); cleanupUserEdit();">
<i class="fa-regular fa-circle-xmark"></i>
</div>
<span class="usr-title">User Settings</span>
<div class="usr-details">
<img src="./media/logo.jpg">
<span><?= htmlspecialchars($_SESSION['USER']) ?></span>
</div>
<form class="edit-form" method="get" id="edit-form" autocomplete="off">
<label class="edit-form-label">Username</label>
<div class="edit-field" id="usr-edit">
<div class="edit-content">
<span id="usr-name-edit"><?= htmlspecialchars($_SESSION['USER']) ?></span>
<input id="usr-name-input"type="text" class="edit-box hiddenform" value="<?= htmlspecialchars($_SESSION['USER']) ?>">
</div>
<div class="edit-buttons">
<div id="edit-btn" class="button" onClick="toggleEdit('usr-edit', true)"><span>Edit</span></div>
<div id="ok-btn" class="button hiddenform" onClick="toggleEdit('usr-edit', false)"><span>OK</span></div>
</div>
</div>
<label class="edit-form-label">Email</label>
<div class="edit-field" id="email-edit">
<div class="edit-content">
<span id="usr-mail-edit"><?= htmlspecialchars($_SESSION['EMAIL']) ?></span>
<input id="usr-mail-input" type="email" class="edit-box hiddenform" value="<?= htmlspecialchars($_SESSION['EMAIL']) ?>">
</div>
<div class="edit-buttons">
<div id="edit-btn" class="button" onClick="toggleEdit('email-edit', true)"><span>Edit</span></div>
<div id="ok-btn" class="button hiddenform" onClick="toggleEdit('email-edit', false)"><span>OK</span></div>
</div>
</div>
<label class="edit-form-label">Password</label>
<div class="edit-field" id="pwd-edit">
<div class="edit-content">
<span>********</span>
</div>
<div class="edit-buttons">
<a href="./change.php"><div id="edit-btn" class="button"><span>Edit</span></div></a>
</div>
</div>
<div class="edit-button hiddenform">
<div class="button" onclick=checkUserEdit();>
<span>save</span>
</div>
</div>
</form>
</div>
</div>
<?php } ?>
</header>
<?php
if ($pagetitle == "Login" || $pagetitle == "Forgot Password" || $pagetitle == "Reset Password" || $pagetitle == "Change Password"){
echo "<main style=\"justify-content: center\">";
} else {
echo "<main> ";
}
?>