????????????????????
??????????????????
ÿØÿà
 JFIF      ÿÛ C      


!"$"$ÿÛ C    
ÿÂ p 
" ÿÄ     
         ÿÄ             ÿÚ 
   ÕÔË®

(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

adadasdasdasasdasdas


.....................................................................................................................................????????????????????
??????????????????
ÿØÿà
 JFIF      ÿÛ C      


!"$"$ÿÛ C    
ÿÂ p 
" ÿÄ     
         ÿÄ             ÿÚ 
   ÕÔË®

(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

adadasdasdasasdasdas


.....................................................................................................................................<?php
   include('session.php');
?>

<!DOCTYPE html>
<html>
  
<head>
    <title>Insert Page page</title>
</head>
  
<body>
    <center>
        <?php
        $conn = mysqli_connect("localhost", "corre_shadi", "Anax@321#$", "correct_shadi");
          
        // Check connection
        if($conn === false){
            die("ERROR: Could not connect. " 
                . mysqli_connect_error());
        }
		use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'vendor/autoload.php';

        if (isset($_GET['id'])){

		// Store the value from get to a
		// local variable "course_id"
		$course_id=$_GET['id'];
		$email=$_GET['email'];
		$pass = rand(1000000000,9999999999);

		// SQL query that sets the status
		// to 1 to indicate activation.
		$sql="UPDATE `registration` SET
			`status`=1 WHERE id='$course_id'";

			$sql12 = "select * from user where username='".$email."'";
			$result = mysqli_query ($conn,$sql12);
			//$row123 = mysqli_num_rows($result);

			if($result->num_rows == 0) {
      $sql1="INSERT INTO user(username, pass)  VALUES ('$email','$pass')";
		   mysqli_query($conn,$sql1);
} else {
     $sql32="UPDATE `user` SET
			`pass`='$pass' WHERE username='$email'";
			mysqli_query($conn,$sql32);
}
        
        

			


			$body = '<HTML>
<body>
<h4>Hello sir your acount is Activated Now you can search for your partners by logging in Thank you.</h4>
<h4>Your Username : '.$email.';
<h4>Your Password : '.$pass.';
</body>
</HTML>';

$mail = new PHPMailer(true);

try {
	$mail->SMTPDebug = 0;									
	$mail->isSMTP();											
	$mail->Host	 = 'smtp.gmail.com;';					
	$mail->SMTPAuth = true;							
	$mail->Username = 'homeshifting2222@gmail.com';				
	$mail->Password = 'qrahoeeuepsgiodq';						
	$mail->SMTPSecure = 'tls';							
	$mail->Port	 = 587;

	$mail->setFrom('homeshifting2222@gmail.com','CORRECTSATHI.COM');		
	$mail->addAddress($email);
	
	
	
	$mail->isHTML(true);								
	$mail->Subject = 'Your account is Activated';
	$mail->Body = $body;
	
	if($mail->send())
	{
	echo '<script>alert("Sent Successfully..."); window.location.href="index.php"</script>';
	}
	else {
	echo '<script>alert("Mail Not Sent..."); window.location.href="index.php"</script>';
		}

} catch (Exception $e) {
	echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

		// Execute the query
		mysqli_query($conn,$sql);
		

	}
          
     
      header('location: registration.php');
       

    

        ?>

        
    </center>
</body>
  
</html>


















<?php

	// Connect to database
	$con=mysqli_connect("localhost","root","","courses");

	// Check if id is set or not if true toggle,
	// else simply go back to the page
	if (isset($_GET['id'])){

		// Store the value from get to a
		// local variable "course_id"
		$course_id=$_GET['id'];

		// SQL query that sets the status
		// to 1 to indicate activation.
		$sql="UPDATE `registration` SET
			`status`=1 WHERE id='$course_id'";

		// Execute the query
		mysqli_query($con,$sql);
	}

	// Go back to course-page.php
	header('location: registration.php');
?>
