<?php require_once __DIR__ . "/../../../Backend/SessionManager.php"; require_once __DIR__ . "/../../../Backend/CommunionManager.php"; if (!isset($_GET) || $_GET["idCommunion"] === NULL) { echo "KO"; } else { $communion = CommunionManager::getSingleCommunion("id", $_GET["idCommunion"]); if ($communion === 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"] == $communion->getIdChurch()) { if (CommunionManager::removeCommunion($communion)) { echo "OK"; } else { echo "KO"; } } } } }
require_once __DIR__ . "/../../Backend/CommunionManager.php"; require_once __DIR__ . "/../../Backend/PersonManager.php"; require_once __DIR__ . "/../../Backend/RectorManager.php"; require_once __DIR__ . "/../../Backend/LanguageSupport.php"; SessionManager::validateUserInPage('communionLook.php'); //Get File contest from template $string = file_get_contents("template/CommunionInsertion.html"); //Remplace the nav $string = str_replace("|title|", 'Look Communion', $string); $string = str_replace("|NavBar|", SessionManager::getNavBar(), $string); if (!isset($_GET) || $_GET["id"] === NULL) { echo "<script src='../JS/functions.js'></script><script>href('main.php')</script>"; } //Get The Data of the Communion $idCommunion = $_GET["id"]; $communion = CommunionManager::getSingleCommunion('id', $idCommunion); $ownerId = $communion->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 = $communion->getIdChurch(); $communionDate = DatabaseManager::databaseDateToSingleDate($communion->getCelebrationDate()); $idRector = $communion->getIdRector(); $objRector = RectorManager::getSingleRector('id', $idRector); $objPerRect = PersonManager::getSinglePerson('id', $objRector->getIdPerson()); $nameRector = $objPerRect->getFullNameBeginName(); $idBookRegistry = $communion->getIdBookRegistry(); $bookRegistry = CommunionManager::getSingleCommunionRegistry('id', $idBookRegistry); $idGodFather = $communion->getIdGodFather(); $godMother = PersonManager::getSinglePerson('id', $idGodMother);