Пример #1
0
function create_rel_array($gednr)
{
    // creates array of ancestors of person with gedcom nr. $gednr
    global $dbh, $db_functions;
    $family_id = $gednr;
    $ancestor_id2[] = $family_id;
    $ancestor_number2[] = 1;
    $marriage_number2[] = 0;
    $generation = 1;
    $genarray_count = 0;
    // *** Loop ancestor report ***
    while (isset($ancestor_id2[0])) {
        unset($ancestor_id);
        $ancestor_id = $ancestor_id2;
        unset($ancestor_id2);
        unset($ancestor_number);
        $ancestor_number = $ancestor_number2;
        unset($ancestor_number2);
        unset($marriage_number);
        $marriage_number = $marriage_number2;
        unset($marriage_number2);
        // *** Loop per generation ***
        $kwcount = count($ancestor_id);
        for ($i = 0; $i < $kwcount; $i++) {
            if ($ancestor_id[$i] != '0') {
                $person_manDb = $db_functions->get_person($ancestor_id[$i]);
                $man_cls = new person_cls();
                $man_cls->construct($person_manDb);
                $man_privacy = $man_cls->privacy;
                if (strtolower($person_manDb->pers_sexe) == 'm' and $ancestor_number[$i] > 1) {
                    @($familyDb = $db_functions->get_family($marriage_number[$i]));
                    // *** Use privacy filter of woman ***
                    $person_womanDb = $db_functions->get_person($familyDb->fam_woman);
                    $woman_cls = new person_cls();
                    $woman_cls->construct($person_womanDb);
                    $woman_privacy = $woman_cls->privacy;
                    // *** Use class for marriage ***
                    $marriage_cls = new marriage_cls();
                    $marriage_cls->construct($familyDb, $man_privacy, $woman_privacy);
                    $family_privacy = $marriage_cls->privacy;
                }
                //*** Show person data ***
                $genarray[$genarray_count][0] = $ancestor_id[$i];
                $genarray[$genarray_count][1] = $generation - 1;
                $genarray_count++;
                // increase by one
                // *** Check for parents ***
                if ($person_manDb->pers_famc) {
                    @($familyDb = $db_functions->get_family($person_manDb->pers_famc));
                    if ($familyDb->fam_man) {
                        $ancestor_id2[] = $familyDb->fam_man;
                        $ancestor_number2[] = 2 * $ancestor_number[$i];
                        $marriage_number2[] = $person_manDb->pers_famc;
                        $genarray[][2] = $genarray_count - 1;
                        // save array nr of child in parent array so we can build up ancestral line later
                    }
                    if ($familyDb->fam_woman) {
                        $ancestor_id2[] = $familyDb->fam_woman;
                        $ancestor_number2[] = 2 * $ancestor_number[$i] + 1;
                        $marriage_number2[] = $person_manDb->pers_famc;
                        $genarray[][2] = $genarray_count - 1;
                        // save array nr of child in parent array so we can build up ancestral line later
                    }
                }
            }
        }
        // loop per generation
        $generation++;
    }
    // loop ancestors
    return @$genarray;
}
echo '<th colspan="2" width="280px">' . ucfirst(__('Married (religious)')) . '</th>';
echo '</tr>';
while (@($familyDb = $person_result->fetch(PDO::FETCH_OBJ))) {
    // *** Man privacy filter ***
    $personDb = $db_functions->get_person($familyDb->fam_man);
    // *** Person class used for name and person pop-up data ***
    $man_cls = new person_cls();
    $man_cls->construct($personDb);
    // *** Woman privacy filter ***
    $personDb = $db_functions->get_person($familyDb->fam_woman);
    // *** Person class used for name and person pop-up data ***
    $woman_cls = new person_cls();
    $woman_cls->construct($personDb);
    // *** Proces marriage using a class ***
    $marriage_cls = new marriage_cls();
    $marriage_cls->construct($familyDb, $man_cls->privacy, $woman_cls->privacy);
    $family_privacy = $marriage_cls->privacy;
    // *** $family_privacy='1' = filter ***
    if ($family_privacy) {
        $privcount++;
    } else {
        show_person($familyDb);
    }
}
echo '</table>';
if ($privcount) {
    echo "<br>" . $privcount . __(' persons are not shown due to privacy settings') . ".<br>";
}
echo '<br><div class="index_list1">' . $line_pages . '</div>';
//for testing only:
//echo 'Query: '.$query." LIMIT ".safe_text($item).",".$nr_persons.'<br>';
Пример #3
0
function outline($family_id, $main_person, $gn, $nr_generations)
{
    global $dbh, $db_functions, $tree_prefix_quoted, $pdf, $show_date, $dates_behind_names, $nr_generations;
    global $language, $dirmark1, $dirmark1, $screen_mode;
    $family_nr = 1;
    //*** Process multiple families ***
    if ($nr_generations < $gn) {
        return;
    }
    $gn++;
    // *** Count marriages of man ***
    // *** YB: if needed show woman as main_person ***
    @($familyDb = $db_functions->get_family($family_id, 'man-woman'));
    $parent1 = '';
    $parent2 = '';
    $change_main_person = false;
    // *** Standard main_person is the father ***
    if ($familyDb->fam_man) {
        $parent1 = $familyDb->fam_man;
    }
    // *** If mother is selected, mother will be main_person ***
    if ($familyDb->fam_woman == $main_person) {
        $parent1 = $familyDb->fam_woman;
        $change_main_person = true;
    }
    // *** Check family with parent1: N.N. ***
    if ($parent1) {
        // *** Save man's families in array ***
        @($personDb = $db_functions->get_person($parent1, 'famc-fams'));
        $marriage_array = explode(";", $personDb->pers_fams);
        $nr_families = substr_count($personDb->pers_fams, ";");
    } else {
        $marriage_array[0] = $family_id;
        $nr_families = "0";
    }
    // *** Loop multiple marriages of main_person ***
    for ($parent1_marr = 0; $parent1_marr <= $nr_families; $parent1_marr++) {
        @($familyDb = $db_functions->get_family($marriage_array[$parent1_marr]));
        // *** Privacy filter man and woman ***
        @($person_manDb = $db_functions->get_person($familyDb->fam_man));
        $man_cls = new person_cls();
        $man_cls->construct($person_manDb);
        $privacy_man = $man_cls->privacy;
        @($person_womanDb = $db_functions->get_person($familyDb->fam_woman));
        $woman_cls = new person_cls();
        $woman_cls->construct($person_womanDb);
        $privacy_woman = $woman_cls->privacy;
        $marriage_cls = new marriage_cls();
        $marriage_cls->construct($familyDb, $privacy_man, $privacy_woman);
        $familylevend = $marriage_cls->privacy;
        // *************************************************************
        // *** Parent1 (normally the father)                         ***
        // *************************************************************
        if ($familyDb->fam_kind != 'PRO-GEN') {
            //onecht kind, vrouw zonder man
            if ($family_nr == 1) {
                // *** Show data of man ***
                $dir = "";
                if ($language["dir"] == "rtl") {
                    $dir = "rtl";
                    // in the following code calls the css indentation for rtl pages: "div.rtlsub2" instead of "div.sub2"
                }
                $indent = $dir . 'sub' . $gn;
                // hier wordt de indent bepaald voor de namen div class (sub1, sub2 enz. die in gedcom.css staan)
                if ($screen_mode != "PDF") {
                    echo '<div class="' . $indent . '">';
                    echo '<b>' . $gn . ' </b>';
                } else {
                    $pdf->SetLeftMargin($gn * 10);
                    $pdf->Write(8, "\n");
                    $pdf->Write(8, $gn . '  ');
                }
                if ($change_main_person == true) {
                    if ($screen_mode != "PDF") {
                        echo $woman_cls->name_extended("outline");
                    } else {
                        $pdf->SetFont('Arial', 'B', 12);
                        $pdf->Write(8, $woman_cls->name_extended("outline"));
                        $pdf->SetFont('Arial', '', 12);
                    }
                    if ($show_date == "1" and !$privacy_woman) {
                        if ($screen_mode != "PDF") {
                            echo $dirmark1 . ',';
                            if ($dates_behind_names == false) {
                                echo '<br>';
                            }
                            echo ' &nbsp; (' . language_date($person_womanDb->pers_birth_date) . ' - ' . language_date($person_womanDb->pers_death_date) . ')';
                        } else {
                            if ($dates_behind_names == false) {
                                $pdf->SetLeftMargin($gn * 10 + 4);
                                $pdf->Write(8, "\n");
                            }
                            $pdf->Write(8, ' (' . language_date($person_womanDb->pers_birth_date) . ' - ' . language_date($person_womanDb->pers_death_date) . ')');
                        }
                    }
                } else {
                    if ($screen_mode != "PDF") {
                        echo $man_cls->name_extended("outline");
                    } else {
                        $pdf->SetFont('Arial', 'B', 12);
                        $pdf->Write(8, $man_cls->name_extended("outline"));
                        $pdf->SetFont('Arial', '', 12);
                    }
                    if ($show_date == "1" and !$privacy_man) {
                        if ($screen_mode != "PDF") {
                            echo $dirmark1 . ',';
                            if ($dates_behind_names == false) {
                                echo '<br>';
                            }
                            echo ' &nbsp; (' . language_date($person_manDb->pers_birth_date) . ' - ' . language_date($person_manDb->pers_death_date) . ')';
                        } else {
                            if ($dates_behind_names == false) {
                                $pdf->SetLeftMargin($gn * 10 + 4);
                                $pdf->Write(8, "\n");
                            }
                            $pdf->Write(8, ' (' . language_date($person_manDb->pers_birth_date) . ' - ' . language_date($person_manDb->pers_death_date) . ')');
                        }
                    }
                }
                if ($screen_mode != "PDF") {
                    echo '</div>';
                }
            } else {
            }
            // empty: no second show of data of main_person in outline report
            $family_nr++;
        }
        // *** end check of PRO-GEN ***
        // *************************************************************
        // *** Parent2 (normally the mother)                         ***
        // *************************************************************
        if ($screen_mode != "PDF") {
            echo '<div class="' . $indent . '" style="font-style:italic">';
            echo ' x ' . $dirmark1;
        } else {
            $pdf->SetLeftMargin($gn * 10);
            $pdf->Write(8, "\n");
            $pdf->Write(8, 'x  ');
        }
        if ($change_main_person == true) {
            if ($screen_mode != "PDF") {
                echo $man_cls->name_extended("outline");
            } else {
                $pdf->SetFont('Arial', 'BI', 12);
                $pdf->Write(8, $man_cls->name_extended("outline"));
                $pdf->SetFont('Arial', '', 12);
            }
            if ($show_date == "1" and !$privacy_man) {
                if ($screen_mode != "PDF") {
                    echo $dirmark1 . ',';
                    if ($dates_behind_names == false) {
                        echo '<br>';
                    }
                    echo ' &nbsp; (' . @language_date($person_manDb->pers_birth_date) . ' - ' . @language_date($person_manDb->pers_death_date) . ')';
                } else {
                    if ($dates_behind_names == false) {
                        $pdf->SetLeftMargin($gn * 10 + 4);
                        $pdf->Write(8, "\n");
                    }
                    $pdf->Write(8, ' (' . @language_date($person_manDb->pers_birth_date) . ' - ' . @language_date($person_manDb->pers_death_date) . ')');
                }
            }
        } else {
            if ($screen_mode != "PDF") {
                echo $woman_cls->name_extended("outline");
            } else {
                $pdf->SetFont('Arial', 'BI', 12);
                $pdf->Write(8, $woman_cls->name_extended("outline"));
                $pdf->SetFont('Arial', '', 12);
            }
            if ($show_date == "1" and !$privacy_woman) {
                if ($screen_mode != "PDF") {
                    echo $dirmark1 . ',';
                    if ($dates_behind_names == false) {
                        echo '<br>';
                    }
                    echo ' &nbsp; (' . @language_date($person_womanDb->pers_birth_date) . ' - ' . @language_date($person_womanDb->pers_death_date) . ')';
                } else {
                    if ($dates_behind_names == false) {
                        $pdf->SetLeftMargin($gn * 10 + 4);
                        $pdf->Write(8, "\n");
                    }
                    $pdf->Write(8, ' (' . @language_date($person_womanDb->pers_birth_date) . ' - ' . @language_date($person_womanDb->pers_death_date) . ')');
                }
            }
        }
        if ($screen_mode != "PDF") {
            echo '</div>';
        }
        // *************************************************************
        // *** Children                                              ***
        // *************************************************************
        if ($familyDb->fam_children) {
            $childnr = 1;
            $child_array = explode(";", $familyDb->fam_children);
            for ($i = 0; $i <= substr_count("{$familyDb->fam_children}", ";"); $i++) {
                @($childDb = $db_functions->get_person($child_array[$i]));
                $child_privacy = "";
                $child_cls = new person_cls();
                $child_cls->construct($childDb);
                $child_privacy = $child_cls->privacy;
                // *** Build descendant_report ***
                if ($childDb->pers_fams) {
                    // *** 1e family of child ***
                    $child_family = explode(";", $childDb->pers_fams);
                    $child1stfam = $child_family[0];
                    outline($child1stfam, $childDb->pers_gedcomnumber, $gn, $nr_generations);
                    // recursive
                } else {
                    // Child without own family
                    if ($nr_generations >= $gn) {
                        $childgn = $gn + 1;
                        $childindent = $dir . 'sub' . $childgn;
                        if ($screen_mode != "PDF") {
                            echo '<div class="' . $childindent . '">';
                            echo '<b>' . $childgn . ' ' . '</b>';
                            echo $child_cls->name_extended("outline");
                        } else {
                            $pdf->SetLeftMargin($childgn * 10);
                            $pdf->Write(8, "\n");
                            $pdf->Write(8, $childgn . '  ');
                            $pdf->SetFont('Arial', 'B', 12);
                            $pdf->Write(8, $child_cls->name_extended("outline"));
                            $pdf->SetFont('Arial', '', 12);
                        }
                        if ($show_date == "1" and !$child_privacy) {
                            if ($screen_mode != "PDF") {
                                echo $dirmark1 . ',';
                                if ($dates_behind_names == false) {
                                    echo '<br>';
                                }
                                echo ' &nbsp; (' . language_date($childDb->pers_birth_date) . ' - ' . language_date($childDb->pers_death_date) . ')';
                            } else {
                                if ($dates_behind_names == false) {
                                    $pdf->SetLeftMargin($childgn * 10 + 4);
                                    $pdf->Write(8, "\n");
                                }
                                $pdf->Write(8, ' (' . language_date($childDb->pers_birth_date) . ' - ' . language_date($childDb->pers_death_date) . ')');
                            }
                        }
                        if ($screen_mode != "PDF") {
                            echo '</div>';
                        }
                    }
                }
                if ($screen_mode != "PDF") {
                    echo "\n";
                } else {
                }
                $childnr++;
            }
        }
    }
    // Show  multiple marriages
}
Пример #4
0
 @($person_manDb = $db_functions->get_person($ancestor_array[$i]));
 $man_cls = new person_cls();
 $man_cls->construct($person_manDb);
 $privacy_man = $man_cls->privacy;
 // for pdf function pdf_ancestor_name() further along
 //$sexe=$person_manDb->pers_sexe;
 if (strtolower($person_manDb->pers_sexe) == 'm' and $ancestor_number[$i] > 1) {
     @($familyDb = $db_functions->get_family($marriage_gedcomnumber[$i]));
     // *** Use privacy filter of woman ***
     @($person_womanDb = $db_functions->get_person($familyDb->fam_woman));
     $woman_cls = new person_cls();
     $woman_cls->construct($person_womanDb);
     $privacy_woman = $woman_cls->privacy;
     // *** Use class for marriage ***
     $marriage_cls = new marriage_cls();
     $marriage_cls->construct($familyDb, $privacy_man, $privacy_woman);
     $family_privacy = $marriage_cls->privacy;
 }
 if ($screen_mode != 'PDF' and $screen_mode != 'RTF') {
     echo '<tr><td valign="top" width="80" nowrap><b>' . $ancestor_number[$i] . '</b> (' . floor($ancestor_number[$i] / 2) . ')</td>';
     echo '<td>';
     //*** Show data man ***
     echo '<div class="parent1">';
     // ***  Use "child", to show a link for own family. ***
     echo $man_cls->name_extended("child");
     if ($listednr == '') {
         echo $man_cls->person_data("standard", $ancestor_array[$i]);
     } else {
         // person was already listed
         echo ' <strong> (' . __('Allready listed above as number ') . $listednr . ') </strong>';
     }
Пример #5
0
     $partner = $marrDb->fam_woman;
 } else {
     $partner = $marrDb->fam_man;
 }
 $children = $marrDb->fam_children;
 // *** Privacy filter main person and spouse ***
 // privacy filter main person is already set above
 // check privacy of partner
 $person_partner = $dbh->query("SELECT * FROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='{$partner}'");
 @($person_partnerDb = $person_partner->fetch(PDO::FETCH_OBJ));
 // *** Proces spouse using a clas ***
 $partner_cls = new person_cls();
 $partner_cls->construct($person_partnerDb);
 // *** Proces marriage using a class ***
 $marriage_cls = new marriage_cls();
 $marriage_cls->construct($res, $man_cls->privacy, $partner_cls->privacy);
 $family_privacy = $marriage_cls->privacy;
 // *** Show full marriage details ***
 if ($family_privacy) {
     // *** Show standard marriage data ***
     $var = '<br>' . $marriage_cls->marriage_data($marrDb, '', 'short');
 } else {
     $var = '<br>' . $marriage_cls->marriage_data($marrDb);
 }
 print '<li data-role="list-divider">' . __('Marriage') . '</li>';
 print '<li><p>' . $var . '</p></li>';
 // marriage date place
 // *** Show partner ***
 echo popup($partner, false);
 // *** Show person details using standard HuMo-gen function ***
 //$partner_sql=$dbh->query("SELECT * FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE pers_gedcomnumber='".safe_text($partner)."'");