Esempio n. 1
0
 function Footer()
 {
     global $font;
     $this->SetY(-10);
     $this->SetFont($font, '', 8);
     $this->Cell(0, 4, '©2002-2003 Keith Morrison, Infused Solutions - www.infused.org', 0, 1, 'C', 0, 'http://www.infused.org');
     $this->Cell(0, 4, sprintf(gtc("Send questions or comments to %s"), '*****@*****.**'), 0, 0, 'C', 0, 'mailto:keithm@infused.org');
 }
Esempio n. 2
0
/**
 * @access public
 * @param string $p_node
 * @param integer $p_generation
 */
function process_indiv($p_node, $p_generation)
{
    global $g_generation, $individuals;
    $father = $p_node->father_indkey ? new Person($p_node->father_indkey, 3) : null;
    $mother = $p_node->mother_indkey ? new Person($p_node->mother_indkey, 3) : null;
    # increment $g_generation if generation has changed
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
    }
    $individual['generation'] = $g_generation;
    $individual['generation_title'] = sprintf(gtc("Generation %s"), $g_generation);
    $individual['ns_number'] = $p_node->ns_number;
    $individual['name_link'] = '<a href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $p_node->indkey . '">' . $p_node->full_name() . '</a>';
    $individual['parent_sentence'] = get_parents_sentence($p_node, $father, $mother);
    $individual['birth_sentence'] = get_birth_sentence($p_node);
    $individual['marriage_sentence'] = get_marriage_sentences($p_node);
    $individual['death_sentence'] = get_death_sentence($p_node);
    $individuals[] = $individual;
}
Esempio n. 3
0
function display_indiv($p_array)
{
    global $g_content, $g_descendants, $g_generation, $g_max_gens, $g_count, $individuals;
    $string = '';
    $p_node = $p_array[0];
    $p_generation = $p_array[1];
    $father = $p_node->father_indkey ? new Person($p_node->father_indkey, 3) : null;
    $mother = $p_node->mother_indkey ? new Person($p_node->mother_indkey, 3) : null;
    if ($p_generation > $g_generation) {
        $g_generation = $p_generation;
    }
    # children
    foreach ($p_node->marriages as $marriage) {
        $spouse = !empty($marriage->spouse) ? new Person($marriage->spouse, 3) : null;
        if ($marriage->child_count > 0) {
            $string .= '<br />' . "\n";
            $string .= get_children_of_sentence($p_node, $spouse) . ':<br />';
            foreach ($marriage->children as $child_indkey) {
                $child = new Person($child_indkey);
                if ($child->marriage_count > 0) {
                    foreach ($child->marriages as $cmarriage) {
                        if ($cmarriage->child_count > 0) {
                            $child->ns_number = $g_count + 1;
                            $child_gen = $p_generation + 1;
                            if ($child_gen > $g_max_gens) {
                                break;
                            }
                            array_push($g_descendants, array($child, $child_gen));
                            $g_count++;
                            break;
                        }
                    }
                }
                $child_nk = '<a class="secondary" href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $child->indkey . '">' . $child->full_name() . '</a>';
                if ($child->ns_number) {
                    $string .= '<ol><li value="' . $child->ns_number . '">' . $child_nk;
                    if ($child->birth && $child->birth->date || $child->death && $child->death->date) {
                        $string .= '&nbsp;&nbsp;';
                        if ($child->birth && $child->birth->date) {
                            $string .= gtc("b.") . ' ' . $child->birth->date . ' ';
                        }
                        if ($child->death && $child->death->date) {
                            $string .= gtc("d.") . ' ' . $child->death->date;
                        }
                    }
                    $string .= '</li></ol>';
                } else {
                    $string .= '<ul><li class="nobullet">' . $child_nk . '</li></ul>';
                }
            }
        }
    }
    $string .= '</li></ol>';
    $individual['generation'] = $p_generation;
    $individual['generation_title'] = sprintf(gtc("Generation %s"), $g_generation);
    $individual['ns_number'] = $p_node->ns_number;
    $individual['name_link'] = '<a href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $p_node->indkey . '">' . $p_node->full_name() . '</a>';
    $individual['parent_sentence'] = get_parents_sentence($p_node, $father, $mother);
    $individual['birth_sentence'] = get_birth_sentence($p_node);
    $individual['marriage_sentence'] = get_marriage_sentences($p_node);
    $individual['death_sentence'] = get_death_sentence($p_node);
    $individual['children_string'] = $string;
    $individuals[] = $individual;
}
Esempio n. 4
0
# process expected get/post variables
$g_indiv = isset($_GET['id']) ? $_GET['id'] : exit;
# populate keyword array
keyword_push(gtc("Pedigree"));
keyword_push(gtc("Ancestors"));
# get first person information
$o = new Person($g_indiv);
$smarty->assign('indiv', $o);
# initialize other variables
$g_node_indkey = array();
$g_node_strings = array();
$g_node_parents = array();
$g_max_gens = 4;
# assign other smarty variables
$smarty->assign('page_title', sprintf(gtc("Family Page for %s"), $o->full_name()));
$smarty->assign('surname_title', sprintf(gtc("%s Surname"), $o->sname));
$content_title = $o->prefix . ' ' . $o->full_name();
if ($o->suffix) {
    $content_title .= ', ' . $o->suffix;
}
$smarty->assign('content_title', $content_title);
# instantiate new tree
$tree = new ATree($g_indiv);
# fill tree with ancestors
$tree->fill_tree(4);
# get root node and traverse tree
# each node of the tree is passed to the display_indiv function
$root = $tree->get_node_at_index(0);
$tree->level_order_traversal($root, 'process_indiv');
function process_indiv($p_node)
{
Esempio n. 5
0
/**
 * Gets 'children of' sentence
 * @access public
 * @param Person $p Individual
 * @param Person $ps Spouse
 */
function get_children_of_sentence($p, $ps)
{
    $s = '';
    if ($p->full_name() and $ps->full_name()) {
        $s .= sprintf(gtc("Children of %s and %s"), $p->full_name(), $ps->full_name());
    } else {
        $s .= sprintf(gtc("Children of %s"), $p->full_name());
    }
    return $s;
}
Esempio n. 6
0
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License contained in the file GNU.txt for
 * more details.
 */
/**
 * $Id$
 */
# Ensure this file is being included by a parent file
defined('_RGDS_VALID') or die('Direct access to this file is not allowed.');
# process expected get/post variables
$g_indiv = isset($_GET['id']) ? $_GET['id'] : exit;
# get first person information
$o = new person($g_indiv, 3);
$smarty->assign('indiv', $o);
# assign other smarty variables
$smarty->assign_by_ref('page_title', sprintf(gtc("Reports for %s"), $o->full_name()));
$smarty->assign_by_ref('surname_title', sprintf(gtc("%s Surname"), $o->sname));
$content_title = $o->prefix . ' ' . $o->full_name();
if ($o->suffix) {
    $content_title .= ', ' . $o->suffix;
}
$smarty->assign_by_ref('content_title', $content_title);
# populate keyword array
keyword_push(gtc("Reports"));
keyword_push($o->full_name());
Esempio n. 7
0
$search_params .= '&begin_month=' . $begin_month;
$search_params .= '&begin_day=' . $begin_day;
$search_params .= '&begin_year=' . $begin_year;
$search_params .= '&end_month=' . $end_month;
$search_params .= '&end_day=' . $end_day;
$search_params .= '&end_year=' . $end_year;
$search_params .= '&locat=' . $location;
$search_params .= '&search_type=' . $search_type;
$search_params .= '&parts=' . $parts;
$search_params .= '&note=' . $note;
$smarty->assign('search_params', $search_params);
# set page title
$smarty->assign('page_title', gtc("Search Results"));
$smarty->assign('content_title', gtc("Results"));
# populate keyword array
keyword_push(gtc("Search Results"));
# name searches
if ($search_type == 'name') {
    $sql = "SELECT * FROM " . TBL_INDIV . " WHERE ";
    # set the surname where clause based on soundex selection
    if ($soundex === true) {
        $surname_search_string = "soundex(surname)=soundex(" . $db->qstr($sname) . ")";
    } else {
        $surname_search_string = "surname LIKE " . $db->qstr($sname . '%');
    }
    # search by givenname and surname
    if ($gname != null and $sname != null) {
        $sql .= $surname_search_string . " AND givenname LIKE " . $db->qstr('%' . $gname . '%') . " ORDER BY surname, givenname";
    } elseif ($gname == null and $sname != null) {
        $sql .= $surname_search_string . " ORDER BY surname";
    } else {
Esempio n. 8
0
$g_other_indiv = isset($_GET['other_id']) ? $_GET['other_id'] : false;
$g_max_gens = isset($_GET['g']) ? intval(trim($_GET['g'])) : 250;
$pos = strpos($g_other_indiv, "I");
if (($pos === false || $pos != 0) && strlen($g_other_indiv) > 0) {
    $g_other_indiv = "I" . $g_other_indiv;
}
if ($g_other_indiv) {
    $other_indiv = new Person($g_other_indiv);
    $calculator = new RelCalculator($g_indiv, $g_max_gens);
    $results = $calculator->calculate($g_other_indiv);
} else {
    $results = array();
    $other_indiv = false;
}
# get first person information
$indiv = new person($g_indiv);
$smarty->assign('indiv', $indiv);
$smarty->assign('other_indiv', $other_indiv);
$smarty->assign('relationship', $results['relationship']);
$smarty->assign('common_ancestors', $results['common_ancestors']);
if ($other_indiv) {
    $smarty->assign_by_ref('page_title', sprintf(gtc("Relationship Calculator for %s and %s"), $indiv->name, $other_indiv->name));
} else {
    $smarty->assign_by_ref('page_title', sprintf(gtc("Relationship Calculator for %s"), $indiv->name));
}
$smarty->assign_by_ref('surname_title', sprintf(gtc("%s Surname"), $indiv->sname));
$content_title = $indiv->prefix . ' ' . $indiv->full_name();
if ($indiv->suffix) {
    $content_title .= ', ' . $indiv->suffix;
}
$smarty->assign_by_ref('content_title', $content_title);
Esempio n. 9
0
/** 
 * Smarty gettext plugin function
 */
function lang_translate_smarty($params)
{
    if ($params['s']) {
        $s = $params['s'];
        return gtc($s);
    } else {
        return '';
    }
}
Esempio n. 10
0
$smarty->assign('form_gname', $gname);
$sname = isset($_GET['sname']) ? $_GET['sname'] : null;
$smarty->assign('form_sname', $sname);
$soundex = isset($_GET['soundex']) ? true : false;
$smarty->assign('form_soundex', $soundex);
$begin_month = isset($_GET['begin_month']) ? $_GET['begin_month'] : null;
$begin_day = isset($_GET['begin_day']) ? $_GET['begin_day'] : null;
$begin_year = isset($_GET['begin_year']) ? $_GET['begin_year'] : null;
$smarty->assign('form_begin_month', $begin_month);
$smarty->assign('form_begin_day', $begin_day);
$smarty->assign('form_begin_year', $begin_year);
$end_month = isset($_GET['end_month']) ? $_GET['end_month'] : null;
$end_day = isset($_GET['end_day']) ? $_GET['end_day'] : null;
$end_year = isset($_GET['end_year']) ? $_GET['end_year'] : null;
$smarty->assign('form_end_month', $end_month);
$smarty->assign('form_end_day', $end_day);
$smarty->assign('form_end_year', $end_year);
$location = isset($_GET['locat']) ? $_GET['locat'] : null;
$smarty->assign('form_location', $location);
$search_type = isset($_GET['search_type']) ? $_GET['search_type'] : null;
$smarty->assign('form_search_type', $search_type);
$parts = isset($_GET['parts']) ? $_GET['parts'] : null;
$smarty->assign('form_parts', $parts);
$note = isset($_GET['note']) ? $_GET['note'] : null;
$smarty->assign('form_note', $note);
# set page title
$smarty->assign('page_title', gtc("Search"));
$smarty->assign('content_title', gtc("Search"));
# populate keyword array
keyword_push(gtc("Search"));
Esempio n. 11
0
/**
 * Create a link based on the selected alpha character
 * @access public
 * @param string $p_alpha
 */
function get_alpha_link($p_alpha)
{
    global $db, $g_alpha;
    $p_alpha = strtoupper($p_alpha);
    return $p_alpha == $g_alpha ? '<a>' . $p_alpha . '</a>' : '<a href="' . $_SERVER['PHP_SELF'] . '?m=surnames&amp;alpha=' . $p_alpha . '">' . gtc($p_alpha) . '</a>';
}
Esempio n. 12
0
$smarty->assign('cnt_events', $cnt_events);
# events - birth
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Birth'";
$cnt_events_birth = $db->GetOne($sql);
$smarty->assign('cnt_events_birth', $cnt_events_birth);
# events - death
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Death'";
$cnt_events_death = $db->GetOne($sql);
$smarty->assign('cnt_events_death', $cnt_events_death);
# events - marriage
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Marriage'";
$cnt_events_marriage = $db->GetOne($sql);
$smarty->assign('cnt_events_marriage', $cnt_events_marriage);
# facts - other
$cnt_events_other = $cnt_events - $cnt_events_birth - $cnt_events_death - $cnt_events_marriage;
$smarty->assign('cnt_events_other', $cnt_events_other);
# notes
$sql = "SELECT COUNT(*) FROM " . TBL_NOTE;
$smarty->assign('cnt_notes', $db->GetOne($sql));
# sources
$sql = "SELECT COUNT(*) FROM " . TBL_SOURCE;
$smarty->assign('cnt_sources', $db->GetOne($sql));
# source citations
$sql = "SELECT COUNT(*) FROM " . TBL_CITATION;
$smarty->assign('cnt_citations', $db->GetOne($sql));
# comments
$sql = "SELECT COUNT(*) FROM " . TBL_COMMENT;
$smarty->assign('cnt_comments', $db->GetOne($sql));
# populate keyword array
keyword_push(gtc("Statistics"));
Esempio n. 13
0
 /**
  * Translates date modifiers such as Abt, Bet, Aft
  * @access private
  * @param string $p_date english language modifier
  * @return string translated date modifier
  */
 function _translate_mod($mod)
 {
     return gtc(strtolower($mod));
 }
Esempio n. 14
0
foreach ($events as $event) {
    foreach ($event->sources as $source) {
        $sources[] = nl2br($source);
    }
}
$smarty->assign('events', $events);
unset($events, $vitals);
# marriages
$marriages = array();
for ($i = 0; $i < count($o->marriages); $i++) {
    $m = $o->marriages[$i];
    if ($s = !empty($m->spouse) ? new person($m->spouse, 3) : null) {
        if ($s->full_name()) {
            keyword_push($s->full_name());
        }
        $marriages[$i]['family_number'] = sprintf(gtc("Family %s"), $i + 1);
        $marriages[$i]['notes'] = $m->notes;
        $events = array();
        if ($m->begin_event) {
            $events[] = $m->begin_event;
        }
        if ($m->end_event) {
            $events[] = $m->end_event;
        }
        $marriages[$i]['events'] = array_merge($events, $m->events);
        foreach ($marriages[$i]['events'] as $event) {
            foreach ($event->sources as $source) {
                $sources[] = nl2br($source);
            }
        }
        # spouse
Esempio n. 15
0
$smarty->assign('indiv', $o);
# populate keyword array
keyword_push(gtc("Comments"));
keyword_push($o->full_name());
# assign other smarty variables
$smarty->assign('page_title', sprintf(gtc("Comments for %s"), $o->full_name()));
$smarty->assign('surname_title', sprintf(gtc("%s Surname"), $o->sname));
$content_title = $o->prefix . ' ' . $o->full_name();
if ($o->suffix) {
    $content_title .= ', ' . $o->suffix;
}
$smarty->assign('content_title', $content_title);
# If the form has been posted then let's validate the form variables
if (!empty($_POST)) {
    if (empty($_POST['email'])) {
        $form_errors['email'] = gtc("YOU MUST ENTER AN EMAIL ADDRESS");
    } elseif (!rgds_is_email(trim($_POST['email']))) {
        $form_errors['email'] = gtc("THE EMAIL ADDRESS YOU ENTERED IS NOT VALID");
    }
    if (empty($_POST['comment'])) {
        $form_errors['comment'] = gtc("PLEASE ENTER SOME TEXT");
    }
    $smarty->assign('form_errors', $form_errors);
    # The form validated ok, so now save the data
    if (!$form_errors) {
        insert_comment($g_indiv, $_POST['email'], $_POST['comment']);
        $comment_preview = rgds_parse_links($_POST['comment']);
        $smarty->assign('comment_preview', $comment_preview);
        $smarty->assign('SAVED', 1);
    }
}