<?php
		header("Access-Control-Allow-Origin: *");
		header("Access-Control-Allow-Headers: access");
		header("Access-Control-Allow-Methods: GET");
		header("Access-Control-Allow-Credentials: true");
		header("Content-Type: application/json; charset=UTF-8");

		include_once '../Database.php';
		include_once 'cliente.php';

		$database = new DataBase();
		$db = $database->getConnection();

		$cliente = new CLIENTE($db);
		$cliente->correo = isset($_GET['email'])?$_GET['email']:die();
		try{
			$stmt = $cliente->select("select * from web where correo='".$cliente->correo."' ");
		$num = $stmt->rowCount();

		if($num>0){
			$row =$stmt->fetch(PDO::FETCH_ASSOC);
				extract($row);
				$add_item=array(
					"nombre"=>$nombre,
					"correo"=>$correo
				);
			
			echo json_encode($add_item);
		}
		else {
			echo json_encode(array("Mensaje"=>"No se han encontrado registros"));
		}
	}catch(Exeption $e){
		echo json_encode(array("Error"=>"Error ".$e));
	}
	
		
?>