Ejemplo n.º 1
0
/**
 * @access public
 * @param string $p_node
 * @param integer $p_generation
 */
function process_indiv($p_node, $p_generation)
{
    global $g_generation, $individuals;
    $father = $p_node->father_indkey ? new Person($p_node->father_indkey, 3) : null;
    $mother = $p_node->mother_indkey ? new Person($p_node->mother_indkey, 3) : null;
    # increment $g_generation if generation has changed
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
    }
    $individual['generation'] = $g_generation;
    $individual['generation_title'] = sprintf(gtc("Generation %s"), $g_generation);
    $individual['ns_number'] = $p_node->ns_number;
    $individual['name_link'] = '<a href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $p_node->indkey . '">' . $p_node->full_name() . '</a>';
    $individual['parent_sentence'] = get_parents_sentence($p_node, $father, $mother);
    $individual['birth_sentence'] = get_birth_sentence($p_node);
    $individual['marriage_sentence'] = get_marriage_sentences($p_node);
    $individual['death_sentence'] = get_death_sentence($p_node);
    $individuals[] = $individual;
}
Ejemplo n.º 2
0
function display_indiv($p_array)
{
    global $g_content, $g_descendants, $g_generation, $g_max_gens, $g_count, $individuals;
    $string = '';
    $p_node = $p_array[0];
    $p_generation = $p_array[1];
    $father = $p_node->father_indkey ? new Person($p_node->father_indkey, 3) : null;
    $mother = $p_node->mother_indkey ? new Person($p_node->mother_indkey, 3) : null;
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
    }
    # children
    foreach ($p_node->marriages as $marriage) {
        $spouse = !empty($marriage->spouse) ? new Person($marriage->spouse, 3) : null;
        if ($marriage->child_count > 0) {
            $string .= '<br />' . "\n";
            $string .= get_children_of_sentence($p_node, $spouse) . ':<br />';
            foreach ($marriage->children as $child_indkey) {
                $child = new Person($child_indkey);
                if ($child->marriage_count > 0) {
                    foreach ($child->marriages as $cmarriage) {
                        if ($cmarriage->child_count > 0) {
                            $child->ns_number = $g_count + 1;
                            $child_gen = $p_generation + 1;
                            if ($child_gen > $g_max_gens) {
                                break;
                            }
                            array_push($g_descendants, array($child, $child_gen));
                            $g_count++;
                            break;
                        }
                    }
                }
                $child_nk = '<a class="secondary" href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $child->indkey . '">' . $child->full_name() . '</a>';
                if ($child->ns_number) {
                    $string .= '<ol><li value="' . $child->ns_number . '">' . $child_nk;
                    if ($child->birth && $child->birth->date || $child->death && $child->death->date) {
                        $string .= '&nbsp;&nbsp;';
                        if ($child->birth && $child->birth->date) {
                            $string .= gtc("b.") . ' ' . $child->birth->date . ' ';
                        }
                        if ($child->death && $child->death->date) {
                            $string .= gtc("d.") . ' ' . $child->death->date;
                        }
                    }
                    $string .= '</li></ol>';
                } else {
                    $string .= '<ul><li class="nobullet">' . $child_nk . '</li></ul>';
                }
            }
        }
    }
    $string .= '</li></ol>';
    $individual['generation'] = $p_generation;
    $individual['generation_title'] = sprintf(gtc("Generation %s"), $g_generation);
    $individual['ns_number'] = $p_node->ns_number;
    $individual['name_link'] = '<a href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $p_node->indkey . '">' . $p_node->full_name() . '</a>';
    $individual['parent_sentence'] = get_parents_sentence($p_node, $father, $mother);
    $individual['birth_sentence'] = get_birth_sentence($p_node);
    $individual['marriage_sentence'] = get_marriage_sentences($p_node);
    $individual['death_sentence'] = get_death_sentence($p_node);
    $individual['children_string'] = $string;
    $individuals[] = $individual;
}
Ejemplo n.º 3
0
function display_indiv($p_array)
{
    global $pdf, $g_descendants, $g_generation, $g_max_gens, $font;
    $gencol = 13;
    $factcol = 30;
    $childcol = 40;
    $birthcol = 100;
    $deathcol = 150;
    $p_node = $p_array[0];
    $p_generation = $p_array[1];
    if ($p_node->father_indkey) {
        $father = new Person($p_node->father_indkey, 3);
    } else {
        $father = null;
    }
    if ($p_node->mother_indkey) {
        $mother = new Person($p_node->mother_indkey, 3);
    } else {
        $mother = null;
    }
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
        # display generation if it changed
        $pdf->SetLeftMargin(13);
        $pdf->SetX(0);
        $pdf->SetFont($font, 'BU', 10);
        $pdf->Ln(10);
        $pdf->Cell(0, 5, sprintf(gtc("Generation %s"), $g_generation), 0, 2, 'C');
        //$pdf->Ln(5);
    }
    $pdf->LN(5);
    $pdf->SetX($gencol);
    $pdf->SetFont($font, '', 9);
    $pdf->Write(5, $p_node->ns_number . '.');
    $pdf->SetLeftMargin($factcol);
    $pdf->SetFont($font, 'B', 9);
    $pdf->Write(5, $p_node->full_name());
    $pdf->SetFont($font, '', 9);
    $pdf->Write(5, html_entity_decode(strip_tags(get_parents_sentence($p_node, $father, $mother))));
    $pdf->LN(5);
    $pdf->Write(5, html_entity_decode(strip_tags(get_birth_sentence($p_node))));
    $pdf->Write(5, html_entity_decode(strip_tags(get_marriage_sentences($p_node))));
    $pdf->Write(5, html_entity_decode(strip_tags(get_death_sentence($p_node))));
    $pdf->Ln(5);
    # children
    foreach ($p_node->marriages as $marriage) {
        $spouse = !empty($marriage->spouse) ? new Person($marriage->spouse) : null;
        if ($marriage->child_count > 0) {
            $pdf->Ln(5);
            $pdf->Write(5, html_entity_decode(strip_tags(get_children_of_sentence($p_node, $spouse))) . ':');
            foreach ($marriage->children as $child_indkey) {
                $child = new Person($child_indkey);
                if ($child->marriage_count > 0) {
                    foreach ($child->marriages as $cmarriage) {
                        if ($cmarriage->child_count > 0) {
                            $child->ns_number = count($g_descendants) + 1;
                            $child_gen = $p_generation + 1;
                            if ($child_gen > $g_max_gens) {
                                break;
                            }
                            array_push($g_descendants, array($child, $child_gen));
                            break;
                        }
                    }
                }
                if ($child->ns_number) {
                    $pdf->SetLeftMargin($factcol);
                    $pdf->Ln(5);
                    $pdf->Write(5, $child->ns_number);
                    $pdf->SetX($childcol);
                    $pdf->Write(5, $child->full_name());
                    if ($child->birth->date || $child->death->date) {
                        if ($child->birth->date) {
                            $pdf->SetX($birthcol);
                            $pdf->Write(5, $child->birth->date);
                        }
                        if ($child->death->date) {
                            $pdf->SetX($deathcol);
                            $pdf->Write(5, $child->death->date);
                        }
                    }
                } else {
                    $pdf->Ln(5);
                    $pdf->SetX($childcol);
                    $pdf->Write(5, $child->full_name());
                    if ($child->birth->date || $child->death->date) {
                        if ($child->birth->date) {
                            $pdf->SetX($birthcol);
                            $pdf->Write(5, $child->birth->date);
                        }
                        if ($child->death->date) {
                            $pdf->SetX($deathcol);
                            $pdf->Write(5, $child->death->date);
                        }
                    }
                }
            }
        }
    }
}
Ejemplo n.º 4
0
function display_indiv($p_node, $p_generation)
{
    global $pdf, $g_generation, $font;
    $gencol = 13;
    $factcol = 30;
    $father = null;
    $mother = null;
    if ($p_node->father_indkey) {
        $father = new Person($p_node->father_indkey, 1);
    }
    if ($p_node->mother_indkey) {
        $mother = new Person($p_node->mother_indkey, 1);
    }
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
        # display generation if it changed
        $pdf->SetLeftMargin(13);
        $pdf->SetX(0);
        $pdf->SetFont($font, 'BU', 10);
        $pdf->Ln(5);
        $pdf->Cell(0, 5, sprintf(gtc("Generation %s"), $g_generation), 0, 2, 'C');
        $pdf->Ln(5);
    }
    $pdf->SetX($gencol);
    $pdf->SetFont($font, '', 9);
    $pdf->Write(5, $p_node->ns_number . '.');
    $pdf->SetLeftMargin($factcol);
    $pdf->SetFont($font, 'B', 9);
    $pdf->Write(5, $p_node->full_name());
    $pdf->SetFont($font, '', 9);
    $pdf->Write(5, html_entity_decode(strip_tags(get_parents_sentence($p_node, $father, $mother))));
    $pdf->Ln(5);
    $pdf->Write(5, html_entity_decode(strip_tags(get_birth_sentence($p_node))));
    $pdf->Write(5, html_entity_decode(strip_tags(get_marriage_sentences($p_node))));
    $pdf->Write(5, html_entity_decode(strip_tags(get_death_sentence($p_node))));
    $pdf->Ln(10);
}