<?php require_once __DIR__ . "/../../../Backend/SessionManager.php"; require_once __DIR__ . "/../../../Backend/ConfirmationManager.php"; if (!isset($_GET) || $_GET["idConfirmation"] === NULL) { echo "KO"; } else { $confirmation = ConfirmationManager::getSingleConfirmation("id", $_GET["idConfirmation"]); if ($confirmation === NULL) { echo "KO"; } else { if (!isset($_SESSION) || $_SESSION["user_church"] === NULL) { echo "KO"; } else { //Check for permision if ($_SESSION["user_type"] == 'A' || $_SESSION["user_church"] == $confirmation->getIdChurch()) { if (ConfirmationManager::removeConfirmation($confirmation)) { echo "OK"; } else { echo "KO"; } } } } }
require_once __DIR__ . "/../../Backend/PersonManager.php"; require_once __DIR__ . "/../../Backend/RectorManager.php"; require_once __DIR__ . "/../../Backend/LanguageSupport.php"; require_once __DIR__ . "/../../Backend/BaptismManager.php"; SessionManager::validateUserInPage('confirmationLook.php'); //Get File contest from template $string = file_get_contents("template/ConfirmationInsertion.html"); if (!isset($_GET) || $_GET["id"] === NULL) { echo "<script src='../JS/functions.js'></script><script>href('main.php')</script>"; } //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);