Example #1
0
 function person_data($person_kind, $id)
 {
     global $dbh, $db_functions, $tree_id, $dataDb, $user, $language, $humo_option, $family_id, $uri_path;
     global $family_expanded, $change_main_person;
     global $childnr, $screen_mode, $dirmark1, $dirmark2;
     global $templ_person;
     global $sect, $arial12;
     // *** RTF export ***
     unset($templ_person);
     $personDb = $this->personDb;
     $privacy = $this->privacy;
     // *** Settings for mobile version, show details in multiple lines ***
     if ($person_kind == "mobile") {
         $family_expanded = true;
     }
     // *** $personDb is empty by N.N. person ***
     if ($personDb) {
         $tree_prefix_quoted = $personDb->pers_tree_prefix;
         $db_functions->set_tree_prefix($tree_prefix_quoted);
         $process_text = '';
         $temp = '';
         //*** PRIVACY PART ***
         $privacy_filter = '';
         if ($privacy) {
             if ($screen_mode == "mobile") {
                 return __('PRIVACY FILTER');
             } elseif ($screen_mode != "PDF") {
                 $privacy_filter = ' ' . __('PRIVACY FILTER');
             } else {
                 return;
             }
             // makes no sense to ask for login in a pdf report.....
         } else {
             // *** Quality (function show_quality can be found in script: family.php) ***
             // Disabled because normally quality belongs to a source.
             //if ($personDb->pers_quality=='0' or $personDb->pers_quality){
             //	$quality_text=show_quality($personDb->pers_quality);
             //	$process_text.= ' <i>'.ucfirst($quality_text).'</i>';
             //}
             // *** Show extra names of BK ***
             if ($personDb->pers_gedcomnumber) {
                 $eventnr = 0;
                 $name_qry = $db_functions->get_events_person($personDb->pers_gedcomnumber, 'name');
                 foreach ($name_qry as $nameDb) {
                     $eventnr++;
                     $text = '';
                     if ($nameDb->event_gedcom == '_AKAN') {
                         $text .= __('Also known as') . ': ';
                     }
                     // *** MyHeritage Family Tree Builder ***
                     if ($nameDb->event_gedcom == '_AKA') {
                         $text .= __('Also known as') . ': ';
                     }
                     if ($nameDb->event_gedcom == 'NICK') {
                         $text .= __('Nickname') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_ALIA') {
                         $text .= __('alias name') . ': ';
                     }
                     // For Pro-Gen
                     if ($nameDb->event_gedcom == '_SHON') {
                         $text .= __('Short name (for reports)') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_ADPN') {
                         $text .= __('Adopted name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_HEBN') {
                         $text .= __('Hebrew name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_CENN') {
                         $text .= __('Census name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_MARN') {
                         $text .= __('Married name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_GERN') {
                         $text .= __('Nickname') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_FARN') {
                         $text .= __('Farm name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_BIRN') {
                         $text .= __('Birth name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_INDN') {
                         $text .= __('Indian name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_FKAN') {
                         $text .= __('Formal name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_CURN') {
                         $text .= __('Current name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_SLDN') {
                         $text .= __('Soldier name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_FRKA') {
                         $text .= __('Formerly known as') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_RELN') {
                         $text .= __('Religious name') . ': ';
                     }
                     if ($nameDb->event_gedcom == '_OTHN') {
                         $text .= __('Other name') . ': ';
                     }
                     if ($eventnr > 1) {
                         $templ_person["bknames" . $eventnr] = ', ';
                         $process_text .= ', ';
                         $text = lcfirst($text);
                     } else {
                         $templ_person["bknames" . $eventnr] = '';
                         $text = ucfirst($text);
                     }
                     $templ_person["bknames" . $eventnr] .= $text;
                     if ($templ_person["bknames" . $eventnr] != '') {
                         $temp = "bk_names" . $eventnr;
                     }
                     $process_text .= $text;
                     if ($nameDb->event_date) {
                         $templ_person["bk_date" . $eventnr] = date_place($nameDb->event_date, '') . ' ';
                         if ($templ_person["bk_date" . $eventnr] != '') {
                             $temp = "bk_date" . $eventnr;
                         }
                         $process_text .= $templ_person["bk_date" . $eventnr];
                     }
                     $templ_person["bk_event" . $eventnr] = $nameDb->event_event;
                     if ($templ_person["bk_event" . $eventnr] != '') {
                         $temp = "bk_event" . $eventnr;
                     }
                     $process_text .= $nameDb->event_event;
                     $source = show_sources2("person", "pers_event_source", $nameDb->event_id);
                     if ($source) {
                         if ($screen_mode == 'PDF') {
                             $templ_person["bk_source" . $eventnr] = $source;
                             $temp = "bk_source" . $eventnr;
                         } else {
                             $process_text .= $source;
                         }
                     }
                     if ($nameDb->event_text) {
                         $templ_person["bk_text" . $eventnr] = ' ' . $nameDb->event_text;
                         $temp = "bk_text" . $eventnr;
                         $process_text .= $templ_person["bk_text" . $eventnr];
                     }
                 }
                 unset($name_qry);
             }
             // *** Own code ***
             if ($user['group_own_code'] == 'j' and $personDb->pers_own_code) {
                 if ($temp) {
                     $templ_person[$temp] .= ", ";
                 }
                 //$templ_person["own_code"]='('.ucfirst($personDb->pers_own_code).')';
                 $templ_person["own_code"] = ucfirst($personDb->pers_own_code);
                 $temp = "own_code";
                 if (!$process_text or $family_expanded == true) {
                     $text = '<b>' . __('Own code') . ':</b> ';
                 } else {
                     $text = ', <b>' . lcfirst(__('Own code')) . ':</b> ';
                 }
                 //	if ($process_text) $process_text.=', ';
                 //$process_text.='<span class="pers_own_code">'.$templ_person["own_code"].'</span>';
                 $process_text .= '<span class="pers_own_code">' . $text . $templ_person["own_code"] . '</span>';
             }
             // ****************
             // *** BIRTH    ***
             // ****************
             $text = '';
             if ($personDb->pers_birth_date or $personDb->pers_birth_place) {
                 $templ_person["born_dateplacetime"] = date_place($personDb->pers_birth_date, $personDb->pers_birth_place);
                 if ($templ_person["born_dateplacetime"] != '') {
                     $temp = "born_dateplacetime";
                 }
                 $text = $templ_person["born_dateplacetime"];
             }
             // *** Birth time ***
             if (isset($personDb->pers_birth_time) and $personDb->pers_birth_time) {
                 $templ_person["born_dateplacetime"] = ' ' . __('at') . ' ' . $personDb->pers_birth_time . ' ' . __('hour');
                 $temp = "born_dateplacetime";
                 $text .= $templ_person["born_dateplacetime"];
             }
             if ($user["group_texts_pers"] == 'j') {
                 $work_text = process_text($personDb->pers_birth_text);
                 if ($work_text) {
                     //$templ_person["born_text"]=", ".$work_text;
                     $templ_person["born_text"] = " " . $work_text;
                     $temp = "born_text";
                     $text .= $templ_person["born_text"];
                 }
             }
             // *** Birth source ***
             $source = show_sources2("person", "pers_birth_source", $personDb->pers_gedcomnumber);
             if ($source) {
                 if ($screen_mode == 'PDF') {
                     $templ_person["born_source"] = $source;
                     $temp = "born_source";
                 } elseif ($screen_mode == 'RTF') {
                     $rtf_text = strip_tags($templ_person["born_source"], "<b><i>");
                     $sect->writeText($rtf_text, $arial12, new PHPRtfLite_ParFormat());
                 } else {
                     $text .= $dirmark1 . $source;
                 }
             }
             // *** Birth declaration/ registration ***
             if ($personDb->pers_gedcomnumber) {
                 $temp_text = witness($personDb->pers_gedcomnumber, 'birth_declaration');
                 if ($temp_text) {
                     //if($temp) { $templ_person[$temp].=" ("; }
                     $templ_person["born_witn"] = ' (' . __('birth declaration') . ': ' . $temp_text . ')';
                     $temp = "born_witn";
                     $text .= $templ_person["born_witn"];
                 }
             }
             // *** Check for birth items, if needed use a new line ***
             if ($text) {
                 if (!$process_text or $family_expanded == true) {
                     $text = '<b>' . ucfirst(__('born')) . '</b> ' . $text;
                 } else {
                     $text = ', <b>' . __('born') . '</b> ' . $text;
                 }
                 if ($process_text and $family_expanded == true) {
                     $text = '<br>' . $text;
                 }
                 $process_text .= $text;
             }
             // ***************
             // *** BAPTISE ***
             // ***************
             $text = '';
             if ($personDb->pers_bapt_date or $personDb->pers_bapt_place) {
                 $templ_person["bapt_dateplacetime"] = date_place($personDb->pers_bapt_date, $personDb->pers_bapt_place);
                 if ($templ_person["bapt_dateplacetime"] != '') {
                     $temp = "bapt_dateplacetime";
                 }
                 $text = $templ_person["bapt_dateplacetime"];
             }
             if ($user["group_texts_pers"] == 'j') {
                 $work_text = process_text($personDb->pers_bapt_text);
                 if ($work_text) {
                     //if($temp) { $templ_person[$temp].=", "; }
                     //$templ_person["bapt_text"]=$work_text;
                     $templ_person["bapt_text"] = ' ' . $work_text;
                     $temp = "bapt_text";
                     //$text.=", ".$work_text;
                     $text .= $templ_person["bapt_text"];
                 }
             }
             if ($user['group_religion'] == 'j' and $personDb->pers_religion) {
                 $templ_person["bapt_reli"] = " (" . __('religion') . ': ' . $personDb->pers_religion . ')';
                 $temp = "bapt_reli";
                 $text .= ' <span class="religion">(' . __('religion') . ': ' . $personDb->pers_religion . ')</span>';
             }
             // *** Baptise source ***
             $source = show_sources2("person", "pers_bapt_source", $personDb->pers_gedcomnumber);
             if ($source) {
                 if ($screen_mode == 'PDF') {
                     $templ_person["bapt_source"] = $source;
                     $temp = "bapt_source";
                 } else {
                     $text .= $source;
                 }
             }
             // *** Show baptise witnesses ***
             if ($personDb->pers_gedcomnumber) {
                 $temp_text = witness($personDb->pers_gedcomnumber, 'baptism_witness');
                 if ($temp_text) {
                     if ($temp) {
                         $templ_person[$temp] .= " (";
                     }
                     $templ_person["bapt_witn"] = __('baptism witness') . ': ' . $temp_text . ')';
                     $temp = "bapt_witn";
                     $text .= ' (' . __('baptism witness') . ': ' . $temp_text . ')';
                 }
             }
             // *** check for baptise items, if needed use a new line ***
             if ($text) {
                 if (!$process_text or $family_expanded == true) {
                     $text = '<b>' . ucfirst(__('baptised')) . '</b> ' . $text;
                 } else {
                     $text = ', <b>' . __('baptised') . '</b> ' . $text;
                 }
                 if ($process_text and $family_expanded == true) {
                     $text = '<br>' . $text;
                 }
                 $process_text .= $text;
             }
             // *** Show age of living person ***
             if (($personDb->pers_bapt_date or $personDb->pers_birth_date) and !$personDb->pers_death_date and $personDb->pers_alive != 'deceased') {
                 $process_age = new calculate_year_cls();
                 $age = $process_age->calculate_age($personDb->pers_bapt_date, $personDb->pers_birth_date, '');
                 $templ_person["age_liv"] = $age;
                 if ($templ_person["age_liv"] != '') {
                     $temp = "age_liv";
                 }
                 $process_text .= $dirmark1 . $age;
                 // *** komma and space already in $age
             }
             // ******************
             // *** DEATH      ***
             // ******************
             $text = '';
             if ($personDb->pers_death_date or $personDb->pers_death_place) {
                 $templ_person["dead_dateplacetime"] = date_place($personDb->pers_death_date, $personDb->pers_death_place);
                 if ($templ_person["dead_dateplacetime"] != '') {
                     $temp = "dead_dateplacetime";
                 }
                 $text = $templ_person["dead_dateplacetime"];
             }
             // *** Death time ***
             if (isset($personDb->pers_death_time) and $personDb->pers_death_time) {
                 //$templ_person["dead_dateplacetime"]=' '.$personDb->pers_death_time;
                 $templ_person["dead_dateplacetime"] = ' ' . __('at') . ' ' . $personDb->pers_death_time . ' ' . __('hour');
                 $temp = "dead_dateplacetime";
                 $text .= $templ_person["dead_dateplacetime"];
             }
             if ($user["group_texts_pers"] == 'j') {
                 $work_text = process_text($personDb->pers_death_text);
                 if ($work_text) {
                     //$text.=", ".$work_text;
                     //if($temp) { $templ_person[$temp].=", "; }
                     $templ_person["dead_text"] = ' ' . $work_text;
                     $temp = "dead_text";
                     $text .= $templ_person["dead_text"];
                 }
             }
             // *** Show age, by Yossi Beck ***
             if (($personDb->pers_bapt_date or $personDb->pers_birth_date) and $personDb->pers_death_date) {
                 $process_age = new calculate_year_cls();
                 $age = $process_age->calculate_age($personDb->pers_bapt_date, $personDb->pers_birth_date, $personDb->pers_death_date);
                 $templ_person["dead_age"] = $age;
                 if ($templ_person["dead_age"] != '') {
                     $temp = "dead_age";
                 }
                 $text .= $dirmark1 . $age;
                 // *** comma and space already in $age
             }
             $pers_death_cause = '';
             if ($personDb->pers_death_cause == 'murdered') {
                 $pers_death_cause = ', ' . __('death cause') . ': ' . __('murdered');
             }
             if ($personDb->pers_death_cause == 'drowned') {
                 $pers_death_cause = ', ' . __('death cause') . ': ' . __('drowned');
             }
             if ($personDb->pers_death_cause == 'perished') {
                 $pers_death_cause = ', ' . __('death cause') . ': ' . __('perished');
             }
             if ($personDb->pers_death_cause == 'killed in action') {
                 $pers_death_cause = ', ' . __('killed in action');
             }
             if ($personDb->pers_death_cause == 'being missed') {
                 $pers_death_cause = ', ' . __('being missed');
             }
             if ($personDb->pers_death_cause == 'committed suicide') {
                 $pers_death_cause = ', ' . __('death cause') . ': ' . __('committed suicide');
             }
             if ($personDb->pers_death_cause == 'executed') {
                 $pers_death_cause = ', ' . __('death cause') . ': ' . __('executed');
             }
             if ($personDb->pers_death_cause == 'died young') {
                 $pers_death_cause = ', ' . __('died young');
             }
             if ($personDb->pers_death_cause == 'died unmarried') {
                 $pers_death_cause = ', ' . __('died unmarried');
             }
             if ($personDb->pers_death_cause == 'registration') {
                 $pers_death_cause = ', ' . __('registration');
             }
             //2 TYPE registration?
             if ($personDb->pers_death_cause == 'declared death') {
                 $pers_death_cause = ', ' . __('declared death');
             }
             if ($pers_death_cause) {
                 $templ_person["dead_cause"] = $pers_death_cause;
                 $temp = "dead_cause";
                 $text .= $pers_death_cause;
             } else {
                 if ($personDb->pers_death_cause) {
                     if ($temp) {
                         $templ_person[$temp] .= ", ";
                     }
                     $templ_person["dead_cause"] = __('death cause') . ': ' . $personDb->pers_death_cause;
                     $temp = "dead_cause";
                     $text .= ', ' . __('death cause') . ': ' . $personDb->pers_death_cause;
                 }
             }
             // *** Death source ***
             $source = show_sources2("person", "pers_death_source", $personDb->pers_gedcomnumber);
             if ($source) {
                 if ($screen_mode == 'PDF') {
                     $templ_person["dead_source"] = $source;
                     $temp = "dead_source";
                 } else {
                     $text .= $source;
                 }
             }
             // *** Death declaration ***
             if ($personDb->pers_gedcomnumber) {
                 $temp_text = witness($personDb->pers_gedcomnumber, 'death_declaration');
                 if ($temp_text) {
                     if ($temp) {
                         $templ_person[$temp] .= " (";
                     }
                     $templ_person["dead_witn"] = __('death declaration') . ' ' . $temp_text . ')';
                     $temp = "dead_witn";
                     $text .= ' (' . __('death declaration') . ' ' . $temp_text . ')';
                 }
             }
             // *** Check for death items, if needed use a new line ***
             if ($text) {
                 if (!$process_text or $family_expanded == true) {
                     $text = '<b>' . ucfirst(__('died')) . '</b> ' . $text;
                 } else {
                     $text = ', <b>' . __('died') . '</b> ' . $text;
                 }
                 if ($process_text and $family_expanded == true) {
                     $text = '<br>' . $text;
                 }
                 $process_text .= $text;
             }
             // ****************
             // *** BURIED   ***
             // ****************
             $text = '';
             if ($personDb->pers_buried_date or $personDb->pers_buried_place) {
                 $templ_person["buri_dateplacetime"] = date_place($personDb->pers_buried_date, $personDb->pers_buried_place);
                 if ($templ_person["buri_dateplacetime"] != '') {
                     $temp = "buri_dateplacetime";
                 }
                 $text = $templ_person["buri_dateplacetime"];
             }
             if ($user["group_texts_pers"] == 'j') {
                 $work_text = process_text($personDb->pers_buried_text);
                 if ($work_text) {
                     //if($temp) { $templ_person[$temp].=", "; }
                     $templ_person["buri_text"] = ' ' . $work_text;
                     $temp = "buri_text";
                     //$text.=", ".$work_text;
                     $text .= $templ_person["buri_text"];
                 }
             }
             // *** Buried source ***
             $source = show_sources2("person", "pers_buried_source", $personDb->pers_gedcomnumber);
             if ($source) {
                 if ($screen_mode == 'PDF') {
                     $templ_person["buri_source"] = $source;
                     $temp = "buri_source";
                 } else {
                     $text .= $source;
                 }
             }
             // *** Buried witness ***
             if ($personDb->pers_gedcomnumber) {
                 $temp_text = witness($personDb->pers_gedcomnumber, 'burial_witness');
                 if ($temp_text) {
                     //$templ_person[$temp].=" (";
                     $templ_person["buri_witn"] = ' (' . __('burial witness') . ' ' . $temp_text . ')';
                     $temp = "buri_witn";
                     $text .= $templ_person["buri_witn"];
                 }
             }
             // *** Check for burial items, if needed use a new line ***
             if ($text) {
                 if ($personDb->pers_cremation) {
                     $buried_cremation = __('cremation');
                     $templ_person["flag_buri"] = 1;
                 } else {
                     $buried_cremation = __('buried');
                     $templ_person["flag_buri"] = 0;
                 }
                 if (!$process_text or $family_expanded == true) {
                     $text = '<b>' . ucfirst($buried_cremation) . '</b> ' . $text;
                 } else {
                     $text = ', <b>' . $buried_cremation . '</b> ' . $text;
                 }
                 if ($process_text and $family_expanded == true) {
                     $text = '<br>' . $text;
                 }
                 $process_text .= $text;
             }
             // *** HZ-21 ash dispersion (asverstrooiing) ***
             $name_qry = $db_functions->get_events_person($personDb->pers_gedcomnumber, 'ash dispersion');
             foreach ($name_qry as $nameDb) {
                 $process_text .= ', ' . __('ash dispersion') . ' ';
                 if ($nameDb->event_date) {
                     $process_text .= date_place($nameDb->event_date, '') . ' ';
                 }
                 $process_text .= $nameDb->event_event . ' ';
                 //SOURCE and TEXT.
                 //CHECK PDF EXPORT
             }
             // **************************
             // *** Show professions   ***
             // **************************
             if ($personDb->pers_gedcomnumber) {
                 $eventnr = 0;
                 $event_qry = $dbh->query("SELECT * FROM humo_events\n\t\t\t\tWHERE event_tree_id='" . $tree_id . "' AND event_person_id='" . $personDb->pers_gedcomnumber . "' AND event_kind='profession'\n\t\t\t\tORDER BY substring( event_date,-4 ), event_order");
                 $nr_occupations = $event_qry->rowCount();
                 while ($eventDb = $event_qry->fetch(PDO::FETCH_OBJ)) {
                     $eventnr++;
                     if ($eventnr == '1') {
                         if ($nr_occupations == '1') {
                             $occupation = __('occupation');
                             $templ_person["flag_prof"] = 0;
                         } else {
                             $occupation = __('occupations');
                             $templ_person["flag_prof"] = 1;
                         }
                         if ($family_expanded == true) {
                             $process_text .= '<br><span class="profession"><b>' . ucfirst($occupation) . ':</b> ';
                         } else {
                             if ($process_text) {
                                 $process_text .= '. <span class="profession">';
                             }
                             if ($temp) {
                                 $templ_person[$temp] .= ". ";
                             }
                             $process_text .= '<b>' . ucfirst($occupation) . ':</b> ';
                             //$templ_person["prof_exist"]=ucfirst($occupation).': ';
                             //$temp="prof_exist";
                         }
                     }
                     if ($eventnr > 1) {
                         $process_text .= ', ';
                         if ($temp) {
                             $templ_person[$temp] .= ", ";
                         }
                     }
                     if ($eventDb->event_date or $eventDb->event_place) {
                         $templ_person["prof_date" . $eventnr] = date_place($eventDb->event_date, $eventDb->event_place) . '; ';
                         $temp = "prof_date" . $eventnr;
                         $process_text .= $templ_person["prof_date" . $eventnr];
                     }
                     $process_text .= $eventDb->event_event;
                     $templ_person["prof_prof" . $eventnr] = $eventDb->event_event;
                     $temp = "prof_prof" . $eventnr;
                     if ($eventDb->event_text) {
                         $work_text = process_text($eventDb->event_text);
                         if ($work_text) {
                             //if($temp) { $templ_person[$temp].=", "; }
                             if ($temp) {
                                 $templ_person[$temp] .= " ";
                             }
                             $templ_person["prof_text" . $eventnr] = $work_text;
                             $temp = "prof_text" . $eventnr;
                             //$process_text.=", ".$work_text;
                             $process_text .= " " . $work_text;
                         }
                     }
                     // *** Profession source ***
                     $source = show_sources2("person", "pers_event_source", $eventDb->event_id);
                     if ($source) {
                         if ($screen_mode == 'PDF') {
                             $templ_person["prof_source"] = $source;
                             $temp = "prof_source";
                         } else {
                             $process_text .= $source;
                         }
                     }
                 }
                 if ($eventnr > 0) {
                     $process_text .= '</span>';
                 }
             }
             // ***********************
             // *** Show residences ***
             // ***********************
             if ($personDb->pers_gedcomnumber and $user['group_living_place'] == 'j') {
                 $text = '';
                 $eventnr = 0;
                 $event_qry = $db_functions->get_addresses_person($personDb->pers_gedcomnumber);
                 $nr_addresses = count($event_qry);
                 foreach ($event_qry as $eventDb) {
                     $eventnr++;
                     if ($eventnr == '1') {
                         if ($process_text) {
                             if ($family_expanded == true) {
                                 $text .= '<br>';
                             } else {
                                 $text .= '. ';
                             }
                         }
                         if ($nr_addresses == '1') {
                             $residence = __('residence');
                             $templ_person["flag_address"] = 0;
                         } else {
                             $residence = __('residences');
                             $templ_person["flag_address"] = 1;
                         }
                         if ($temp) {
                             $templ_person[$temp] .= ". ";
                         }
                         //$templ_person["address_exist"]=ucfirst($residence).': ';
                         //$temp="address_exist";
                         $text .= '<b>' . ucfirst($residence) . ':</b> ';
                     }
                     if ($eventnr > 1) {
                         $text .= ', ';
                         if ($temp) {
                             $templ_person[$temp] .= ", ";
                         }
                     }
                     if ($eventDb->address_date) {
                         $text .= date_place($eventDb->address_date, '') . ' ';
                         // default, without place, place is processed later.
                         $templ_person["address_date" . $eventnr] = date_place($eventDb->address_date, '') . ' ';
                         $temp = "address_date" . $eventnr;
                     }
                     if ($user['group_addresses'] == 'j' and $eventDb->address_address) {
                         $text .= ' ' . $eventDb->address_address . ' ';
                         // PDF Export?
                     }
                     if ($eventDb->address_zip) {
                         $text .= ' ' . $eventDb->address_zip . ' ';
                         // PDF Export?
                     }
                     $text .= $eventDb->address_place;
                     $templ_person["address_address" . $eventnr] = $eventDb->address_place;
                     if ($templ_person["address_address" . $eventnr] != '') {
                         $temp = "address_address" . $eventnr;
                     }
                     if ($eventDb->address_phone) {
                         $text .= ', ' . $eventDb->address_phone;
                     }
                     // *** Address text ***
                     if ($eventDb->address_text) {
                         $work_text = process_text($eventDb->address_text);
                         if ($work_text) {
                             if ($temp) {
                                 $templ_person[$temp] .= ", ";
                             }
                             $templ_person["address_text" . $eventnr] = $work_text;
                             $temp = "address_text" . $eventnr;
                             $text .= ", " . $work_text;
                         }
                     }
                     $source = show_sources2("person", "pers_address_source", $eventDb->address_id);
                     if ($source) {
                         if ($screen_mode == 'PDF') {
                             $templ_person["address_source"] = $source;
                             $temp = "address_source";
                         } else {
                             $text .= $source;
                         }
                     }
                 }
                 if ($text) {
                     $process_text .= '<span class="pers_living_place">' . $text . '</span>';
                 }
             }
             // *** Person source ***
             $source = show_sources2("person", "person_source", $personDb->pers_gedcomnumber);
             if ($source) {
                 if ($screen_mode == 'PDF') {
                     $templ_person["pers_source"] = $source;
                     $temp = "pers_source";
                 } else {
                     $process_text .= $source;
                 }
             }
             // *** Extended addresses for HuMo-gen and dutch Haza-data program (Haza-data plus version) ***
             if ($user['group_addresses'] == 'j') {
                 // *** Search for all connected addresses ***
                 $eventnr = 0;
                 $connect_sql = $db_functions->get_connections_person('person_address', $personDb->pers_gedcomnumber);
                 foreach ($connect_sql as $connectDb) {
                     $eventnr++;
                     if ($temp) {
                         $templ_person[$temp] .= ". ";
                     }
                     $templ_person["HDadres_exist" . $eventnr] = __('Address') . ': ';
                     $temp = "HDadres_exist" . $eventnr;
                     $process_text .= '. <b>' . __('Address') . ':</b> ';
                     $process_text .= '<a href="' . $uri_path . 'address.php?gedcomnumber=' . $connectDb->connect_item_id . '">';
                     $eventDb2 = $db_functions->get_address($connectDb->connect_item_id);
                     if (isset($eventDb2->address_address) and $eventDb2->address_address) {
                         $templ_person["HDadres_adres" . $eventnr] = " " . trim($eventDb2->address_address);
                         $temp = "HDadres_adres" . $eventnr;
                         $process_text .= $templ_person["HDadres_adres" . $eventnr];
                     }
                     if (isset($eventDb2->address_address) and $eventDb2->address_place) {
                         $templ_person["HDadres_place" . $eventnr] = " " . trim($eventDb2->address_place);
                         $temp = "HDadres_place" . $eventnr;
                         $process_text .= $templ_person["HDadres_place" . $eventnr];
                     }
                     $process_text .= "</a>";
                 }
             }
         }
         //*** END PRIVACY PART ***
         // *** Use a link for multiple marriages by parent2 ***
         if ($person_kind == 'parent2') {
             $marriage_array = explode(";", $personDb->pers_fams);
             if (isset($marriage_array[1])) {
                 for ($i = 0; $i <= substr_count($personDb->pers_fams, ";"); $i++) {
                     $marriagenr = $i + 1;
                     $parent2_famDb = $db_functions->get_family($marriage_array[$i]);
                     // *** Use a class for marriage ***
                     $parent2_marr_cls = new marriage_cls();
                     // *** Show standard marriage text ***
                     if ($screen_mode != "PDF") {
                         $parent2_marr_data = $parent2_marr_cls->marriage_data($parent2_famDb, $marriagenr, 'short');
                     } else {
                         $pdf_marriage = $parent2_marr_cls->marriage_data($parent2_famDb, $marriagenr, 'short');
                     }
                     if ($change_main_person == true) {
                         $parent2Db = $db_functions->get_person($parent2_famDb->fam_woman);
                     } else {
                         $parent2Db = $db_functions->get_person($parent2_famDb->fam_man);
                     }
                     if ($id == $marriage_array[$i]) {
                         if ($process_text) {
                             $process_text .= ',';
                         }
                         if (isset($parent2_marr_data)) {
                             $process_text .= ' ' . $dirmark1 . $parent2_marr_data . ' ';
                         }
                         // *** $parent2Db is empty if it is a N.N. person ***
                         if ($parent2Db) {
                             $name = $this->person_name($parent2Db);
                             $process_text .= $name["standard_name"];
                         } else {
                             $process_text .= __('N.N.');
                         }
                     } else {
                         $process_text .= ', ';
                         // *** url_rewrite ***
                         if ($humo_option["url_rewrite"] == "j") {
                             // *** $uri_path is made header.php ***
                             $process_text .= '<a href="' . $uri_path . 'family/' . $_SESSION['tree_prefix'] . '/' . $marriage_array[$i] . '/' . $personDb->pers_gedcomnumber . '/">';
                         } else {
                             $process_text .= '<a href="' . CMS_ROOTPATH . 'family.php?database=' . $_SESSION['tree_prefix'] . '&amp;id=' . $marriage_array[$i] . '&amp;main_person=' . $personDb->pers_gedcomnumber . '">';
                         }
                         if (isset($parent2_marr_data)) {
                             $process_text .= $dirmark1 . $parent2_marr_data . ' ';
                         }
                         // *** $parent2Db is empty by N.N. person ***
                         if ($parent2Db) {
                             $name = $this->person_name($parent2Db);
                             $process_text .= $name["standard_name"];
                         } else {
                             $process_text .= __('N.N.');
                         }
                         $process_text .= '</a>';
                     }
                     if ($screen_mode == "PDF") {
                         if ($parent2Db) {
                             if ($temp) {
                                 $templ_person[$temp] .= ", ";
                             }
                             $name = $this->person_name($parent2Db);
                             $templ_person["marr_more" . $marriagenr] = $pdf_marriage["relnr_rel"] . $pdf_marriage["rel_add"] . " " . $name["standard_name"];
                             $temp = "marr_more" . $marriagenr;
                         } else {
                             if ($temp) {
                                 $templ_person[$temp] .= ", ";
                             }
                             $templ_person["marr_more" . $marriagenr] = $pdf_marriage["relnr_rel"] . " " . __('N.N.');
                             $temp = "marr_more" . $marriagenr;
                         }
                     }
                 }
             }
         }
         //if ($privacy){
         if ($screen_mode == "mobile" or $privacy) {
             //
         } else {
             // *** Show media/ pictures ***
             $result = show_media($personDb, '');
             // *** This function can be found in file: show_picture.php! ***
             $process_text .= $result[0];
             if (isset($templ_person)) {
                 $templ_person = array_merge((array) $templ_person, (array) $result[1]);
             } else {
                 $templ_person = $result[1];
             }
             // *** Internet links (URL) ***
             $url_qry = $db_functions->get_events_person($personDb->pers_gedcomnumber, 'URL');
             if (count($url_qry) > 0) {
                 $process_text .= '<br>';
             }
             foreach ($url_qry as $urlDb) {
                 if ($urlDb->event_text) {
                     $process_text .= $urlDb->event_text . ': ';
                 }
                 $process_text .= '<a href="' . $urlDb->event_event . '" target="_blank">' . $urlDb->event_event . '</a>';
                 $process_text .= '<br>';
             }
             //******** Text by person **************
             if ($user["group_text_pers"] == 'j') {
                 $work_text = process_text($personDb->pers_text, 'person');
                 // *** BK: Source by person text ***
                 $source = show_sources2("person", "pers_text_source", $personDb->pers_gedcomnumber);
                 if ($source) {
                     //PDF
                     if ($screen_mode == 'PDF') {
                         //
                     } else {
                         $work_text .= $source;
                     }
                 }
                 if ($work_text) {
                     $process_text .= '<br>' . $work_text . "\n";
                     $templ_person["pers_text"] = "\n" . $work_text;
                     $temp = "pers_text";
                 }
             }
             // *** Show events ***
             if ($user['group_event'] == 'j') {
                 if ($personDb->pers_gedcomnumber) {
                     $event_qry = $db_functions->get_events_person($personDb->pers_gedcomnumber, 'event');
                     $num_rows = count($event_qry);
                     if ($num_rows > 0) {
                         $process_text .= '<span class="event">' . "\n";
                     }
                     $eventnr = 0;
                     foreach ($event_qry as $eventDb) {
                         $eventnr++;
                         $process_text .= "<br>\n";
                         $templ_person["event_start" . $eventnr] = "\n";
                         // *** Check if NCHI is 0 or higher ***
                         $event_gedcom = $eventDb->event_gedcom;
                         //$event_text=$eventDb->event_text;
                         if ($event_gedcom == 'NCHI' and trim($eventDb->event_event) == '') {
                             $event_gedcom = 'NCHI0';
                             //$event_text='';
                         }
                         $process_text .= '<b>' . language_event($event_gedcom) . '</b>';
                         $templ_person["event_ged" . $eventnr] = language_event($event_gedcom);
                         $temp = "event_ged" . $eventnr;
                         if ($eventDb->event_event) {
                             $templ_person["event_event" . $eventnr] = ' ' . $eventDb->event_event;
                             $temp = "event_event" . $eventnr;
                             $process_text .= $templ_person["event_event" . $eventnr];
                         }
                         $templ_person["event_dateplace" . $eventnr] = ' ' . date_place($eventDb->event_date, $eventDb->event_place);
                         $temp = "event_dateplace" . $eventnr;
                         $process_text .= $templ_person["event_dateplace" . $eventnr];
                         if ($eventDb->event_text) {
                             $work_text = process_text($eventDb->event_text);
                             if ($work_text) {
                                 //$process_text.=", ".$work_text;
                                 $process_text .= " " . $work_text;
                                 //if($temp) { $templ_person[$temp].=", "; }
                                 if ($temp) {
                                     $templ_person[$temp] .= " ";
                                 }
                                 $templ_person["event_text" . $eventnr] = $work_text;
                                 $temp = "event_text" . $eventnr;
                             }
                         }
                         $source = show_sources2("person", "pers_event_source", $eventDb->event_id);
                         if ($source) {
                             if ($screen_mode == 'PDF') {
                                 $templ_person["pers_event_source"] = $source;
                                 $temp = "pers_event_source";
                             } else {
                                 $process_text .= $source;
                             }
                         }
                     }
                     if ($num_rows > 0) {
                         $process_text .= "</span>\n";
                     }
                     unset($event_qry);
                 }
             }
         }
         // End of privacy
         // *** Return person data ***
         if ($screen_mode == "mobile") {
             if ($process_text) {
                 return $process_text;
             }
         } elseif ($screen_mode != "PDF") {
             if ($process_text) {
                 $div = '<div class="margin_person">';
                 if ($person_kind == 'child') {
                     $div = '<div class="margin_child">';
                 }
                 return $privacy_filter . $div . $process_text . '</div>';
             } else {
                 return $privacy_filter;
             }
         } else {
             // return array with pdf values
             if (isset($templ_person)) {
                 return $templ_person;
             }
         }
     }
     // End of check $personDb
 }
Example #2
0
function compare_gap($first_date, $second_date)
{
    // finds gap between 2 years. No need for months or days, since we look for gaps of several years
    include_once CMS_ROOTPATH . 'include/calculate_age_cls.php';
    $process_date = new calculate_year_cls();
    // take care of combined julian/gregorian dates (1678/9)
    if (strpos($first_date, '/') > 0) {
        $temp = explode('/', $first_date);
        $first_date = $temp[0];
    }
    if (strpos($second_date, '/') > 0) {
        $temp = explode('/', $second_date);
        $second_date = $temp[0];
    }
    $year1 = $process_date->search_year($first_date);
    $year2 = $process_date->search_year($second_date);
    if ($year1 and $year2) {
        return $year2 - $year1;
    } else {
        return false;
    }
}
 function marriage_data($marriageDb = '', $number = '0', $presentation = 'standard')
 {
     global $dbh, $db_functions, $tree_prefix_quoted, $url_path, $dataDb, $uri_path;
     global $language, $user, $screen_mode;
     global $templ_person;
     if ($marriageDb == '') {
         $marriageDb = $this->cls_marriage_Db;
     }
     // *** Open a person class for witnesses ***
     $person_cls = new person_cls();
     $relation_kind = '';
     $relation_check = false;
     $marriage_check = false;
     $addition = __(' to: ');
     $text = '';
     if ($marriageDb->fam_kind == 'living together') {
         $relation_check = true;
         $relation_kind = __('Living together');
     }
     if ($marriageDb->fam_kind == 'living apart together') {
         $relation_kind = __('Living apart together');
         $relation_check = true;
     }
     if ($marriageDb->fam_kind == 'intentionally unmarried mother') {
         $relation_kind = __('Intentionally unmarried mother');
         $relation_check = true;
         $addition = '';
     }
     if ($marriageDb->fam_kind == 'homosexual') {
         $relation_check = true;
         $relation_kind = __('Homosexual');
     }
     if ($marriageDb->fam_kind == 'non-marital') {
         $relation_check = true;
         $relation_kind = __('Non marital');
         $addition = '';
     }
     if ($marriageDb->fam_kind == 'extramarital') {
         $relation_check = true;
         $relation_kind = __('Extramarital');
         $addition = '';
     }
     // NOT TESTED
     if ($marriageDb->fam_kind == "PRO-GEN") {
         $relation_check = true;
         $relation_kind = __('Extramarital');
         $addition = '';
     }
     // *** Aldfaer relations ***
     if ($marriageDb->fam_kind == 'partners') {
         $relation_check = true;
         $relation_kind = __('Partner') . ' ';
     }
     if ($marriageDb->fam_kind == 'registered') {
         $relation_check = true;
         $relation_kind = __('Registered') . ' ';
     }
     if ($marriageDb->fam_kind == 'unknown') {
         $relation_check = true;
         $relation_kind = __('Unknown relation') . ' ';
     }
     // *** Living together ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_relation_date or $marriageDb->fam_relation_place) {
         $templ_relation["marriage_date"] = date_place($marriageDb->fam_relation_date, $marriageDb->fam_relation_place);
         $temp = "marriage_date";
         $temp_text .= $templ_relation["marriage_date"];
     }
     if ($user["group_texts_fam"] == 'j' and process_text($marriageDb->fam_relation_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= ' ';
             }
         }
         $templ_relation["marriage_text"] = process_text($marriageDb->fam_relation_text);
         $temp = "marriage_text";
         $temp_text .= $templ_relation["marriage_text"];
     }
     // *** Living together source ***
     $source = show_sources2("family", "fam_relation_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["marriage_source"] = $source;
             $temp = "marriage_source";
         } else {
             $temp_text .= $source;
         }
     }
     if ($temp_text) {
         $relation_check = true;
         $addition = __(' to: ');
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["marriage_exist"] = "\n";
         }
         // *** Text "living together" already shown in "kind" ***
         // *** Just in case made an extra text "living together" here ***
         if (!$relation_kind) {
             $text .= '<b>' . __('Living together') . '</b>';
             if (isset($templ_relation["marriage_exist"])) {
                 $templ_relation["marriage_exist"] .= __('Living together') . " ";
             } else {
                 $templ_relation["marriage_exist"] = __('Living together') . " ";
             }
         }
         $text .= ' ' . $temp_text;
     }
     // *** End of living together. NO end place, end text or end source yet. ***
     $temp_text = '';
     $temp = '';
     $fam_relation_end_place = '';
     if ($marriageDb->fam_relation_end_date or $fam_relation_end_place) {
         $temp_text .= date_place($marriageDb->fam_relation_end_date, $fam_relation_end_place);
         $templ_relation["marriage_end"] = '';
         if (isset($templ_relation["marriage_exist"])) {
             $templ_relation["marriage_end"] = '. ';
         }
         $templ_relation["marriage_end"] .= __('End living together') . ' ' . date_place($marriageDb->fam_relation_end_date, $fam_relation_end_place);
         $temp = "marriage_end";
     }
     //if ($user["group_texts_fam"]=='j' AND isset($marriageDb->fam_relation_end_text) AND process_text($marriageDb->fam_relation_end_text)){
     //	if ($temp_text){
     //		$temp_text.= ', ';
     //		if($temp) { $templ_relation[$temp].=", "; }
     //	}
     //	$temp_text.= process_text($marriageDb->fam_relation_end_text);
     //	//$templ_relation["marriage_text"]=process_text($marriageDb->fam_relation_end_text);
     //	//$temp="marriage_text";
     //}
     // *** Living together source ***
     // no source yet...
     if ($temp_text) {
         $marriage_check = true;
         if ($text != '' or $relation_kind) {
             $text .= "<br>\n";
             //$templ_relation["marriage_exist"]="\n";
         }
         $text .= '<b>' . __('End living together') . '</b>';
         //if(isset($templ_relation["marriage_exist"])) {$templ_relation["marriage_exist"].=__('End living together')." "; }
         //else {$templ_relation["marriage_exist"]=__('End living together')." ";  }
         $text .= ' ' . $temp_text;
     }
     // *** Married Notice ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_marr_notice_date or $marriageDb->fam_marr_notice_place) {
         $temp_text .= date_place($marriageDb->fam_marr_notice_date, $marriageDb->fam_marr_notice_place);
         $templ_relation["prew_date"] = date_place($marriageDb->fam_marr_notice_date, $marriageDb->fam_marr_notice_place);
         $temp = "prew_date";
     }
     if ($user["group_texts_fam"] == 'j' and process_text($marriageDb->fam_marr_notice_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= " ";
             }
         }
         $temp_text .= process_text($marriageDb->fam_marr_notice_text);
         $templ_relation["prew_text"] = process_text($marriageDb->fam_marr_notice_text);
         $temp = "prew_text";
     }
     // *** Married notice source ***
     $source = show_sources2("family", "fam_marr_notice_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["prew_source"] = $source;
             $temp = "pre_source";
         } else {
             $temp_text .= $source;
         }
     }
     if ($temp_text) {
         $marriage_check = true;
         $addition = __(' to: ');
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["prew_exist"] = "\n";
         }
         $text .= '<b>' . __('Marriage notice') . '</b> ' . $temp_text;
         if (isset($templ_relation["prew_exist"])) {
             $templ_relation["prew_exist"] .= __('Marriage notice') . ' ';
         } else {
             $templ_relation["prew_exist"] = __('Marriage notice') . ' ';
         }
     }
     // *** Marriage ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_marr_date or $marriageDb->fam_marr_place) {
         $templ_relation["wedd_date"] = date_place($marriageDb->fam_marr_date, $marriageDb->fam_marr_place);
         $temp = "wedd_date";
         $temp_text .= $templ_relation["wedd_date"];
     }
     if ($marriageDb->fam_marr_authority) {
         $templ_relation["wedd_authority"] = " [" . $marriageDb->fam_marr_authority . "]";
         $temp = "wedd_authority";
         $temp_text .= $templ_relation["wedd_authority"];
     }
     if ($user["group_texts_fam"] == 'j' and process_text($marriageDb->fam_marr_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= " ";
             }
         }
         $templ_relation["wedd_text"] = process_text($marriageDb->fam_marr_text);
         $temp = "wedd_text";
         $temp_text .= $templ_relation["wedd_text"];
     }
     // *** Aldfaer/ HuMo-gen: show witnesses ***
     if ($marriageDb->fam_gedcomnumber) {
         $temp_text2 = witness($marriageDb->fam_gedcomnumber, 'marriage_witness', 'family');
         if ($temp_text2) {
             $temp_text .= ' (' . __('marriage witness') . ' ' . $temp_text2 . ')';
             if ($temp) {
                 $templ_relation[$temp] .= " (";
             }
             $templ_relation["wedd_witn"] = __('marriage witness') . ' ' . $temp_text2 . ')';
             $temp = "wedd_witn";
         }
     }
     // *** Marriage source ***
     $source = show_sources2("family", "fam_marr_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["wedd_source"] = $source;
             $temp = "wedd_source";
         } else {
             $temp_text .= $source;
         }
     }
     if ($temp_text) {
         $marriage_check = true;
         $addition = __(' to: ');
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["wedd_exist"] = "\n";
         }
         $text .= '<b>' . __('Married') . '</b> ' . $temp_text;
         if (isset($templ_relation["wedd_exist"])) {
             $templ_relation["wedd_exist"] .= __('Married') . ' ';
         } else {
             $templ_relation["wedd_exist"] = __('Married') . ' ';
         }
     } else {
         // *** Marriage without further data (date or place) ***
         if ($marriageDb->fam_kind == 'civil') {
             $marriage_check = true;
             $addition = __(' to: ');
             $text .= '<b>' . __('Married') . '</b>';
             $templ_relation["wedd_exist"] = __('Married');
         }
     }
     // *** Married church notice ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_marr_church_notice_date or $marriageDb->fam_marr_church_notice_place) {
         $templ_relation["prec_date"] = date_place($marriageDb->fam_marr_church_notice_date, $marriageDb->fam_marr_church_notice_place);
         $temp = "prec_date";
         $temp_text .= $templ_relation["prec_date"];
     }
     if ($user["group_texts_fam"] == 'j' and process_text($marriageDb->fam_marr_church_notice_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= " ";
             }
         }
         $templ_relation["prec_text"] = process_text($marriageDb->fam_marr_church_notice_text);
         $temp = "prec_text";
         $temp_text .= $templ_relation["prec_text"];
     }
     // *** Married church notice source ***
     $source = show_sources2("family", "fam_marr_church_notice_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["prec_source"] = $source;
             $temp = "prec_source";
         } else {
             $temp_text .= $source;
         }
     }
     if ($temp_text) {
         $marriage_check = true;
         $addition = __(' to: ');
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["prec_exist"] = "\n";
         }
         $text .= '<b>' . __('Married notice (religious)') . '</b> ' . $temp_text;
         if (isset($templ_relation["prec_exist"])) {
             $templ_relation["prec_exist"] .= __('Married notice (religious)') . ' ';
         } else {
             $templ_relation["prec_exist"] = __('Married notice (religious)') . ' ';
         }
     }
     // *** Married church ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_marr_church_date or $marriageDb->fam_marr_church_place) {
         $templ_relation["chur_date"] = date_place($marriageDb->fam_marr_church_date, $marriageDb->fam_marr_church_place);
         $temp = "chur_date";
         $temp_text .= $templ_relation["chur_date"];
     }
     if ($user["group_texts_fam"] == 'j' and process_text($marriageDb->fam_marr_church_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= " ";
             }
         }
         $templ_relation["chur_text"] = process_text($marriageDb->fam_marr_church_text);
         $temp = "chur_text";
         $temp_text .= $templ_relation["chur_text"];
     }
     // *** Aldfaer/ HuMo-gen show witnesses ***
     if ($marriageDb->fam_gedcomnumber) {
         $temp_text2 = witness($marriageDb->fam_gedcomnumber, 'marriage_witness_rel', 'family');
         if ($temp_text2) {
             $temp_text .= ' (' . __('marriage witness (religious)') . ' ' . $temp_text2 . ')';
             if ($temp) {
                 $templ_relation[$temp] .= " (";
             }
             $templ_relation["chur_witn"] = __('marriage witness (religious)') . ' ' . $temp_text2 . ')';
             $temp = "chur_witn";
         }
     }
     // *** Married church source ***
     $source = show_sources2("family", "fam_marr_church_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["chur_source"] = $source;
             $temp = "chur_source";
         } else {
             $temp_text .= $source;
         }
     }
     if ($temp_text) {
         $marriage_check = true;
         $addition = __(' to: ');
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["chur_exist"] = "\n";
         }
         $text .= '<b>' . __('Married (religious)') . '</b> ' . $temp_text;
         if (isset($templ_relation["chur_exist"])) {
             $templ_relation["chur_exist"] .= __('Married (religious)') . ' ';
         } else {
             $templ_relation["chur_exist"] = __('Married (religious)') . ' ';
         }
     }
     // *** Religion ***
     if ($user['group_religion'] == 'j' and $marriageDb->fam_religion) {
         $templ_relation["reli_reli"] = ' (' . __('religion: ') . $marriageDb->fam_religion . ')';
         $text .= ' <span class="religion">(' . __('religion: ') . $marriageDb->fam_religion . ')</span>';
     }
     // *** Divorse ***
     $temp_text = '';
     $temp = '';
     if ($marriageDb->fam_div_date or $marriageDb->fam_div_place) {
         $templ_relation["devr_date"] = date_place($marriageDb->fam_div_date, $marriageDb->fam_div_place);
         $temp = "devr_date";
         $temp_text .= $templ_relation["devr_date"];
     }
     if ($marriageDb->fam_div_authority) {
         $templ_relation["devr_authority"] = " [" . $marriageDb->fam_div_authority . "]";
         $temp = "devr_authority";
         $temp_text .= $templ_relation["devr_authority"];
     }
     if ($user["group_texts_fam"] == 'j' and $marriageDb->fam_div_text != 'DIVORCE' and process_text($marriageDb->fam_div_text)) {
         if ($temp_text) {
             //$temp_text.= ', ';
             //if($temp) { $templ_relation[$temp].=", "; }
             $temp_text .= ' ';
             if ($temp) {
                 $templ_relation[$temp] .= " ";
             }
         }
         $templ_relation["devr_text"] = process_text($marriageDb->fam_div_text);
         $temp = "devr_text";
         $temp_text .= $templ_relation["devr_text"];
     }
     // *** Divorse source ***
     $source = show_sources2("family", "fam_div_source", $marriageDb->fam_gedcomnumber);
     if ($source) {
         if ($screen_mode == 'PDF') {
             $templ_relation["devr_source"] = $source;
             $temp = "devr_source";
         } else {
             $temp_text .= $source;
         }
     }
     //if ($temp_text){
     // *** div_text "DIVORCE" is used for divorce without further data! ***
     if ($temp_text or $marriageDb->fam_div_text == 'DIVORCE') {
         $marriage_check = true;
         $addition = ' ' . __('from:') . ' ';
         if ($text != '') {
             $text .= "<br>\n";
             $templ_relation["devr_exist"] = "\n";
         }
         $text .= '<span class="divorse"><b>' . ucfirst(__('divorced')) . '</b> ' . $temp_text . '</span>';
         if (isset($templ_relation["devr_exist"])) {
             $templ_relation["devr_exist"] .= ucfirst(__('divorced')) . ' ';
         } else {
             $templ_relation["devr_exist"] = ucfirst(__('divorced')) . ' ';
         }
     }
     // *** No relation data (marriage without date), show standard text ***
     if ($relation_check == false and $marriage_check == false) {
         // *** Show standard marriage text ***
         $templ_relation["unkn_rel"] = __('Marriage/ Related') . ' ';
         $text .= '<b>' . __('Marriage/ Related') . '</b> ';
     } else {
         // *** Years of marriage ***
         if (($marriageDb->fam_marr_church_date or $marriageDb->fam_marr_date) and $marriageDb->fam_div_text != 'DIVORCE' and !($temp_text and $marriageDb->fam_div_date == '')) {
             $end_date = '';
             // *** Check death date of husband ***
             @($person_manDb = $db_functions->get_person($marriageDb->fam_man));
             if (isset($person_manDb->pers_death_date) and $person_manDb->pers_death_date) {
                 $end_date = $person_manDb->pers_death_date;
             }
             // *** Check death date of wife ***
             @($person_womanDb = $db_functions->get_person($marriageDb->fam_woman));
             if (isset($person_womanDb->pers_death_date) and $person_womanDb->pers_death_date) {
                 // *** Check if men died earlier then woman (AT THIS MOMENT ONLY CHECK YEAR) ***
                 if ($end_date and substr($end_date, -4) > substr($person_womanDb->pers_death_date, -4)) {
                     $end_date = $person_womanDb->pers_death_date;
                 }
                 // *** Man still living or no date available  ***
                 if ($end_date == '') {
                     $end_date = $person_womanDb->pers_death_date;
                 }
             }
             // *** End of marriage by divorse ***
             if ($marriageDb->fam_div_date) {
                 $end_date = $marriageDb->fam_div_date;
             }
             $marr_years = new calculate_year_cls();
             $age = $marr_years->calculate_marriage($marriageDb->fam_marr_church_date, $marriageDb->fam_marr_date, $end_date);
             $text .= $age;
             // Space and komma in $age
             //PDF?
         }
     }
     // *** Show media/ pictures ***
     //$text.=show_media('',$marriageDb); // *** This function can be found in file: show_picture.php! ***
     $result = show_media('', $marriageDb);
     // *** This function can be found in file: show_picture.php! ***
     $text .= $result[0];
     //if (isset($templ_person))
     //	$templ_person = array_merge((array)$templ_person,(array)$result[1]);
     //else
     //	$templ_person=$result[1];
     // *** Show objecs ***
     // *** Show events ***
     if ($user['group_event'] == 'j') {
         if ($marriageDb->fam_gedcomnumber) {
             $event_qry = $db_functions->get_events_family($marriageDb->fam_gedcomnumber, 'event');
             $num_rows = count($event_qry);
             if ($num_rows > 0) {
                 $text .= '<span class="event">';
             }
             $i = 0;
             foreach ($event_qry as $eventDb) {
                 $i++;
                 //echo '<br>'.__('Event (family)');
                 if ($text != '') {
                     $text .= "<br>\n";
                 }
                 if ($i > 1) {
                     $templ_relation["event" . $i . "_ged"] = "\n";
                 }
                 // *** Check if NCHI is 0 or higher ***
                 $event_gedcom = $eventDb->event_gedcom;
                 $event_text = $eventDb->event_text;
                 if ($event_gedcom == 'NCHI' and trim($eventDb->event_text) == '0') {
                     $event_gedcom = 'NCHI0';
                     $event_text = '';
                 }
                 $text .= '<b>' . language_event($event_gedcom) . '</b>';
                 if (isset($templ_relation["event" . $i . "_ged"])) {
                     $templ_relation["event" . $i . "_ged"] .= language_event($event_gedcom);
                 } else {
                     $templ_relation["event" . $i . "_ged"] = language_event($event_gedcom);
                 }
                 // *** Show event kind ***
                 if ($eventDb->event_event) {
                     $templ_relation["event" . $i . "_event"] = ' (' . $eventDb->event_event . ')';
                     $text .= $templ_relation["event" . $i . "_event"];
                 }
                 if ($eventDb->event_date or $eventDb->event_place) {
                     $templ_relation["event" . $i . "_date"] = ' ' . date_place($eventDb->event_date, $eventDb->event_place);
                     $text .= $templ_relation["event" . $i . "_date"];
                 }
                 if ($event_text) {
                     $templ_relation["event" . $i . "_text"] = ' ' . process_text($eventDb->event_text);
                     $text .= $templ_relation["event" . $i . "_text"];
                 }
                 // *** Sources by a family event ***
                 $source = show_sources2("family", "fam_event_source", $eventDb->event_id);
                 if ($source) {
                     if ($screen_mode == 'PDF') {
                         //	$templ_relation["event_source"]=show_sources2("family","fam_event_source",$eventDb->event_id);
                         //	$temp="fam_event_source";
                     } else {
                         $text .= $source;
                     }
                 }
             }
             if ($num_rows > 0) {
                 $text .= "</span><br>\n";
                 // if there are events, the word "with" should be on a new line to make the text clearer
                 $templ_relation["event_lastline"] = "\n";
                 $addition = ltrim($addition);
             }
         }
     }
     // **********************************
     // *** Concacenate marriage texts ***
     // **********************************
     // Process english 1st, 2nd, 3rd and 4th marriage.
     $relation_number = '';
     //if ($number!=''){
     if ($presentation == 'short' or $presentation == 'shorter') {
         if ($number == '1') {
             $relation_number = __('1st');
         }
         if ($number == '2') {
             $relation_number = __('2nd');
         }
         if ($number == '3') {
             $relation_number = __('3rd');
         }
         if ($number > '3') {
             $relation_number = $number . __('th');
         }
         if ($marriage_check == true) {
             if ($number) {
                 $relation_number .= ' ' . __('marriage');
                 // marriage
                 $relation_kind = '';
                 $addition = __(' to: ');
             } else {
                 $relation_number .= __('Married ');
                 // Married
                 $relation_kind = '';
                 $addition = __(' to: ');
             }
         }
         if ($relation_check == true) {
             if ($number) {
                 $relation_number .= ' ' . __('related');
                 // relation
                 $relation_kind = '';
                 $addition = __(' to: ');
             } else {
                 $relation_number = ucfirst(__('related')) . ' ';
                 // Relation
                 $relation_kind = '';
                 $addition = __(' to: ');
             }
         }
         if ($relation_check == false and $marriage_check == false) {
             if ($number) {
                 // *** Other text in 2nd marriage: 2nd marriage Hubertus [Huub] Mons ***
                 if ($presentation == 'shorter') {
                     $relation_number .= ' ' . __('marriage/ relation');
                     // relation
                 } else {
                     $relation_number .= ' ' . __('marriage/ related');
                     // relation
                 }
                 $relation_kind = '';
                 $addition = __(' to: ');
             } else {
                 $relation_number .= __('Marriage/ Related');
                 // Relation
                 $relation_kind = '';
                 $addition = __(' to: ');
             }
         }
     }
     if ($presentation == 'short' or $presentation == 'shorter') {
         $text = '<b>' . $relation_number . $relation_kind . '</b>';
         $templ_relation = array();
         //reset array - don't need it
         // *** Show divorse if privacy filter is set ***
         if ($marriageDb->fam_div_date or $marriageDb->fam_div_place or $marriageDb->fam_div_text) {
             $text .= ' <span class="divorse">(' . __('divorced') . ')</span>';
         }
         // Show end of relation here?
         // *** No addition in text: 2nd marriage Hubertus [Huub] Mons ***
         if ($presentation == 'shorter') {
             $addition = '';
         }
     } else {
         $text = '<b>' . $relation_number . $relation_kind . '</b>' . $text;
     }
     if ($addition) {
         $text .= '<b>' . $addition . '</b>';
     }
     $templ_relation["relnr_rel"] = $relation_number . $relation_kind;
     $templ_relation["rel_add"] = $addition;
     if ($screen_mode != "PDF") {
         return $text;
     } else {
         return $templ_relation;
     }
 }
Example #4
0
<?php

include_once "header.php";
// returns CMS_ROOTPATH constant
include_once CMS_ROOTPATH . "menu.php";
require_once CMS_ROOTPATH . "include/person_cls.php";
//require_once(CMS_ROOTPATH."include/date_place.php");
require_once CMS_ROOTPATH . "include/language_date.php";
include_once CMS_ROOTPATH . "include/calculate_age_cls.php";
$process_age = new calculate_year_cls();
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
@($personDb = $db_functions->get_person($id));
$isborn = 0;
$isdeath = 0;
$ismarr = 0;
$ischild = 0;
$deathtext = '';
$borntext = '';
$bapttext = '';
$burrtext = '';
$marrtext = '';
$privacy_filtered = false;
function julgreg($date)
{
    // alters a julian/gregorian date entry such as 4 mar 1572/3 to use regular date for calculations
    if (strpos($date, '/') > 0) {
        $temp = explode('/', $date);
        $date = $temp[0];
    }
Example #5
0
     // *** Now get full person data (quicker in large family trees) ***
     $row = $db_functions->get_person($oldest_person->pers_gedcomnumber);
     echo '<td align="center"><i>' . $test_year . ' ' . __('years') . "</i></td>\n";
     echo show_person($row);
 } else {
     echo "<td></td><td></td>\n";
 }
 // *** Longest living woman and calculate ages ***
 $woman_min = 50;
 $woman_max = 0;
 $woman_min_married = 50;
 $woman_max_married = 0;
 $res = @$dbh->query("SELECT pers_gedcomnumber, pers_sexe, pers_birth_date, pers_bapt_date, pers_death_date, pers_fams, pers_indexnr\n\t\t\tFROM humo_persons WHERE pers_tree_id='" . $tree_id . "'\n\t\t\tAND pers_sexe='F' AND (pers_birth_date LIKE '_%' OR pers_bapt_date LIKE '_%') AND pers_death_date LIKE '_%'");
 $test_year = "10";
 while (@($record = $res->fetch(PDO::FETCH_OBJ))) {
     $age = new calculate_year_cls();
     $age_cal = $age->calculate_age($record->pers_bapt_date, $record->pers_birth_date, $record->pers_death_date, true);
     $age_woman[] = $age_cal;
     if ($age_cal > $woman_max) {
         $woman_max = $age_cal;
     }
     if ($age_cal > 0 and $age_cal < $woman_min) {
         $woman_min = $age_cal;
     }
     if ($record->pers_fams and $age_cal > 0) {
         $age_woman_married[] = $age_cal;
         if ($age_cal > $woman_max_married) {
             $woman_max_married = $age_cal;
         }
         if ($age_cal > 0 and $age_cal < $woman_min_married) {
             $woman_min_married = $age_cal;