forked from khrisnairham/pesona-lokal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lupaPassAdv.html
179 lines (163 loc) · 6.31 KB
/
lupaPassAdv.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Forgot Password Page - Pesona Lokal</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous">
</script>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="path/to/bootstrap.min.css" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="./css/login.css" />
</head>
<body>
<div class="wrapper">
<div class="text-center">
<a href="home.html"
><img src="./assets/Header_Pesona Lokal.png" alt=""
/></a>
</div>
<div class="title-text">
<!-- <div class="title signup">Form Registrasi</div> -->
</div>
<div class="form-container">
<h3
class="text-center mt-4"
style="color: rgba(102, 102, 102, 0.959); font-weight: 600"
>
Lupa Kata Sandi
</h3>
<div class="form-inner">
<form id="lupaPassAdv" method="POST" action="cek_kodeverify.php" class="login">
<pre></pre>
<div id="lupaAlertContainer"></div>
<p style="color: rgba(102, 102, 102, 0.959); font-weight: 500; padding-top: 30px;margin-left: 10px; margin-bottom: -10px;">Masukan Kode Verifikasi</p>
<div
id="otp"
class="inputs d-flex flex-row justify-content-center mt-2"
>
<input
class="m-2 text-center form-control rounded"
type="text"
id="first"
name="verification_code"
maxlength="6" required
/>
</div>
<div class="field">
<input type="password" name="password" id="password" placeholder="Masukan Password Baru" required>
</div>
<div class="field">
<input type="password" id="confirm_password" name="confirm_password" placeholder="Ulangi password" required><br>
</div><br><br>
<!-- <input
class="m-2 text-center form-control rounded"
type="text"
id="second"
maxlength="1" required
/>
<input
class="m-2 text-center form-control rounded"
type="text"
id="third"
maxlength="1" required
/>
<input
class="m-2 text-center form-control rounded"
type="text"
id="fourth"
maxlength="1" required
/>
<input
class="m-2 text-center form-control rounded"
type="text"
id="fifth"
maxlength="1" required
/>
<input
class="m-2 text-center form-control rounded"
type="text"
id="sixth"
maxlength="6" required
/> -->
<div class="field btn">
<div class="btn-layer"></div>
<input type="submit" value="Reset" />
</div>
<div class="pass-link mt-4 text-center">
<a href="loginSignUp.html">Masuk Ke Akun</a>
</div>
</form>
<p id="error_message" style="color: red"></p>
</div>
</div>
</div>
<script>
document
.getElementById("lupaPassAdv")
.addEventListener("submit", function (event) {
event.preventDefault(); // Mencegah pengiriman form secara default
codeVerify();
});
//dinggo login
function codeVerify() {
var form = document.getElementById("lupaPassAdv");
var formData = new FormData(form);
var lupaAlertContainer = document.getElementById("lupaAlertContainer");
lupaAlertContainer.innerHTML = ""; // Menghapus semua alert login sebelumnya
var xhr = new XMLHttpRequest();
xhr.open("POST", "cek_kodeverify.php", true);
xhr.onload = function() {
if (xhr.status === 200) {
var response = xhr.responseText.trim();
if (response === 'Kode verifikasi telah dikirim ke alamat email Anda.') {
window.location.href = "loginSignUp.html"; // Mengarahkan ke halaman selanjutnya
} else {
showAlert("danger", "" + response, lupaAlertContainer);
}
} else {
showAlert("danger", "Terjadi kesalahan. Silakan coba lagi.", lupaAlertContainer);
}
};
xhr.send(formData);
}
//dinggo nampilke pesan eror
function showAlert(type, message, container) {
// membuat elemen Alert Bootstrap
var alertElement = document.createElement("div");
alertElement.classList.add(
"alert",
"alert-" + type,
"alert-dismissible",
"fade",
"show"
);
alertElement.setAttribute("role", "alert");
// Tambahkan pesan dan tombol close ke dalam elemen Alert
alertElement.innerHTML =
"<strong>" +
message +
"</strong>" +
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
'<span aria-hidden="true">×</span>' +
"</button>";
// Tambahkan elemen Alert ke dalam container
container.appendChild(alertElement);
}
</script>
<script src="./js/login.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script> $(document).ready(function() {
$('[title="Hosted on free web hosting 000webhost.com. Host your own website for FREE."]').hide();
});</script>
</body>
</html>