/**
  * Constructor of the Class
  *
  * @author Jonathan Sandoval <*****@*****.**>
  * @param  integer $idUser    idUser
  * @param  integer $idChurch  idChurch
  * @param  boolean $full      full document
  */
 function __construct($idUser = 0, $idChurch = 0)
 {
     //Define the constructor
     parent::FPDF('L', 'mm', 'Letter');
     $this->church = ChurchManager::getSingleChurch('id', $idChurch);
     $this->user = SessionManager::getSingleUser('id', $idUser);
 }
                 <tr style="text-align: center;">
                     <th style="text-align: center;">^Fullname^</th>
                     <th style="text-align: center;">^Name Church^</th>
                     <th style="text-align: center;">^Options^</th>
                 </tr>
                </thead>';
 $table = $table . $header;
 $table = $table . '<tbody>';
 $i = 0;
 foreach ($defuntionRegistries as $singleDefuntion) {
     if ($i === 10) {
         continue;
     }
     $child = PersonManager::getSinglePerson('id', $singleDefuntion->getIdOwner());
     $nameChild = $child->getFullName();
     $church = ChurchManager::getSingleChurch('id', $singleDefuntion->getIdChurch());
     if ($_SESSION["user_type"] == 'A' || $singleDefuntion->getIdChurch() == $_SESSION["user_church"]) {
         $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                             <button type="button" class="btn btn-success btn-inside" onclick="href(\'defuntionLook.php?id=' . $singleDefuntion->getID() . '\')">
                                 <img src="../icons/eye.png" class="img-inside" height="30px">
                             </button>
                             <button type="button" class="btn btn-success btn-inside" onclick="href(\'defuntionChange.php?id=' . $singleDefuntion->getID() . '\')">
                                 <img src="../icons/refresh.png" class="img-inside" height="30px">
                             </button>
                             <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'defuntion\', \'' . $singleDefuntion->getID() . '\')">
                                 <img src="../icons/delete.png" class="img-inside" height="30px">
                             </button>
                         </td>';
     } else {
         $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                             <button type="button" class="btn btn-success btn-inside" onclick="href(\'defuntionLook.php?id=' . $singleDefuntion->getID() . '\')">
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/RectorManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
require_once __DIR__ . "/../../../Backend/MarriageManager.php";
require_once __DIR__ . "/../../../Backend/PersonManager.php";
if (!isset($_POST) || $_POST["idBoyfriend"] == NULL) {
    echo "KO";
    die;
}
$churchMarriage = ChurchManager::getSingleChurch('name', $_POST["celebrationChurch"]);
$churchProcess = ChurchManager::getSingleChurch('name', $_POST["processChurch"]);
$boyfriend = new Person();
if ($_POST["idBoyfriend"] !== '0') {
    $boyfriend = PersonManager::getSinglePerson('id', $_POST["idBoyfriend"]);
}
$girlfriend = new Person();
if ($_POST["idGirlfriend"] !== '0') {
    $girlfriend = PersonManager::getSinglePerson('id', $_POST["idGirlfriend"]);
}
$boyfriend->setId($_POST["idBoyfriend"]);
$boyfriend->setNames($_POST["boyfriendName"]);
$boyfriend->setLastname1($_POST["lastname1Boyfriend"]);
$boyfriend->setLastname2($_POST["lastname2Boyfriend"]);
$girlfriend->setId($_POST["idGirlfriend"]);
$girlfriend->setNames($_POST["girlfriendName"]);
$girlfriend->setLastname1($_POST["lastname1Girlfriend"]);
$girlfriend->setLastname2($_POST["lastname2Girlfriend"]);
$marriage = new Marriage();
$marriage->setId($_POST["idMarriage"]);
require_once __DIR__ . "/../../Backend/SessionManager.php";
require_once __DIR__ . "/../../Backend/ChurchManager.php";
require_once __DIR__ . "/../../Backend/PersonManager.php";
require_once __DIR__ . "/../../Backend/LanguageSupport.php";
SessionManager::validateUserInPage('churchChange.php');
//Get File contest from template
$string = file_get_contents("template/ChurchInsertion.html");
if (!isset($_GET) || $_GET["id"] === NULL) {
    echo "<script src='../JS/functions.js'></script><script>href('main.php')</script>";
}
//Remplace the nav
$string = str_replace("|title|", 'Change Church', $string);
$string = str_replace("|NavBar|", SessionManager::getNavBar(), $string);
$idChurch = $_GET["id"];
$church = ChurchManager::getSingleChurch('id', $idChurch);
if ($church === NULL) {
    echo "<script src='../JS/functions.js'></script><script>href('churchMenu.php')</script>";
}
//Create a String of options of Vicars
$vicarString = "";
$vicars = ChurchManager::getAllVicars();
foreach ($vicars as $singleVicar) {
    if ($church->getIdVicar() === $singleVicar->getId()) {
        $vicarString = $vicarString . "<option selected> " . $singleVicar->getName() . "</option>\n";
    } else {
        $vicarString = $vicarString . "<option> " . $singleVicar->getName() . "</option>\n";
    }
}
$string = str_replace("|VicarOptions|", $vicarString, $string);
//Create a String of options of Deans
예제 #5
0
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
if (!isset($_POST) || $_POST["username"] === NULL) {
    echo "KO";
    die;
}
$user = new User();
$church = ChurchManager::getSingleChurch('name', $_POST["church"]);
$user->setPassword(sha1($_POST["password"]));
$user->setUsername($_POST["username"]);
if ($_POST["type"] == '0') {
    $user->setType('A');
} else {
    $user->setType('G');
}
$user->setLanguage("es");
$user->setIdChurch($church->getId());
if (SessionManager::addUser($user)) {
    echo "OK";
} else {
    echo "KO";
}
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/RectorManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
if (!isset($_GET) || $_GET["nameChuch"] === NULL) {
    echo "KO";
    die;
}
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"]);
예제 #7
0
                     <th style="text-align: center;">^Name Church^</th>
                     <th style="text-align: center;">^Type^</th>
                     <th style="text-align: center;">^Options^</th>
                 </tr>
                </thead>';
 $table = $table . $header;
 $table = $table . '<tbody>';
 $i = 0;
 foreach ($userRegistries as $singleUser) {
     if ($i === 10) {
         continue;
     }
     $username = $singleUser->getUsername();
     $type = $singleUser->getType();
     $offline = $singleUser->getOffline();
     $church = ChurchManager::getSingleChurch('id', $singleUser->getIdChurch());
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'userMessage.php?id=' . $singleUser->getID() . '\')">
                             <img src="../icons/message.png" class="img-inside" height="30px">
                         </button>
                     </td>';
     if ($_SESSION["user_id"] == $singleUser->getId()) {
         $options = '';
     }
     if ($offline == '1') {
         $offline = "^Offline^";
     } else {
         $offline = "^Online^";
     }
     if ($type == 'A') {
         $type = '^Administrator^';
예제 #8
0
 if ($i === 10) {
     continue;
 }
 $child = PersonManager::getSinglePerson('id', $singleProof->getIdOwner());
 $nameChild = $child->getFullName();
 $mother = PersonManager::getSinglePerson('id', $child->getIdMother());
 $nameMother = "";
 if ($mother != NULL) {
     $nameMother = $mother->getFullName();
 }
 $father = PersonManager::getSinglePerson('id', $child->getIdFather());
 $nameFather = "";
 if ($father != NULL) {
     $nameFather = $father->getFullName();
 }
 $church = ChurchManager::getSingleChurch('id', $singleProof->getIdChurch());
 if ($_SESSION["user_type"] == 'A' || $singleProof->getIdChurch() == $_SESSION["user_church"]) {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'proofLook.php?id=' . $singleProof->getID() . '\')">
                             <img src="../icons/eye.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'proofChange.php?id=' . $singleProof->getID() . '\')">
                             <img src="../icons/refresh.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'proof\', \'' . $singleProof->getID() . '\')">
                             <img src="../icons/delete.png" class="img-inside" height="30px">
                         </button>
                     </td>';
 } else {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'proofLook.php?id=' . $singleProof->getID() . '\')">
                     <th style="text-align: center;">^Status^</th>
                     <th style="text-align: center;">^Position^</th>
                     <th style="text-align: center;">^Actual Church^</th>
                     <th style="text-align: center;">^Options^</th>
                 </tr>
                </thead>';
 $table = $table . $header;
 $table = $table . '<tbody>';
 $i = 0;
 foreach ($rectorRegistries as $singleRector) {
     if ($i === 10) {
         continue;
     }
     $person = PersonManager::getSinglePerson('id', $singleRector->getIdPerson());
     $name = $person->getFullName();
     $church = ChurchManager::getSingleChurch('id', $singleRector->getIdActualChurch());
     $status = "Active";
     if ($singleRector->getStatus() !== 'A') {
         $status = "Inactive";
     }
     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(\'rectorLook.php?id=' . $singleRector->getID() . '\')">
                                 <img src="../icons/eye.png" class="img-inside" height="30px">
                             </button>
                             <button type="button" class="btn btn-success btn-inside" onclick="href(\'rectorChange.php?id=' . $singleRector->getID() . '\')">
                                 <img src="../icons/refresh.png" class="img-inside" height="30px">
                             </button>
                             <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'rector\', \'' . $singleRector->getID() . '\')">
                                 <img src="../icons/delete.png" class="img-inside" height="30px">
                             </button>
예제 #10
0
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/RectorManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
require_once __DIR__ . "/../../../Backend/ProofManager.php";
require_once __DIR__ . "/../../../Backend/PersonManager.php";
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') {
        $churchString = $churchString . "<option> " . $singleChurch->getName() . "</option>\n";
    }
}
$string = str_replace("|ChurchOption|", $churchString, $string);
$saveButton = '';
$cancelButton = '';
$returnButton = '<button type="button" class="btn btn-success" onclick=\'href("defuntionMenu.php")\'>
                        <img src="../icons/return.png" width="50px"><br>
                        <strong>^Return^</strong>
                    </button>';
//Create a action for button cancel
$string = str_replace("|SaveButton|", $saveButton, $string);
$string = str_replace("|CancelButton|", $cancelButton, $string);
$string = str_replace("|ReturnButton|", $returnButton, $string);
//Recuperamos la iglesia
$church = ChurchManager::getSingleChurch('id', $churchId);
if ($church !== NULL) {
    if ($church->getIdNiche() !== NULL) {
        if ($defuntion->getIdCrypt() !== NULL) {
            $cryptData = DefuntionManager::getSingleCrypt('id', $defuntion->getIdCrypt());
            //Load Crypt Data
            $string = str_replace('value="col"', 'value="' . $cryptData->getCol() . '"', $string);
            $string = str_replace('value="row"', 'value="' . $cryptData->getRow() . '"', $string);
            $string = str_replace('value="size"', 'value="' . $cryptData->getNumber() . '"', $string);
            $idCrypt = $defuntion->getIdCrypt();
            //Display the page
            $string = LanguageSupport::HTMLEvalLanguage($string);
            echo $string;
            //put the data of the crypt
            echo "<script>\n                        document.getElementById('inputCrypt').checked = true;\n                        checkCrypt();\n                        \$('#idCrypt').html('{$idCrypt}');\n                      </script>";
        } else {
                     <th style="text-align: center;">^Name Church^</th>
                     <th style="text-align: center;">^Options^</th>
                 </tr>
                </thead>';
 $table = $table . $header;
 $table = $table . '<tbody>';
 $i = 0;
 foreach ($marriageRegistries as $singleMarriage) {
     if ($i === 10) {
         continue;
     }
     $boyf = PersonManager::getSinglePerson('id', $singleMarriage->getIdBoyfriend());
     $nameboyf = $boyf->getFullName();
     $girlf = PersonManager::getSinglePerson('id', $singleMarriage->getIdGirlfriend());
     $namegirlf = $girlf->getFullName();
     $church = ChurchManager::getSingleChurch('id', $singleMarriage->getIdChurchMarriage());
     if ($_SESSION["user_type"] == 'A' || $singleMarriage->getIdChurchMarriage() == $_SESSION["user_church"] || $singleMarriage->getIdChurchProcess() == $_SESSION["user_church"]) {
         $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'marriageLook.php?id=' . $singleMarriage->getID() . '\')">
                             <img src="../icons/eye.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'marriageChange.php?id=' . $singleMarriage->getID() . '\')">
                             <img src="../icons/refresh.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'marriage\', \'' . $singleMarriage->getID() . '\')">
                             <img src="../icons/delete.png" class="img-inside" height="30px">
                         </button>
                     </td>';
     } else {
         $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'marriageLook.php?id=' . $singleMarriage->getID() . '\')">
 if ($i === 10) {
     continue;
 }
 $child = PersonManager::getSinglePerson('id', $singleConfirmation->getIdOwner());
 $nameChild = $child->getFullName();
 $mother = PersonManager::getSinglePerson('id', $child->getIdMother());
 $nameMother = "";
 if ($mother != NULL) {
     $nameMother = $mother->getFullName();
 }
 $father = PersonManager::getSinglePerson('id', $child->getIdFather());
 $nameFather = "";
 if ($father != NULL) {
     $nameFather = $father->getFullName();
 }
 $church = ChurchManager::getSingleChurch('id', $singleConfirmation->getIdChurch());
 if ($_SESSION["user_type"] == 'A' || $singleConfirmation->getIdChurch() == $_SESSION["user_church"]) {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'confirmationLook.php?id=' . $singleConfirmation->getID() . '\')">
                             <img src="../icons/eye.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'confirmationChange.php?id=' . $singleConfirmation->getID() . '\')">
                             <img src="../icons/refresh.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'confirmation\', \'' . $singleConfirmation->getID() . '\')">
                             <img src="../icons/delete.png" class="img-inside" height="30px">
                         </button>
                     </td>';
 } else {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'confirmationLook.php?id=' . $singleConfirmation->getID() . '\')">
<?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["nameChurch"] === NULL) {
    die;
}
$church = ChurchManager::getSingleChurch('name', $_GET["nameChurch"]);
$rectors = RectorManager::getAllFormerRectors($church->getId());
$response = "";
if ($rectors !== NULL) {
    foreach ($rectors as $singleRector) {
        $person = PersonManager::getSinglePerson('id', $singleRector->getIdPerson());
        $nameRector = $person->getFullNameBeginName();
        $response = $response . "<li><a value='" . $singleRector->getId() . "' onclick='changeParent(\"" . $singleRector->getId() . "\", " . " \" " . $nameRector . " \")'>" . "{$nameRector}</a></li>";
    }
}
echo $response;
예제 #15
0
 if ($i === 10) {
     continue;
 }
 $child = PersonManager::getSinglePerson('id', $singleBaptism->getIdOwner());
 $nameChild = $child->getFullName();
 $mother = PersonManager::getSinglePerson('id', $child->getIdMother());
 $nameMother = "";
 if ($mother != NULL) {
     $nameMother = $mother->getFullName();
 }
 $father = PersonManager::getSinglePerson('id', $child->getIdFather());
 $nameFather = "";
 if ($father != NULL) {
     $nameFather = $father->getFullName();
 }
 $church = ChurchManager::getSingleChurch('id', $singleBaptism->getIdChurch());
 if ($_SESSION["user_type"] == 'A' || $singleBaptism->getIdChurch() == $_SESSION["user_church"]) {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                     <button type="button" class="btn btn-success btn-inside" onclick="href(\'baptismLook.php?id=' . $singleBaptism->getID() . '\')">
                         <img src="../icons/eye.png" class="img-inside" height="30px">
                     </button>
                     <button type="button" class="btn btn-success btn-inside" onclick="href(\'baptismChange.php?id=' . $singleBaptism->getID() . '\')">
                         <img src="../icons/refresh.png" class="img-inside" height="30px">
                     </button>
                     <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'baptism\', \'' . $singleBaptism->getID() . '\')">
                         <img src="../icons/delete.png" class="img-inside" height="30px">
                     </button>
                 </td>';
 } else {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                     <button type="button" class="btn btn-success btn-inside" onclick="href(\'baptismLook.php?id=' . $singleBaptism->getID() . '\')">
<?php

require_once __DIR__ . "/../../../Backend/SessionManager.php";
require_once __DIR__ . "/../../../Backend/RectorManager.php";
require_once __DIR__ . "/../../../Backend/ChurchManager.php";
if (!isset($_GET) || $_GET["idChurch"] === NULL) {
    echo "KO";
} else {
    $church = ChurchManager::getSingleChurch("id", $_GET["idChurch"]);
    if ($church === NULL) {
        echo "KO";
    } else {
        if (!isset($_SESSION) || $_SESSION["user_church"] === NULL) {
            echo "KO";
        } else {
            //Check for permision
            if ($_SESSION["user_type"] == 'A') {
                if (ChurchManager::removeChurch($church)) {
                    echo "OK";
                } else {
                    echo "KO";
                }
            }
        }
    }
}
 if ($i === 10) {
     continue;
 }
 $child = PersonManager::getSinglePerson('id', $singleCommunion->getIdOwner());
 $nameChild = $child->getFullName();
 $mother = PersonManager::getSinglePerson('id', $child->getIdMother());
 $nameMother = "";
 if ($mother != NULL) {
     $nameMother = $mother->getFullName();
 }
 $father = PersonManager::getSinglePerson('id', $child->getIdFather());
 $nameFather = "";
 if ($father != NULL) {
     $nameFather = $father->getFullName();
 }
 $church = ChurchManager::getSingleChurch('id', $singleCommunion->getIdChurch());
 if ($_SESSION["user_type"] == 'A' || $singleCommunion->getIdChurch() == $_SESSION["user_church"]) {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'communionLook.php?id=' . $singleCommunion->getID() . '\')">
                             <img src="../icons/eye.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'communionChange.php?id=' . $singleCommunion->getID() . '\')">
                             <img src="../icons/refresh.png" class="img-inside" height="30px">
                         </button>
                         <button type="button" class="btn btn-success btn-inside" onclick="deleteObject(\'communion\', \'' . $singleCommunion->getID() . '\')">
                             <img src="../icons/delete.png" class="img-inside" height="30px">
                         </button>
                     </td>';
 } else {
     $options = '<td data-title="^Options^" class="center-btn" style="text-align: center">
                         <button type="button" class="btn btn-success btn-inside" onclick="href(\'communionLook.php?id=' . $singleCommunion->getID() . '\')">