-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashboard.html
154 lines (144 loc) · 4.67 KB
/
dashboard.html
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
<!--Aaron Elcheson: 261047851-->
<!-- dashboard -> private dashboard for users who are logged in-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Aesbin User Dashboard</title>
<link rel="stylesheet" href="./animation.css" />
<link rel="stylesheet" href="./general_styles.css" />
<script>
// Ensure only logged-in users can access the dashboard
// Chenxuan Jin 261074669
document.addEventListener("DOMContentLoaded", () => {
fetch("check_session.php", { cache: "no-store" })
.then((response) => response.json())
.then((data) => {
if (!data.loggedIn) {
alert("You need to log in to access the dashboard.");
window.location.href = "login.php";
}
})
.catch((error) => console.error("Error checking session:", error));
});
</script>
</head>
<body>
<script src="common.js"></script>
<header class="navbar">
<div class="logo">
<img src="./logo.PNG" alt="Logo" />
</div>
<nav>
<ul class="nav-links">
<li><a href="./index.html">Home</a></li>
<li><a href="./about.html">About</a></li>
<li><a href="./recent_pastes_v2.html">Recent</a></li>
<li><a href="./login.php" id="login-button">Login</a></li>
<li><a href="./dashboard.html">Dashboard</a></li>
<li>
<a
href="./logout.php"
id="logout-button"
style="cursor: pointer; font-weight: bold"
>Logout</a
>
</li>
</ul>
</nav>
<div class="falling-letters">
<span class="letter">A</span>
<span class="letter">E</span>
<span class="letter">S</span>
<span class="letter">b</span>
<span class="letter">i</span>
<span class="letter">n</span>
</div>
</header>
<div class="picture-box">
<img
class="picture-box"
src="./nebula.jpg"
alt="Image of the Horsehead Nebula"
/>
</div>
<!--had a lot of trouble with these flex containers. I'm sorry I really tried. I know this is not working like the recent pastes page-->
<div class="dashboard-box">
<aside class="sidebar">
<p>User Name</p>
<p>Date Registered</p>
<p>Number of Posts</p>
<!-- Begin WeatherLink Fragment -->
<aside class="weather">
<iframe
title="Environment Canada Weather"
width="296"
height="191"
src="https://weather.gc.ca/wxlink/wxlink.html?coords=45.529%2C-73.562&lang=e"
allowtransparency="true"
style="border: 0"
></iframe>
</aside>
<!-- End WeatherLink Fragment -->
</aside>
<main class="main-content">
<div class="paste-search-area">
<div class="paste-search-buttons">
<button class="paste-button active">Recent</button>
<button class="paste-button">Popular</button>
<button class="paste-button">Oldest</button>
</div>
<div class="paste-search-bar">
<input type="text" placeholder="Paste search..." />
<button>Search</button>
</div>
</div>
<div class="table-container" style="padding: 1rem; margin: auto">
<table>
<thead>
<tr>
<th>Posted date</th>
<th>Id</th>
<th>Content</th>
<th>Visits</th>
</tr>
</thead>
<tbody>
<tr>
<td>2024-12-15</td>
<td>1</td>
<td>Sample Content</td>
<td>0</td>
</tr>
<tr>
<td>2024-12-13</td>
<td>2</td>
<td>Sample Content</td>
<td>1</td>
</tr>
<tr>
<td>2024-12-12</td>
<td>3</td>
<td>Sample Content</td>
<td>1</td>
</tr>
</tbody>
</table>
<div class="page-buttons" style="padding: 1.5rem">
<button id="prevPage" class="page-button" disabled>Previous</button>
<span id="pageNumber">Page 1</span>
<button id="nextPage" class="page-button">Next</button>
</div>
</div>
</main>
</div>
<footer
class="footer"
style="font-family: 'Courier New', Courier, monospace"
>
AESbin 2024
</footer>
<script src="recent_script.js"></script>
</body>
</html>