<?php
ini_set('display_errors', 1);
include_once 'header.php';
  function base64_url_encode($input)

{

return strtr(base64_encode($input), '+/=', '-_,');

}
// include 'PHPMailer.php';
// include 'SMTP.php';
// include 'Exception.php';

$usernamecurrent = $_GET['usernamecurrent'];
require_once "config.php";

session_start();

$sqlcurrentVerify = "SELECT verification_code, email FROM users WHERE username='$usernamecurrent'";
$currentVerifyquery = mysqli_query($mysqli,$sqlcurrentVerify);
$currentVerifygrab  = mysqli_fetch_assoc($currentVerifyquery);
$VerificationCode = $currentVerifygrab['verification_code'];
$Email = $currentVerifygrab['email'];



// $mail = new PHPMailer\PHPMailer\PHPMailer();
// $mail->isSMTP();                                            
// $mail->SMTPAuth = true;                     
// $mail->SMTPSecure = 'ssl';
// $mail->Host =  "smtp.gmail.com";
// $mail->Port = 465;
// $mail->Username = "manish.makwana@beelinesoftwares.com";                   
// $mail->Password = "#brevity123";
// $mail->Username = "uclatest2122@gmail.com";                   
// $mail->Password = "AlphaZulu1";
// $mail->SMTPAuth = true;                     
// $mail->SMTPSecure = 'TLS';
// $mail->Host =  "smtp.gmail.com";
// $mail->Port = 587;
// $mail->Username = "poojajoshibr@gmail.com";                   
// $mail->Password = "#brevity123";



// $mail->From ="manish.makwana@beelinesoftwares.com";
// $mail->FromName ="stresstracker";

$mail->From ="uclatest2122@gmail.com";
$mail->FromName ="stresstracker";
$mail->addAddress($Email);

// Content
$mail->isHTML(true);
$mail->Subject = "Verify Email";
 $usernamecurrenttosend = base64_url_encode($usernamecurrent);
$mail->Body = '<table style="font-family:Verdana,sans-serif;font-size:13px;border:2px solid #242424;line-height:18px;border-radius:4px;overflow:hidden;max-width:600px" border="0" width="600px" cellspacing="0" cellpadding="0" align="center"><tbody><tr style="background:#ffffff"><td style="padding:10px;margin:10px 0px 0px 10px;text-align:left;margin-top:5px;display:block" colspan="2"><a><br><img src="'.$baseurl.'Stress_Tracker_Logo.png" alt="Stress Tracker" width="60px"><br></a></td></tr><tr style="background:#242424;margin-top:5px;display:block;width:100%"><td style="padding:5px 20px;text-align:left" colspan="2"><p style="font-size:16px;color:#ffffff;margin:0px;padding:6px 0px">Stress Tracker Verification Email</p>
  </td></tr><tr><td style="padding:10px 20px 20px 20px;width:100%"><p style="font-weight:normal;text-align:left;line-height:26px;font-size:14px;color:#000">Hello '.$usernamecurrent.',</p><p style="font-weight:normal;text-align:left;line-height:26px;font-size:14px;color:#3b3b3b">Click the link to verify your email. <a href="'.$baseurl.'FirstTimeLogin.php?usernamecurrent='.$usernamecurrenttosend.'">Click here</a></p><p style="font-weight:bold;text-align:left;color:#242424;margin:0px">Thanks,</p><p style="font-weight:bold;text-align:left;color:#242424;margin:0px">Stress Tracker Team</p></td></tr></tbody></table>';
 $msg ='';
if($mail->send())
{
    
    $msg = "Email has been sent for verify your account.";
}
else
{
    $msg =  "Could not be sent <br> Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>
<section class="thank-you">
  <div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
           <div class="thank-you-con">
            <img src="./public/images/verified.png" alt="">
            <h2>Thank you</h2>
            <p><?php echo $msg; ?></p>
           </div>
        </div>
    </div>
</div>
</section>
<?php
    
include_once 'footer.php';
?>


