$kbornp = $_GET["kbornp"]; $kbornd = DatabaseManager::singleDateToDatabaseDate($_GET["kbornd"]); $knamec = $_GET["knamec"]; $klastname1c = $_GET["klastname1c"]; $klastname2c = $_GET["klastname2c"]; $knamef = $_GET["knamef"]; $kchurch = $_GET["kchurch"]; $defuntionSearch->setId($kid); $defuntionSearch->setDeadDate($kcelebration); $posibleNames[0] = PersonManager::searchPersonsByNames($knamec, $klastname1c, $klastname2c, false); $defuntionSearch->setIdOwner($posibleNames); $posibleChurch = ChurchManager::simpleSearchChurch($kchurch, 'id', -1); $defuntionSearch->setIdChurch($posibleChurch); $defuntionRegistries = DefuntionManager::advancedSearchDefuntion($defuntionSearch, 'AND', $sortType, $numberPage); } else { $defuntionRegistries = DefuntionManager::getAllDefuntions($sortType, $numberPage); } } //Get the total of registries $totalRegistries = DatabaseManager::getAffectedRows(); $affectedRegistries = DatabaseManager::registriesAffectedLastQuery(); $lastPage = floor($affectedRegistries / 10); if ($affectedRegistries % 10 === 0) { $lastPage = floor($affectedRegistries / 10) - 1; } if ($totalRegistries === 0 && $numberPage !== 0) { echo "<script src='../JS/functions.js'></script><script>nextPage('set', '0')</script>"; } //Create contest for button next and prev $nextButtonString = '<button type="button" class="btn btn-warning"
if ($_SESSION["user_type"] != 'A') { if ($_SESSION["user_church"] == $church->getId()) { if ($_POST["status"] === 'insert') { if (DefuntionManager::addDefuntion($defuntion)) { echo "OK"; } else { echo "KO"; } } else { if ($_POST["status"] === 'update') { DefuntionManager::updateDefuntion($defuntion); echo "OK"; } } } else { echo "KO"; } } else { if ($_POST["status"] === 'insert') { if (DefuntionManager::addDefuntion($defuntion)) { echo "OK"; } else { echo "KO"; } } else { if ($_POST["status"] === 'update') { DefuntionManager::updateDefuntion($defuntion); echo "OK"; } } }
$saveButton = ''; $cancelButton = ''; $returnButton = '<button type="button" class="btn btn-success" onclick=\'href("defuntionMenu.php")\'> <img src="../icons/return.png" width="50px"><br> <strong>^Return^</strong> </button>'; //Create a action for button cancel $string = str_replace("|SaveButton|", $saveButton, $string); $string = str_replace("|CancelButton|", $cancelButton, $string); $string = str_replace("|ReturnButton|", $returnButton, $string); //Recuperamos la iglesia $church = ChurchManager::getSingleChurch('id', $churchId); if ($church !== NULL) { if ($church->getIdNiche() !== NULL) { if ($defuntion->getIdCrypt() !== NULL) { $cryptData = DefuntionManager::getSingleCrypt('id', $defuntion->getIdCrypt()); //Load Crypt Data $string = str_replace('value="col"', 'value="' . $cryptData->getCol() . '"', $string); $string = str_replace('value="row"', 'value="' . $cryptData->getRow() . '"', $string); $string = str_replace('value="size"', 'value="' . $cryptData->getNumber() . '"', $string); $idCrypt = $defuntion->getIdCrypt(); //Display the page $string = LanguageSupport::HTMLEvalLanguage($string); echo $string; //put the data of the crypt echo "<script>\n document.getElementById('inputCrypt').checked = true;\n checkCrypt();\n \$('#idCrypt').html('{$idCrypt}');\n </script>"; } else { //Display the page $string = LanguageSupport::HTMLEvalLanguage($string); echo $string; }
<?php require_once __DIR__ . "/../../../Backend/SessionManager.php"; require_once __DIR__ . "/../../../Backend/DefuntionManager.php"; if (!isset($_GET) || $_GET["idDefuntion"] === NULL) { echo "KO"; } else { $defuntion = DefuntionManager::getSingleDefuntion("id", $_GET["idDefuntion"]); if ($defuntion === 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"] == $defuntion->getIdChurch()) { if (DefuntionManager::removeDefuntion($defuntion)) { echo "OK"; } else { echo "KO"; } } } } }