function displayData() { $cityTemp = CityManager::getSingleCity('id', $this->church->getIdCity()); if ($cityTemp === NULL) { $cityTemp = new City(); } $stateTemp = CityManager::getSingleState('id', $cityTemp->getIdState()); $cityString = "*************************"; if ($stateTemp === NULL) { $stateTemp = new State(); } else { $cityString = $cityTemp->getName() . ", " . $stateTemp->getShortName(); } $this->SetFont('Arial', 'B', 10); $cellSizeY = 5; for ($i = 0; $i < 3; $i++) { //Get the data necesary of create the document $this->SetXY($x + 100, $i * 60 + $y + 40 - $cellSizeY); $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getName()), 0, 0, 'C'); $this->SetXY($x + 100, $i * 60 + $y + 47 - $cellSizeY); $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getAddress()), 0, 0, 'C'); $this->SetXY($x + 100, $i * 60 + $y + 54 - $cellSizeY); $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', 'CP. ' . $this->church->getPostalCode()), 0, 0, 'C'); $this->SetXY($x + 100, $i * 60 + $y + 61 - $cellSizeY); $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $cityString), 0, 0, 'C'); } }
if ($_GET["status"] === 'insert' && ChurchManager::getSingleChurch('name', $_GET["nameChuch"]) !== NULL) { echo "KO"; } else { $status = $_GET["status"]; $church = new Church(); $church->setId(0); $church->setName($_GET["nameChuch"]); $church->setType($_GET["typeChurch"]); $church->setCode($_GET["codeChurch"]); $church->setAddress($_GET["addressChurch"]); $church->setColony($_GET["colonyChurch"]); $church->setPostalCode($_GET["postalCodeChurch"]); $church->setPhoneNumber($_GET["phoneNumberChurch"]); $church->setIdVicar(ChurchManager::getSingleVicar('name', $_GET["vicar"])->getId()); $church->setIdDean(ChurchManager::getSingleDean('name', $_GET["dean"])->getId()); $church->setIdCity(CityManager::getSingleCity('name', $_GET["city"])->getId()); $niches = $_GET["niche"]; if ($niches == 'true') { $niche = new Niche(); $niche->setMaxCol($_GET["maxCol"]); $niche->setMaxRow($_GET["maxRow"]); $niche->setSize($_GET["size"]); $nicheT = ChurchManager::getSingleNiche('maxCol', $niche->getMaxCol(), 'maxRow', $niche->getMaxRow(), 'size', $niche->getSize()); if ($nicheT === NULL) { ChurchManager::addNiche($niche); $nicheT = ChurchManager::getSingleNiche('maxCol', $niche->getMaxCol(), 'maxRow', $niche->getMaxRow(), 'size', $niche->getSize()); $church->setIdNiche($nicheT->getId()); } else { $church->setIdNiche($nicheT->getId()); } } else {
//Create a String of options of Last Church $churchString = ""; $churchs = ChurchManager::getAllChurchs('name'); 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("|ChurchOption|", $churchString, $string); //Create a String of options of Civil Registries $civilString = ""; $civilRegis = BaptismManager::getAllOfficeCivilRegistries(); foreach ($civilRegis as $single) { $city = CityManager::getSingleCity('id', $single->getIdCity())->getName(); if ($office->getId() === $single->getId()) { $civilString = $civilString . "<option selected> No. " . $single->getNumber() . ", {$city}.</option>\n"; } else { $civilString = $civilString . "<option> No. " . $single->getNumber() . ", {$city}.</option>\n"; } } $string = str_replace("|CivilRegistryOption|", $civilString, $string); if ($baptism->getLegitimate() !== 'Y') { $string = str_replace("|isLegitimate|", "selected", $string); } else { $string = str_replace("|isLegitimate|", "", $string); } if ($owner->getGender() === 'F') { $string = str_replace("|isFemale|", "selected", $string); } else {
<th style="text-align: center;">^City^</th> <th style="text-align: center;">^Options^</th> </tr> </thead>'; $table = $table . $header; $table = $table . '<tbody>'; $i = 0; foreach ($churchRegistries as $singleChurch) { if ($i === 10) { continue; } $vicar = ChurchManager::getSingleVicar('id', $singleChurch->getIdVicar()); $nameVicar = $vicar->getName(); $dean = ChurchManager::getSingleDean('id', $singleChurch->getIdDean()); $nameDean = $dean->getName(); $city = CityManager::getSingleCity('id', $singleChurch->getIdCity()); $nameCity = $city->getName(); if ($_SESSION["user_type"] == 'A') { $options = '<td data-title="^Options^" class="center-btn" style="text-align: center"> <button type="button" class="btn btn-success btn-inside" onclick="href(\'churchLook.php?id=' . $singleChurch->getID() . '\')"> <img src="../icons/eye.png" class="img-inside" height="30px"> </button> <button type="button" class="btn btn-success btn-inside" onclick="href(\'churchChange.php?id=' . $singleChurch->getID() . '\')"> <img src="../icons/refresh.png" class="img-inside" height="30px"> </button> <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'church\', \'' . $singleChurch->getID() . '\')"> <img src="../icons/delete.png" class="img-inside" height="30px"> </button> <button type="button" class="btn btn-success btn-inside" onclick="href(\'churchRectorRelationMenu.php?id=' . $singleChurch->getID() . '\')"> <img src="../icons/rector.png" class="img-inside" height="30px"> </button>
if (!isset($_POST) || $_POST["idChild"] === NULL) { echo "KO"; die; } $church = ChurchManager::getSingleChurch('name', $_POST["celebrationChurch"]); $child = new Person(); if ($_POST["idChild"] !== '0') { $child = PersonManager::getSinglePerson('id', $_POST["idChild"]); } $child->setId($_POST["idChild"]); $child->setNames($_POST["nameChild"]); $child->setLastname1($_POST["lastname1Child"]); $child->setLastname2($_POST["lastname2Child"]); $child->setAddress($_POST["addressChild"]); $child->setPhoneNumber($_POST["phoneChild"]); $child->setIdCityAddress(CityManager::getSingleCity('name', $_POST["cityChild"])->getId()); $proof = new ProofTalks(); $proof->setId($_POST["idProof"]); $proof->setIdChurch($church->getId()); $typeProof = "B"; if ($_POST["type"] === '1') { $typeProof = "E"; } else { if ($_POST["type"] === '2') { $typeProof = "C"; } else { if ($_POST["type"] === '3') { $typeProof = "X"; } } }
$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(); $civilRegistry->setBook($_POST["bookCivilRegistry"]); $civilRegistry->setPage($_POST["pageCivilRegistry"]); $civilRegistry->setNumber($_POST["numCivilRegistry"]); $civilRegistry->setIdOffice($office->getId()); BaptismManager::addCivilRegistry($civilRegistry); $civilRegistry = BaptismManager::getSingleCivilRegistry('book', $_POST["bookCivilRegistry"], 'page', $_POST["pageCivilRegistry"], 'number', $_POST["numCivilRegistry"], 'idOfficineCivilRegistry', $office->getId()); } $baptism->setIdCivilRegistry(1); if ($civilRegistry !== NULL) { $baptism->setIdCivilRegistry($civilRegistry->getId()); }
<?php require_once __DIR__ . "/../../../Backend/SessionManager.php"; require_once __DIR__ . "/../../../Backend/CityManager.php"; require_once __DIR__ . "/../../../Backend/BaptismManager.php"; if (!isset($_GET) || $_GET["cityName"] === NULL) { echo "KO"; die; } $city = CityManager::getSingleCity('name', $_GET["cityName"]); $number = $_GET["numberCivil"]; $office = new OfficeCivilRegistry(0, $number, $city->getId()); if (BaptismManager::addOfficeCivilRegistry($office)) { echo "OK"; } else { echo "KO"; }