} $confirmation->setIdGodFather($godFather->getId()); } //Get The Book Registry Data $reverse = substr($_POST["reverseBookRegistry"], 0, 1); if ($reverse === 'Y' || $reverse === 'S') { $reverse = 'Y'; } $bookRegistry = ConfirmationManager::getSingleConfirmationRegistry('book', $_POST["bookBookRegistry"], 'page', $_POST["pageBookRegistry"], 'number', $_POST["numBookRegistry"], 'reverse', $reverse); if ($bookRegistry === NULL) { $bookRegistry = new ConfirmationRegistry(); $bookRegistry->setBook($_POST["bookBookRegistry"]); $bookRegistry->setPage($_POST["pageBookRegistry"]); $bookRegistry->setNumber($_POST["numBookRegistry"]); $bookRegistry->setReverse($reverse); ConfirmationManager::addConfirmationRegistry($bookRegistry); $bookRegistry = ConfirmationManager::getSingleConfirmationRegistry('book', $_POST["bookBookRegistry"], 'page', $_POST["pageBookRegistry"], 'number', $_POST["numBookRegistry"], 'reverse', substr($reverse, 0, 1)); } $confirmation->setIdBookRegistry(1); if ($bookRegistry !== NULL) { $confirmation->setIdBookRegistry($bookRegistry->getId()); } //Add the registry if ($_SESSION["user_type"] != 'A') { if ($_SESSION["user_church"] == $church->getId()) { if ($_POST["status"] === 'insert') { if (ConfirmationManager::addConfirmation($confirmation)) { echo "OK"; } else { echo "KO"; }