-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
273 lines (250 loc) · 9.35 KB
/
login.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Sustainability-Development-Project</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Fontawesome CSS -->
<link href="css/all.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
<!-- Navigation -->
<nav id="left">
<div class="container">
<a class="navbar-brand" href="index.html">
<img src="images/logo.png" alt="logo" />
<img src="images/img_5.png" alt="">
<!-- <a class="nav-link nav-color" href="#">Sustainability Diversity Project</a> Need to be change -->
</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="fas fa-bars"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link " href="services.html">Our services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="blog-post.html">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="login.html">Log in</a>
</li>
<li class="nav-item">
<a class="nav-link" href="singup.html">Sign Up</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- full Title -->
<div class="full-title" style="background-image: url('images/all-title-bg.png')">
<div class="container">
<!-- Page Heading/Breadcrumbs -->
<h1 class="mt-4 mb-3">LOG IN
</h1>
</div>
</div>
<!-- Page Content -->
<section class="vh-100" style="background-color: #146657;">
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<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-5 text-center">
<h3 class="mb-5">Sign in</h3>
<div class="form-outline mb-4">
<input type="email" id="email" class="form-control form-control-lg" />
<label class="form-label" for="typeEmailX-2">Email</label>
</div>
<div class="form-outline mb-4">
<input type="password" id="password" class="form-control form-control-lg" />
<label class="form-label" for="typePasswordX-2">Password</label>
</div>
<!-- Checkbox -->
<div class="form-check d-flex justify-content-start mb-4">
<input class="form-check-input" type="checkbox" value="" id="form1Example3" />
<label class="form-check-label" for="form1Example3"> Remember password </label>
</div>
<!--
<button class="btn btn-primary btn-lg btn-block" type="submit" id="submitData">Login</button>
<hr class="my-4">
<button class="btn btn-lg btn-block btn-primary" style="background-color: #dd4b39;"
type="submit"><i class="fab fa-google me-2"></i> Sign in with google</button>
<button class="btn btn-lg btn-block btn-primary mb-2" style="background-color: #3b5998;"
type="submit"><i class="fab fa-facebook-f me-2"></i>Sign in with facebook</button>
-->
</div>
</div>
</div>
</div>
</div>
</section>
<!-- /.container -->
<!--footer starts from here-->
<footer class="footer">
<div class="container bottom_border">
<div class="row">
<div class="col-lg-3 col-md-6 col-sm-6 col">
<h5 class="headin5_amrc col_white_amrc pt2">Find us</h5>
<!--headin5_amrc-->
<p class="mb10">
Don't hesitate to contact us if you have any question or inquiries. We would be happy to
answer your question and set up a meeting with you.
</p>
<p><i class="fa fa-location-arrow"></i></p>
<p><i class="fa fa-phone"></i> 0000000000 </p>
<p><i class="fa fa fa-envelope"></i> [email protected] </p>
</div>
<div class="col-lg-3 col-md-6 col-sm-6 col">
<h5 class="headin5_amrc col_white_amrc pt2">Follow us</h5>
<!--headin5_amrc ends here-->
<ul class="footer_ul2_amrc">
<li>
<a href="#"><i class="fab fa-twitter fleft padding-right"></i> </a>
<p class="xlower">Find us on our Twitter page</p>
</li>
<li>
<a href="#"><i class="fab fa-facebook-f fleft padding-right xmargin"></i> </a>
<p class="xlower">Find us on our Facebook page</p>
</li>
<li>
<a href="#"><i class="fab fa-instagram fleft padding-right"></i> </a>
<p class="xlower">Find us on our Instagram page</p>
</li>
</ul>
<!--footer_ul2_amrc ends here-->
</div>
<div class="col-lg-3 col-md-6 col-sm-6">
<h5 class="headin5_amrc col_white_amrc pt2">Quick links</h5>
<!--headin5_amrc-->
<ul class="footer_ul_amrc">
<li><a href="#">Our Team </a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Get In Touch</a></li>
</ul>
<!--footer_ul_amrc ends here-->
</div>
<div class="col-lg-3 col-md-6 col-sm-6 ">
<h5 class="headin5_amrc col_white_amrc pt2">Recent posts</h5>
<!--headin5_amrc-->
<!--footer_ul_amrc ends here-->
</div>
</div>
</div>
<div class="container">
<div class="footer-logo">
<a href="#"><img src="images/LOGO.png" alt="" /></a>
</div>
<!--foote_bottom_ul_amrc ends here-->
<p class="copyright text-center">All Rights Reserved. © 2022 <a href="#"></a> Design By :
<a href="https://www.linkedin.com/in/loic-mavah-tseket-271543157/"></a>
</p>
<ul class="social_footer_ul">
<li><a href="#"><i class="fab fa-facebook-f"></i></a></li>
<li><a href="#"><i class="fab fa-twitter"></i></a></li>
<li><a href="#"><i class="fab fa-linkedin"></i></a></li>
<li><a href="#"><i class="fab fa-instagram"></i></a></li>
</ul>
<!--social_footer_ul ends here-->
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<form method="post" action="connect.php">
Username : <input type="text" name="username"><br><br>
Password : <input type="password" name="password"><br><br>
<input type="submit" value="Submit">
</form>
<!-- Back end Firebase Script-->
<script type="module">
// Import the functions you need from the SDKs you need
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-app.js";
import { getAuth, createUserWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/9.14.0/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: "AIzaSyDhURhjs8EnU9yD_ebJMhAP_Y4WgYhY-AU",
authDomain: "sdp-website-6b4ae.firebaseapp.com",
projectId: "sdp-website-6b4ae",
storageBucket: "sdp-website-6b4ae.appspot.com",
messagingSenderId: "1024170213513",
appId: "1:1024170213513:web:bbb82fa671078b211e8658"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
//The event to submit data
// submitData.addEventListener('click', (e) => {
var email = document.getElementById('email').value
var password = document.getElementById('pasword').value
createUserWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...redirect them to another page
alert("You sucsessfuly register");
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
// ..
alert("error");
});
submitData.addEventListener('click', (e) => {
e.preventDefault()
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
// log in user
signInWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
// Signed in
const user = userCredential.user;
// ...
// save log in details into real time database
var lgDate = new Date();
update(ref(database, 'users/' + user.uid), {
last_login: lgDate,
})
.then(() => {
// Data saved successfully!
alert('user logged in successfully');
})
.catch((error) => {
// The write failed...
alert(error);
});
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
alert(errorMessage);
});
//sign out user
signOut(auth).then(() => {
// Sign-out successful.
}).catch((error) => {
// An error happened.
});
});
</script>
</body>
</html>