Your IP : 216.73.217.64


Current Path : /home3/gp97/nou.97gp.net/app/controller/
Upload File :
Current File : //home3/gp97/nou.97gp.net/app/controller/relationsController.php

<?php
require_once  __DIR__ . "/../model/relations.php";

include_once(__DIR__ . "/../../include/marriage_cls.php");
include_once(__DIR__ . "/../../include/language_date.php");
include_once(__DIR__ . "/../../include/date_place.php");

class RelationsController
{
    //private $db_functions, $user;

    /*
    public function __construct($db_functions, $user)
    {
        $this->db_functions = $db_functions;
        $this->user = $user;
    }
    */

    public function getRelations($db_functions, $person_cls)
    {
        $RelationsModel = new RelationsModel();

        $RelationsModel->resetValues();
        $RelationsModel->checkInput();

        $get_persons = $RelationsModel->getSelectedPersons($db_functions, $person_cls);
        $get_names = $RelationsModel->getNames();
        $get_GEDCOMnumbers = $RelationsModel->getGEDCOMnumbers();

        //$relation = array(
        //    "title" => __('Relationship calculator')
        //);

        // *** Add array $person_data:
        //$relation = array_merge($relation, $get_persons);
        $relation = $get_persons;
        $relation = array_merge($relation, $get_names);
        $relation = array_merge($relation, $get_GEDCOMnumbers);

        $switch_persons = $RelationsModel->switchPersons($relation);
        if (isset($switch_persons)) {
            $relation = array_merge($relation, $switch_persons);
        }

        return $relation;
    }
}