} print ' <input class="fonts" type="text" name="search_quicksearch_man" placeholder="' . __('Name') . '" value="' . $search_quicksearch_man . '" size="15">'; $search_man_id = ''; if (isset($_POST['search_man_id'])) { $search_man_id = safe_text($_POST['search_man_id']); } echo __('or ID:') . ' <input class="fonts" type="text" name="search_man_id" value="' . $search_man_id . '" size="5">'; echo ' <input class="fonts" type="submit" name="submit" value="' . __('Search') . '">'; echo '</form><br><br>'; if ($search_quicksearch_man != '') { // *** Replace space by % to find first AND lastname in one search "Huub Mons" *** $search_quicksearch_man = str_replace(' ', '%', $search_quicksearch_man); // *** In case someone entered "Mons, Huub" using a comma *** $search_quicksearch_man = str_replace(',', '', $search_quicksearch_man); //$person_qry= "SELECT *, CONCAT(pers_firstname,pers_prefix,pers_lastname) as concat_name $person_qry = "SELECT *\n\tFROM humo_persons\n\tWHERE pers_tree_id='" . $tree_id . "'\n\t\tAND (CONCAT(pers_firstname,REPLACE(pers_prefix,'_',' '),pers_lastname)\n\t\tLIKE '%" . $search_quicksearch_man . "%'\n\t\tOR CONCAT(pers_lastname,REPLACE(pers_prefix,'_',' '),pers_firstname)\n\t\tLIKE '%" . $search_quicksearch_man . "%' \n\t\tOR CONCAT(pers_lastname,pers_firstname,REPLACE(pers_prefix,'_',' '))\n\t\tLIKE '%" . $search_quicksearch_man . "%' \n\t\tOR CONCAT(REPLACE(pers_prefix,'_',' '), pers_lastname,pers_firstname)\n\t\tLIKE '%" . $search_quicksearch_man . "%')\n\t\tORDER BY pers_lastname, pers_firstname"; } elseif ($search_man_id != '') { if (substr($search_man_id, 0, 1) != "i" and substr($search_man_id, 0, 1) != "I") { $search_man_id = "I" . $search_man_id; } //make entry "48" into "I48" $person_qry = "SELECT * FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . $search_man_id . "'"; } else { $person_qry = "SELECT * FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . $man_gedcomnumber . "'"; } $person_result = $dbh->query($person_qry); include 'include/editor_cls.php'; $editor_cls = new editor_cls(); while ($person = $person_result->fetch(PDO::FETCH_OBJ)) { echo '<a href="" onClick=\'return select_item("' . $person->pers_gedcomnumber . '")\'>' . $editor_cls->show_selected_person($person) . '</a><br>'; }
<?php // *** Safety line *** if (!defined('ADMIN_PAGE')) { exit; } //$joomlapath=CMS_ROOTPATH_ADMIN.'include/'; include_once "editor_cls.php"; $editor_cls = new editor_cls(); if (isset($_SESSION['admin_tree_prefix'])) { $tree_prefix = $_SESSION['admin_tree_prefix']; } if (isset($_SESSION['admin_tree_id'])) { $tree_id = $_SESSION['admin_tree_id']; } if (isset($_SESSION['admin_pers_gedcomnumber'])) { $pers_gedcomnumber = $_SESSION['admin_pers_gedcomnumber']; } if (isset($_SESSION['admin_fam_gedcomnumber'])) { $marriage = $_SESSION['admin_fam_gedcomnumber']; } if (isset($_SESSION['admin_address_gedcomnumber'])) { $address_id = $_SESSION['admin_address_gedcomnumber']; } // *** Needed for event sources *** $connect_kind = ''; if (isset($_GET['connect_kind'])) { $connect_kind = $_GET['connect_kind']; } //if (isset($_POST['connect_kind'])) $connect_kind=$_POST['connect_kind']; $connect_sub_kind = '';
$family_string = 'index.php?option=com_humo-gen&task=family&'; $sourcestring = 'index.php?option=com_humo-gen&task=source&'; $addresstring = 'index.php?option=com_humo-gen&task=address&'; $path_prefix = ''; // in joomla we are already in main joomla map and do not have to "get out of admin" } else { $phpself = $_SERVER['PHP_SELF']; $joomlastring = ''; $family_string = '../family.php?'; $sourcestring = '../source.php?'; $addresstring = '../address.php?'; $path_prefix = '../'; } $joomlapath = CMS_ROOTPATH_ADMIN . 'include/'; include_once $joomlapath . "editor_cls.php"; $editor_cls = new editor_cls(); include_once CMS_ROOTPATH . "include/language_date.php"; include_once CMS_ROOTPATH . "include/date_place.php"; include_once CMS_ROOTPATH . "include/language_event.php"; // *** Used for person color selectection for descendants and ancestors, etc. *** include_once CMS_ROOTPATH . "include/ancestors_descendants.php"; include 'editor_event_cls.php'; $event_cls = new editor_event_cls(); // ***************** // *** FUNCTIONS *** // ***************** // *** Calculate nr. of persons and families *** function family_tree_update($tree_prefix) { global $dbh, $tree_id; $total = $dbh->query("SELECT COUNT(*) FROM humo_persons WHERE pers_tree_id='" . $tree_id . "'");