Пример #1
0
function statistics_line($familyDb)
{
    global $dbh, $language, $person_cls, $selected_language;
    $tree_id = $familyDb->tree_id;
    echo '<tr>';
    if (isset($familyDb->count_lines)) {
        echo '<td>' . $familyDb->count_lines . '</td>';
    }
    $treetext = show_tree_text($familyDb->tree_prefix, $selected_language);
    echo '<td>' . $treetext['name'] . '</td>';
    if (!isset($familyDb->count_lines)) {
        echo '<td>' . $familyDb->stat_date_stat . '</td>';
    }
    // *** Check if family is still in the genealogy! ***
    $check_sql = $dbh->query("SELECT * FROM humo_families\n\t\tWHERE fam_tree_id='" . $tree_id . "' AND fam_gedcomnumber='{$familyDb->stat_gedcom_fam}'");
    $checkDb = $check_sql->fetch(PDO::FETCH_OBJ);
    $check = false;
    if ($checkDb and $checkDb->fam_man == $familyDb->stat_gedcom_man and $checkDb->fam_woman == $familyDb->stat_gedcom_woman) {
        $check = true;
    }
    if ($check == true) {
        if (CMS_SPECIFIC == "Joomla") {
            print '<td><a href="index.php?option=com_humo-gen&amp;task=family&amp;id=' . $familyDb->stat_gedcom_fam . '&amp;database=' . $familyDb->tree_prefix . '">' . __('Family') . ': </a>';
        } else {
            print '<td><a href="../family.php?id=' . $familyDb->stat_gedcom_fam . '&amp;database=' . $familyDb->tree_prefix . '">' . __('Family') . ': </a>';
        }
        //*** Man ***
        $person_qry = $dbh->query("SELECT * FROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . $familyDb->stat_gedcom_man . "'");
        $personDb = $person_qry->fetch(PDO::FETCH_OBJ);
        if (!$familyDb->stat_gedcom_man) {
            echo 'N.N.';
        } else {
            $name = $person_cls->person_name($personDb);
            echo $name["standard_name"];
        }
        echo " &amp; ";
        //*** Woman ***
        $person_qry = $dbh->query("SELECT * FROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . $familyDb->stat_gedcom_woman . "'");
        $personDb = $person_qry->fetch(PDO::FETCH_OBJ);
        if (!$familyDb->stat_gedcom_woman) {
            echo 'N.N.';
        } else {
            $name = $person_cls->person_name($personDb);
            echo $name["standard_name"];
        }
    } else {
        echo '<td><b>' . __('FAMILY NOT FOUND IN FAMILY TREE') . '</b></td>';
    }
}
Пример #2
0
if (isset($_GET['menu_admin'])) {
    $menu_admin = $_GET['menu_admin'];
}
// *** Select family tree ***
$tree_prefix_sql = "SELECT * FROM humo_trees WHERE tree_prefix!='EMPTY' ORDER BY tree_order";
$tree_prefix_result = $dbh->query($tree_prefix_sql);
echo __('Family tree') . ': ';
echo '<form method="POST" action="' . $phpself . '" style="display : inline;">';
echo '<input type="hidden" name="page" value="' . $page . '">';
echo '<select size="1" name="tree_id" onChange="this.form.submit();">';
while ($tree_prefixDb = $tree_prefix_result->fetch(PDO::FETCH_OBJ)) {
    $selected = '';
    if ($tree_prefixDb->tree_id == $tree_id) {
        $selected = ' SELECTED';
    }
    $treetext = show_tree_text($tree_prefixDb->tree_prefix, $selected_language);
    echo '<option value="' . $tree_prefixDb->tree_id . '"' . $selected . '>' . @$treetext['name'] . '</option>';
}
echo '</select>';
echo '</form>';
// *** Family trees administration menu ***
$data2sql = $dbh->query("SELECT * FROM humo_trees WHERE tree_id=" . $tree_id);
$data2Db = $data2sql->fetch(PDO::FETCH_OBJ);
echo '<p><div class="pageHeadingContainer pageHeadingContainer-lineVisible" aria-hidden="false" style="">';
echo '<div class="pageHeading">';
// <div class="pageHeadingText">Configuratie gegevens</div>
// <div class="pageHeadingWidgets" aria-hidden="true" style="display: none;"></div>
echo '<div class="pageTabsContainer" aria-hidden="false" style="">';
echo '<ul class="pageTabs">';
//echo '<li class="pageTabItem"><div tabindex="0" class="pageTab pageTab-active">Details</div></li>';
$select_item = '';
Пример #3
0
 function tree_list($datasql)
 {
     global $dbh, $humo_option, $uri_path, $user, $language, $selected_language;
     $text = '';
     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;
         if (in_array($dataDb->tree_id, $hide_tree_array)) {
             $hide_tree = true;
         }
         if ($hide_tree == false) {
             $treetext = show_tree_text($dataDb->tree_prefix, $selected_language);
             $treetext_name = $treetext['name'];
             // *** Name family tree ***
             if (isset($_SESSION['tree_prefix']) and $_SESSION['tree_prefix'] == $dataDb->tree_prefix) {
                 $tree_name = '<span class="tree_link fonts">' . $treetext_name . '</span><br>';
             } else {
                 if (CMS_SPECIFIC == 'Joomla') {
                     $path_tmp = 'index.php?option=com_humo-gen&amp;database=' . $dataDb->tree_prefix;
                 } elseif ($humo_option["url_rewrite"] == "j") {
                     // *** $uri_path is made in header.php ***
                     $path_tmp = $uri_path . 'tree_index/' . $dataDb->tree_prefix . '/';
                 } else {
                     $path_tmp = $_SERVER['PHP_SELF'] . '?database=' . $dataDb->tree_prefix;
                 }
                 $tree_name = '<span class="tree_link fonts">';
                 $tree_name .= '<a href="' . $path_tmp . '">' . $treetext_name . '</a>';
                 $tree_name .= '</span><br>';
             }
             // *** Show empty line ***
             if ($dataDb->tree_prefix == 'EMPTY') {
                 $tree_name = '<br>';
             }
             $text .= $tree_name;
         }
         // end of family tree check
     }
     echo $text;
 }
Пример #4
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>';
}
Пример #5
0
include_once "header.php";
include_once CMS_ROOTPATH . "menu.php";
// *** Check block_spam_answer ***
$mail_allowed = false;
if (isset($_POST['send_mail'])) {
    if (isset($_POST['mail_block_spam']) and strtolower($_POST['mail_block_spam']) == strtolower($humo_option["block_spam_answer"])) {
        $mail_allowed = true;
    }
}
if ($humo_option["use_spam_question"] != 'y') {
    $mail_allowed = true;
}
if (isset($_POST['send_mail']) and $mail_allowed == true) {
    $mail_address = $dataDb->tree_email;
    $treetext = show_tree_text($_SESSION['tree_prefix'], $selected_language);
    $mail_subject = "HuMo-gen " . __('Mail form') . " (" . $treetext['name'] . "): " . $_POST['mail_subject'] . "\n";
    // *** It's better to use plain text in the subject ***
    $mail_subject = strip_tags($mail_subject, ENT_QUOTES);
    $mail_message = __('Message sent through HuMo-gen from the website.') . "<br>\n";
    $mail_message .= "<br>\n";
    $mail_message .= __('Name') . ':' . $_POST['mail_name'] . "<br>\n";
    $mail_message .= __('E-mail') . ": <a href='mailto:" . $_POST['mail_sender'] . "'>" . $_POST['mail_sender'] . "</a><br>\n";
    if (isset($_SESSION['save_last_visitid'])) {
        $mail_message .= __('Last visited family:') . " <a href='http://" . $_SESSION['save_last_visitid'] . "'>" . $_SESSION['save_last_visitid'] . "</a><br>\n";
    }
    if (isset($_POST['newsletter'])) {
        $mail_message .= __('Receive newsletter') . ': ' . $_POST['newsletter'] . "<br>\n";
    }
    $mail_message .= $_POST['mail_text'] . "<br>\n";
    //$headers  = "MIME-Version: 1.0\n";
Пример #6
0
 function tree_main()
 {
     global $language, $language_tree, $language_file, $selected_language;
     global $dbh, $page, $menu_admin, $tree_id;
     global $phpself, $phpself2, $joomlastring;
     echo '<br>';
     echo __('Administration of the family tree(s), i.e. the name can be changed here, and trees can be added or removed.') . '<br>';
     // *** Read settings here to be shure radio buttons show proper values. ***
     include_once CMS_ROOTPATH . "include/settings_global.php";
     // *** Read settings ***
     echo '<table class="humo" border="1" cellspacing="0" width="100%">';
     echo '<tr class="table_header"><th>' . __('Order') . '</th>';
     echo '<th>' . __('Name of family tree') . '</th>';
     echo '<th>' . __('Family tree data') . '</th>';
     echo '<th>' . __('Remove') . '</th>';
     echo '</tr>';
     echo '<tr class="table_header">';
     echo '<td></td>';
     echo '<td>';
     echo '<a href="index.php?' . $joomlastring . 'page=tree&amp;language_tree=default&amp;tree_id=' . $tree_id . '">' . __('Default') . '</a> ';
     // *** Language choice ***
     $language_tree2 = $language_tree;
     if ($language_tree == 'default') {
         $language_tree2 = $selected_language;
     }
     echo '&nbsp;&nbsp;&nbsp;<div class="ltrsddm" style="display : inline;">';
     echo '<a href="index.php?option=com_humo-gen"';
     include CMS_ROOTPATH . 'languages/' . $language_tree2 . '/language_data.php';
     echo ' onmouseover="mopen(event,\'adminx\',\'?\',\'?\')"';
     $select_top = '';
     echo ' onmouseout="mclosetime()"' . $select_top . '>' . '<img src="' . CMS_ROOTPATH . 'languages/' . $language_tree2 . '/flag.gif" title="' . $language["name"] . '" alt="' . $language["name"] . '" style="border:none; height:14px"> ' . $language["name"] . ' <img src="' . CMS_ROOTPATH . 'images/button3.png" height= "13" style="border:none;" alt="pull_down"></a>';
     echo '<div id="adminx" class="sddm_abs" onmouseover="mcancelclosetime()" onmouseout="mclosetime()" style="width:250px;">';
     echo '<ul class="humo_menu_item2">';
     for ($i = 0; $i < count($language_file); $i++) {
         // *** Get language name ***
         if ($language_file[$i] != $language_tree2) {
             include CMS_ROOTPATH . 'languages/' . $language_file[$i] . '/language_data.php';
             echo '<li style="float:left; width:124px;">';
             echo '<a href="index.php?' . $joomlastring . 'page=tree&amp;language_tree=' . $language_file[$i] . '&amp;tree_id=' . $tree_id . '">';
             echo '<img src="' . CMS_ROOTPATH . 'languages/' . $language_file[$i] . '/flag.gif" title="' . $language["name"] . '" alt="' . $language["name"] . '" style="border:none;"> ';
             echo $language["name"];
             echo '</a>';
             echo '</li>';
         }
     }
     echo '</ul>';
     echo '</div>';
     echo '</div>';
     echo '</td>';
     echo '<td></td>';
     echo '<td></td>';
     echo '</tr>';
     // *** New family tree number ***
     $new_number = '1';
     $datasql = $dbh->query("SELECT * FROM humo_trees ORDER BY tree_order");
     if ($datasql) {
         // *** Count lines in query ***
         $count_trees = $datasql->rowCount();
         while ($dataDb = $datasql->fetch(PDO::FETCH_OBJ)) {
             $style = '';
             if ($tree_id == $dataDb->tree_id) {
                 $style = ' bgcolor="#99CCFF"';
             }
             echo '<tr' . $style . '>';
             echo '<td nowrap>';
             if ($dataDb->tree_order < 10) {
                 echo '0';
             }
             echo $dataDb->tree_order;
             // *** Number for new family tree ***
             $new_number = $dataDb->tree_order + 1;
             if ($dataDb->tree_order != '1') {
                 echo ' <a href="' . $phpself2 . 'page=' . $page . '&amp;up=1&amp;tree_order=' . $dataDb->tree_order . '&amp;id=' . $dataDb->tree_id . '"><img src="' . CMS_ROOTPATH_ADMIN . 'images/arrow_up.gif" border="0" alt="up"></a>';
             }
             if ($dataDb->tree_order != $count_trees) {
                 echo ' <a href="' . $phpself2 . 'page=' . $page . '&amp;down=1&amp;tree_order=' . $dataDb->tree_order . '&amp;id=' . $dataDb->tree_id . '"><img src="' . CMS_ROOTPATH_ADMIN . 'images/arrow_down.gif" border="0" alt="down"></a>';
             }
             echo '</td>';
             echo '<td>';
             $treetext = show_tree_text($dataDb->tree_prefix, $language_tree);
             if ($dataDb->tree_prefix == 'EMPTY') {
                 echo '* ' . __('EMPTY LINE') . ' *';
             } else {
                 // *** Change family tree name ***
                 echo '<a href="index.php?' . $joomlastring . 'page=' . $page . '&amp;menu_admin=tree_text&amp;tree_id=' . $dataDb->tree_id . '"><img src="images/edit.jpg" title="edit" alt="edit"></a> ' . $treetext['name'];
             }
             echo '</td>';
             echo '<td>';
             if ($dataDb->tree_prefix != 'EMPTY') {
                 echo '<a href="index.php?' . $joomlastring . 'page=' . $page . '&amp;menu_admin=tree_gedcom&amp;tree_id=' . $dataDb->tree_id . '&tree_prefix=' . $dataDb->tree_prefix . '&step1=read_gedcom"><img src="images/import.jpg" title="gedcom import" alt="gedcom import"></a>';
             }
             if ($dataDb->tree_prefix == 'EMPTY') {
                 //
             } elseif ($dataDb->tree_persons > 0) {
                 echo ' <font color="#00FF00"><b>' . __('OK') . '</b></font>';
             } else {
                 echo ' <font color="#FF0000"><b>' . __('ERROR') . '!</b></font>';
             }
             if ($dataDb->tree_prefix == 'EMPTY') {
                 //
             } elseif ($dataDb->tree_persons > 0) {
                 // *** Show tree data ***
                 $tree_date = $dataDb->tree_date;
                 $month = '';
                 // for empty tree_dates
                 if (substr($tree_date, 5, 2) == '01') {
                     $month = ' ' . strtolower(__('jan')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '02') {
                     $month = ' ' . strtolower(__('feb')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '03') {
                     $month = ' ' . strtolower(__('mar')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '04') {
                     $month = ' ' . strtolower(__('apr')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '05') {
                     $month = ' ' . strtolower(__('may')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '06') {
                     $month = ' ' . strtolower(__('jun')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '07') {
                     $month = ' ' . strtolower(__('jul')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '08') {
                     $month = ' ' . strtolower(__('aug')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '09') {
                     $month = ' ' . strtolower(__('sep')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '10') {
                     $month = ' ' . strtolower(__('oct')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '11') {
                     $month = ' ' . strtolower(__('nov')) . ' ';
                 }
                 if (substr($tree_date, 5, 2) == '12') {
                     $month = ' ' . strtolower(__('oct')) . ' ';
                 }
                 $tree_date = substr($tree_date, 8, 2) . $month . substr($tree_date, 0, 4);
                 echo ' <font size=-1>' . $tree_date . ': ' . $dataDb->tree_persons . ' ' . __('persons') . ', ' . $dataDb->tree_families . ' ' . __('families') . '</font>';
             } else {
                 echo ' <b>' . __('This tree does not yet contain any data or has not been imported properly!') . '</b>';
             }
             echo '</td>';
             echo '<td nowrap>';
             // *** If there is only one family tree, prevent it can be removed ***
             if ($count_trees > 1) {
                 echo ' <a href="index.php?' . $joomlastring . 'page=' . $page . '&amp;remove_tree=' . $dataDb->tree_id . '&amp;treetext_name=' . $treetext['name'] . '">';
                 echo '<img src="' . CMS_ROOTPATH_ADMIN . 'images/button_drop.png" alt="' . __('Remove tree') . '" border="0"></a>';
             }
             echo '</td>';
         }
         echo '</tr>';
     }
     // *** Add new family tree ***
     // *** Find latest tree_prefix ***
     $found = '1';
     $i = 1;
     while ($found == '1') {
         $new_tree_prefix = 'humo' . $i . '_';
         $datasql = $dbh->query("SELECT * FROM humo_trees\n\t\t\tWHERE tree_prefix='{$new_tree_prefix}'");
         $found = $datasql->rowCount();
         $i++;
     }
     echo '<tr><td colspan="4"><br></td></tr>';
     echo '<tr><td>';
     if ($new_number < 10) {
         echo '0';
     }
     echo $new_number . '</td>';
     echo '<td colspan="3">';
     echo '<form method="post" action="' . $phpself . '" style="display : inline;">';
     echo '<input type="hidden" name="page" value="' . $page . '">';
     echo '<input type="hidden" name="tree_order" value="' . $new_number . '">';
     echo '<input type="hidden" name="tree_prefix" value="' . $new_tree_prefix . '">';
     echo ' <input type="Submit" name="add_tree_data" value="' . __('Add family tree') . '">';
     echo '</form>';
     echo '</td></tr>';
     echo '<tr><td colspan="4"><br></td></tr>';
     echo '<tr><td>';
     if ($new_number < 10) {
         echo '0';
     }
     echo $new_number . '</td>';
     echo '<td colspan="3">';
     echo '<form method="post" action="' . $phpself . '" style="display : inline;">';
     echo '<input type="hidden" name="page" value="' . $page . '">';
     echo '<input type="hidden" name="tree_order" value="' . $new_number . '">';
     echo ' <input type="Submit" name="add_tree_data_empty" value="' . __('Add empty line') . '"> ';
     echo __('Add empty line in list of family trees');
     echo '</form>';
     echo '</td></tr>';
     echo "</table>";
     // ** Change collation of family tree (needed for Swedish etc.) ***
     $collation_sql = $dbh->query("SHOW FULL COLUMNS\n\t\tFROM humo_persons\n\t\tWHERE Field = 'pers_firstname'");
     $collationDb = $collation_sql->fetch(PDO::FETCH_OBJ);
     $collation = $collationDb->Collation;
     echo '<form method="post" action="' . $phpself . '" style="display : inline;">';
     echo '<input type="hidden" name="page" value="' . $page . '">';
     echo '<br>' . __('Collation') . ' ';
     echo '<select size="1" name="tree_collation" style="width:250px;">';
     // *** Default collation ***
     echo '<option value="utf8_general_ci">utf8_general_ci (default)</option>';
     // *** Swedish collation ***
     $select = '';
     if ($collation == 'utf8_swedish_ci') {
         $select = 'selected';
     }
     echo '<option value="utf8_swedish_ci"' . $select . '>utf8_swedish_ci</option>';
     // *** Danish collation ***
     $select = '';
     if ($collation == 'utf8_danish_ci') {
         $select = 'selected';
     }
     echo '<option value="utf8_danish_ci"' . $select . '>utf8_danish_ci</option>';
     echo '</select>';
     echo ' <input type="Submit" name="change_collation" value="OK">';
     echo '</form>';
 }
Пример #7
0
function topline()
{
    global $dataDb, $bot_visit, $descendant_loop, $parent1_marr, $rtlmarker, $family_id, $main_person;
    global $alignmarker, $language, $uri_path, $descendant_report, $family_expanded;
    global $user, $source_presentation, $change_main_person, $maps_presentation, $picture_presentation, $text_presentation, $database, $man_cls, $person_manDb;
    global $woman_cls, $person_womanDb, $selected_language;
    $text = '<tr class="table_headline"><td class="table_header" width="65%">';
    // *** Text above family ***
    $treetext = show_tree_text($dataDb->tree_prefix, $selected_language);
    $text .= '<div class="family_page_toptext fonts">' . $treetext['family_top'] . '<br></div>';
    $text .= '</td><td class="table_header fonts" width="10%" style="text-align:center";>';
    // *** Hide selections for bots, and second family screen (descendant report etc.) ***
    if (!$bot_visit and $descendant_loop == 0 and $parent1_marr == 0) {
        // *** Settings in pop-up screen ***
        $text .= '<div class="' . $rtlmarker . 'sddm" style="left:10px;top:10px;display:inline;">';
        $text .= '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . '"';
        $text .= ' style="display:inline" ';
        $text .= 'onmouseover="mopen(event,\'help_menu\',0,0)"';
        $text .= 'onmouseout="mclosetime()">';
        $text .= '<b>' . __('Settings') . '</b>';
        $text .= '</a>';
        //$text='<div style="z-index:40; padding:4px; direction:'.$rtlmarker.'" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        $text .= '<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:' . $alignmarker . ';  direction:' . $rtlmarker . ';" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        $text .= '<span style="color:blue">=====</span>&nbsp;<b>' . __('Settings family screen') . '</b> <span style="color:blue">=====</span><br><br>';
        $text .= '<table><tr><td>';
        // *** Extended view button ***
        $text .= '<b>' . __('Family Page') . '</b><br>';
        $desc_rep = '';
        if ($descendant_report == true) {
            $desc_rep = '&amp;descendant_report=1';
        }
        $selected = ' CHECKED';
        $selected2 = '';
        if ($family_expanded == true) {
            $selected = '';
            $selected2 = ' CHECKED';
        }
        $text .= '<input type="radio" name="keuze0" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;family_expanded=0&xx=\'+this.value"' . $selected . '>' . __('Compact view') . "<br>\n";
        $text .= '<input type="radio" name="keuze0" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;family_expanded=1&xx=\'+this.value"' . $selected2 . '>' . __('Expanded view') . "<br>\n";
        // *** Select source presentation (as title/ footnote or hide sources) ***
        if ($user['group_sources'] != 'n') {
            $text .= '<hr>';
            $text .= '<b>' . __('Sources') . '</b><br>';
            $desc_rep = '';
            if ($descendant_report == true) {
                $desc_rep = '&amp;descendant_report=1';
            }
            $selected = '';
            if ($source_presentation == 'title') {
                $selected = ' CHECKED';
            }
            $text .= '<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;source_presentation=title&xx=\'+this.value"' . $selected . '>' . __('Show source title') . "<br>\n";
            $selected = '';
            if ($source_presentation == 'footnote') {
                $selected = ' CHECKED';
            }
            $text .= '<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;source_presentation=footnote&xx=\'+this.value"' . $selected . '>' . __('Show source title as footnote') . "<br>\n";
            $selected = '';
            if ($source_presentation == 'hide') {
                $selected = ' CHECKED';
            }
            $text .= '<input type="radio" name="keuze1" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;source_presentation=hide&xx=\'+this.value"' . $selected . '>' . __('Hide sources') . "<br>\n";
        }
        // *** Show/ hide Google maps ***
        if ($descendant_report == false) {
            $text .= '<hr>';
            $text .= '<b>' . __('Google maps') . '</b><br>';
            $selected = '';
            $selected2 = '';
            if ($maps_presentation == 'hide') {
                $selected2 = ' CHECKED';
            } else {
                $selected = ' CHECKED';
            }
            $text .= '<input type="radio" name="keuze2" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . '&amp;maps_presentation=show&xx=\'+this.value"' . $selected . '>' . __('Show Google maps') . "<br>\n";
            $text .= '<input type="radio" name="keuze2" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . '&amp;maps_presentation=hide&xx=\'+this.value"' . $selected2 . '>' . __('Hide Google maps') . "<br>\n";
        }
        $text .= '</td><td valign="top">';
        if ($user['group_pictures'] == 'j') {
            $text .= '<b>' . __('Pictures') . '</b><br>';
            $selected = '';
            $selected2 = '';
            if ($picture_presentation == 'hide') {
                $selected2 = ' CHECKED';
            } else {
                $selected = ' CHECKED';
            }
            $text .= '<input type="radio" name="keuze3" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;picture_presentation=show&xx=\'+this.value"' . $selected . '>' . __('Show pictures') . "<br>\n";
            $text .= '<input type="radio" name="keuze3" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;picture_presentation=hide&xx=\'+this.value"' . $selected2 . '>' . __('Hide pictures') . "<br>\n";
            $text .= '<hr>';
        }
        $text .= '<b>' . __('Texts') . '</b><br>';
        $selected = '';
        if ($text_presentation == 'show') {
            $selected = ' CHECKED';
        }
        $text .= '<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;text_presentation=show&xx=\'+this.value"' . $selected . '>' . __('Show texts') . "<br>\n";
        $selected = '';
        if ($text_presentation == 'popup') {
            $selected = ' CHECKED';
        }
        $text .= '<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;text_presentation=popup&xx=\'+this.value"' . $selected . '>' . __('Show texts in popup screen') . "<br>\n";
        $selected = '';
        if ($text_presentation == 'hide') {
            $selected = ' CHECKED';
        }
        $text .= '<input type="radio" name="keuze4" value="" onclick="javascript: document.location.href=\'' . $_SERVER['PHP_SELF'] . '?id=' . $family_id . '&amp;main_person=' . $main_person . $desc_rep . '&amp;text_presentation=hide&xx=\'+this.value"' . $selected . '>' . __('Hide texts') . "<br>\n";
        $text .= '</td></tr></table>';
        $text .= '</div>';
        $text .= '</div>';
        $text .= '</td><td class="table_header fonts" width="20%" style="text-align:center";>';
        // *** PDF button ***
        //if($user["group_pdf_button"]=='y' AND $language["dir"]!="rtl") {
        if ($user["group_pdf_button"] == 'y' and $language["dir"] != "rtl" and $language["name"] != "简体中文") {
            $text .= '<form method="POST" action="' . $uri_path . 'family.php?show_sources=1" style="display : inline;">';
            $text .= '<input type="hidden" name="id" value="' . $family_id . '">';
            $text .= '<input type="hidden" name="main_person" value="' . $main_person . '">';
            $text .= '<input type="hidden" name="database" value="' . $database . '">';
            $text .= '<input type="hidden" name="screen_mode" value="PDF">';
            if ($descendant_report == true) {
                $text .= '<input type="hidden" name="descendant_report" value="' . $descendant_report . '">';
            }
            $text .= '<input class="fonts" type="Submit" name="submit" value="' . __('PDF Report') . '">';
            //$text.='<input type="image" src="images/pdf.jpeg" width="20" border="0" alt="PDF">';
            $text .= '</form> ';
        }
        // *** RTF button ***
        if ($user["group_rtf_button"] == 'y' and $language["dir"] != "rtl") {
            $text .= '<form method="POST" action="' . $uri_path . 'family.php?show_sources=1" style="display : inline;">';
            $text .= '<input type="hidden" name="id" value="' . $family_id . '">';
            $text .= '<input type="hidden" name="main_person" value="' . $main_person . '">';
            $text .= '<input type="hidden" name="database" value="' . $database . '">';
            $text .= '<input type="hidden" name="screen_mode" value="RTF">';
            if ($descendant_report == true) {
                $text .= '<input type="hidden" name="descendant_report" value="' . $descendant_report . '">';
            }
            $text .= '<input class="fonts" type="Submit" name="submit" value="' . __('RTF Report') . '">';
            $text .= '</form> ';
        }
        $text .= '</td><td class="table_header fonts" width="5%" style="text-align:center";>';
        // *** Add family to favorite list ***
        // If there is a N.N. father, then use mother in favorite icon.
        if ($change_main_person == true or !isset($person_manDb->pers_gedcomnumber)) {
            $name = $woman_cls->person_name($person_womanDb);
            $favorite_gedcomnumber = ' [' . $person_womanDb->pers_gedcomnumber . ']';
        } else {
            $name = $man_cls->person_name($person_manDb);
            $favorite_gedcomnumber = ' [' . $person_manDb->pers_gedcomnumber . ']';
        }
        if ($name) {
            $favorite_values = $name['name'] . $favorite_gedcomnumber . '|' . $family_id . '|' . $_SESSION['tree_prefix'] . '|' . $main_person;
            $check = false;
            if (isset($_SESSION['save_favorites'])) {
                foreach ($_SESSION['save_favorites'] as $key => $value) {
                    if ($value == $favorite_values) {
                        $check = true;
                    }
                }
            }
            $text .= '<form method="POST" action="' . $uri_path . 'family.php" style="display : inline;">';
            $text .= '<input type="hidden" name="id" value="' . $family_id . '">';
            $text .= '<input type="hidden" name="main_person" value="' . $main_person . '">';
            if ($descendant_report == true) {
                echo '<input type="hidden" name="descendant_report" value="1">';
            }
            if ($check == false) {
                $text .= '<input type="hidden" name="favorite" value="' . $favorite_values . '">';
                $text .= ' <input type="image" src="images/favorite.png" name="favorite_button" alt="' . __('Add to favourite list') . '" />';
            } else {
                $text .= '<input type="hidden" name="favorite_remove" value="' . $favorite_values . '">';
                $text .= ' <input type="image" src="images/favorite_blue.png" name="favorite_button" alt="' . __('Add to favourite list') . '" />';
            }
            $text .= '</form>';
        }
    }
    // End of bot visit
    $text .= '</td></tr>';
    return $text;
}