2) $birthloc = getLocationCode(urldecode($birthloc)); if (strlen($spbirthloc) > 2) $birthloc = getLocationCode(urldecode($spbirthloc)); } if (!empty($surname) && empty($criteria)) $criteria = "exact"; if (!empty($author)){ //Clear all other search fields if search is by author. $firstname = ""; $gender = ""; $birthyear = ""; $birthloc = ""; $spfirstname = ""; $splastname = ""; $spbirthyear = ""; $spbirthloc = ""; $surname = ""; $criteria = ""; } if (!is_numeric($birthyear)) $birthyear = ""; if (!is_numeric($spbirthyear)) $spbirthyear = ""; // The following creates unique titles $name = $firstname . " " . $lastname; $title = " | The Computerized Ancestor | Page "; $description = ""; $keywords = ""; if (strlen($name) > 1){ $title = $name . " Name Matches" . $title . $pagenum; $keywords = $name . ", "; $description = $name . " name matches in over 840,000 group sheets from the Family Group Sheet Exchange, page " . $pagenum . "."; } else if (!empty($author)){ $title = "Author Searched: " . $author . $title . $pagenum; $description = "Family group data from author " . $author . " in the Family Group Sheet Exchange, page " . $pagenum . "."; } else if (!empty($surname)){ $title = $surname . " Surname Matches" . $title . $pagenum; $keywords = $surname . ", surname, "; $description = $surname . " surname matches in over 840,000 group sheets from the Family Group Sheet Exchange, page " . $pagenum . "."; } else { $title = "Free Search for Ancestors | The Computerized Ancestor"; $description = "Search genealogy data on over 840,000 group sheets from the Family Group Sheet Exchange."; } ?> <?php echo $title ?> "; echo "Error: [$errno] $errstr
"; error_log("Error: [$errno] $errstr",1, "doug@barryandassociates.com","From: webmaster@computerized-ancestor.com"); } //set error handler set_error_handler("customError",E_USER_WARNING); // Get a key position in array function array_key_position(&$array,$key) { $x=0; foreach($array as $i=>$v) { if($key==$v) return $x; $x++; } return -1; } // Return key by position function array_key_by_position(&$array,$pos) { $x=0; foreach($array as $i=>$v) { if($pos==$x++) return $v; } return -1; } function CanadianProvince($location_code){ $location_code = strtoupper(trim($location_code)); $locationCodes = array("AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"); $return_result = false; $array_position = array_key_position($locationCodes, $location_code); if ($array_position >= 0) $return_result = true; return $return_result; } function getLocationName($location_code){ $location_code = strtoupper(trim($location_code)); $locationCodes = array("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"); $locationNames = array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming", "Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland", "Northwest Territories", "Nova Scotia", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon"); $location_name = ""; $array_position = array_key_position($locationCodes, $location_code); if ($array_position >= 0) $location_name = array_key_by_position($locationNames, $array_position); return $location_name; } function getLocationCode($location_name){ $location_name = strtolower(trim($location_name)); $locationCodes = array("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AB", "BC", "MB", "NB", "NL", "NT", "NS", "NU", "ON", "PE", "QC", "SK", "YT"); $locationNames = array("alabama", "alaska", "arizona", "arkansas", "california", "colorado", "connecticut", "delaware", "district of columbia", "florida", "georgia", "hawaii", "idaho", "illinois", "indiana", "iowa", "kansas", "kentucky", "louisiana", "maine", "maryland", "massachusetts", "michigan", "minnesota", "mississippi", "missouri", "montana", "nebraska", "nevada", "new hampshire", "new jersey", "new mexico", "new york", "north carolina", "north dakota", "ohio", "oklahoma", "oregon", "pennsylvania", "rhode island", "south carolina", "south dakota", "tennessee", "texas", "utah", "vermont", "virginia", "washington", "west virginia", "wisconsin", "wyoming", "alberta", "british columbia", "manitoba", "new brunswick", "newfoundland", "northwest territories", "nova scotia", "nunavut", "ontario", "prince edward island", "quebec", "saskatchewan", "yukon"); $location_code = ""; $array_position = array_key_position($locationNames, $location_name); if ($array_position >= 0) $location_code= array_key_by_position($locationCodes, $array_position); return $location_code; } $shade = true; //for shading every other row of the search results ?>

The Computerized Ancestor

Free Search for Ancestors'; echo '

You can search this genealogy database in two ways:

'; echo '
    '; echo '
  1. Search for a specific ancestor. Use the first Ancestor Search form and provide as much as you know about that ancestor.
  2. '; echo '
  3. Search for all people with a specific surname. A second Surname Search form is provided for this type of genealogy search.
  4. '; echo '
'; } else { $con = mysqli_connect("localhost","uetsthoc_cdi","Eden0609","uetsthoc_ancestor"); // Check connection if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Set up the different type of queries $query_modifed = false; //Whether or not the query needed to simplified in order to get some results if (!empty($lastname)){ $query_built = false; while (!$query_built) { // Reduce the query in an attempt to get results $query_string = "SELECT * FROM records WHERE "; if ($gender == "f"){ $query_string .= "((wife_last_name_metaphone = '" . metaphone($lastname) ."' "; if (!empty($firstname)) $query_string .= "AND MATCH(wife_full_name) AGAINST ('". addslashes($firstname) ."') "; if (!empty($spfirstname) || !empty($splastname)){ $spfullname = trim($spfirstname . " " . $splastname); $query_string .= "AND MATCH(husband_full_name) AGAINST ('". addslashes($spfullname) ."')"; } $query_string .= ") "; if (!empty($spfirstname) && !empty($splastname)){ $fullname = trim($firstname . " " . $lastname); $query_string .= "OR (husband_last_name_metaphone = '" . metaphone($splastname) ."' AND MATCH(husband_full_name) AGAINST ('". addslashes($spfirstname) ."') AND MATCH(wife_full_name) AGAINST ('". addslashes($fullname) ."')) "; } $query_string .= ")"; if (!empty($birthloc)){ if (!empty($birthyear) && $birthyear < 1864 && ($birthloc == "VA" || $birthloc == "WV")) $query_string .= " AND (wife_birth_location = 'VA' OR wife_birth_location = 'WV') "; else $query_string .= " AND wife_birth_location = '". $birthloc ."'"; } if (!empty($spbirthloc)){ if (!empty($spbirthyear) && $spbirthyear < 1864 && ($spbirthloc == "VA" || $spbirthloc == "WV")) $query_string .= " AND (husband_birth_location = 'VA' OR husband_birth_location = 'WV') "; else $query_string .= " AND husband_birth_location = '". $spbirthloc ."'"; } if (!empty($birthyear)){ $startbirthyear = $birthyear - 10; $endbirthyear = $birthyear + 10; $query_string .= " AND wife_birth >= ". $startbirthyear ." AND wife_birth <= ". $endbirthyear; } if (!empty($spbirthyear)){ $spstartbirthyear = $spbirthyear - 10; $spendbirthyear = $spbirthyear + 10; $query_string .= " AND husband_birth >= ". $spstartbirthyear ." AND husband_birth <= ". $spendbirthyear; } } else { $query_string .= "((husband_last_name_metaphone = '" . metaphone($lastname) ."' "; if (!empty($firstname)) $query_string .= "AND MATCH(husband_full_name) AGAINST ('". addslashes($firstname) ."') "; if (!empty($spfirstname) || !empty($splastname)){ $spfullname = trim($spfirstname . " " . $splastname); $query_string .= "AND MATCH(wife_full_name) AGAINST ('". addslashes($spfullname) ."')"; } $query_string .= ") "; if (!empty($spfirstname) && !empty($splastname)){ $fullname = trim($firstname . " " . $lastname); $query_string .= "OR (wife_last_name_metaphone = '" . metaphone($splastname) ."' AND MATCH(wife_full_name) AGAINST ('". addslashes($spfirstname) ."') AND MATCH(husband_full_name) AGAINST ('". addslashes($fullname) ."')) "; } $query_string .= ")"; if (!empty($birthloc)){ if (!empty($birthyear) && $birthyear < 1864 && ($birthloc == "VA" || $birthloc == "WV")) $query_string .= " AND (husband_birth_location = 'VA' OR husband_birth_location = 'WV') "; else $query_string .= " AND husband_birth_location = '". $birthloc ."'"; } if (!empty($spbirthloc)){ if (!empty($spbirthyear) && $spbirthyear < 1864 && ($spbirthloc == "VA" || $spbirthloc == "WV")) $query_string .= " AND (wife_birth_location = 'VA' OR wife_birth_location = 'WV') "; else $query_string .= " AND wife_birth_location = '". $spbirthloc ."'"; } if (!empty($birthyear)){ $startbirthyear = $birthyear - 10; $endbirthyear = $birthyear + 10; $query_string .= " AND husband_birth >= ". $startbirthyear ." AND husband_birth <= ". $endbirthyear; } if (!empty($spbirthyear)){ $spstartbirthyear = $spbirthyear - 10; $spendbirthyear = $spbirthyear + 10; $query_string .= " AND wife_birth >= ". $spstartbirthyear ." AND wife_birth <= ". $spendbirthyear; } } $result = mysqli_query($con,$query_string); $num_rows = mysqli_num_rows($result); if ($num_rows > 0) { $query_built = true; } else { // Query may be too restrictive. Iteratively, remove some parameters. if (!empty($birthyear) || !empty($spbirthyear)){ $birthyear = ""; $spbirthyear = ""; $query_modified = true; } else if (!empty($birthloc) || !empty($spbirthloc)){ $birthloc = ""; $spbirthloc = ""; $query_modified = true; } else if (!empty($splastname)){ $splastname = ""; $query_modified = true; } else if (!empty($spfirstname)){ $spfirstname = ""; $query_modified = true; } else if (!empty($firstname)){ $firstname = ""; $query_modified = true; } else { $query_built = true; // Give up } } } } else if (!empty($surname)){ $query_built = false; while (!$query_built) { // Reduce the query in an attempt to get results if ($criteria == "similar"){ $query_string = "SELECT * FROM records WHERE husband_last_name_metaphone = '" . metaphone($surname) . "' OR wife_last_name_metaphone = '" . metaphone($surname) . "'"; $query_built = true; // This all that can be done to find more records } else { $query_string = "SELECT * FROM records WHERE husband_last_name = '" . $surname . "' OR wife_last_name = '" . $surname . "'"; } $result = mysqli_query($con,$query_string); $num_rows = mysqli_num_rows($result); if ($num_rows > 0) { $query_built = true; } else { $criteria = "similar"; $query_modified = true; } } } else if (!empty($author)){ $query_string = "SELECT * FROM records WHERE author_id = '" . $author . "'"; $result = mysqli_query($con,$query_string); $num_rows = mysqli_num_rows($result); } if ($num_rows == 0){ if (!empty($lastname)){ echo '

No Search Results for ' . $name .'

'; echo '

No results could be found for the Ancestor Search criteria shown at the left. '; } else if (!empty($surname)){ echo '

No Search Results for the ' . $surname . ' Surname

'; echo '

No results could be found for the Surname Search criteria shown at the left. '; } else if (!empty($author)){ echo '

No Search Results for Researcher: ' . $author . '

'; echo '

No results could be found for the researcher requested. '; } else { echo '

No Search Results

'; echo '

No results could be found for the type of search you requested. '; } if (!empty($lastname) && $query_modified) echo 'An attempt was made to simplify the search by modifying some of the search criteria. Nevertheless, no records were found to match the simplified search. Sorry.'; if (!empty($surname) && $query_modified) echo 'Searching on an exact name returned no matches. The search was expanded to include similar names. Unfortunately, no records were found that had similar names. Sorry.'; echo '

'; echo '

If you are interested in advice on other options for researching your genealogy, try Genealogy Search Advice.

'; } else { //This is the number of results displayed per page $page_entries = 10; //The page number of our last page $last_page = ceil($num_rows/$page_entries); if ($pagenum < 1) $pagenum = 1; else if ($pagenum > $last_page) $pagenum = $last_page; //This sets the range to display in our query $range = ' limit ' .($pagenum - 1) * $page_entries .',' .$page_entries; $result = mysqli_query($con,$query_string . $range); if (!empty($lastname)) echo '

' . $name . ' Name Search Results

'; else if (!empty($surname)) echo '

' . $surname . ' Surname Search Results

'; else if (!empty($author)) echo '

Records from Researcher: ' . $author . '

'; else echo '

Search Results

'; if (!empty($lastname) && $query_modified) echo '

Note: The results below are the result of modifying some of the search criteria in order to increase the number of records found.

'; if (!empty($surname) && $query_modified) echo '

Note: The results below are the result of changing the surname search criteria from "exact" to "similar" in order to increase the number of records found.

'; echo '

Page: '. $pagenum .' of '. $last_page .'
Total records found: '. number_format($num_rows) .'

'; echo ''; echo ''; while($row = mysqli_fetch_array($result)){ if ((!empty($lastname) && $gender == "f") || (!empty($surname) && $criteria == "similar" && strcasecmp(metaphone($surname), $row['wife_last_name_metaphone']) == 0) || (!empty($surname) && $criteria == "exact" && strcasecmp($surname, $row['wife_last_name']) == 0)){ $fullName = trim($row['wife_full_name'], ", "); $birth = trim($row['wife_birth']); if (!empty($row['wife_birth_location'])){ $wife_birth_location_name = getLocationName($row['wife_birth_location']); if (!empty($birth)){ if (strcasecmp($birth, "OF") == 0) $birth = "of " . $wife_birth_location_name; else $birth .= ", " . $wife_birth_location_name; } else { $birth = $wife_birth_location_name; } } $spouseName = trim($row['husband_full_name'], ", "); $spouseBirth = trim($row['husband_birth']); if (!empty($row['husband_birth_location'])){ $husband_birth_location_name = getLocationName($row['husband_birth_location']); if (!empty($spouseBirth)){ if (strcasecmp($spouseBirth, "OF") == 0) $spouseBirth = "of " . $husband_birth_location_name; else $spouseBirth .= ", " . $husband_birth_location_name; } else { $spouseBirth = $husband_birth_location_name; } } } else { $fullName = trim($row['husband_full_name'], ", "); $birth = trim($row['husband_birth']); if (!empty($row['husband_birth_location'])){ $husband_birth_location_name = getLocationName($row['husband_birth_location']); if (empty($husband_birth_location_name)) $husband_birth_location_name = $row['husband_birth_location'] . ' (?)'; if (!empty($birth)){ if (strcasecmp($birth, "OF") == 0) $birth = "Other Event in " . $husband_birth_location_name; else $birth .= ", " . $husband_birth_location_name; } else { $birth = $husband_birth_location_name; } } $spouseName = trim($row['wife_full_name'], ", "); $spouseBirth = trim($row['wife_birth']); if (!empty($row['wife_birth_location'])){ $wife_birth_location_name = getLocationName($row['wife_birth_location']); if (empty($wife_birth_location_name)) $wife_birth_location_name = $row['wife_birth_location'] . ' (?)'; if (!empty($spouseBirth)){ if (strcasecmp($spouseBirth, "OF") == 0) $spouseBirth = "Other Event in " . $wife_birth_location_name; else $spouseBirth .= ", " . $wife_birth_location_name; } else { $spouseBirth = $wife_birth_location_name; } } } $marriage = trim($row['marriage']); if (!empty($row['marriage_location'])){ $marriage_location_name = getLocationName($row['marriage_location']); if (empty($marriage_location_name)) $marriage_location_name = $row['marriage_location'] . ' (?)'; if (!empty($marriage)){ if (strcasecmp($marriage, "OF") == 0) $marriage = "Other Event in " . $marriage_location_name; else $marriage .= ", " . $marriage_location_name; } else { $marriage = $marriage_location_name; } } $authorID = $row['author_id']; if ($shade){ echo ''; $shade = false; } else { echo ''; $shade = true; } echo ''; echo ''; echo ''; } echo '
Ancestor and Spouse Additional Information
'; echo 'Name: ' . $fullName . '
'; echo 'Birth: ' . $birth . '
'; echo 'Spouse: ' . $spouseName . '
'; echo 'Birth: ' . $spouseBirth . '
'; echo 'Marriage: ' . $marriage; echo '
'; if (!empty($authorID) && (!empty($lastname) || !empty($surname))) echo 'Researcher: '. $authorID .'. See all records from this researcher

'; else if (strcasecmp(trim($row['type']), "F!") == 0) echo 'Obtain the source data for this record

'; // Set up Ancestry.com census search $pattern = '/(.*?,\s)*(.+?)( .*)*/i'; $replacement = '$2'; $husband_first_name = ucfirst(strtolower(preg_replace($pattern, $replacement, $row['husband_full_name']))); $husband_last_name = ucfirst(strtolower($row['husband_last_name'])); $husband_birth_year = $row['husband_birth']; $husband_birth_location = getLocationName($row['husband_birth_location']); $wife_first_name = ucfirst(strtolower(preg_replace($pattern, $replacement, $row['wife_full_name']))); $wife_birth_year = $row['wife_birth']; $wife_birth_location = getLocationName($row['wife_birth_location']); $marriage_year = $row['marriage']; $marriage_location = getLocationName($row['marriage_location']); if (!empty($husband_last_name) && !empty($husband_first_name) && ($husband_birth_year > 1740 || $wife_birth_year > 1740 || $marriage_year > 1789) && !empty($wife_first_name)){ $ancestry_url = 'name='. $husband_first_name .'_'. $husband_last_name .'&gender=m&spouse='. $wife_first_name; $ancestry_url .= '&birth='.$husband_birth_year; if (!empty($husband_birth_location)) $ancestry_url .= '_'.$husband_birth_location; echo ''; } echo '
'; if ($num_rows > $page_entries){ echo '

Page ['; // Set up link $page_link = ""; if (!empty($firstname)) $page_link .= "&firstname=".$firstname; if (!empty($lastname)) $page_link .= "&lastname=".$lastname; if (!empty($gender)) $page_link .= "&gender=".$gender; if (!empty($birthyear)) $page_link .= "&birthyear=".$birthyear; if (!empty($birthloc)) $page_link .= "&birthloc=".$birthloc; if (!empty($spfirstname)) $page_link .= "&spfirstname=".$spfirstname; if (!empty($splastname)) $page_link .= "&splastname=".$splastname; if (!empty($spbirthyear)) $page_link .= "&spbirthyear=".$spbirthyear; if (!empty($spbirthloc)) $page_link .= "&spbirthloc=".$spbirthloc; if (!empty($surname)) $page_link .= "&surname=".$surname; if (!empty($criteria)) $page_link .= "&criteria=".$criteria; $page_link = trim($page_link, "&"); if (!empty($author)) $page_link .= "author=".$author; for($i = 1; $i <= $last_page; $i++) { if ($i == $pagenum) { //This is the current page. Don't make it a link. echo ''.$i .' '; } else { // This is not the current page. Make it a link. if (($i < 4) || ($i > $pagenum - 3 && $i < $pagenum + 3) || ($i > $last_page - 3)) echo ' '.$i.' '; else if(($i > $pagenum - 6 && $i < $pagenum + 6)) echo ' .'; } } echo ']'; if ($pagenum > 1){ $previouspage = $pagenum - 1; echo ' Previous '; } if ($pagenum < $last_page){ $nextpage = $pagenum + 1; if (isset($previouspage)) echo ' | '; echo ' Next '; } echo '

'; } } mysqli_close($con); } if (!empty($lastname) || !empty($surname)){ $con = mysqli_connect("localhost","uetsthoc_cdi","Eden0609","uetsthoc_ancestor"); // Check connection if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } if (!empty($lastname)) $query_string = "SELECT * FROM yates WHERE metaphone = '" . metaphone($lastname) . "'"; else $query_string = "SELECT * FROM yates WHERE metaphone = '" . metaphone($surname) . "'"; $result = mysqli_query($con,$query_string); $num_rows = mysqli_num_rows($result); if ($num_rows > 0){ echo '

Related Surname Records

'; if ($num_rows == 1) echo '

Yates Publishing has records on the following surname:

'; else echo '

Yates Publishing has records on the following related surnames:

'; echo '
    '; while($row = mysqli_fetch_array($result)){ echo '
  • '. $row['surname'] .'
  • '; } echo '
'; echo '

Go to the Yates Catalogue for more information.

'; } mysqli_close($con); } if (!empty($author)){ $con = mysqli_connect("localhost","uetsthoc_cdi","Eden0609","uetsthoc_ancestor"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $query_string = "SELECT * FROM authors WHERE id = '" . $author . "'"; $result = mysqli_query($con,$query_string); $num_rows = mysqli_num_rows($result); if ($num_rows > 0){ $row = mysqli_fetch_array($result); if (!empty($row['last_name'])){ echo '

Researcher Information

'; echo '

The researcher who provided this family information is:

'; echo '

'; echo $row['first_name'] .' '. $row['middle_name'] . ' ' . $row['last_name'] .'
'; echo $row['city']; if (!empty($row['state'])){ if (!empty($row['city'])) echo ', '. $row['state']; else echo $row['state']; } echo '

'; if (!empty($row['file'])) echo '

The identifying file is: '. $row['file'] .'.

'; echo '
'; echo '

Contact Yates Publishing for more information on this researcher.

'; } } mysqli_close($con); } ?>

Ancestor Search

Enter as much as you can about your ancestor to search the database. Best matches will be displayed.

Spouse

Surname Search

Find all men and women in the database with the same or similar last name.

Search Billions of
Historical Records