} 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()); }
<th style="text-align: center;">^Vicar^</th> <th style="text-align: center;">^Dean^</th> <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() . '\')">