<?php
require_once '../includes/config.php';
require_once '../includes/functions.php';

header('Content-Type: application/json');

if (!isset($_GET['cpf'])) {
    echo json_encode(['erro' => true]);
    exit;
}

$result = checkCPFExists($_GET['cpf']);
echo json_encode([
    'exists' => $result !== false,
    'name' => $result ? $result['name'] : null
]); 