/** * update one ProofTalks in the database * * @author Jonathan Sandoval <*****@*****.**> * @param ProofTalks $ProofTalks The ProofTalks to update * @return boolean If was posible to update */ static function updateProofTalks($ProofTalks = null) { if ($ProofTalks === null) { return false; } $tableProofTalks = DatabaseManager::getNameTable('TABLE_PROFF_TALKS'); $idOwner = $ProofTalks->getIdOwner(); $type = $ProofTalks->getType(); $id = $ProofTalks->getId(); $idGodFather = $ProofTalks->getIdGodFather(); $idGodMother = $ProofTalks->getIdGodMother(); $idChurch = $ProofTalks->getIdChurch(); if ($idGodFather === NULL) { $idGodFather = 'NULL'; } if ($idGodMother === NULL) { $idGodMother = 'NULL'; } $query = "UPDATE {$tableProofTalks}\r\n SET idOwner = '{$idOwner}', type = '{$type}', idGodMother = {$idGodMother}, \r\n idGodFather = {$idGodFather}, idChurch = '{$idChurch}'\r\n WHERE {$tableProofTalks}.id = {$id}"; $person = PersonManager::getSinglePerson("id", $idOwner); ChangesLogsManager::addChangesLogs("C", "Comprobante de " . $person->getFullNameBeginName()); return DatabaseManager::singleAffectedRow($query); }
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"; } } } $proof->setType($typeProof);
$numberPage = intval($_GET["page"]); $sortType = $_GET["sort"]; $simpleKeyword = $_GET["keyword"]; $kid = $_GET["kid"]; if ($sortType == NULL || $sortType == '') { $sortType = 'id'; } if ($numberPage === NULL || $numberPage < 0) { echo "<script src='../JS/functions.js'></script><script>nextPage('set', '0')</script>"; } //Getting all registries if ($simpleKeyword !== NULL) { $proofRegistries = ProofManager::simpleSearchProof($simpleKeyword, $sortType, $numberPage); } else { if ($kid !== NULL) { $proofSearch = new ProofTalks(); $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"]; $ktype = $_GET["ktype"]; $posibleNames[0] = PersonManager::searchPersonsByNames($knamec, $klastname1c, $klastname2c, false); $posibleNames[1] = PersonManager::searchPersonsByNames($knamef, $klastname1f, $klastname2f, false); $posibleNames[2] = PersonManager::searchPersonsByNames($knamem, $klastname1m, $klastname2m, false); $proofSearch->setIdOwner($posibleNames);