System: Windows NT WINDOWS18 10.0 build 17763 (Windows Server 2016) AMD64 | User: IWPD_3544(appclien)
Path: D:\Inetpub\vhosts\appclients.in\fruits-vegitables.nmvm.org\user
[Back to List]
<?php
include("../admin/config.php");
//reset password
if(isset($_POST['ResetPassword'])){
$email=mysqli_real_escape_string($con,$_POST['email']);
$password=$_POST['password'];
$changepass=md5($password);
$sql=mysqli_query($con,"select * from regis where email='$email'") or die(mysqli_error($con));
//echo mysqli_num_rows($sql);
if(mysqli_num_rows($sql)>0){
$result=mysqli_fetch_array($sql);
$user_id=$result['reg_id'];
$email=$result['email'];
$name=$result['name'];
$_SESSION['dcustOTP']=date('ihs');
$_SESSION['resetUser']=$user_id;
require('../phpmailer/class.phpmailer.php');
$message = "Hi! $name,\n\n OTP to reset your password is ".$_SESSION['dcustOTP']."\n\n";
$message .= "Thanks for showing interest with us.\n\n
Thanks & Regards,\n\nSupport Team\n\nwww.localbvocalb.com\n\n";
$mail = new PHPMailer;
$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = "localbvocalb.com"; // Specify main and backup server
//$mail->Host = "Give IP Address"; // If the above does not work.
$mail->Port = 25; // Set the SMTP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "order@localbvocalb.com"; // SMTP username
$mail->Password = "admin@@987"; // SMTP password
//$mail->SMTPSecure = "ssl"; // Enable encryption, 'ssl' also accepted
$mail->From = 'order@localbvocalb.com';
$mail->FromName = 'Localbvocalb';
$mail->AddAddress($email); // Add a recipient
if(!empty($vendorEml))
//$mail->AddAddress($vendorEml); // Add a recipient
$mail->IsHTML(true);
//send mail to customer
$sendmail_customer = $mail->AddAddress($email,$name);
$mail->Subject = "Reset password verification on localbvocalb.com";
$mail->Body = $message;
$mail->Send();
$url="pass-forgot.php";
?>
<script>
alert("OTP has sent to your resistered email id");
window.location='<?php echo $url?>';
</script>
<?php
}
else
{
?>
<script>
alert("error!You have entered wrong email id");
window.location="<?php echo $_SERVER['HTTP_REFERER']; ?>";
</script>
<?php
}
}
if(isset($_POST['changePass'])){
if($_POST['otpIS']==$_SESSION['dcustOTP']){
$respass = $_POST['password'];
$resetChangepass = md5($_POST['password']);
mysqli_query($con,"UPDATE regis SET pass='$respass',password='$resetChangepass' where reg_id='$_SESSION[resetUser]'");
unset($_SESSION['custID']);
unset($_SESSION['dcustOTP']);
echo "<script>alert('Your password has reset successfully!')</script>";
echo "<script>window.location='index.php'</script>";
}else{
echo "<script>alert('OTP does not matches,please try again.')</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="img/favicon.png">
<title>Delivery Boy :: Reset Password</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-reset.css" rel="stylesheet">
<link rel="stylesheet" href="css/mithlesh_animation.css"/>
<!--external css-->
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link href="css/style.css" rel="stylesheet">
<link href="css/style-responsive.css" rel="stylesheet" />
<style>
.cc{
width:22%; margin:2% auto;
}
@media (min-width:300px) and (max-width:600px) {
.cc{
width:100%; margin:5% auto;
}
}
</style>
<link href="jGrowl/jquery.jgrowl.css" rel="stylesheet" media="screen"/>
<script src="jquery-1.9.1.min.js"></script>
</head>
<body class="lock-screen" onLoad="startTime()">
<!--<div class="cc"> <center> <img src="img/lelo.png" width="100%;"></center> </div>-->
<div class="lock-wrapper">
<div id="time"></div>
<div class="lock-box text-center">
<img src="img/follower-avatar.png" alt="lock avatar" class="animated infinite bounce"/>
<h1>Delivery Boy</h1>
<span class="locked">Reset Password</span>
<?php if(isset($_SESSION['dcustOTP']) && !empty($_SESSION['dcustOTP'])){?>
<form class="form-inline" id="login_form" method="post" name="formReg">
<div class="form-group col-lg-12">
<input type="text" class="form-control" name="otpIS" placeholder="Enter OTP" style="margin-bottom:10px;" autocomplete="off">
<input type="password" placeholder="Create a new Password" style="margin-bottom:10px;" name="password" id="password" class="form-control">
<input type="password" placeholder="Create a new Password" name="confirmPass" class="form-control lock-input">
<button type="submit" name="changePass" class="btn btn-lock" onClick="return checkFormValidation1()">
<i class="icon-arrow-right"></i>
</button>
<p style="padding-top: 15px;float: right;"><a href="index.php" class="forgot">Login</a></p>
</div>
</form>
<script>
function checkFormValidation1(){
if(document.formReg.otpIS.value==''){
alert("Enter OTP");
document.formReg.otpIS.focus();
return false;
}
if(document.formReg.password.value==''){
alert("Enter Your Password");
document.formReg.password.focus();
return false;
}
if(document.formReg.password.value!=document.formReg.confirmPass.value){
alert("Password and Confirm Password does not matches.");
document.formReg.confirmPass.focus();
return false;
}
else{
return true;
}
}
</script>
<?php }else{?>
<form class="form-inline" id="login_form" method="post" name="formReg">
<div class="form-group col-lg-12">
<input type="text" class="form-control" name="email" id="email" placeholder="Enter Your Email ID" autofocus onFocus="document.getElementById('error').style.display='none'" style="width:80%" autocomplete="off">
<button type="submit" name="ResetPassword" class="btn btn-lock" onClick="return checkFormValidation()">
<i class="icon-arrow-right"></i>
</button>
<p style="padding-top: 15px;float: right;"><a href="index.php" class="forgot">Login</a></p>
</div>
</form>
<script>
function checkFormValidation(){
var email = document.formReg.email.value;
atpos = email.indexOf("@");
dotpos = email.lastIndexOf(".");
if (email == "" || atpos < 1 || ( dotpos - atpos < 2 )){
alert("Please enter correct email ID");
document.formReg.email.focus() ;
return false;
}
else{
return true;
}
}
</script>
<?php }?>
</div>
</div>
<script>
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('time').innerHTML=h+":"+m+":"+s;
t=setTimeout(function(){startTime()},500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
</body>
</html>