예제 #1
0
function get_parent($parent)
{
    global $datefmt, $tblprefix, $strBorn, $strDied, $restrictdate, $level, $err_father, $err_mother, $grid, $strLivingPerson, $countlines, $outputstring, $htmlstring, $gridsize;
    $peep = new PersonDetail();
    $peep->person_id = $parent;
    $peep->queryType = Q_IND;
    $dao = getPeopleDAO();
    $dao->getPersonDetails($peep);
    // check if there is a parent
    if ($peep->numResults != 1) {
        return;
    } else {
        $per = $peep->results[0];
    }
    $level += 1;
    // ---- position father
    $fhtmlstring = "<div style=\"position: absolute; left: " . a2p($level) . "px;\">";
    $fhtmlstring .= "(" . $level . ") ";
    $nextfather = $per->father->person_id;
    $nextmother = $per->mother->person_id;
    if ($nextfather != 0) {
        get_parent($nextfather);
    }
    $fhtmlstring .= $per->getFullLink();
    $fhtmlstring .= "</div> \n";
    // ---- grid lines
    if ($level > 0) {
        for ($y = 1; $y <= $level - 1; $y += 1) {
            if ($grid[$y] != 0) {
                $fhtmlstring .= "<img alt=\"\" src=\"images/point.gif\" height=\"16\" width=\"1\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
            }
        }
        $fhtmlstring .= "<img alt=\"\" src=\"images/point-";
        if ($per->gender == "M") {
            $fhtmlstring .= "m";
            $grid[$level] = 1;
        } else {
            $fhtmlstring .= "f";
            $grid[$level] = 0;
        }
        $fhtmlstring .= ".gif\" height=\"16\" width=\"" . ($gridsize - 9) . "\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
    }
    // ---- end grid lines
    $fhtmlstring .= "<br> \n";
    $outputstring[] = $fhtmlstring;
    $countlines += 1;
    if ($nextmother != 0) {
        $grid[$level + 1] = 1;
        get_parent($nextmother);
    } else {
        $grid[$level + 1] = 0;
    }
    $level -= 1;
    // end get parents
}
예제 #2
0
function make_Descendants($per)
{
    global $tblprefix, $strBorn, $strDied, $strLivingPerson, $strDeceasedPerson, $grid, $level;
    $level += 1;
    $grid[$level] = 1;
    $lines = 0;
    $per->queryType = Q_IND;
    $dao = getPeopleDAO();
    $dao->getChildren($per);
    foreach ($per->children as $child) {
        echo "<br>\n";
        // textposition
        echo "<div style=\"position: absolute; left: " . a2p($level) . "px;\">";
        echo "({$level}) ";
        $icona = "";
        // MODIFICA 20120506
        if ($child->gender == "M") {
            $icona = "&#923;&nbsp;";
        } else {
            $icona = "&#916;&nbsp;";
        }
        echo $icona . $child->getFullLink();
        echo get_spouse_string($child) . "</div>\n";
        // gridline
        for ($y = 1; $y < $level; $y += 1) {
            // gridsurpression
            if ($grid[$y] != -1) {
                echo "<img alt=\"\" src=\"images/point.gif\" height=\"16\" width=\"1\" style=\"position: absolute; left: " . (a2p($y) - 25) . "px;\" border=\"0\">\n";
            }
        }
        // Arrows:
        $totalrows = count($per->children);
        $lines += 1;
        // if not last in array T-arrow:
        if ($totalrows != $lines) {
            echo "<img alt=\"\" src=\"images/point-d.gif\" height=\"16\" width=\"21\" style=\"position: absolute; left: " . (a2p($level) - 25) . "px;\" border=\"0\">\n";
        } else {
            // Final L-arrow if last in array
            echo "<img alt=\"\" src=\"images/point-l.gif\" height=\"16\" width=\"21\" style=\"position: absolute; left: " . (a2p($level) - 25) . "px;\" border=\"0\">\n";
            $grid[$level] = -1;
        }
        make_Descendants($child);
        $level -= 1;
    }
}