} //Remplace the nav $string = str_replace("|title|", 'Look Confirmation', $string); $string = str_replace("|NavBar|", SessionManager::getNavBar(), $string); //Get The Data of the Confirmation $idConfirmation = $_GET["id"]; $confirmation = ConfirmationManager::getSingleConfirmation('id', $idConfirmation); $ownerId = $confirmation->getIdOwner(); $owner = PersonManager::getSinglePerson('id', $ownerId); $owner->getIdFather() !== NULL ? $fatherId = $owner->getIdFather() : ($fatherId = 0); $owner->getIdMother() !== NULL ? $motherId = $owner->getIdMother() : ($motherId = 0); $gender = $owner->getGender(); $churchId = $confirmation->getIdChurch(); $confirmationDate = DatabaseManager::databaseDateToSingleDate($confirmation->getCelebrationDate()); $idRector = $confirmation->getIdRector(); $objRector = RectorManager::getSingleRector('id', $idRector); $objPerRect = PersonManager::getSinglePerson('id', $objRector->getIdPerson()); $nameRector = $objPerRect->getFullNameBeginName(); $idBookRegistry = $confirmation->getIdBookRegistry(); $bookRegistry = ConfirmationManager::getSingleConfirmationRegistry('id', $idBookRegistry); $idGodFather = $confirmation->getIdGodFather(); $godMother = PersonManager::getSinglePerson('id', $idGodMother); $godFather = PersonManager::getSinglePerson('id', $idGodFather); if ($godFather === NULL) { $godFather = new Person(); } if ($godMother === NULL) { $godMother = new Person(); } //Create a String of options of Last Church $churchString = "";
<?php require_once __DIR__ . "/../../../Backend/SessionManager.php"; require_once __DIR__ . "/../../../Backend/RectorManager.php"; require_once __DIR__ . "/../../../Backend/ChurchManager.php"; if (!isset($_GET) || $_GET["idRector"] === NULL) { echo "KO"; } else { $rector = RectorManager::getSingleRector("id", $_GET["idRector"]); if ($rector === NULL) { echo "KO"; } else { if (!isset($_SESSION) || $_SESSION["user_type"] === NULL) { echo "KO"; } else { //Check for permision if ($_SESSION["user_type"] == 'A') { if (RectorManager::removeRector($rector)) { echo "OK"; } else { echo "KO"; } } } } }
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) { $baptism->setIdChurch($church->getId()); $baptism->setIdRector(RectorManager::getSingleRector('idActualChurch', $church->getId())->getId()); } $baptism->setIdOwner($child->getId()); $baptism->setIdBookRegistry($bookRegistry->getId()); BaptismManager::addBaptism($baptism); } } else { $baptism = BaptismManager::getSingleBaptism('id', $_POST["baptismId"]); if ($baptism !== NULL) { $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]); $baptism->setCelebrationDate($celb); $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]); if ($church !== NULL) { $baptism->setIdChurch($church->getId()); } BaptismManager::updateBaptism($baptism);