echo "OK";
            } else {
                echo "KO";
            }
        } else {
            if ($_POST["status"] === 'update') {
                ConfirmationManager::updateConfirmation($confirmation);
                echo "OK";
            }
        }
    } else {
        echo "KO";
    }
} else {
    if ($_POST["status"] === 'insert') {
        if (ConfirmationManager::addConfirmation($confirmation)) {
            echo "OK";
            if ($_POST["baptismId"] === '0') {
                if ($_POST["baptismChurch"] != "XXXXXXXXXX") {
                    $bookRegistry = new BaptismRegistry();
                    $bookRegistry->setBook($_POST["bookBookRegistryB"]);
                    $bookRegistry->setPage($_POST["pageBookRegistryB"]);
                    $bookRegistry->setNumber($_POST["numBookRegistryB"]);
                    BaptismManager::addBaptismRegistry($bookRegistry);
                    $bookRegistry = BaptismManager::getSingleBaptismRegistry('book', $_POST["bookBookRegistryB"], 'page', $_POST["pageBookRegistryB"], 'number', $_POST["numBookRegistryB"]);
                    $baptism = new Baptism('0', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL');
                    $baptism->setIdCivilRegistry('1');
                    $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]);
                    $baptism->setCelebrationDate($celb);
                    $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]);
                    if ($church !== NULL) {