<?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();

$client = new CLIENTE($db);
try{
	$clienteid = isset($_GET['id'])?$_GET['id']:die();
	$query = "UPDATE ".$client->table_name." SET confirmacorreo='Si' WHERE id=:id";
	$stm = $client->conn->prepare($query);
	$stm->bindParam(":id",$clienteid);
	$stmt = $client->Update($stm);
	if($stmt !==false){
		echo json_encode(array("Mensaje"=>"Correo Confirmado"));
	}else{
		echo json_encode(array("Error"=>"No se ha podido Confirmar el correo"));
	}
}catch(Exception $ex){
	echo json_encode(array("Error"=>"No se ha podido procesar la solicitud"));
}

?>