-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforget.html
142 lines (129 loc) · 4.09 KB
/
forget.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
<!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>Document</title>
<style>
body{
background:url('image/pc.jpg') no-repeat center/cover;
background-color: rgba(0, 0, 0, 0.425);
min-height:100vh;
font-size:4vmin ;
display: flex;
align-items: center;
justify-content: center;
}
.container {
min-width:50%;
min-height:30%;
background-color:rgba(255, 255, 255, 0.637);
padding: 30px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1em;
}
h2,h6{
color:tomato;
text-shadow: 0px 0px 10px rgb(180, 180, 180);
}
.inputInfo {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1em;
}
.input{
width: 100%;
display: flex;
gap: 2em;
}
label {
width: 40%;
text-align: left;
color: tomato;
}
input{
width: 40%;
height:30px;
padding: 2px 10px;
outline:none;
border:1px solid black;
}
input[type="text"] , input[type="email"]{
border-radius: 5px;
color:green;
}
</style>
</head>
<body>
<div class="container">
<h2>Mot de passe oublié ?</h2>
<form name="myForm" id="myForm">
<div class="inputInfo">
<div class="input">
<label for="identifiant">
Entrez votre identifiant
</label>
<input type="text" id="identifiant" name="identifiant">
</div>
<div class="input">
<label for="email">
Entrez votre email
</label>
<input type="email" id="email">
</div>
<div class="input">
<input type="submit" id="submit" value="verifier">
</div>
</div>
<p id="message"></p>
</form>
<h6>Si vos informations sont reconnues dans la base de donnée vous recevrez un message contenant votre code</h6>
</div>
</body>
<script>
const myForm = document.getElementById('myForm');
const id = document.getElementById('identifiant');
const email = document.getElementById('email');
const msg = document.getElementById('message');
let local = JSON.parse(localStorage.getItem("Admin"));
myForm.addEventListener('submit',function(e){
msg.style.display="block";
msg.style.color="white";
e.preventDefault();
if (id.value=="" && email.value=="") {
msg.style.color="red";
msg.innerHTML = "Aucune information saisie";
setTimeout(function() {
msg.innerHTML = "";
msg.style.display="none";
},2000)
}
else {
if (local) {
for(admin in local){
if (id.value!==local[admin].identifiant || email.value!==local[admin].email) {
msg.style.color="red";
msg.innerHTML = "Identifiant ou email incorrect";
setTimeout(function() {
msg.innerHTML = "";
msg.style.display="none";
},2000)
}
else{
alert("Votre mot de passe est : " + local[admin].motDePasse)
}
}
}
else{
alert("Votre mot de passe est : nan2021")
}
}
})
</script>
</html>