$baptism->setIdChurch($church->getId()); } BaptismManager::updateBaptism($baptism); $baptismReg = BaptismManager::getSingleBaptismRegistry('id', $baptism->getIdBookRegistry()); $baptismReg->setBook($_POST["bookBookRegistryB"]); $baptismReg->setPage($_POST["pageBookRegistryB"]); $baptismReg->setNumber($_POST["numBookRegistryB"]); BaptismManager::updateBaptismRegistry($baptismReg); } } } else { echo "KO"; } } else { if ($_POST["status"] === 'update') { ConfirmationManager::updateConfirmation($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) {