-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgotStudent.html
182 lines (133 loc) · 6 KB
/
forgotStudent.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forgot Student</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="adminPage.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
</head>
<body class="d-flex flex-column min-vh-100">
<header>
<nav class="navbar navbar-expand-lg bg-body-tertiary ">
<div class="container-fluid">
<img src="Photos/Logo.png" alt="Bootstrap" width="90" height="40">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse " id="navbarSupportedContent">
<div class="navbar-nav ms-auto mb-2 mb-lg-0 n">
<div class="nav-item ">
<a class="nav-link " aria-current="page" href="index.html">Home</a>
</div>
<div class="nav-item">
<a class="nav-link " href="about.html">About</a>
</div>
<div class="nav-item">
<a class="nav-link " href="doctor.html">Doctors</a>
</div>
<div class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</div>
<div class="nav-item">
<a class="nav-link" href="http://127.0.0.1:5000">
<button type="button" class="btn btn-dark"><span class="bi bi-chat-quote-fill"></span></button>
</a>
</div>
</div>
</div>
</div>
</nav>
</header>
<!-------------------------------form----------------------------------------------->
<section class="vh-100" >
<div class="container py-3 h-100">
<div class="row d-flex justify-content-center align-items-center h-80">
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
<div class="card shadow-2-strong" style="border-radius: 1rem;">
<div class="card-body p-3 text-center">
<a href="user.html">
<button type="button" class="btn-close float-end" aria-label="Close"></button>
</a>
<h1 class="font-weight-bold py-2">Reset your password</h1>
<div class="form-outline mb-4">
<p>please enter your e-mail address. </p>
</div>
<div class="form-outline mb-3">
<input type="text" id="email" name="email" placeholder="E-mail" class="form-control my-3 p-3">
</div>
<div class="form-check d-flex justify-content-start mb-3">
<button class="btn1" type="button" id="btn1-ResetPassword">Reset Password</button>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script type="module">
//------------------------------------getData-----------------------------------//
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.17.1/firebase-app.js";
import {getDatabase} from "https://www.gstatic.com/firebasejs/9.17.1/firebase-database.js";
import { getAuth, sendPasswordResetEmail } from "https://www.gstatic.com/firebasejs/9.17.1/firebase-auth.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyD6022n259Mf4FCqynEVJxCzzIDr2c9HHg",
authDomain: "se-mini-project-fcee4.firebaseapp.com",
databaseURL: "https://se-mini-project-fcee4-default-rtdb.firebaseio.com",
projectId: "se-mini-project-fcee4",
storageBucket: "se-mini-project-fcee4.appspot.com",
messagingSenderId: "574489212826",
appId: "1:574489212826:web:c1a7cbda00ed8c6fd72c23"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db =getDatabase();
const auth = getAuth();
//variables
var submitBtn=document.querySelector("#btn1-ResetPassword");
function setPassword()
{
var email=document.getElementById('email').value;
sendPasswordResetEmail(auth, email)
.then(() => {
alert("Password reset email send successfully!");
window.location.replace("user.html")
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
alert("You entere'd Emain is incorrect.")
});
}
submitBtn.addEventListener('click',setPassword);
</script>
<!----------------------end of form------------------------------------------------->
<footer class="bg-dark text-center text-white mt-auto ">
<hr class="m-0" />
<div class="text-center py-2 align-items-center" style="background-color: rgba(0, 0, 0, 0.2);">
<div class="name">
<p>University of Sri Jayewardenepura<br>
Gangodawila, Nugegoda, Sri Lanka.</p>
</div>
<div class="name">
<p>+94 11 2758000, +94 11 2802022<br>
+94 11 2801024, +94 11 2801025</p>
</div>
</a>
</div>
<!-- Copyright -->
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);">
© 2023 Copyright:
<p><a href="https://www.sjp.ac.lk/" target="blank">[email protected]</a></p>
</div>
<!-- Copyright -->
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>