} else { $stringResponse = $stringResponse . "&namem=" . $mother->getNames() . "&lastname1m=" . $mother->getLastname1() . "&lastname2m=" . $mother->getLastname2(); } if ($gpp === NULL) { $stringResponse = $stringResponse . "&namegpp=&lastname1gpp=&lastname2gpp="; } else { $stringResponse = $stringResponse . "&namegpp=" . $gpp->getNames() . "&lastname1gpp=" . $gpp->getLastname1() . "&lastname2gpp=" . $gpp->getLastname2(); } if ($gmp === NULL) { $stringResponse = $stringResponse . "&namegmp=&lastname1gmp=&lastname2gmp="; } else { $stringResponse = $stringResponse . "&namegmp=" . $gmp->getNames() . "&lastname1gmp=" . $gmp->getLastname1() . "&lastname2gmp=" . $gmp->getLastname2(); } if ($gpm === NULL) { $stringResponse = $stringResponse . "&namegpm=&lastname1gpm=&lastname2gpm="; } else { $stringResponse = $stringResponse . "&namegpm=" . $gpm->getNames() . "&lastname1gpm=" . $gpm->getLastname1() . "&lastname2gpm=" . $gpm->getLastname2(); } if ($gmm === NULL) { $stringResponse = $stringResponse . "&namegmm=&lastname1gmm=&lastname2gmm="; } else { $stringResponse = $stringResponse . "&namegmm=" . $gmm->getNames() . "&lastname1gmm=" . $gmm->getLastname1() . "&lastname2gmm=" . $gmm->getLastname2(); } $baptism = BaptismManager::getSingleBaptism('idOwner', $child->getId()); if ($baptism !== NULL) { $baptismReg = BaptismManager::getSingleBaptismRegistry('id', $baptism->getIdBookRegistry()); $stringResponse = $stringResponse . "&idBap=" . $baptism->getId() . "&dateBap=" . DatabaseManager::databaseDateToSingleDate($baptism->getCelebrationDate()) . "&bookBap=" . $baptismReg->getBook() . "&pageBap=" . $baptismReg->getPage() . "&numbBap=" . $baptismReg->getNumber() . "&"; } else { $stringResponse = $stringResponse . "&idBap=0&dateBap=&bookBap=&pageBap=&numbBap=&"; } echo $stringResponse;
$klastname2m = $_GET["klastname2m"]; $kchurch = $_GET["kchurch"]; $kbook = $_GET["kbook"]; $knumber = $_GET["knumber"]; $kpape = $_GET["kpape"]; $baptismSearch->setId($kid); $baptismSearch->setCelebrationDate($kcelebration); $baptismSearch->setBornPlace($kbornp); $baptismSearch->setBornDate($kbornd); $posibleNames[0] = PersonManager::searchPersonsByNames($knamec, $klastname1c, $klastname2c, false); $posibleNames[1] = PersonManager::searchPersonsByNames($knamef, $klastname1f, $klastname2f, false); $posibleNames[2] = PersonManager::searchPersonsByNames($knamem, $klastname1m, $klastname2m, false); $baptismSearch->setIdOwner($posibleNames); $posibleChurch = ChurchManager::simpleSearchChurch($kchurch, 'id', -1); $baptismSearch->setIdChurch($posibleChurch); $baptismRegistry = BaptismManager::getSingleBaptismRegistry('book', $kbook, 'page', $kpape, 'number', $knumber); $baptismSearch->setIdBookRegistry($baptismRegistry); $baptismRegistries = BaptismManager::advancedSearchBaptism($baptismSearch, 'AND', $sortType, $numberPage); } else { $baptismRegistries = BaptismManager::getAllBaptisms($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>";
$baptism = BaptismManager::getSingleBaptism('idOwner', $ownerId); if ($baptism !== NULL) { //Create the String for Churchs of Baptism $churchString = "<option>XXXXXXXXXX</option>"; $churchId = $baptism->getIdChurch(); $baptismId = $baptism->getId(); foreach ($churchs as $singleChurch) { if ($singleChurch->getId() === $churchId) { $churchString = $churchString . "<option selected> " . $singleChurch->getName() . "</option>\n"; } else { $churchString = $churchString . "<option> " . $singleChurch->getName() . "</option>\n"; } } $string = str_replace("|ChurchOptionB|", $churchString, $string); $idBookRegistryB = $baptism->getIdBookRegistry(); $bookRegistryB = BaptismManager::getSingleBaptismRegistry('id', $idBookRegistryB); $baptismDate = DatabaseManager::databaseDateToSingleDate($baptism->getCelebrationDate()); $baptismBook = $bookRegistryB->getBook(); $baptismPage = $bookRegistryB->getPage(); $baptismNumber = $bookRegistryB->getNumber(); } else { $churchString = "<option selected>XXXXXXXXXX</option>"; $baptismId = 0; foreach ($churchs as $singleChurch) { $churchString = $churchString . "<option> " . $singleChurch->getName() . "</option>\n"; } $string = str_replace("|ChurchOptionB|", $churchString, $string); $baptismDate = ""; $baptismBook = ""; $baptismPage = ""; $baptismNumber = "";
$baptism->setIdGodMother($godMother->getId()); } //Get The Book Registry Data $reverse = substr($_POST["reverseBookRegistry"], 0, 1); if ($reverse === 'Y' || $reverse === 'S') { $reverse = 'Y'; } $bookRegistry = BaptismManager::getSingleBaptismRegistry('book', $_POST["bookBookRegistry"], 'page', $_POST["pageBookRegistry"], 'number', $_POST["numBookRegistry"], 'reverse', $reverse); if ($bookRegistry === NULL) { $bookRegistry = new BaptismRegistry(); $bookRegistry->setBook($_POST["bookBookRegistry"]); $bookRegistry->setPage($_POST["pageBookRegistry"]); $bookRegistry->setNumber($_POST["numBookRegistry"]); $bookRegistry->setReverse($reverse); BaptismManager::addBaptismRegistry($bookRegistry); $bookRegistry = BaptismManager::getSingleBaptismRegistry('book', $_POST["bookBookRegistry"], 'page', $_POST["pageBookRegistry"], 'number', $_POST["numBookRegistry"], 'reverse', substr($reverse, 0, 1)); } $baptism->setIdBookRegistry(1); if ($bookRegistry !== NULL) { $baptism->setIdBookRegistry($bookRegistry->getId()); } //Get The Civil Registry Data $officeTemp = $_POST["officeCivilRegistry"]; $posComa = strpos($officeTemp, ','); $numberOffice = substr($officeTemp, 4, $posComa - 4); $cityOfficeName = substr($officeTemp, $posComa + 2, -1); $cityId = CityManager::getSingleCity('name', $cityOfficeName)->getId(); $office = BaptismManager::getSingleOfficeCivilRegistry('number', $numberOffice, 'idCity', $cityId); $civilRegistry = BaptismManager::getSingleCivilRegistry('book', $_POST["bookCivilRegistry"], 'page', $_POST["pageCivilRegistry"], 'number', $_POST["numCivilRegistry"], 'idOfficineCivilRegistry', $office->getId()); if ($civilRegistry === NULL) { $civilRegistry = new civilRegistry();