$kbornd = DatabaseManager::singleDateToDatabaseDate($_GET["kbornd"]); $knamec = $_GET["knamec"]; $klastname1c = $_GET["klastname1c"]; $klastname2c = $_GET["klastname2c"]; $knamef = $_GET["knamef"]; $klastname1f = $_GET["klastname1f"]; $klastname2f = $_GET["klastname2f"]; $knamem = $_GET["knamem"]; $klastname1m = $_GET["klastname1m"]; $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); } }
} else { if ($_POST["status"] === 'update') { ConfirmationManager::updateConfirmation($confirmation); echo "OK"; if ($_POST["baptismId"] === '0') { if ($_POST["baptismChurch"] != "XXXXXXXXXX") { $bookRegistry = new BaptismRegistry(); $bookRegistry->setBook($_POST["bookBookRegistryB"]); $bookRegistry->setPage($_POST["pageBookRegistryB"]); $bookRegistry->setNumber($_POST["numBookRegistryB"]); BaptismManager::addBaptismRegistry($bookRegistry); $bookRegistry = BaptismManager::getSingleBaptismRegistry('book', $_POST["bookBookRegistryB"], 'page', $_POST["pageBookRegistryB"], 'number', $_POST["numBookRegistryB"]); $baptism = new Baptism('0', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL', 'NULL'); $baptism->setIdCivilRegistry('1'); $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]); $baptism->setCelebrationDate($celb); $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]); if ($church !== NULL) { $baptism->setIdChurch($church->getId()); $baptism->setIdRector(RectorManager::getSingleRector('idActualChurch', $church->getId())->getId()); } $baptism->setIdOwner($child->getId()); $baptism->setIdBookRegistry($bookRegistry->getId()); BaptismManager::addBaptism($baptism); } } else { $baptism = BaptismManager::getSingleBaptism('id', $_POST["baptismId"]); if ($baptism !== NULL) { $celb = DatabaseManager::singleDateToDatabaseDate($_POST["baptismDate"]); $baptism->setCelebrationDate($celb); $church = ChurchManager::getSingleChurch('name', $_POST["baptismChurch"]);