function popup($text, $show_data = true)
{
    global $dbh, $tree_id, $lang, $number, $c, $tree_prefix_quoted;
    $person = $text;
    $text = '';
    include_once "../include/person_cls.php";
    include_once "../include/marriage_cls.php";
    //$person_man=$dbh->query("SELECT * FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE pers_gedcomnumber='".safe_text($person)."'");
    $person_man = $dbh->query("SELECT * FROM humo_persons\n\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . safe_text($person) . "'");
    @($person_manDb = $person_man->fetch(PDO::FETCH_OBJ));
    //*** Use class to show person ***
    $man_cls = new person_cls();
    $man_cls->construct($person_manDb);
    $man_privacy = $man_cls->privacy;
    $name = $man_cls->person_name($person_manDb);
    if ($person_manDb->pers_sexe == "M") {
        $text .= '<li><img src="../images/man.gif" class="ui-li-icon">';
    } elseif ($person_manDb->pers_sexe == "F") {
        $text .= '<li><img src="../images/woman.gif" class="ui-li-icon">';
    } else {
        $text .= '<li><img src="../images/unknown.gif" class="ui-li-icon">';
    }
    $number_text = '';
    if ($number == 1) {
        $number_text = $c + 1 . ' ';
    }
    $text .= '<p>' . $number_text . '<a href="family.php?id=' . $person_manDb->pers_gedcomnumber . '">' . $name["index_name"] . '</a><br>';
    if ($show_data == true) {
        if ($man_privacy) {
            $text .= __(' PRIVACY FILTER');
        } else {
            // no privacy set
            if ($person_manDb->pers_birth_date or $person_manDb->pers_birth_place) {
                $text .= ucfirst(__('*')) . ' ' . date_place($person_manDb->pers_birth_date, $person_manDb->pers_birth_place) . '<br>';
            } elseif ($person_manDb->pers_bapt_date or $person_manDb->pers_bapt_place) {
                $text .= ucfirst(__('~')) . ' ' . date_place($person_manDb->pers_bapt_date, $person_manDb->pers_bapt_place) . '<br>';
            }
            if ($person_manDb->pers_death_date or $person_manDb->pers_death_place) {
                $text .= ucfirst(__('&#134;')) . ' ' . date_place($person_manDb->pers_death_date, $person_manDb->pers_death_place) . '<br>';
            } elseif ($person_manDb->pers_buried_date or $person_manDb->pers_buried_place) {
                if ($person_manDb->pers_cremation) {
                    $var .= ucfirst(__('crem.')) . ' ';
                } else {
                    $var .= ucfirst(__('buried')) . ' ';
                }
                $var .= date_place($person_manDb->pers_buried_date, $person_manDb->pers_buried_place) . '<br>';
            } else {
                $text .= '</p></li>';
            }
        }
    }
    return $text;
}
Exemple #2
0
function show_person($personDb)
{
    global $dbh, $db_functions, $index_list, $selected_place, $language, $user;
    global $bot_visit, $humo_option, $uri_path, $search_database, $list_expanded;
    global $selected_language, $privacy, $dirmark1, $dirmark2, $rtlmarker;
    global $select_birth, $select_bapt, $select_place, $select_death, $select_buried;
    global $selectsort;
    $pers_tree_prefix = $personDb->pers_tree_prefix;
    $db_functions->set_tree_prefix($pers_tree_prefix);
    $db_functions->set_tree_id($personDb->pers_tree_id);
    if (CMS_SPECIFIC == 'Joomla') {
        $start_url = 'index.php?option=com_humo-gen&amp;task=family&amp;database=' . $pers_tree_prefix . '&amp;id=' . $personDb->pers_indexnr . '&amp;main_person=' . $personDb->pers_gedcomnumber;
    } elseif ($humo_option["url_rewrite"] == "j") {
        // *** url_rewrite ***
        // *** $uri_path made in header.php ***
        $start_url = $uri_path . 'family/' . $pers_tree_prefix . '/' . $personDb->pers_indexnr . '/' . $personDb->pers_gedcomnumber . '/';
    } else {
        $start_url = CMS_ROOTPATH . 'family.php?database=' . $pers_tree_prefix . '&amp;id=' . $personDb->pers_indexnr . '&amp;main_person=' . $personDb->pers_gedcomnumber;
    }
    // *** Person class used for name and person pop-up data ***
    $person_cls = new person_cls();
    $person_cls->construct($personDb);
    $name = $person_cls->person_name($personDb);
    // *** Show name ***
    $index_name = '';
    if ($name["show_name"] == false) {
        $index_name = __('Name filtered');
    } else {
        // *** If there is no lastname, show a - character. ***
        if ($personDb->pers_lastname == "") {
            // Don't show a "-" by pers_patronymes
            if (!isset($_GET['pers_patronym'])) {
                $index_name = "-&nbsp;&nbsp;";
            }
        }
        $index_name .= $name["index_name_extended"] . $name["colour_mark"];
    }
    // *** Show extra colums before a person in index places ***
    if ($index_list == 'places') {
        if ($selected_place != $personDb->place_order) {
            echo '<td colspan="7"><b>' . $dirmark2 . "{$personDb->place_order}</b></td></tr><tr>";
        }
        $selected_place = $personDb->place_order;
        echo '<td valign="top" style="white-space:nowrap;width:90px">';
        if ($select_birth == '1') {
            if ($selected_place == $personDb->pers_birth_place) {
                echo '<span class="place_index place_index_selected">' . __('*') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_bapt == '1') {
            if ($selected_place == $personDb->pers_bapt_place) {
                echo '<span class="place_index place_index_selected">' . __('~') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_place == '1') {
            if ($selected_place == $personDb->pers_place_index) {
                echo '<span class="place_index place_index_selected">' . __('^') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_death == '1') {
            if ($selected_place == $personDb->pers_death_place) {
                echo '<span class="place_index place_index_selected">' . __('&#134;') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_buried == '1') {
            if ($selected_place == $personDb->pers_buried_place) {
                echo '<span class="place_index place_index_selected">' . __('[]') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        echo '</td>';
    }
    echo '<td valign="top" style="border-right:0px; white-space:nowrap;">';
    // *** Show person popup menu ***
    echo $person_cls->person_popup_menu($personDb);
    // *** Show picture man or wife ***
    if ($personDb->pers_sexe == "M") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man" style="vertical-align:top">';
    } elseif ($personDb->pers_sexe == "F") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman" style="vertical-align:top">';
    } else {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown" style="vertical-align:top">';
    }
    // *** Add own icon by person, using a file name in own code ***
    if ($personDb->pers_own_code != '' and is_file("images/" . $personDb->pers_own_code . ".gif")) {
        echo $dirmark1 . '<img src="' . CMS_ROOTPATH . 'images/' . $personDb->pers_own_code . '.gif" alt="' . $personDb->pers_own_code . '">&nbsp;';
    }
    echo '</td><td style="border-left:0px;">';
    // *** Show name of person ***
    echo ' <a href="' . $start_url . '">' . $index_name . '</a>';
    //*** Show spouse/ partner ***
    if ($list_expanded == true and $personDb->pers_fams) {
        $marriage_array = explode(";", $personDb->pers_fams);
        $nr_marriages = count($marriage_array);
        for ($x = 0; $x <= $nr_marriages - 1; $x++) {
            $fam_partnerDb = $db_functions->get_family($marriage_array[$x]);
            // *** This check is better then a check like: $personDb->pers_sexe=='F', because of unknown sexe or homosexual relations. ***
            if ($personDb->pers_gedcomnumber == $fam_partnerDb->fam_man) {
                $partner_id = $fam_partnerDb->fam_woman;
            } else {
                $partner_id = $fam_partnerDb->fam_man;
            }
            $relation_short = __('&amp;');
            if ($fam_partnerDb->fam_marr_date or $fam_partnerDb->fam_marr_place or $fam_partnerDb->fam_marr_church_date or $fam_partnerDb->fam_marr_church_place or $fam_partnerDb->fam_kind == 'civil') {
                $relation_short = __('X');
            }
            if ($fam_partnerDb->fam_div_date or $fam_partnerDb->fam_div_place) {
                $relation_short = __(') (');
            }
            if ($partner_id != '0' and $partner_id != '') {
                $partnerDb = $db_functions->get_person($partner_id);
                $partner_cls = new person_cls();
                $name = $partner_cls->person_name($partnerDb);
            } else {
                $name["standard_name"] = __('N.N.');
            }
            if ($nr_marriages > 1 and $x > 0) {
                echo ',';
            }
            echo ' <span class="index_partner" style="font-size:10px;">';
            if ($nr_marriages > 1) {
                if ($x == 0) {
                    echo __('1st');
                } elseif ($x == 1) {
                    echo __('2nd');
                } elseif ($x == 2) {
                    echo __('3rd');
                } elseif ($x > 2) {
                    echo $x + 1 . __('th');
                }
            }
            echo ' ' . $relation_short . ' ' . rtrim($name["standard_name"]) . '</span>';
        }
    }
    // *** End spouse/ partner ***
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($personDb->pers_bapt_date) {
        $info = __('~') . ' ' . date_place($personDb->pers_bapt_date, '');
    }
    if ($personDb->pers_birth_date) {
        $info = __('*') . ' ' . date_place($personDb->pers_birth_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($personDb->pers_bapt_place) {
        $info = __('~') . ' ' . $personDb->pers_bapt_place;
    }
    if ($personDb->pers_birth_place) {
        $info = __('*') . ' ' . $personDb->pers_birth_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($personDb->pers_buried_date) {
        $info = __('[]') . ' ' . date_place($personDb->pers_buried_date, '');
    }
    if ($personDb->pers_death_date) {
        $info = __('&#134;') . ' ' . date_place($personDb->pers_death_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($personDb->pers_buried_place) {
        $info = __('[]') . ' ' . $personDb->pers_buried_place;
    }
    if ($personDb->pers_death_place) {
        $info = __('&#134;') . ' ' . $personDb->pers_death_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    // *** Show name of family tree, if search in multiple family trees is used ***
    if ($search_database == 'all_trees' or $search_database == 'all_but_this') {
        $treetext = show_tree_text($pers_tree_prefix, $selected_language);
        echo '</td><td>';
        echo '<i><font size="-1">' . $treetext['name'] . '</font></i>';
    }
    echo '</td></tr>';
}
$datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_prefix!='EMPTY' ORDER BY tree_order");
while ($dataDb = $datasql->fetch(PDO::FETCH_OBJ)) {
    // *** Check is family tree is shown or hidden for user group ***
    $hide_tree_array = explode(";", $user['group_hide_trees']);
    $hide_tree = false;
    for ($x = 0; $x <= count($hide_tree_array) - 1; $x++) {
        if ($hide_tree_array[$x] == $dataDb->tree_id) {
            $hide_tree = true;
        }
    }
    if ($hide_tree == false) {
        $sql = "SELECT *,\n\t\t\tsubstring(pers_birth_date,1,2) as birth_day,\n\t\t\tsubstring(pers_birth_date,8,4) as birth_year,\n\t\t\tsubstring(pers_death_date,8,4) as death_year\n\t\t\tFROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $dataDb->tree_id . "'\n\t\t\tAND (pers_birth_date!=''\n\t\t\tAND (substring(pers_birth_date,3,3) = '{$month_number}' AND CONCAT('0',substring(pers_birth_date,1,1)) = '{$today_day}') \n\t\t\tOR (substring(pers_birth_date,4,3) = '{$month_number}' AND substring(pers_birth_date,1,2)='{$today_day}')\n\t\t\t) order by pers_lastname";
        $query = $dbh->query($sql);
        while ($record = $query->fetch(PDO::FETCH_OBJ)) {
            $person_cls1 = new person_cls();
            $person_cls1->construct($record);
            $privacy = $person_cls1->privacy;
            if ($privacy != 1) {
                $death_date = $record->pers_death_date;
                $calculated_age = '';
                if ($death_date != '') {
                    $death_date = ' (&#8224; ' . $death_date . ')';
                    if ($record->death_year - $record->birth_year < 120) {
                        $calculated_age = ' (' . ($record->death_year - $record->birth_year) . ')';
                    }
                } else {
                    $death_date = '';
                    if ($year - $record->birth_year < 120) {
                        $calculated_age = ' (' . ($year - $record->birth_year) . ')';
                    }
                }
Exemple #4
0
 $hide_tree = false;
 for ($x = 0; $x <= count($hide_tree_array) - 1; $x++) {
     if ($hide_tree_array[$x] == $dataDb->tree_id) {
         $hide_tree = true;
     }
 }
 if ($hide_tree == false) {
     //$person_qry = $dbh->query("SELECT * FROM ".safe_text($dataDb->tree_prefix)."person ORDER BY pers_lastname");
     $person_qry = $dbh->query("SELECT * FROM humo_persons\r\n\t\t\tWHERE pers_tree_id='" . $dataDb->tree_id . "' ORDER BY pers_lastname");
     //GENDEX:
     //person-URL|FAMILYNAME|Firstname /FAMILYNAME/|
     //Birthdate|Birthplace|Deathdate|Deathplace|
     while (@($personDb = $person_qry->fetch(PDO::FETCH_OBJ))) {
         // *** Use class for privacy filter ***
         $person_cls = new person_cls();
         $person_cls->construct($personDb);
         $privacy = $person_cls->privacy;
         // *** Completely filter person ***
         if ($user["group_pers_hide_totally_act"] == 'j' and strpos(' ' . $personDb->pers_own_code, $user["group_pers_hide_totally"]) > 0) {
             // *** Don't show person ***
         } else {
             $person_url = $personDb->pers_indexnr;
             if ($person_url == '') {
                 if ($personDb->pers_famc) {
                     // *** Person without own family ***
                     $person_url = $personDb->pers_famc;
                 } else {
                     // *** Person without parents or own family ***
                     $person_url = '&main_person=' . $personDb->pers_gedcomnumber;
                 }
             }
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;
}
function printchart()
{
    global $dbh, $tree_id, $db_functions, $genarray, $size, $tree_prefix_quoted, $language, $chosengen, $keepfamily_id, $keepmain_person, $uri_path, $database;
    global $vbasesize, $hsize, $vsize, $vdist, $hdist, $user, $direction, $dna;
    global $dirmark1, $dirmark2, $rtlmarker, $alignmarker, $base_person_gednr, $base_person_name, $base_person_sexe, $base_person_famc;
    // YB: -- check browser type & version. we need this further on to detect IE7 with it's widely reported z-index bug
    $browser_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
    global $hourglass, $divlen, $divhi;
    if ($hourglass === false) {
        // find rightmost and bottommost positions to calculate size of the canvas needed for png image
        $divlen = 0;
        $divhi = 0;
        for ($i = 0; $i < count($genarray); $i++) {
            if ($genarray[$i]["x"] > $divlen) {
                $divlen = $genarray[$i]["x"];
            }
            if ($genarray[$i]["y"] > $divhi) {
                $divhi = $genarray[$i]["y"];
            }
        }
        $divlen += 200;
        $divhi += 300;
        // the width and length of following div are set with $divlen en $divhi in java function "showimg"
        // (at bottom of this file) otherwise double scrollbars won't work.
        echo '<div id="png">';
        //======== HELP POPUP ========================
        echo '<div id="helppopup" class="' . $rtlmarker . 'sddm" style="position:absolute;left:10px;top:10px;display:inline;">';
        echo '<a href="#"';
        echo ' style="display:inline" ';
        echo 'onmouseover="mopen(event,\'help_menu\',0,0)"';
        echo 'onmouseout="mclosetime()">';
        echo '<b>' . __('Help') . '</b>';
        echo '</a>&nbsp;';
        //echo '<div style="z-index:40; padding:4px; direction:'.$rtlmarker.'" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        echo '<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:' . $alignmarker . ';  direction:' . $rtlmarker . ';" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        echo __('<b>USE:</b>
<p><b>Hover over square:</b> Display popup menu with details and report & chart options<br>
<b>Click on square:</b> Move this person to the center of the chart<br>
<b>Click on spouse\'s name in popup menu:</b> Go to spouse\'s family page<br><br>
<b>LEGEND:</b>');
        echo '<p><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #81bef7 100%); border:1px brown solid;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Male') . '</br>';
        echo '<span style="background-image: linear-gradient(to bottom, #ffffff 0%, #f5bca9 100%); border:1px brown solid;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Female') . '</br>';
        if ($dna == "ydna" or $dna == "ydnamark" or $dna == "mtdna" or $dna == "mtdnamark") {
            echo '<p style="line-height:3px"><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #81bef7 100%); border:3px solid #999999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Male Y-DNA or mtDNA carrier (Base person has red border)') . '</p>';
            echo '<p style="line-height:10px"><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #f5bca9 100%); border:3px solid #999999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Female MtDNA carrier (Base person has red border)') . '</p>';
        }
        echo '<p><span style="color:blue">=====</span>&nbsp;' . __('Additional marriage of same person') . '<br><br>';
        echo __('<b>SETTINGS:</b>
<p>Horizontal/Vertical button: toggle direction of the chart from top-down to left-right<br>
<b>Nr. Generations:</b> choose between 2 - 15 generations<br>
(large number of generations will take longer to generate)<br>
<b>Box size:</b> Use the slider to choose display size (9 steps): <br>
step 1-3: small boxes with popup for details<br>
step 4-7: larger boxes with initials of name + popup for details<br>
step 8:   rectangles with name inside + popup with further details<br>
step 9:   large rectangles with name, birth and death details + popup with further details');
        echo '</div>';
        echo '</div>';
        //=================================
        if ($dna == "none") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Descendant chart') . __(' of ') . $genarray[0]["nam"] . '</b>';
        } elseif ($dna == "ydna" or $dna == "ydnamark") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Same Y-DNA as ') . $base_person_name . '</b>';
        } elseif ($dna == "mtdna" or $dna == "mtdnamark") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Same mtDNA as ') . $base_person_name . '</b>';
        }
        echo '<br><input type="button" id="imgbutton" value="' . __('Get image of chart for printing (allow popup!)') . '" onClick="showimg();">';
        echo '</div>';
        if ($direction == 0) {
            $latter = count($genarray) - 1;
            $the_height = $genarray[$latter]["y"] + 130;
        } else {
            $hgt = 0;
            for ($e = 0; $e < count($genarray); $e++) {
                if ($genarray[$e]["y"] > $hgt) {
                    $hgt = $genarray[$e]["y"];
                }
            }
            $the_height = $hgt + 130;
        }
        echo '<style type="text/css">';
        echo '#doublescroll { position:relative; width:auto; height:' . $the_height . 'px; overflow: auto; overflow-y: hidden;z-index:10; }';
        echo '</style>';
        //print '<div class="wrapper" style="position:relative; direction:'.$rtlmarker.';">';
        //print '<div id="doublescroll" class="wrapper" style="direction:'.$rtlmarker.';"><br style="line-height:50%">';
        print '<div id="doublescroll" class="wrapper" style="direction:' . $rtlmarker . ';">';
        // generation and size choice box:
        if ($dna == "none") {
            $boxwidth = "520";
        } else {
            $boxwidth = "730";
        }
        // DNA charts
        echo '<div id="menubox" class="search_bar" style="margin-top:5px; direction:ltr; z-index:20; width:' . $boxwidth . 'px; text-align:left;">';
        print '<div style="display:inline;">';
        if (CMS_SPECIFIC == 'Joomla') {
            print '<form method="POST" name="desc_form" action="index.php?option=com_humo-gen&task=family&chosensize=' . $size . '&amp;screen_mode=STARSIZE" style="display : inline;">';
        } else {
            print '<form method="POST" name="desc_form" action="' . CMS_ROOTPATH . 'family.php?chosensize=' . $size . '&amp;screen_mode=STARSIZE" style="display : inline;">';
        }
        print '<input type="hidden" name="id" value="' . $keepfamily_id . '">';
        print '<input type="hidden" name="chosengen" value="' . $chosengen . '">';
        print '<input type="hidden" name="main_person" value="' . $keepmain_person . '">';
        print '<input type="hidden" name="database" value="' . $database . '">';
        if ($dna != "none") {
            print '<input type="hidden" name="dnachart" value="' . $dna . '">';
            print '<input type="hidden" name="bf" value="' . $base_person_famc . '">';
            print '<input type="hidden" name="bs" value="' . $base_person_sexe . '">';
            print '<input type="hidden" name="bn" value="' . $base_person_name . '">';
            print '<input type="hidden" name="bg" value="' . $base_person_gednr . '">';
        }
        print '<input id="dirval" type="hidden" name="direction" value="">';
        // will be filled in next lines
        if ($direction == "1") {
            // horizontal
            print '<input type="button" name="dummy" value="' . __('vertical') . '" onClick=\'document.desc_form.direction.value="0";document.desc_form.submit();\'>';
        } else {
            print '<input type="button" name="dummy" value="' . __('horizontal') . '" onClick=\'document.desc_form.direction.value="1";document.desc_form.submit();\'>';
        }
        print '</form>';
        $result = $dbh->query("SELECT pers_sexe FROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber ='" . $keepmain_person . "'");
        $resultDb = $result->fetch(PDO::FETCH_OBJ);
        if ($dna != "none") {
            echo "&nbsp;&nbsp;" . __('DNA: ');
            echo '<select name="dnachart" style="width:150px" onChange="window.location=this.value">';
            //		echo $selected="selected"; if($dna!="none") $selected="";
            //		echo '<option value="'.$uri_path.'family.php?id='.$keepfamily_id.'&amp;main_person='.
            //				$keepmain_person.'&amp;direction='.$direction.'&amp;database='.$database.'&amp;dnachart='."none".'&amp;chosensize='.
            //				$size.'&amp;chosengen='.$chosengen.'&amp;screen_mode=STAR" '.$selected.'>'.__('All').'</option>';
            if ($base_person_sexe == "M") {
                // only show Y-DNA option if base person is male
                //echo $selected=""; if($dna=="ydna") $selected="selected";
                echo $selected = "selected";
                if ($dna != "ydna") {
                    $selected = "";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "ydna" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('Y-DNA Carriers only') . '</option>';
                //echo $selected="selected"; if($dna!="ydnamark") $selected="";
                echo $selected = "";
                if ($dna == "ydnamark") {
                    $selected = "selected";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "ydnamark" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('Y-DNA Mark carriers') . '</option>';
            }
            if ($base_person_sexe == "F" or $base_person_sexe == "M" and isset($base_person_famc) and $base_person_famc != "") {
                // if base person is male, only show mtDNA if there are ancestors since he can't have mtDNA descendants...
                echo $selected = "";
                if ($dna == "mtdna") {
                    $selected = "selected";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "mtdna" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('mtDNA Carriers only') . '</option>';
                if ($base_person_sexe == "F") {
                    echo $selected = "selected";
                    if ($dna != "mtdnamark") {
                        $selected = "";
                    }
                } else {
                    echo $selected = "";
                    if ($dna == "mtdnamark") {
                        $selected = "selected";
                    }
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "mtdnamark" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('mtDNA Mark carriers') . '</option>';
            }
            echo '</select>';
        }
        print '</div>';
        print '&nbsp;&nbsp;';
        print '&nbsp;' . __('Nr. generations') . ': ';
        print '<select name="chosengen" onChange="window.location=this.value">';
        for ($i = 2; $i <= 15; $i++) {
            if (CMS_SPECIFIC == 'Joomla') {
                print '<option value="index.php?option=com_humo-gen&task=family&id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=' . $i . '&amp;screen_mode=STAR" ';
            } else {
                print '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=' . $i . '&amp;screen_mode=STAR" ';
            }
            if ($i == $chosengen) {
                print "selected=\"selected\" ";
            }
            print ">" . $i . "</option>";
        }
        //NEW - option "All" for all generations
        print '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=All&amp;screen_mode=STAR" ';
        if ($chosengen == "All") {
            print "selected=\"selected\" ";
        }
        print ">" . "All" . "</option>";
        print '</select>';
        print '&nbsp;&nbsp;';
        $dna_params = "";
        if ($dna != "none") {
            $dna_params = '
					bn: "' . $base_person_name . '",
					bs: "' . $base_person_sexe . '",
					bf: "' . $base_person_famc . '",
					bg: "' . $base_person_gednr . '",';
        }
        //NEW min:0 (for extra first step - now 10 steps: 0-9), then twice value +1 so on display first step is shown as 1, not 0
        echo ' 
			<script>
			$(function() {
				$( "#slider" ).slider({
					value: ' . ($size / 5 - 1) . ',
					min: 0,
					max: 9,
					step: 1,
					database: "' . $database . '",
					main_person: "' . $keepmain_person . '",
					id: "' . $keepfamily_id . '",
					chosengen: "' . $chosengen . '",
					direction: "' . $direction . '",
					dna: "' . $dna . '",' . $dna_params . '
					slide: function( event, ui ) {
						$( "#amount" ).val(ui.value+1);
					}
				});
				$( "#amount" ).val($( "#slider" ).slider( "value" )+1 );
			});
			</script>
		';
        //echo '<label for="amount">Zoom in/out:</label>';
        echo '<label for="amount">' . __('Zoom level:') . '</label> ';
        echo '<input type="text" id="amount" disabled="disabled" style="width:15px;border:0; color:#0000CC; font-weight:normal;font-size:115%;" />';
        echo '<div id="slider" style="float:right;width:135px;margin-top:7px;margin-right:15px;"></div>';
        echo '</div>';
    }
    // end if not hourglass
    for ($w = 0; $w < count($genarray); $w++) {
        $xvalue = $genarray[$w]["x"];
        $yvalue = $genarray[$w]["y"];
        var_dump($w, $genarray[$w]["x"]);
        $sexe_colour = '';
        $backgr_col = "#FFFFFF";
        if ($genarray[$w]["sex"] == "v") {
            $sexe_colour = ' ancestor_woman';
            $backgr_col = "#FBDEC0";
            //"#f8bdf1";
        } else {
            $sexe_colour = ' ancestor_man';
            $backgr_col = "#C0F9FC";
            //"#bbf0ff";
        }
        // *** Start person class and calculate privacy ***
        if ($genarray[$w]["gednr"]) {
            $man = $db_functions->get_person($genarray[$w]["gednr"]);
            $man_cls = new person_cls();
            $man_cls->construct($man);
            $man_privacy = $man_cls->privacy;
        }
        //echo '<div style="position:absolute; background-color:'.$bkcolor.';height:'.$vsize.'px; width:'.$hsize.'px; border:1px brown solid; left:'.$xvalue.'px; top:'.$yvalue.'px">';
        $bkgr = "";
        if (($dna == "ydnamark" or $dna == "mtdnamark" or $dna == "ydna" or $dna == "mtdna") and $genarray[$w]["dna"] == 1) {
            $bkgr = "border:3px solid #999999;background-color:" . $backgr_col . ";";
            if ($genarray[$w]["gednr"] == $base_person_gednr) {
                // base person
                $bkgr = "border:3px solid red;background-color:" . $backgr_col . ";";
            }
        } else {
            $bkgr = "border:1px solid #8C8C8C;background-color:" . $backgr_col . ";";
        }
        if ($genarray[$w]["gen"] == 0 and $hourglass === true) {
            $bkgr = "background-color:" . $backgr_col . ";";
        }
        echo '<div class="ancestor_name' . $sexe_colour . '" style="' . $bkgr . 'position:absolute; height:' . $vsize . 'px; width:' . $hsize . 'px; left:' . $xvalue . 'px; top:' . $yvalue . 'px;">';
        $replacement_text = '';
        if ($size >= 25) {
            /*
            if(CMS_SPECIFIC=='Joomla') {
            	$replacement_text.= '<a class="nam" href="index.php?option=com_humo-gen&task=family&id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
            }
            else {
            	$replacement_text.= '<a class="nam" href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
            }
            
            $replacement_text.= ' style="font-size:9px; text-align:center; display:block; width:100%; height:100%" ';
            $replacement_text.= 'onmouseover="mopen(event,\'m1'.$w.'\',0,0)"';
            $replacement_text.= 'onmouseout="mclosetime()">';
            */
            if (strpos($browser_user_agent, "msie 7.0") === false) {
                if ($size == 50) {
                    // *** Show picture ***
                    if (!$man_privacy and $user['group_pictures'] == 'j') {
                        //  *** Path can be changed per family tree ***
                        global $dataDb;
                        $tree_pict_path = $dataDb->tree_pict_path;
                        $picture_qry = $db_functions->get_events_person($man->pers_gedcomnumber, 'picture');
                        // *** Only show 1st picture ***
                        if (isset($picture_qry[0])) {
                            $pictureDb = $picture_qry[0];
                            $picture = show_picture($tree_pict_path, $pictureDb->event_event, 60, 65);
                            //$replacement_text.='<img src="'.$tree_pict_path.$picture['thumb'].$picture['picture'].'" style="float:left; margin:5px;" alt="'.$pictureDb->event_text.'" height="65px">';
                            $replacement_text .= '<img src="' . $tree_pict_path . $picture['thumb'] . $picture['picture'] . '" style="float:left; margin:5px;" alt="' . $pictureDb->event_text . '" width="' . $picture['width'] . '"';
                            //if (isset($picture['height'])) $replacement_text.=' height="'.$picture['height'].'"';
                            $replacement_text .= '>';
                        }
                    }
                    //$replacement_text.= '<strong>'.$genarray[$w]["nam"].'</strong>';
                    //$replacement_text.= '<span class="anc_box_name">'.$genarray[$w]["nam"].'</span>';
                    $replacement_text .= '<span class="anc_box_name">' . $genarray[$w]["nam"] . '</span>';
                    if ($man_privacy) {
                        $replacement_text .= '<br>' . __(' PRIVACY FILTER') . '<br>';
                        //Tekst privacy weergeven
                    } else {
                        //if ($man->pers_birth_date OR $man->pers_birth_place){
                        if ($man->pers_birth_date) {
                            //$replacement_text.= '<br>'.__('*').$dirmark1.' '.date_place($man->pers_birth_date,$man->pers_birth_place);
                            $replacement_text .= '<br>' . __('*') . $dirmark1 . ' ' . date_place($man->pers_birth_date, '');
                        } elseif ($man->pers_bapt_date) {
                            //$replacement_text.= '<br>'.__('~').$dirmark1.' '.date_place($man->pers_bapt_date,$man->pers_bapt_place);
                            $replacement_text .= '<br>' . __('~') . $dirmark1 . ' ' . date_place($man->pers_bapt_date, '');
                        }
                        //if ($man->pers_death_date OR $man->pers_death_place){
                        if ($man->pers_death_date) {
                            //$replacement_text.= '<br>'.__('&#134;').$dirmark1.' '.date_place($man->pers_death_date,$man->pers_death_place);
                            $replacement_text .= '<br>' . __('&#134;') . $dirmark1 . ' ' . date_place($man->pers_death_date, '');
                        } elseif ($man->pers_buried_date) {
                            //$replacement_text.= '<br>'.__('[]').$dirmark1.' '.date_place($man->pers_buried_date,$man->pers_buried_place);
                            $replacement_text .= '<br>' . __('[]') . $dirmark1 . ' ' . date_place($man->pers_buried_date, '');
                        }
                        if ($genarray[$w]["non"] == 0) {
                            // otherwise for an unmarried child it would give the parents' marriage!
                            $ownfam = $db_functions->get_family($genarray[$w]["fams"]);
                            //if ($ownfam->fam_marr_date OR $ownfam->fam_marr_place){
                            if ($ownfam->fam_marr_date) {
                                //$replacement_text.= '<br>'.__('X').$dirmark1.' '.date_place($ownfam->fam_marr_date,$ownfam->fam_marr_place);
                                $replacement_text .= '<br>' . __('X') . $dirmark1 . ' ' . date_place($ownfam->fam_marr_date, '');
                            }
                        }
                    }
                } elseif ($size == 45) {
                    $replacement_text .= $genarray[$w]["nam"];
                } elseif ($size == 40) {
                    $replacement_text .= '<span class="wordwrap" style="font-size:75%">' . $genarray[$w]["short"] . '</span>';
                } elseif ($size >= 25 and $size < 40) {
                    $replacement_text .= $genarray[$w]["init"];
                }
            }
        } else {
            if (isset($genarray[$w]["fams"]) and isset($genarray[$w]["gednr"])) {
                /*
                if(CMS_SPECIFIC=='Joomla') {
                	$replacement_text.= '<a href="index.php?option=com_humo-gen&task=family&id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
                }
                else {
                	$replacement_text.= '<a href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
                }
                $replacement_text.= ' style="display:block; width:100%; height:100%" ';
                $replacement_text.= ' onmouseover="mopen(event,\'m1'.$w.'\',0,0)"';
                $replacement_text.= 'onmouseout="mclosetime()">';
                */
                if (strpos($browser_user_agent, "chrome") !== false or strpos($browser_user_agent, "safari") !== false) {
                    $replacement_text .= "&nbsp;";
                }
                //  (Chrome and Safari need some character here - even &nbsp - or else popup won't work..!
            }
        }
        //$replacement_text.='</a>';
        // *** POP-UP box ***
        $extra_popup_text = '';
        if ($genarray[$w]["2nd"] == 1) {
            $extra_popup_text .= $genarray[$w]["huw"] . "<br>";
        }
        if ($genarray[$w]["non"] != 1) {
            // *** Start person class and calculate privacy ***
            $woman_cls = '';
            // prevent use of $woman_cls from previous wife if another wife is NN
            if (isset($genarray[$w]["spgednr"]) and $genarray[$w]["spgednr"]) {
                @($woman = $db_functions->get_person($genarray[$w]["spgednr"]));
                $woman_cls = new person_cls();
                $woman_cls->construct($woman);
                $woman_privacy = $woman_cls->privacy;
            }
            // *** Marriage data ***
            $extra_popup_text .= '<br>' . $genarray[$w]["htx"] . "<br>";
            if ($woman_cls) {
                $name = $woman_cls->person_name($woman);
                if (isset($genarray[$w]["spfams"]) and isset($genarray[$w]["spgednr"]) and isset($genarray[$w]["sps"])) {
                    if (CMS_SPECIFIC == 'Joomla') {
                        $extra_popup_text .= '<a href="index.php?option=com_humo-gen&task=family&id=' . $genarray[$w]["spfams"] . '&amp;main_person=' . $genarray[$w]["spgednr"] . '">' . '<strong>' . $name["standard_name"] . '</strong></a>';
                    } else {
                        $extra_popup_text .= '<a href="' . CMS_ROOTPATH . 'family.php?id=' . $genarray[$w]["spfams"] . '&amp;main_person=' . $genarray[$w]["spgednr"] . '">' . '<strong>' . $name["standard_name"] . '</strong></a>';
                    }
                } else {
                    $extra_popup_text .= $name["standard_name"];
                }
                if ($woman_privacy) {
                    $extra_popup_text .= __(' PRIVACY FILTER') . '<br>';
                    //Tekst privacy weergeven
                } else {
                    if ($woman->pers_birth_date or $woman->pers_birth_place) {
                        $extra_popup_text .= __('born') . $dirmark1 . ' ' . date_place($woman->pers_birth_date, $woman->pers_birth_place) . '<br>';
                    }
                    if ($woman->pers_death_date or $woman->pers_death_place) {
                        $extra_popup_text .= __('died ') . $dirmark1 . ' ' . date_place($woman->pers_death_date, $woman->pers_death_place) . '<br>';
                    }
                }
            } else {
                $extra_popup_text .= __('N.N.');
            }
        }
        echo $man_cls->person_popup_menu($man, true, $replacement_text, $extra_popup_text);
        echo '</div>';
        // div of square
        if ($direction == 0) {
            // if vertical
            // draw dotted line from first marriage to following marriages
            if (isset($genarray[$w]["2nd"]) and $genarray[$w]["2nd"] == 1) {
                $startx = $genarray[$w - 1]["x"] + $hsize + 2;
                $starty = $genarray[$w - 1]["y"] + $vsize / 2;
                $width = $genarray[$w]["x"] - ($genarray[$w - 1]["x"] + $hsize) - 2;
                print '<div style="position:absolute;border:1px blue dashed;height:2px;width:' . $width . 'px;left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw line to children
            if ($genarray[$w]["nrc"] != 0) {
                $startx = $genarray[$w]["x"] + $hsize / 2;
                $starty = $genarray[$w]["y"] + $vsize + 2;
                print '<div class="chart_line" style="position:absolute; height:' . ($vdist / 2 - 2) . 'px; width:1px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw line to parent
            if ($genarray[$w]["gen"] != 0 and $genarray[$w]["2nd"] != 1) {
                $startx = $genarray[$w]["x"] + $hsize / 2;
                $starty = $genarray[$w]["y"] - $vdist / 2;
                print '<div class="chart_line" style="position:absolute; height:' . $vdist / 2 . 'px;width:1px;left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw horizontal line from 1st child in fam to last child in fam
            if ($genarray[$w]["gen"] != 0) {
                $parent = $genarray[$w]["par"];
                if ($genarray[$w]["chd"] == $genarray[$parent]["nrc"]) {
                    // last child in fam
                    $z = $w;
                    while ($genarray[$z]["2nd"] == 1) {
                        //if last is 2nd (3rd etc) marriage, the line has to stop at first marriage
                        $z--;
                    }
                    $startx = $genarray[$parent]["fst"] + $hsize / 2;
                    $starty = $genarray[$z]["y"] - $vdist / 2;
                    $width = $genarray[$z]["x"] - $genarray[$parent]["fst"];
                    print '<div class="chart_line" style="position:absolute; height:1px; width:' . $width . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
                }
            }
        } else {
            // if horizontal
            // draw dotted line from first marriage to following marriages
            if (isset($genarray[$w]["2nd"]) and $genarray[$w]["2nd"] == 1) {
                $starty = $genarray[$w - 1]["y"] + $vsize + 2;
                $startx = $genarray[$w - 1]["x"] + $hsize / 2;
                $height = $genarray[$w]["y"] - ($genarray[$w - 1]["y"] + $vsize) - 2;
                print '<div style="position:absolute;border:1px blue dashed;height:' . $height . 'px; width:3px; left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw line to children
            if ($genarray[$w]["nrc"] != 0) {
                $starty = $genarray[$w]["y"] + $vsize / 2;
                $startx = $genarray[$w]["x"] + $hsize + 3;
                print '<div class="chart_line" style="position:absolute; height:1px; width:' . ($hdist / 2 - 2) . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw line to parent
            if ($genarray[$w]["gen"] != 0 and $genarray[$w]["2nd"] != 1) {
                $starty = $genarray[$w]["y"] + $vsize / 2;
                $startx = $genarray[$w]["x"] - $hdist / 2;
                print '<div class="chart_line" style="position:absolute; width:' . $hdist / 2 . 'px; height:1px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw vertical line from 1st child in fam to last child in fam
            if ($genarray[$w]["gen"] != 0) {
                $parent = $genarray[$w]["par"];
                if ($genarray[$w]["chd"] == $genarray[$parent]["nrc"]) {
                    // last child in fam
                    $z = $w;
                    while ($genarray[$z]["2nd"] == 1) {
                        //if last is 2nd (3rd etc) marriage, the line has to stop at first marriage
                        $z--;
                    }
                    $starty = $genarray[$parent]["fst"] + $vsize / 2;
                    $startx = $genarray[$z]["x"] - $hdist / 2;
                    $height = $genarray[$z]["y"] - $genarray[$parent]["fst"];
                    print '<div class="chart_line" style="position:absolute; width:1px; height:' . $height . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
                }
            }
        }
        // end if horizontal
    }
    echo '</div>';
    // id=png
    print "<br><br></div>";
    // id=doublescroll
    // YB:
    // before creating the image we want to hide unnecessary items such as the help link, the menu box etc
    // we also have to set the width and height of the "png" div (this can't be set before because then the double scrollbars won't work
    // after generating the image, all those items are returned to their  previous state....
    echo '<script type="text/javascript">';
    if ($hourglass === false) {
        echo "\n\t\tfunction showimg() { \n\t\t\tdocument.getElementById('helppopup').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('menubox').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('imgbutton').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('png').style.width = '" . $divlen . "px';\n\t\t\tdocument.getElementById('png').style.height= '" . $divhi . "px';\n\t\t\thtml2canvas( [ document.getElementById('png') ], {  \n\t\t\t\tonrendered: function( canvas ) {\n\t\t\t\t\tdocument.getElementById('helppopup').style.visibility = 'visible';\n\t\t\t\t\tdocument.getElementById('menubox').style.visibility = 'visible';\n\t\t\t\t\tdocument.getElementById('imgbutton').style.visibility = 'visible';\n\t\t\t\t\tvar img = canvas.toDataURL();\n\t\t\t\t\tdocument.getElementById('png').style.width = 'auto';\n\t\t\t\t\tdocument.getElementById('png').style.height= 'auto';\n\t\t\t\t\tvar newWin = window.open();\n\t\tnewWin.document.open();\n\t\tnewWin.document.write('<!DOCTYPE html><head></head><body>" . __('Right click on the image below and save it as a .png file to your computer.<br>You can then print it over multiple pages with dedicated third-party programs, such as the free: ') . "<a href=\"http://posterazor.sourceforge.net/index.php?page=download&lang=english\" target=\"_blank\">\"PosteRazor\"</a><br>" . __('If you have a plotter you can use its software to print the image on one large sheet.') . "<br><br><img src=\"' + img + '\"></body></html>');\n\t\tnewWin.document.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t";
    } else {
        echo "\n\t\tfunction showimg() { \n\t\t\tdocument.getElementById('png').style.width = '" . $divlen . "px';\n\t\t\tdocument.getElementById('png').style.height= '" . $divhi . "px';\n\t\t\thtml2canvas( [ document.getElementById('png') ], {  \n\t\t\t\tonrendered: function( canvas ) {\n\t\t\t\tvar img = canvas.toDataURL();\n\t\t\t\tdocument.getElementById('png').style.width = 'auto';\n\t\t\t\tdocument.getElementById('png').style.height= 'auto';\n\t\t\t\tvar newWin = window.open();\n\t\tnewWin.document.open();\n\t\tnewWin.document.write('<!DOCTYPE html><head></head><body>" . __('Right click on the image below and save it as a .png file to your computer.<br>You can then print it over multiple pages with dedicated third-party programs, such as the free: ') . "<a href=\"http://posterazor.sourceforge.net/index.php?page=download&lang=english\" target=\"_blank\">\"PosteRazor\"</a><br>" . __('If you have a plotter you can use its software to print the image on one large sheet.') . "<br><br><img src=\"' + img + '\"></body></html>');\n\t\tnewWin.document.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t";
    }
    echo "</script>";
    ?>
	<script type='text/javascript'>
		function DoubleScroll(element) {
			var scrollbar= document.createElement('div');
			scrollbar.appendChild(document.createElement('div'));
			scrollbar.style.overflow= 'auto';
			scrollbar.style.overflowY= 'hidden';
			scrollbar.firstChild.style.width= element.scrollWidth+'px';
			scrollbar.firstChild.style.paddingTop= '1px';
			scrollbar.firstChild.style.height= '20px';
			scrollbar.firstChild.appendChild(document.createTextNode('\xA0'));
			scrollbar.onscroll= function() {
				element.scrollLeft= scrollbar.scrollLeft;
			};
			element.onscroll= function() {
				scrollbar.scrollLeft= element.scrollLeft;
			};
			element.parentNode.insertBefore(scrollbar, element);
		}

		DoubleScroll(document.getElementById('doublescroll'));
	</script>
<?php 
    // here place div at bottom so there is some space under last boxes
    $last = count($genarray) - 1;
    $putit = $genarray[$last]["y"] + 130;
    print '<div style="position:absolute;left:1px;top:' . $putit . 'px;">&nbsp; </div>';
}
function mapbirthplace($place)
{
    global $dbh, $tree_id, $language, $map_max;
    if (isset($_GET['namestring'])) {
        $temparray = explode("@", $_GET['namestring']);
        $namestring = " (";
        foreach ($temparray as $value) {
            //echo $value.'<br>';
            //$namestring .=  "pers_lastname = '".$value."' OR ";
            $namestring .= "CONCAT(pers_lastname,'_',LOWER(SUBSTRING_INDEX(pers_prefix,'_',1))) = '" . $value . "' OR ";
        }
        $namestring = substr($namestring, 0, -3) . ") AND ";
        //echo $namestring;
    } else {
        $namestring = '';
    }
    $desc_arr = '';
    $idstring = '';
    if (isset($_SESSION['desc_array'])) {
        $desc_arr = $_SESSION['desc_array'];
        $idstring = ' (';
        foreach ($desc_arr as $value) {
            $idstring .= " pers_gedcomnumber = '" . $value . "' OR ";
        }
        $idstring = substr($idstring, 0, -3) . ') AND ';
    }
    $min = 1;
    if ($place != "NONFOUND") {
        if ($_SESSION['type_birth'] == 1) {
            if (isset($_GET['all'])) {
                // the 'All birth locations' button
                echo '<b><u>' . __('All persons born here: ') . '</u></b><br>';
                //$maplist=$dbh->query("SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE ".$idstring.$namestring." (pers_birth_place = '".$place."' OR (pers_birth_place = '' AND pers_bapt_place = '".$place."')) ORDER BY wholename");
                $sql = "SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename\n\t\t\t\t\tFROM humo_persons WHERE pers_tree_id='" . $tree_id . "'\n\t\t\t\t\tAND " . $idstring . $namestring . " (pers_birth_place = '" . $place . "' OR (pers_birth_place = '' AND pers_bapt_place = '" . $place . "')) ORDER BY wholename";
                $maplist = $dbh->query($sql);
            } else {
                // the slider
                echo '<b><u>' . __('Persons born here until ') . $map_max . ':</u></b><br>';
                $sql = "SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename FROM humo_persons\n\t\t\t\t\tWHERE pers_tree_id='" . $tree_id . "'\n\t\t\t\t\tAND " . $idstring . $namestring . " (pers_birth_place = '" . $place . "' OR (pers_birth_place = '' AND pers_bapt_place = '" . $place . "'))\n\t\t\t\t\tAND ((SUBSTR(pers_birth_date,-LEAST(4,CHAR_LENGTH(pers_birth_date))) < " . $map_max . "\n\t\t\t\t\tAND SUBSTR(pers_birth_date,-LEAST(4,CHAR_LENGTH(pers_birth_date))) > " . $min . ")\n\t\t\t\t\tOR (pers_birth_date='' AND SUBSTR(pers_bapt_date,-LEAST(4,CHAR_LENGTH(pers_bapt_date))) < " . $map_max . "\n\t\t\t\t\t\tAND SUBSTR(pers_bapt_date,-LEAST(4,CHAR_LENGTH(pers_bapt_date))) > " . $min . "))\n\t\t\t\t\tORDER BY wholename";
                $maplist = $dbh->query($sql);
            }
        } elseif ($_SESSION['type_death'] == 1) {
            if (isset($_GET['all'])) {
                // the 'All birth locations' button
                echo '<b><u>' . __('All persons that died here: ') . '</u></b><br>';
                //$maplist=$dbh->query("SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE ".$idstring.$namestring." (pers_death_place = '".$place."' OR (pers_death_place = '' AND pers_buried_place = '".$place."')) ORDER BY wholename");
                $sql = "SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename\n\t\t\t\t\tFROM humo_persons\n\t\t\t\t\tWHERE pers_tree_id='" . $tree_id . "'\n\t\t\t\t\tAND " . $idstring . $namestring . "\n\t\t\t\t\t(pers_death_place = '" . $place . "' OR (pers_death_place = '' AND pers_buried_place = '" . $place . "'))\n\t\t\t\t\tORDER BY wholename";
                $maplist = $dbh->query($sql);
            } else {
                // the slider
                echo '<b><u>' . __('Persons that died here until ') . $map_max . ':</u></b><br>';
                $sql = "SELECT * , CONCAT(pers_lastname,pers_firstname) AS wholename FROM humo_persons\n\t\t\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND " . $idstring . $namestring . "\n\t\t\t\t\t(pers_death_place = '" . $place . "' OR (pers_death_place = '' AND pers_buried_place = '" . $place . "')) AND\n\t\t\t\t\t((SUBSTR(pers_death_date,-LEAST(4,CHAR_LENGTH(pers_death_date))) < " . $map_max . " AND SUBSTR(pers_death_date,-LEAST(4,CHAR_LENGTH(pers_death_date))) > " . $min . ") OR\n\t\t\t\t\t(pers_death_date='' AND SUBSTR(pers_buried_date,-LEAST(4,CHAR_LENGTH(pers_buried_date))) < " . $map_max . " AND SUBSTR(pers_buried_date,-LEAST(4,CHAR_LENGTH(pers_buried_date))) > " . $min . "))\n\t\t\t\t\tORDER BY wholename";
                $maplist = $dbh->query($sql);
            }
        }
        //echo 'TEST: '.$sql;
        $man_cls = new person_cls();
        echo '<div style="direction:ltr">';
        while (@($maplistDb = $maplist->fetch(PDO::FETCH_OBJ))) {
            $man_cls->construct($maplistDb);
            $privacy_man = $man_cls->privacy;
            $name = $man_cls->person_name($maplistDb);
            if ($name["show_name"] == true) {
                echo '<a href=family.php?database=' . safe_text($_SESSION['tree_prefix']) . '&amp;id=' . $maplistDb->pers_indexnr . '&amp;main_person=' . $maplistDb->pers_gedcomnumber . ' target="blank">';
            }
            if ($_SESSION['type_birth'] == 1) {
                echo $name["index_name"];
                $date = $maplistDb->pers_birth_date;
                $sign = __('born') . ' ';
                if (!$maplistDb->pers_birth_date and $maplistDb->pers_bapt_date) {
                    $date = $maplistDb->pers_bapt_date;
                    $sign = __('baptised') . ' ';
                }
            }
            if ($_SESSION['type_death'] == 1) {
                echo $name["index_name"];
                $date = $maplistDb->pers_death_date;
                $sign = __('died') . ' ';
                if (!$maplistDb->pers_death_date and $maplistDb->pers_buried_date) {
                    $date = $maplistDb->pers_buried_date;
                    $sign = __('buried') . ' ';
                }
            }
            if (!$privacy_man and $date and $name["show_name"] == true) {
                echo ' (' . $sign . date_place($date, '') . ')';
            }
            if ($name["show_name"] == true) {
                echo '</a>';
            }
            echo '<br>';
        }
        echo '</div>';
    } else {
        // Logically we can never get here
        echo 'No persons found';
    }
}
function show_person($familyDb)
{
    global $dbh, $db_functions, $tree_id, $selected_place, $language, $user;
    global $bot_visit, $humo_option, $uri_path, $search_database, $list_expanded;
    global $selected_language, $privacy, $dirmark1, $dirmark2, $rtlmarker;
    global $select_marriage_notice, $select_marriage, $select_marriage_notice_religious, $select_marriage_religious;
    if ($familyDb->fam_man) {
        $selected_person1 = $familyDb->fam_man;
    } else {
        $selected_person1 = $familyDb->fam_woman;
    }
    $personDb = $db_functions->get_person($selected_person1);
    $pers_tree_prefix = $personDb->pers_tree_prefix;
    //if (CMS_SPECIFIC=='Joomla'){
    //	$start_url='index.php?option=com_humo-gen&amp;task=family&amp;database='.$pers_tree_prefix.
    //		'&amp;id='.$personDb->pers_indexnr.'&amp;main_person='.$personDb->pers_gedcomnumber;
    //}
    //else
    if ($humo_option["url_rewrite"] == "j") {
        // *** url_rewrite ***
        // *** $uri_path made in header.php ***
        $start_url = $uri_path . 'family/' . $pers_tree_prefix . '/' . $personDb->pers_indexnr . '/' . $personDb->pers_gedcomnumber . '/';
    } else {
        $start_url = CMS_ROOTPATH . 'family.php?database=' . $pers_tree_prefix . '&amp;id=' . $personDb->pers_indexnr . '&amp;main_person=' . $personDb->pers_gedcomnumber;
    }
    // *** Person class used for name and person pop-up data ***
    $person_cls = new person_cls();
    $person_cls->construct($personDb);
    $privacy = $person_cls->privacy;
    $name = $person_cls->person_name($personDb);
    // *** Show name ***
    $index_name = '';
    if ($name["show_name"] == false) {
        $index_name = __('Name filtered');
    } else {
        // *** If there is no lastname, show a - character. ***
        if ($personDb->pers_lastname == "") {
            // Don't show a "-" by pers_patronymes
            if (!isset($_GET['pers_patronym'])) {
                $index_name = "-&nbsp;&nbsp;";
            }
        }
        $index_name .= $name["index_name_extended"] . $name["colour_mark"];
    }
    // *** Show extra colums before a person in index places ***
    if ($selected_place != $familyDb->place_order) {
        echo '<td colspan="7"><b>' . $dirmark2 . "{$familyDb->place_order}</b></td></tr><tr>";
    }
    $selected_place = $familyDb->place_order;
    echo '<td valign="top" style="white-space:nowrap;width:90px">';
    if ($select_marriage_notice == '1') {
        if ($selected_place == $familyDb->fam_marr_notice_place) {
            echo '<span class="place_index place_index_selected">' . __('&infin;') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage_notice_religious == '1') {
        if ($selected_place == $familyDb->fam_marr_church_notice_place) {
            echo '<span class="place_index place_index_selected">' . __('o') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage == '1') {
        if ($selected_place == $familyDb->fam_marr_place) {
            echo '<span class="place_index place_index_selected">' . __('X') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage_religious == '1') {
        if ($selected_place == $familyDb->fam_marr_church_place) {
            echo '<span class="place_index place_index_selected">' . __('x') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    echo '</td>';
    echo '<td valign="top" style="border-right:0px; white-space:nowrap;">';
    // *** Show person popup menu ***
    echo $person_cls->person_popup_menu($personDb);
    // *** Show picture man or wife ***
    if ($personDb->pers_sexe == "M") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man" style="vertical-align:top">';
    } elseif ($personDb->pers_sexe == "F") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman" style="vertical-align:top">';
    } else {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown" style="vertical-align:top">';
    }
    echo '</td><td style="border-left:0px;">';
    // *** Show name of person ***
    echo ' <a href="' . $start_url . '">' . rtrim($index_name) . '</a>';
    //*** Show spouse/ partner ***
    if ($list_expanded == true and $personDb->pers_fams) {
        $marriage_array = explode(";", $personDb->pers_fams);
        // *** Code to show only last marriage ***
        $nr_marriages = count($marriage_array);
        for ($x = 0; $x <= $nr_marriages - 1; $x++) {
            $fam_partnerDb = $db_functions->get_family($marriage_array[$x]);
            // *** This check is better then a check like: $personDb->pers_sexe=='F', because of unknown sexe or homosexual relations. ***
            if ($personDb->pers_gedcomnumber == $fam_partnerDb->fam_man) {
                $partner_id = $fam_partnerDb->fam_woman;
            } else {
                $partner_id = $fam_partnerDb->fam_man;
            }
            $relation_short = __('&amp;');
            if ($fam_partnerDb->fam_marr_date or $fam_partnerDb->fam_marr_place or $fam_partnerDb->fam_marr_church_date or $fam_partnerDb->fam_marr_church_place) {
                $relation_short = __('X');
            }
            if ($fam_partnerDb->fam_div_date or $fam_partnerDb->fam_div_place) {
                $relation_short = __(') (');
            }
            if ($partner_id != '0' and $partner_id != '') {
                $partnerDb = $db_functions->get_person($partner_id);
                $partner_cls = new person_cls();
                $privacy2 = $person_cls->privacy;
                $name = $partner_cls->person_name($partnerDb);
            } else {
                $name["standard_name"] = __('N.N.');
            }
            if ($nr_marriages > 1) {
                echo ',';
            }
            if (@$partnerDb->pers_gedcomnumber != $familyDb->fam_woman) {
                // *** Show actual relation/ marriage in special font ***
                echo ' <span class="index_partner" style="font-size:10px;">';
            } else {
                echo ' ';
            }
            if ($nr_marriages > 1) {
                if ($x == 0) {
                    echo __('1st');
                } elseif ($x == 1) {
                    echo ' ' . __('2nd');
                } elseif ($x == 2) {
                    echo ' ' . __('3rd');
                } elseif ($x > 2) {
                    echo ' ' . ($x + 1) . __('th');
                }
            }
            echo ' ' . $relation_short . ' ' . rtrim($name["standard_name"]);
            if (@$partnerDb->pers_gedcomnumber != $familyDb->fam_woman) {
                echo '</span>';
            }
        }
    }
    // *** End spouse/ partner ***
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($familyDb->fam_marr_church_notice_date) {
        $info = __('o') . ' ' . date_place($familyDb->fam_marr_church_notice_date, '');
    }
    if ($familyDb->fam_marr_notice_date) {
        $info = __('&infin;') . ' ' . date_place($familyDb->fam_marr_notice_date, '');
    }
    //echo "<span style='font-size:90%'>".$info.$dirmark1."</span>";
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($familyDb->fam_marr_church_notice_place) {
        $info = __('o') . ' ' . $familyDb->fam_marr_church_notice_place;
    }
    if ($familyDb->fam_marr_notice_place) {
        $info = __('&infin;') . ' ' . $familyDb->fam_marr_notice_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($familyDb->fam_marr_church_date) {
        $info = __('x') . ' ' . date_place($familyDb->fam_marr_church_date, '');
    }
    if ($familyDb->fam_marr_date) {
        $info = __('X') . ' ' . date_place($familyDb->fam_marr_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($familyDb->fam_marr_church_place) {
        $info = __('x') . ' ' . $familyDb->fam_marr_church_place;
    }
    if ($familyDb->fam_marr_place) {
        $info = __('X') . ' ' . $familyDb->fam_marr_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td></tr>';
}
Exemple #9
0
 while ($desc_searchDb = $desc_search_result->fetch(PDO::FETCH_OBJ)) {
     $countmarr = 0;
     $man_cls = new person_cls();
     $fam_arr = explode(";", $desc_searchDb->pers_fams);
     foreach ($fam_arr as $value) {
         if ($countmarr == 1) {
             break;
         }
         //this person is already listed
         $chld_var = $value;
         $chld_prep->execute();
         while ($chld_search_resultDb = $chld_prep->fetch(PDO::FETCH_OBJ)) {
             $countmarr = 1;
             $selected = '';
             //if($desc_searchDb->pers_gedcomnumber == $chosenperson) { $selected = ' SELECTED '; }
             $man_cls->construct($desc_searchDb);
             $privacy_man = $man_cls->privacy;
             $date = '';
             if (!$privacy_man) {
                 // if a person has privacy set (even if only for data, not for name,
                 // we won't put them on the list. Most likely it concerns recent people.
                 // Also, using the $man_cls->person_name functions takes too much time...
                 $b_date = $desc_searchDb->pers_birth_date;
                 $b_sign = __('born') . ' ';
                 if (!$desc_searchDb->pers_birth_date and $desc_searchDb->pers_bapt_date) {
                     $b_date = $desc_searchDb->pers_bapt_date;
                     $b_sign = __('baptised') . ' ';
                 }
                 $d_date = $desc_searchDb->pers_death_date;
                 $d_sign = __('died') . ' ';
                 if (!$desc_searchDb->pers_death_date and $desc_searchDb->pers_buried_date) {
Exemple #10
0
         if (isset($key) and $key > 0) {
             $text_array[$key] .= "\\n" . addslashes($google_name . ", " . strtolower(__('Married')) . ' ' . $familyDb->fam_marr_place);
         } else {
             $location_array[] = $familyDb->fam_marr_place;
             $lat_array[] = $info['location_lat'];
             $lon_array[] = $info['location_lng'];
             $text_array[] = addslashes($google_name . ", " . strtolower(__('Married')) . ' ' . $familyDb->fam_marr_place);
         }
     }
 }
 $child_array = explode(";", $familyDb->fam_children);
 for ($i = 0; $i <= substr_count($familyDb->fam_children, ";"); $i++) {
     @($childDb = $db_functions->get_person($child_array[$i]));
     // *** Use person class ***
     $person_cls = new person_cls();
     $person_cls->construct($childDb);
     if ($person_cls->privacy == '') {
         // *** Child birth ***
         $location_var = $childDb->pers_birth_place;
         $location_prep->execute();
         $child_result = $location_prep->rowCount();
         if ($child_result > 0) {
             $info = $location_prep->fetch();
             $name = $person_cls->person_name($childDb);
             $google_name = $name["standard_name"];
             $key = array_search($childDb->pers_birth_place, $location_array);
             if (isset($key) and $key > 0) {
                 $text_array[$key] .= "\\n" . addslashes($google_name . ", " . __('BORN_SHORT') . ' ' . $childDb->pers_birth_place);
             } else {
                 $location_array[] = $childDb->pers_birth_place;
                 $lat_array[] = $info['location_lat'];
    echo '<div style="height:400px; width:60%; margin-left: 20%; overflow-y: scroll;">';
} else {
    echo '<div style="height:400px; width:60%; margin-right: 20%; overflow-y: scroll;">';
}
echo '<table class="humo" width="99%">';
echo '<tr class=table_headline>';
echo '<th style="font-size: 90%; text-align: left">' . __('Changed/ Added') . '</th>';
echo '<th style="font-size: 90%; text-align: left">' . __('When changed') . '</th>';
echo '<th style="font-size: 90%; text-align: left">' . __('When added') . '</th>';
echo '</tr>';
$rowcounter = 0;
while (@($person = $person_result->fetch(PDO::FETCH_OBJ))) {
    $rowcounter++;
    echo '<tr>';
    echo '<td style="font-size: 90%">';
    $person_cls->construct($person);
    echo $person_cls->person_popup_menu($person);
    if ($person->pers_sexe == "M") {
        echo '<img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man">';
    } elseif ($person->pers_sexe == "F") {
        echo '<img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman">';
    } else {
        echo '<img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown">';
    }
    echo '<a href="' . CMS_ROOTPATH . 'family.php?database=' . $_SESSION['tree_prefix'] . '&amp;id=' . $person->pers_indexnr . '&amp;main_person=' . $person->pers_gedcomnumber . '">';
    $name = $person_cls->person_name($person);
    echo $name["standard_name"];
    echo '</a>';
    echo '</td><td style="font-size: 90%">';
    echo '<span style="white-space: nowrap">' . strtolower($person->pers_changed_date) . ' - ' . $person->pers_changed_time . '</span>';
    echo '</td><td style="font-size: 90%">';
Exemple #12
0
/**
* print ancestors on a fan chart
* @param array $treeid ancestry pid
* @param int $fanw fan width in px (default=840)
* @param int $fandeg fan size in deg (default=270)
*/
function print_fan_chart($treeid, $fanw = 840, $fandeg = 270)
{
    global $dbh, $tree_id, $db_functions, $fontsize, $date_display;
    global $fan_style, $family_id;
    global $printing, $language, $selected_language;
    global $pers_var, $tree_prefix_quoted;
    global $china_message;
    // check for GD 2.x library
    if (!defined("IMG_ARC_PIE")) {
        print "ERROR: NO GD LIBRARY";
        return false;
    }
    if (!function_exists("ImageTtfBbox")) {
        print "ERROR: NO GD LIBRARY";
        return false;
    }
    if (intval($fontsize) < 2) {
        $fontsize = 7;
    }
    $treesize = count($treeid);
    if ($treesize < 1) {
        return;
    }
    // generations count
    $gen = log($treesize) / log(2) - 1;
    $sosa = $treesize - 1;
    // fan size
    if ($fandeg == 0) {
        $fandeg = 360;
    }
    $fandeg = min($fandeg, 360);
    $fandeg = max($fandeg, 90);
    $cx = $fanw / 2 - 1;
    // center x
    $cy = $cx;
    // center y
    $rx = $fanw - 1;
    $rw = $fanw / ($gen + 1);
    $fanh = $fanw;
    // fan height
    if ($fandeg == 180) {
        $fanh = round($fanh * ($gen + 1) / ($gen * 2));
    }
    if ($fandeg == 270) {
        $fanh = round($fanh * 0.86);
    }
    $scale = $fanw / 840;
    // image init
    $image = ImageCreate($fanw, $fanh);
    $black = ImageColorAllocate($image, 0, 0, 0);
    $white = ImageColorAllocate($image, 0xff, 0xff, 0xff);
    ImageFilledRectangle($image, 0, 0, $fanw, $fanh, $white);
    if ($printing == 1) {
        ImageColorTransparent($image, $white);
    }
    // *** Border colour ***
    $rgb = "";
    if (empty($rgb)) {
        $rgb = "#6E6E6E";
    }
    $grey = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2)));
    // *** Text colour ***
    $rgb = "";
    if (empty($rgb)) {
        $rgb = "#000000";
    }
    $color = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2)));
    // *** Background colour ***
    $rgb = "";
    if (empty($rgb)) {
        $rgb = "#EEEEEE";
    }
    $bgcolor = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2)));
    // *** Man colour ***
    $rgb = "";
    if (empty($rgb)) {
        $rgb = "#B2DFEE";
    }
    $bgcolorM = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2)));
    // *** wife colour ***
    $rgb = "";
    if (empty($rgb)) {
        $rgb = "#FFE4C4";
    }
    $bgcolorF = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2)));
    // imagemap
    $imagemap = "<map id=\"fanmap\" name=\"fanmap\">";
    // loop to create fan cells
    while ($gen >= 0) {
        // clean current generation area
        $deg2 = 360 + ($fandeg - 180) / 2;
        $deg1 = $deg2 - $fandeg;
        ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bgcolor, IMG_ARC_PIE);
        ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bgcolor, IMG_ARC_EDGED | IMG_ARC_NOFILL);
        $rx -= 3;
        // calculate new angle
        $p2 = pow(2, $gen);
        $angle = $fandeg / $p2;
        $deg2 = 360 + ($fandeg - 180) / 2;
        $deg1 = $deg2 - $angle;
        // special case for rootid cell
        if ($gen == 0) {
            $deg1 = 90;
            $deg2 = 360 + $deg1;
        }
        // draw each cell
        while ($sosa >= $p2) {
            $pid = $treeid[$sosa][0];
            $birthyr = $treeid[$sosa][1];
            $deathyr = $treeid[$sosa][4];
            $fontpx = $fontsize;
            if ($sosa >= 16 and $fandeg == 180) {
                $fontpx = $fontsize - 1;
            }
            if ($sosa >= 32 and $fandeg != 180) {
                $fontpx = $fontsize - 1;
            }
            if (!empty($pid)) {
                if ($sosa % 2) {
                    $bg = $bgcolorF;
                } else {
                    $bg = $bgcolorM;
                }
                if ($sosa == 1) {
                    if ($treeid[$sosa][5] == "F") {
                        $bg = $bgcolorF;
                    } else {
                        if ($treeid[$sosa][5] == "M") {
                            $bg = $bgcolorM;
                        } else {
                            $bg = $bgcolor;
                            // sex unknown
                        }
                    }
                }
                ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bg, IMG_ARC_PIE);
                if ($gen != 0) {
                    ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $grey, IMG_ARC_EDGED | IMG_ARC_NOFILL);
                } else {
                    ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $grey, IMG_ARC_NOFILL);
                }
                $name = $pid;
                // check if string is RTL language- if it is, it has to be reversed later on by persian_log2vis()
                $rtlstr = 0;
                //if(preg_match('/(*UTF8)[א-ת]/',$name)!==0 OR preg_match('/(*UTF8)[أ-ى]/',$name)!==0) {
                if (preg_match('/(*UTF8)[א-ת]/', $name) === 1 or preg_match('/(*UTF8)[أ-ى]/', $name) === 1) {
                    // this is either Hebrew, Arabic or Persian -> we have to reverse the text!
                    $rtlstr = 1;
                }
                $fontfile = CMS_ROOTPATH . "include/fanchart/dejavusans.ttf";
                // this default font serves: Latin,Hebrew,Arabic,Persian,Russian
                //if(preg_match('/(*UTF8)\p{Han}/',$name)!==0) {	// String is Chinese so use a Chinese ttf font if present in the folder
                if (preg_match('/(*UTF8)\\p{Han}/', $name) === 1) {
                    // String is Chinese so use a Chinese ttf font if present in the folder
                    if (is_dir(CMS_ROOTPATH . "include/fanchart/chinese")) {
                        $dh = opendir(CMS_ROOTPATH . "include/fanchart/chinese");
                        while (false !== ($filename = readdir($dh))) {
                            //if (strtolower(substr($filename, -3)) == "ttf"){
                            if (strtolower(substr($filename, -3)) == "otf" or strtolower(substr($filename, -3)) == "ttf") {
                                $fontfile = CMS_ROOTPATH . "include/fanchart/chinese/" . $filename;
                            }
                        }
                    }
                    if ($fontfile == CMS_ROOTPATH . "include/fanchart/dejavusans.ttf") {
                        //no Chinese ttf file found
                        $china_message = 1;
                    }
                }
                $text = $name;
                // names
                $text2 = "";
                // dates
                if ($date_display == 1) {
                    // don't show dates
                } else {
                    if ($date_display == 2) {
                        //show years only
                        // years only chosen but we also do this if no place in outer circles
                        $text2 .= substr($birthyr, -4) . " - " . substr($deathyr, -4);
                    } else {
                        if ($date_display == 3) {
                            //show full dates (but not in narrow outer circles!)
                            if ($gen > 5) {
                                $text2 .= substr($birthyr, -4) . " - " . substr($deathyr, -4);
                            } else {
                                if ($gen > 4 and $fan_style != 4) {
                                    $text2 .= substr($birthyr, -4) . " - " . substr($deathyr, -4);
                                } else {
                                    // full dates
                                    if ($birthyr) {
                                        $text2 .= "b." . $birthyr . "\n";
                                    }
                                    if ($deathyr) {
                                        $text2 .= "d." . $deathyr;
                                    }
                                }
                            }
                        }
                    }
                }
                // split and center text by lines
                $wmax = floor($angle * 7 / $fontpx * $scale);
                $wmax = min($wmax, 35 * $scale);
                //35
                //$wmax = floor((90*$wmax)/100);
                if ($gen == 0) {
                    $wmax = min($wmax, 17 * $scale);
                }
                //17
                $text = split_align_text($text, $wmax, $rtlstr, 1, $gen);
                $text2 = split_align_text($text2, $wmax, $rtlstr, 0, $gen);
                if ($rtlstr == 1) {
                    persian_log2vis($text);
                    // converts persian, arab and hebrew text from logical to visual and reverses it
                }
                $text .= "\n" . $text2;
                // text angle
                $tangle = 270 - ($deg1 + $angle / 2);
                if ($gen == 0) {
                    $tangle = 0;
                }
                // calculate text position
                $bbox = ImageTtfBbox((double) $fontpx, 0, $fontfile, $text);
                $textwidth = $bbox[4];
                //4
                $deg = $deg1 + 0.44;
                if ($deg2 - $deg1 > 40) {
                    $deg = $deg1 + ($deg2 - $deg1) / 11;
                }
                // 11
                if ($deg2 - $deg1 > 80) {
                    $deg = $deg1 + ($deg2 - $deg1) / 7;
                }
                //  7
                if ($deg2 - $deg1 > 140) {
                    $deg = $deg1 + ($deg2 - $deg1) / 4;
                }
                //  4
                if ($gen == 0) {
                    $deg = 180;
                }
                $rad = deg2rad($deg);
                $mr = ($rx - $rw / 4) / 2;
                if ($gen > 0 and $deg2 - $deg1 > 80) {
                    $mr = $rx / 2;
                }
                $tx = $cx + $mr * cos($rad);
                $ty = $cy - $mr * -sin($rad);
                if ($sosa == 1) {
                    $ty -= $mr / 2;
                }
                // print text
                ImageTtfText($image, (double) $fontpx, $tangle, $tx, $ty, $color, $fontfile, $text);
                $imagemap .= "<area shape=\"poly\" coords=\"";
                // plot upper points
                $mr = $rx / 2;
                $deg = $deg1;
                while ($deg <= $deg2) {
                    $rad = deg2rad($deg);
                    $tx = round($cx + $mr * cos($rad));
                    $ty = round($cy - $mr * -sin($rad));
                    $imagemap .= "{$tx}, {$ty}, ";
                    $deg += ($deg2 - $deg1) / 6;
                }
                // plot lower points
                $mr = ($rx - $rw) / 2;
                $deg = $deg2;
                while ($deg >= $deg1) {
                    $rad = deg2rad($deg);
                    $tx = round($cx + $mr * cos($rad));
                    $ty = round($cy - $mr * -sin($rad));
                    $imagemap .= "{$tx}, {$ty}, ";
                    $deg -= ($deg2 - $deg1) / 6;
                }
                // join first point
                $mr = $rx / 2;
                $deg = $deg1;
                $rad = deg2rad($deg);
                $tx = round($cx + $mr * cos($rad));
                $ty = round($cy - $mr * -sin($rad));
                $imagemap .= "{$tx}, {$ty}";
                if (CMS_SPECIFIC == "Joomla") {
                    $imagemap .= "\" href=\"index.php?option=com_humo-gen&amp;task=family&amp;id=" . $treeid[$sosa][2] . "&amp;main_person=" . $treeid[$sosa][3] . "\"";
                } else {
                    $imagemap .= "\" href=\"family.php?id=" . $treeid[$sosa][2] . "&amp;main_person=" . $treeid[$sosa][3] . "\"";
                }
                //NEW - add first spouse to base person's tooltip
                $spousename = "";
                if ($gen == 0 and $treeid[1][2] != "") {
                    // base person and has spouse
                    if ($treeid[1][5] == "F") {
                        $spouse = "fam_man";
                    } else {
                        $spouse = "fam_woman";
                    }
                    $spouse_result = $dbh->query("SELECT " . $spouse . " FROM humo_families\n\t\t\t\t\t\tWHERE fam_tree_id='" . $tree_id . "' AND fam_gedcomnumber='" . $treeid[1][2] . "'");
                    @($spouseDb = $spouse_result->fetch());
                    // fetch() with no parameter deaults to array which is what we want here
                    @($spouse2Db = $db_functions->get_person($spouseDb[$spouse]));
                    $spouse_cls = new person_cls();
                    $spouse_cls->construct($spouse2Db);
                    $spname = $spouse_cls->person_name($spouse2Db);
                    if ($treeid[1][5] == "F") {
                        $spouse_lan = "SPOUSE_MALE";
                    } else {
                        $spouse_lan = "SPOUSE_FEMALE";
                    }
                    if ($spname != "") {
                        $spousename = "\n(" . __($spouse_lan) . ": " . $spname["standard_name"] . ")";
                    }
                }
                $imagemap .= " alt=\"" . $pid . "\" title=\"" . $pid . $spousename . "\">";
            }
            $deg1 -= $angle;
            $deg2 -= $angle;
            $sosa--;
        }
        $rx -= $rw;
        $gen--;
    }
    $imagemap .= "</map>";
    echo $imagemap;
    $image_title = preg_replace("~<.*>~", "", $name) . "   - " . __('RELOAD FANCHART WITH \'VIEW\' BUTTON ON THE LEFT');
    echo "<p align=\"center\" >";
    if (CMS_SPECIFIC == "Joomla") {
        ImagePng($image, CMS_ROOTPATH . "include/fanchart/tmpimg.png");
        $ext = "?" . time();
        // add random string to file to prevent loading from cache and then replacing which is not nice
        echo "<img src=\"index.php?option=com_humo-gen&task=fanimage&format=raw&nochache=" . $ext . "\" width=\"{$fanw}\" height=\"{$fanh}\" border=\"0\" alt=\"{$image_title}\" title=\"{$image_title}\" usemap=\"#fanmap\">";
    } else {
        ob_start();
        ImagePng($image);
        $image_data = ob_get_contents();
        ob_end_clean();
        $image_data = serialize($image_data);
        unset($_SESSION['image_data']);
        $_SESSION['image_data'] = $image_data;
        echo "<img src=\"include/fanchart/fanimage.php\" width=\"{$fanw}\" height=\"{$fanh}\" border=\"0\" alt=\"{$image_title}\" title=\"{$image_title}\" usemap=\"#fanmap\">";
    }
    echo "</p>\n";
    ImageDestroy($image);
}
 function place_cells($type, $begin, $end, $increment, $maxchar, $numrows, $cellwidth)
 {
     global $dbh, $db_functions, $tree_prefix_quoted, $pdf, $data_array, $posy, $posx, $marr_date_array, $marr_place_array, $sexe, $gedcomnumber;
     $pdf->SetLeftMargin(16);
     $marg = 16;
     for ($m = $begin; $m <= $end; $m += $increment) {
         if ($type == "pers") {
             // person's name & details
             data_array($m, $maxchar, $numrows);
             $pdf->SetFont('Arial', 'B', 8);
             if ($m % 2 == 0 or $m == 1 and $sexe[$m] == "M") {
                 // male
                 $pdf->SetFillColor(191, 239, 255);
             } else {
                 // female
                 $pdf->SetFillColor(255, 228, 225);
             }
             $pdf->MultiCell($cellwidth, 4, $data_array[$m][0], "LTR", "C", true);
             $marg += $cellwidth;
             $pdf->SetFont('Arial', '', 8);
             $nstring = '';
             $used = $data_array[$m][3] + $data_array[$m][4] + $data_array[$m][5];
         } else {
             // marr date & place
             $space = '';
             if ($marr_date_array[$m] != '') {
                 $space = ' ';
             }
             if ($gedcomnumber[$m] != '') {
                 @($personDb = $db_functions->get_person($gedcomnumber[$m]));
                 $person_cls = new person_cls();
                 $person_cls->construct($personDb);
                 $pers_privacy = $person_cls->privacy;
             } else {
                 $pers_privacy = false;
             }
             if ($gedcomnumber[$m + 1] != '') {
                 @($womanDb = $db_functions->get_person($gedcomnumber[$m + 1]));
                 $woman_cls = new person_cls();
                 $woman_cls->construct($womanDb);
                 $woman_privacy = $person_cls->privacy;
             } else {
                 $woman_privacy = false;
             }
             if ($pers_privacy or $woman_privacy) {
                 $marr = __('PRIVACY FILTER');
             } else {
                 $marr = __('X') . ' ' . $marr_date_array[$m] . $space . $marr_place_array[$m];
             }
             $result = parse_line($marr, $maxchar, $numrows);
             $marg += $cellwidth;
             $nstring = '';
             $used = $result[0];
         }
         for ($x = 1; $x <= $numrows - $used; $x++) {
             $nstring .= "\n" . " ";
         }
         if ($type == "pers") {
             $breakln = '';
             if ($data_array[$m][1] != '' and $data_array[$m][2] != '') {
                 $breakln = "\n";
             }
             if ($data_array[$m][4] == 0 and $data_array[$m][5] == 0) {
                 $nstring = substr($nstring, 0, strlen($nstring) - 1);
             }
             $pdf->SetFont('Arial', '', 8);
             $pdf->MultiCell($cellwidth, 4, $data_array[$m][1] . $breakln . $data_array[$m][2] . $nstring, "LRB", "C", true);
         } else {
             $pdf->SetFont('Arial', 'I', 8);
             $pdf->MultiCell($cellwidth, 4, $result[1] . $nstring, "LR", "C", false);
         }
         if ($m < $end) {
             $pdf->SetLeftMargin($marg);
             $pdf->SetY($posy);
         }
     }
     $pdf->SetX($posx);
     $posy = $pdf->GetY();
 }
 function show_person($row)
 {
     global $humo_option, $uri_path;
     $person_cls = new person_cls();
     $person_cls->construct($row);
     $name = $person_cls->person_name($row);
     if (CMS_SPECIFIC == "Joomla") {
         return '<td align="center"><a href="index.php?option=com_humo-gen&task=family&id=' . $row->pers_indexnr . '"><i><b>' . $name["standard_name"] . '</b></i> </a> </td>';
     } else {
         if ($humo_option["url_rewrite"] == "j") {
             // *** $uri_path generated in header.php ***
             return '<td align="center"><a href="' . $uri_path . 'family/' . $_SESSION['tree_prefix'] . '/' . $row->pers_indexnr . '/' . $row->pers_gedcomnumber . '/"><i><b>' . $name["standard_name"] . '</b></i> </a> </td>';
         } else {
             return '<td align="center"><a href="family.php?id=' . $row->pers_indexnr . '"><i><b>' . $name["standard_name"] . '</b></i> </a> </td>';
         }
     }
 }
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
}
Exemple #16
0
            $child = explode(";", $children);
            //$nopict=1;
            $number = 1;
            // 1 = show child number.
            for ($c = 0; $c <= count($child) - 1; $c++) {
                $res2 = $dbh->query("SELECT * FROM humo_persons\n\t\t\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber LIKE '" . safe_text($child[$c]) . "'");
                $info2 = $res2->fetch();
                $text = $info2['pers_gedcomnumber'];
                echo popup($text, false);
                // father
                // *** Show person details using standard HuMo-gen function ***
                //$child_sql=$dbh->query("SELECT * FROM ".safe_text($_SESSION['tree_prefix'])."person WHERE pers_gedcomnumber='".safe_text($text)."'");
                $child_sql = $dbh->query("SELECT * FROM humo_persons\n\t\t\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . safe_text($text) . "'");
                @($childDb = $child_sql->fetch(PDO::FETCH_OBJ));
                $child_cls = new person_cls();
                $child_cls->construct($childDb);
                echo $child_cls->person_data("mobile", 0);
                echo '</li>';
            }
            $number = '';
        }
        //else{
        //	print '<li><p>'.__('No known children or without children').'</p></li>';
        //}
    }
}
// if $marriage !=Null
echo '</ul>';
echo '</div>';
echo '<div data-role="footer" data-theme="b">';
echo '<h4>HuMo-gen GPL Licence</h4>';