function make_Descendants($per, $linee = false) { global $tblprefix, $strBorn, $strDied, $strLivingPerson, $strDeceasedPerson, $grid, $level; $level += 1; $grid[$level] = 1; $lines = 0; $per->queryType = Q_IND; $dao = getPeopleDAO(); $dao->getChildren($per); /* // $linee[]=$per->person_id; $arr = array(); // while ($segment = array_pop($path)) { $tmp = array($per->person_id => $per->getDisplayName()); //} $arr = $tmp; print_r($arr); // viewarray($arr); exit; */ if (isset($per->children)) { foreach ($per->children as $child) { /* $arr = array(); $tmp = array($per->person_id => $per->getDisplayName()); $arr = $tmp; */ $ln = ""; // gridline for ($y = 1; $y < $level; $y += 1) { // gridsurpression if ($grid[$y] != -1) { $ln .= "I"; // "|"; // │"; } else { $ln .= "S"; // "."; } } // Arrows: $totalrows = count($per->children); $lines += 1; // if not last in array T-arrow: if ($totalrows != $lines) { $ln .= "T"; // "-"; //├"; } else { // Final L-arrow if last in array $ln .= "L"; // "_"; // └"; $grid[$level] = -1; } // textposition //$ln.=a2p($level); $ln .= "({$level}) "; $icona = ""; // MODIFICA 20120506 if ($child->gender == "M") { $icona = "* "; //Λ "; } else { $icona = "o "; //Δ "; } $ln .= $icona . $child->getDisplayName(); $ln .= get_spouse_string($child); $linee[] = $ln; /* $tmp = array($child->person_id => $ln); $arr[]=$tmp; // viewarray($arr); exit; */ // viewarray($linee); $linee = make_Descendants($child, $linee); $level -= 1; } return $linee; // completato } else { return $linee; } }
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 = "Λ "; } else { $icona = "Δ "; } 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; } }