<div class="banner_bottom_agile_info"><br>
<div class="container">
<div class="agile_ab_w3ls_info">
<div class="inner_sec_info_wthree_agile">
<div class="signin-form">
<div class="login-form-rec">
<center><h4>Password Recovery Area</h4></center>
<form action="" method="POST">
<div class="col-lg-12 register-top-grid">
<div class="mation">
<span>Email Address</span>
<input type="email" name="account_email" class="form-control" placeholder="Your Account Email Address" required />
<hr />
<?php
if(isset($_GET["msg"])){echo "<span style='color:red; font-weight:bold;'>".$urlMsg."</span><hr />";}else{}
?>
<span style="float: left;"></span>
<span style="float: right;">
<button type="submit" class="btn btn-default" name="reset_password">Recover Password</button>
</span>
</div>
</div>
<div class="clearfix"> </div><hr />
</form>
<?php
include("includes/database.php");
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
// Load Composer's autoloader
require "PHPMailer/vendor/autoload.php";
if(isset($_POST['reset_password'])){
$account_email = mysqli_real_escape_string($con, $_POST['account_email']);
$get_user = "select * from customers where customer_email = '$account_email'";
$run_user = mysqli_query($con, $get_user);
$check_passUser = mysqli_num_rows($run_user);
$row_user = mysqli_fetch_array($run_user);
$customer_name = $row_user['customer_name'];
$customer_pass = $row_user['customer_pass'];
if($check_passUser == 1){
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'mail.zetongifts.com';
$mail->SMTPAuth = true;
$mail->Username = 'developer@zetongifts.com';
$mail->Password = 'MbszOo^C0c$A';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom($wiscoy_email1, $wiscoy_title);
$mail->addAddress($account_email, "Account Password Request");
$mail->addReplyTo($wiscoy_email1, $wiscoy_title);
$mail->isHTML(true);
// Content
$mail->Subject = "Password Request | $wiscoy_fullname";
$mail->Body = "
<html>
<head>
</head>
<body>
<h3>Dear $customer_name,</h3>
<p>You Are Receiving This Email Because It Seems You Have Forgotten Your Account Password.</p>
<p>Your Account Password is $customer_pass</p>
<p>Thank You For Choosing $wiscoy_fullname</p>
</body>
</html>
";
//send mail ends
if(!$mail->send()){
//echo $mail->ErrorInfo;
//echo "<script>alert('There Seem To Be A Problem, Please Try Again!')</script>";
echo "<script>window.open('checkout?forgot_pass&msg=There Seem To Be A Problem, Please Try Again!','_self')</script>";
exit();
}else{
//echo "<script>alert('Your Password Reset Link Has Been Sent To $account_email')</script>";
echo "<script>window.open('checkout?forgot_pass&msg=Your Account Password Has Been Sent To $account_email','_self')</script>";
exit();
}
}else{
//echo "<script>alert('The Entered Email Address Does Not Exist In Our Database!')</script>";
echo "<script>window.open('checkout?forgot_pass&msg=The Entered Email Address Does Not Exist In Our Database!','_self')</script>";
}
}
?>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="agile_ab_w3ls_info">
<div class="inner_sec_info_wthree_agile">
<div class="signin-form">
<div class="login-form-rec">
<h4>New Customers</h4>
<p>By creating an account with us, you will be able to move through the checkout process faster, store your shipping addresses, view and track your orders in your account and many more.</p>
<a class="btn btn-default" href="register">Create Account</a>
</div>
</div>
</div>
<div class="clearfix"></div><hr />
</div>
</div>
</div>