$witness1->setLastname1($_POST["lastname1Witness1"]);
        $witness1->setLastname2($_POST["lastname2Witness1"]);
        PersonManager::addPerson($witness1, 'true');
        $witness1 = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
    $marriage->setIdWitness1($witness1->getId());
}
//Process The Witness1
if ($_POST["nameWitness2"] !== '') {
    $witness2 = PersonManager::getSinglePerson('names', $_POST["nameWitness2"], 'lastname1', $_POST["lastname1Witness2"], 'lastname2', $_POST["lastname2Witness2"]);
    if ($witness2 === NULL) {
        $witness2 = new Person();
        $witness2->setNames($_POST["nameWitness2"]);
        $witness2->setLastname1($_POST["lastname1Witness2"]);
        $witness2->setLastname2($_POST["lastname2Witness2"]);
        PersonManager::addPerson($witness2, 'true');
        $witness2 = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
    $marriage->setIdWitness2($witness2->getId());
}
//Get The Book Registry Data
$reverse = substr($_POST["reverseBookRegistry"], 0, 1);
if ($reverse === 'Y' || $reverse === 'S') {
    $reverse = 'Y';
}
$bookRegistry = MarriageManager::getSingleMarriageRegistry('book', $_POST["bookBookRegistry"], 'page', $_POST["pageBookRegistry"], 'number', $_POST["numBookRegistry"], 'reverse', $reverse);
if ($bookRegistry === NULL) {
    $bookRegistry = new MarriageRegistry();
    $bookRegistry->setBook($_POST["bookBookRegistry"]);
    $bookRegistry->setPage($_POST["pageBookRegistry"]);
    $bookRegistry->setNumber($_POST["numBookRegistry"]);
Ejemplo n.º 2
0

  <?php 
//VÄRVIDE LISAMINE
//uus instants klassist
$ColorManager = new ColorManager($mysqli);
$PersonManager = new PersonManager($mysqli);
//aadressirealt muutuja
if (isset($_GET["new_color"])) {
    $add_new_color = $ColorManager->addColor($_GET["new_color"]);
    var_dump($add_new_color);
}
//rippmenüü valiku kõrval vajutati nuppu
if (isset($_POST["add_person"])) {
    var_dump($_POST);
    $add_new_person_response = $PersonManager->addPerson($_POST["new_dd_selection"], $_POST["date_time"], $_POST["gender"], $POST["add_person"]);
}
?>
	


<h2>Lisa uus värv</h2>
  <?php 
if (isset($add_new_color_response->error)) {
    ?>

  
	<p style="color:red;">
		<?php 
    echo $add_new_color_response->error->message;
    ?>
Ejemplo n.º 3
0
        $godFather = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
    $proof->setIdGodFather($godFather->getId());
} else {
    $proof->setIdGodFather(NULL);
}
//Process The GodFather
if ($_POST["nameGodMother"] !== '') {
    $godMother = PersonManager::getSinglePerson('names', $_POST["nameGodMother"], 'lastname1', $_POST["lastname1GodMother"], 'lastname2', $_POST["lastname2GodMother"]);
    if ($godMother === NULL) {
        $godMother = new Person();
        $godMother->setNames($_POST["nameGodMother"]);
        $godMother->setLastname1($_POST["lastname1GodMother"]);
        $godMother->setLastname2($_POST["lastname2GodMother"]);
        $godMother->setGender('F');
        PersonManager::addPerson($godMother, 'true');
        $godMother = PersonManager::getSinglePerson('id', PersonManager::getLastID());
    }
    $proof->setIdGodMother($godMother->getId());
} else {
    $proof->setIdGodMother(NULL);
}
//Add the registry
if ($_SESSION["user_type"] != 'A') {
    if ($_SESSION["user_church"] == $church->getId()) {
        if ($_POST["status"] === 'insert') {
            if (ProofManager::addProofTalks($proof)) {
                echo "OK";
            } else {
                echo "KO";
            }
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/RectorManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
require_once __DIR__ . "/../../../Backend/PersonManager.php";
if (!isset($_GET) || $_GET["name"] === NULL) {
    echo "KO";
    die;
}
$status = $_GET["status"];
$rector = new Rector();
$person = PersonManager::getSinglePerson('names', $_GET["name"], 'lastname1', $_GET["lastname1"], 'lastname2', $_GET["lastname2"]);
if ($person === NULL) {
    $person = new Person(0, $_GET["name"], $_GET["lastname1"], $_GET["lastname2"]);
    PersonManager::addPerson($person);
    $person = PersonManager::getSinglePerson('names', $_GET["name"], 'lastname1', $_GET["lastname1"], 'lastname2', $_GET["lastname2"]);
}
$church = ChurchManager::getSingleChurch('name', $_GET["actualChurch"]);
$rector->setIdPerson($person->getId());
$rector->setType($_GET["type"]);
$rector->setPosition($_GET["position"]);
$rector->setIdActualChurch($church->getId());
if ($_GET["statusR"] === 'Activo' || $_GET["statusR"] === 'Active') {
    $rector->setStatus('A');
} else {
    $rector->setStatus('I');
}
if ($status === 'update') {
    $rector->setId($_GET["id"]);
    if (RectorManager::updateRector($rector)) {