-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprofile.html
More file actions
204 lines (189 loc) · 9.9 KB
/
profile.html
File metadata and controls
204 lines (189 loc) · 9.9 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>E-LEARNING : User Profile</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="img/icon.png" rel="icon">
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600&family=Nunito:wght@600;700;800&display=swap" rel="stylesheet">
<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Customized Bootstrap Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<!-- Spinner Start -->
<div id="spinner" class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
<div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<!-- Spinner End -->
<!-- Navbar Start -->
<nav class="navbar navbar-expand-lg bg-white navbar-light shadow sticky-top p-0">
<a href="index.html" class="navbar-brand d-flex align-items-center px-4 px-lg-5">
<p class="m-0 fw-bold" style="font-size: 25px;">
<img src="img/icon.png" alt="" height="50px"> E-<span style="color: #fb873f;">LEARNING</span>
</p>
</a>
<button type="button" class="navbar-toggler me-4" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" style="border: none;">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<div class="navbar-nav ms-auto p-4 p-lg-0">
<a href="index1.html" class="nav-item nav-link">Home</a>
<a href="about.html" class="nav-item nav-link">About</a>
<a href="courses.html" class="nav-item nav-link">Courses</a>
<a href="contact.html" class="nav-item nav-link">Contact</a>
<a id="login-link" href="login.html" class="nav-item nav-link"><i class="fa fa-user"></i></a>
<a href="profile.html" class="nav-item nav-link">My Profile</a>
</div>
</div>
</nav>
<!-- Navbar End -->
<!-- Header Section -->
<div class="container-fluid bg-primary py-5 mb-5 page-header">
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 text-center">
<h1 class="display-3 text-white animated slideInDown">User Profile</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-center">
<li class="breadcrumb-item"><a class="text-white" href="courses.html">Courses</a></li>
<li class="breadcrumb-item text-white active" aria-current="page">Profile</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<!-- Profile Section -->
<div class="container-xxl py-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="text-center wow fadeInUp" data-wow-delay="0.1s">
<h1 class="mb-5" style="color: #fb873f;">Welcome to Your Profile</h1>
</div>
<div id="userProfile" class="shadow p-5 bg-light rounded"></div>
</div>
</div>
</div>
</div>
<!-- Footer Start -->
<div class="container-fluid bg-dark text-light footer pt-5 mt-5 wow fadeIn" data-wow-delay="0.1s">
<div class="container py-5">
<div class="row g-5">
<div class="col-lg-4 col-md-6">
<h4 class="text-white mb-3">Quick Link</h4>
<p><a class="text-light" href="about.html">About Us</a></p>
<p><a class="text-light" href="contact.html">Contact Us</a></p>
<p><a class="text-light" href="">Privacy Policy</a></p>
<p><a class="text-light" href="">Terms & Condition</a></p>
<p><a class="text-light" href="">FAQs & Help</a></p>
</div>
<div class="col-lg-4 col-md-6">
<h4 class="text-white mb-3">Contact</h4>
<p class="mb-2"><i class="fa fa-map-marker-alt me-3"></i>Mandya, Karnataka (571415)</p>
<p class="mb-2"><i class="fa fa-phone-alt me-3"></i>+91 9380702453</p>
<p class="mb-2"><i class="fa fa-envelope me-3"></i>learning@gmail.com</p>
<div class="d-flex pt-2">
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-twitter"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-facebook-f"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-youtube"></i></a>
<a class="btn btn-outline-light btn-social" href=""><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="col-lg-4 col-md-6">
<h4 class="text-white mb-3">Stay Updated: Subscribe to Our Newsletter</h4>
<p>Join our growing community of learners today by subscribing now and embracing lifelong education! </p>
<div class="position-relative mx-auto" style="max-width: 400px;">
<form action="#">
<input class="form-control border-0 w-100 py-3 ps-4 pe-5" type="email" placeholder="Your email" required>
<button type="submit" class="btn btn-primary py-2 position-absolute top-0 end-0 mt-2 me-2">
<a href="mailto:learning@gmail.com">Subscribe</a>
</button>
</form>
</div>
</div>
</div>
</div>
<div class="container">
<div class="copyright">
<div class="row">
<div class="col-md-6 text-center text-md-start mb-3 mb-md-0">
© <a class="border-bottom" href="index.html">E-LEARNING</a>, All Right Reserved.
</div>
</div>
</div>
</div>
</div>
<!-- Footer End -->
<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="js/main.js"></script>
<script>
console.log("Profile page loaded");
// Show user profile from localStorage
const user = JSON.parse(localStorage.getItem('loggedInUser'));
const profileContainer = document.getElementById('userProfile');
console.log("Retrieved user from localStorage:", user);
if (user && user.username && user.email) {
profileContainer.innerHTML = `
<div class="text-center mb-4">
<i class="fa fa-user-circle fa-5x text-primary mb-3"></i>
<h3 class="text-primary">${user.username}</h3>
</div>
<div class="row">
<div class="col-12 mb-3">
<strong>Username:</strong> ${user.username}
</div>
<div class="col-12 mb-3">
<strong>Email:</strong> ${user.email}
</div>
<div class="col-12 mb-3">
<strong>Member Since:</strong> ${new Date(user.createdAt).toLocaleDateString()}
</div>
</div>
<div class="text-center mt-4">
<a class="btn btn-primary py-2 px-4 me-3" href="index.html">Go Home</a>
<a class="btn btn-outline-danger py-2 px-4" href="#" id="profileLogoutBtn">Logout</a>
</div>
`;
// Add logout functionality for profile page
const profileLogoutBtn = document.getElementById('profileLogoutBtn');
if (profileLogoutBtn) {
profileLogoutBtn.addEventListener('click', function(e) {
e.preventDefault();
console.log("Logout clicked from profile page");
localStorage.removeItem('loggedInUser');
localStorage.removeItem('isLoggedIn');
alert('You have been logged out.');
window.location.href = 'index.html';
});
}
} else {
console.log("No user found, redirecting to login");
alert('Please log in to access your profile.');
window.location.href = "login.html";
}
</script>
<script src="js/auth.js"></script>
</body>
</html>