";
print "\n";
$numkids = 0;
$famids = find_sfamily_ids($pid);
if (count($famids)>0) {
$firstkids = 0;
foreach($famids as $indexval => $famid) {
$famrec = find_family_record($famid, WT_GED_ID);
$ct = preg_match_all("/1 CHIL @(.*)@/", $famrec, $match, PREG_SET_ORDER);
if ($ct>0) {
print "\n";
for($i=0; $i<$ct; $i++) {
$rowspan = 2;
if (($i>0)&&($i<$ct-1)) $rowspan=1;
$chil = trim($match[$i][1]);
print "| \n";
if ($count < $dgenerations-1) {
$kids = print_descendency($chil, $count+1);
if ($i==0) $firstkids = $kids;
$numkids += $kids;
}
else {
print_pedigree_person($chil);
$numkids++;
}
print " | \n";
$twidth = 7;
if ($ct==1) $twidth+=3;
print " | \n";
if ($ct>1) {
if ($i==0) {
print " | \n";
print " | \n";
}
else if ($i==$ct-1) {
print " | \n";
print " | \n";
}
else {
print " | \n";
}
}
print " \n";
}
print " \n";
}
}
print " | \n";
print "\n";
}
// NOTE: If statement OK
if ($numkids==0) {
$numkids = 1;
$tbwidth = $bwidth+16;
for($j=$count; $j<$dgenerations; $j++) {
print " | \n\n";
}
}
//-- add offset divs to make things line up better
if ($show_spouse) {
foreach($famids as $indexval => $famid) {
$famrec = find_family_record($famid, WT_GED_ID);
if (!empty($famrec)) {
$marrec = get_sub_record(1, "1 MARR", $famrec);
if (!empty($marrec)) {
print " ";
}
print "
\n";
}
}
}
print_pedigree_person($pid);
// NOTE: If statement OK
if ($show_spouse) {
foreach($famids as $indexval => $famid) {
$famrec = find_family_record($famid, WT_GED_ID);
if (!empty($famrec)) {
$parents = find_parents_in_record($famrec);
$marrec = get_sub_record(1, "1 MARR", $famrec);
if (!empty($marrec)) {
print " ";
$marriage = new Event($marrec);
$marriage->print_simple_fact();
}
if ($parents["HUSB"]!=$pid) print_pedigree_person($parents["HUSB"]);
else print_pedigree_person($parents["WIFE"]);
}
}
}
// NOTE: If statement OK
if ($count==0) {
$indirec = find_person_record($pid, WT_GED_ID);
// NOTE: If statement OK
if (displayDetailsById($pid, 'INDI') || showLivingNameById($pid)) {
// -- print left arrow for decendants so that we can move down the tree
$famids = find_sfamily_ids($pid);
//-- make sure there is more than 1 child in the family with parents
$cfamids = find_family_ids($pid);
$num=0;
// NOTE: For statement OK
for($f=0; $f1)) {
print "\n\t\t";
if ($view!="preview") {
print " ";
print " ";
print "";
}
print "\n\t\t ";
print "\n\t\t\t ";
for($f=0; $fgetFullName();
print "\n\t\t\t\t";
print PrintReady($name);
print " ";
}
}
$num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER);
for($i=0; $i<$num; $i++) {
//-- add the following line to stop a bad PHP bug
if ($i>=$num) break;
$cid = $smatch[$i][1];
$child=Person::getInstance($cid);
$name=$child->getFullName();
print "\n\t\t\t\t < ";
print PrintReady($name);
print " ";
}
}
}
//-- print the siblings
for($f=0; $f ".i18n::translate('Parents')." ";
if (!empty($parents["HUSB"])) {
$spid = $parents["HUSB"];
$spouse=Person::getInstance($spid);
$name=$spouse->getFullName();
print "\n\t\t\t\t ";
print PrintReady($name);
print " ";
}
if (!empty($parents["WIFE"])) {
$spid = $parents["WIFE"];
$spouse=Person::getInstance($spid);
$name=$spouse->getFullName();
print "\n\t\t\t\t ";
print PrintReady($name);
print " ";
}
}
$num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER);
if ($num>2) print " ".i18n::translate('Siblings')." ";
if ($num==2) print " ".i18n::translate('Sibling')." ";
for($i=0; $i<$num; $i++) {
//-- add the following line to stop a bad PHP bug
if ($i>=$num) break;
$cid = $smatch[$i][1];
if ($cid!=$pid) {
$child=Person::getInstance($cid);
$name=$child->getFullName();
print "\n\t\t\t\t ";
print PrintReady($name);
print " ";
}
}
}
}
print "\n\t\t\t |
";
print "\n\t\t ";
print "\n\t\t ";
}
}
}
print " |
\n";
print "