-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot.php
175 lines (153 loc) · 4.64 KB
/
forgot.php
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
<?php
require "header.php";
?>
<!-- Start Bradcaump area -->
<div class="ht__bradcaump__area bg-image--6">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="bradcaump__inner text-center">
<h2 class="bradcaump-title"></h2>
<nav class="bradcaump-content">
<a class="breadcrumb_item" href="index.html"></a>
<span class="brd-separetor">/</span>
<span class="breadcrumb_item active"></span>
</nav>
</div>
</div>
</div>
</div>
</div>
<!-- End Bradcaump area -->
<!--Start Message Area -->
<div class="btn btn-dark btn-block text-center " >
Congratulations!
</div>
<div class="btn btn-danger btn-block text-center " >
Error!
</div>
<!-- End Message area -->
<!-- Start Reset Password Area -->
<section class="my_account_area pt--80 pb--55 bg--white">
<div class="row justify-content-center">
<div class="col-lg-6 col-10">
<div class="my__account__wrapper">
<h3 class="account__title text-center">Reset Your Password</h3>
<form action="#">
<div class="account__form">
<div class="email">
<div class="input__box">
<label>Email address <span>*</span></label>
<input type="email" id="id1" class="form-control" placeholder="Email" required>
</div>
<div class="form__btn text-center">
<button type="button" id="sendOTP">Send OTP</button>
</div><br>
</div>
<div class="otp">
<div class="input__box">
<label>OTP<span>*</span></label>
<input type="number" min="100000" max="999999" name="otp" id="id2"
placeholder="Enter OTP" class="form-control" required><br>
</div>
<div class="form__btn text-center">
<button type="button" id="otp">Submit</button>
</div><br>
</div>
<div class="pswd">
<div class="input__box">
<label>Set New Password<span>*</span></label>
<input type="password" id="id3" class="form-control" placeholder="Password" required>
</div>
<div class="form__btn text-center">
<button type="button" id="save">Save</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
<script>
$(document).ready(function(){
$('.btn-danger').hide();
$('.btn-dark').hide();
$('.otp,.pswd').hide();
//....Email Verification.........//
$('#sendOTP').click(function(){
var email=$('#id1').val();
if(email!=""){
$.ajax({
url:'Login_dashboard.php',
type:'POST',
data:{action_type:'forgot',email:email},
success:function(response){
if(response==1)
{ $('.otp').show(); $('.email').hide(); $('.btn-danger').hide(); }
else
{
$('.btn-danger').text(response);
$('.btn-danger').show();
}
}
});
}
else{alert("Fill Email");}
});
//......OTP Verification.......//
$('#otp').click(function(){
var otp=$('#id2').val();
if(otp>=100000&&otp<=999999){
$.ajax({
url:'Login_dashboard.php',
type:'POST',
data:{action_type:'otp',user_otp:otp},
success:function(response){
if(response==1)
{ $('.otp').hide(); $('.pswd').show(); $('.btn-danger').hide();}
else
{
$('.btn-danger').text(response);
$('.btn-danger').show();
}
}
});
}
else{
$('.btn-danger').text("Fill 6 digit OTP");
$('.btn-danger').show();}
});
//........Setting New Password..........//
$('#save').click(function(){
var pswd=$('#id3').val();
if(pswd!=""){
$.ajax({
url:'Login_dashboard.php',
type:'POST',
data:{action_type:'reset_pswd',pswd:pswd},
success:function(response){
if(response==1)
{
$('.btn-danger').hide();
$('.btn-dark').html('Resetting Password.....!!');
$('.btn-dark').show();
setTimeout( function(){location="my-account.php";}, 3000 );
}
else{
$('.btn-danger').text(response);
$('.btn-danger').show();
}
}
});
}
else{
$('.btn-danger').text("Fill Password");
$('.btn-danger').show();
}
});
});
</script>
<?php
require "footer.php";
?>