} 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>'; }
if ($menu_admin == 'person') { if ($new_tree == false) { // *** Favorites *** echo ' <img src="' . CMS_ROOTPATH . 'images/favorite_blue.png"> '; echo '<form method="POST" action="' . $phpself . '" style="display : inline;">'; echo '<input type="hidden" name="page" value="' . $page . '">'; $fav_qry = "SELECT * FROM humo_settings, humo_persons\n\t\t\t\t\tWHERE setting_variable='admin_favourite'\n\t\t\t\t\tAND setting_tree_id='" . safe_text($tree_id) . "'\n\t\t\t\t\tAND pers_tree_id='" . $tree_id . "'\n\t\t\t\t\tAND pers_gedcomnumber=setting_value\n\t\t\t\t\tORDER BY pers_lastname, pers_firstname"; $fav_result = $dbh->query($fav_qry); echo '<select size="1" name="person" onChange="this.form.submit();" style="width: 200px">'; echo '<option value="">' . __('Favourites list:') . '</option>'; while ($favDb = $fav_result->fetch(PDO::FETCH_OBJ)) { $selected = ''; if ($favDb->setting_value == $pers_gedcomnumber) { $selected = ' SELECTED'; } echo '<option value="' . $favDb->setting_value . '"' . $selected . '>' . $editor_cls->show_selected_person($favDb) . '</option>'; } echo '</select>'; echo '</form>'; } // *** Show delete message *** if ($confirm) { echo $confirm; } if ($new_tree == false) { echo '<br><br><table class="humo" style="text-align:center; width:90%; margin-left: auto; margin-right:auto;"><tr class="table_header_large"><td>'; // *** Search persons firstname/ lastname *** echo '<form method="POST" action="' . $phpself . '" style="display : inline;">'; echo '<input type="hidden" name="page" value="' . $page . '">'; print __('Person') . ':'; print ' <input class="fonts" type="text" name="search_quicksearch" placeholder="' . __('Name') . '" value="' . $search_quicksearch . '" size="15"> ';