<?php
	include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php");

	session_start();


	$email = $_SESSION['email'];
	$email_new = $_GET['email'];
	// echo "no code is found";

	$result = $conn->query("SELECT * FROM user_account");
		
		if($result) {
			
			$existed = false;

			while ( $row = $result->fetch_assoc() ){
				if ( $row['email'] == $email_new && $row['email'] != $email  ){
					$existed = true;
					echo 0;
					exit();
				}
			}

			if ($existed == false){
				echo 1;
			}
		}
	   
	$conn->close();
?>