$boyfriend = PersonManager::getSinglePerson('id', $_POST["idBoyfriend"]); } $girlfriend = new Person(); if ($_POST["idGirlfriend"] !== '0') { $girlfriend = PersonManager::getSinglePerson('id', $_POST["idGirlfriend"]); } $boyfriend->setId($_POST["idBoyfriend"]); $boyfriend->setNames($_POST["boyfriendName"]); $boyfriend->setLastname1($_POST["lastname1Boyfriend"]); $boyfriend->setLastname2($_POST["lastname2Boyfriend"]); $girlfriend->setId($_POST["idGirlfriend"]); $girlfriend->setNames($_POST["girlfriendName"]); $girlfriend->setLastname1($_POST["lastname1Girlfriend"]); $girlfriend->setLastname2($_POST["lastname2Girlfriend"]); $marriage = new Marriage(); $marriage->setId($_POST["idMarriage"]); $celb = DatabaseManager::singleDateToDatabaseDate($_POST["celebrationDate"]); $marriage->setCelebrationDate($celb); $marriage->setIdChurchProcess($churchProcess->getId()); $marriage->setIdChurchMarriage($churchMarriage->getId()); $marriage->setIdRector($_POST["rectorId"]); if ($boyfriend->getId() === '0') { PersonManager::addPerson($boyfriend, 'true'); $boyfriend = PersonManager::getSinglePerson('id', PersonManager::getLastID()); } else { PersonManager::updatePerson($boyfriend); } if ($girlfriend->getId() === '0') { PersonManager::addPerson($girlfriend, 'true'); $girlfriend = PersonManager::getSinglePerson('id', PersonManager::getLastID()); } else {
$marriageRegistries = MarriageManager::simpleSearchMarriage($simpleKeyword, $sortType, $numberPage); } else { if ($kid !== NULL) { $marriageSearch = new Marriage(); $kcelebration = DatabaseManager::singleDateToDatabaseDate($_GET["kcelebration"]); $knameb = $_GET["knameb"]; $klastname1b = $_GET["klastname1b"]; $klastname2b = $_GET["klastname2b"]; $knameg = $_GET["knameg"]; $klastname1g = $_GET["klastname1g"]; $klastname2g = $_GET["klastname2g"]; $kchurchc = $_GET["kchurch"]; $kbook = $_GET["kbook"]; $knumber = $_GET["knumber"]; $kpape = $_GET["kpape"]; $marriageSearch->setId($kid); $marriageSearch->setCelebrationDate($kcelebration); $posibleNames[0] = PersonManager::searchPersonsByNames($knameb, $klastname1b, $klastname2b, false); $posibleNames[1] = PersonManager::searchPersonsByNames($knameg, $klastname1g, $klastname2g, false); $marriageSearch->setIdBoyfriend($posibleNames[0]); $marriageSearch->setIdGirlfriend($posibleNames[1]); $posibleChurch = ChurchManager::simpleSearchChurch($kchurchc, 'id', -1); $marriageSearch->setIdChurchMarriage($posibleChurch); $marriageRegistry = MarriageManager::getSingleMarriageRegistry('book', $kbook, 'page', $kpape, 'number', $knumber); $marriageSearch->setIdBookRegistry($marriageRegistry); $marriageRegistries = MarriageManager::advancedSearchMarriage($marriageSearch, 'AND', $sortType, $numberPage); } else { $marriageRegistries = MarriageManager::getAllMarriages($sortType, $numberPage); } } //Get the total of registries