", $alpha =safe_GET('alpha', WT_REGEX_UNSAFE); // All surnames beginning with this letter where "@"=unknown and ","=none $surname =safe_GET('surname', WT_REGEX_UNSAFE); // All indis with this surname. NB - allow ' and " $show_all=safe_GET('show_all', array('no','yes'), 'no'); // All indis // Don't show the list until we have some filter criteria if (isset($alpha) || isset($surname) || $show_all=='yes') { $showList = true; } else { $showList = false; } // Long lists can be broken down by given name $falpha=safe_GET('falpha'); // All first names beginning with this letter $show_all_firstnames=safe_GET('show_all_firstnames', array('no','yes'), 'no'); // We can show either a list of surnames or a list of names $surname_sublist=safe_GET('surname_sublist', array('no','yes')); if (!$surname_sublist) { $surname_sublist=safe_COOKIE('surname_sublist', array('no','yes'), 'yes'); } setcookie('surname_sublist', $surname_sublist); // We can either include or exclude married names. // We use $SHOW_MARRIED_NAMES as the default value. $show_marnm=safe_GET('show_marnm', array('no','yes')); if (!$show_marnm) { $show_marnm=safe_COOKIE('show_marnm_indilist', array('no','yes')); } if (!$show_marnm) { $show_marnm=$SHOW_MARRIED_NAMES ? 'yes' : 'no'; } setcookie('show_marnm_indilist', $show_marnm); // Override $SHOW_MARRIED_NAMES for this page $SHOW_MARRIED_NAMES=($show_marnm=='yes'); // Fetch a list of the initial letters of all surnames in the database $initials=WT_Query_Name::surnameAlpha($SHOW_MARRIED_NAMES, false, WT_GED_ID); // Make sure selections are consistent. // i.e. can't specify show_all and surname at the same time. if ($show_all=='yes') { $alpha=''; $surname=''; $legend=WT_I18N::translate('All'); $url='indilist.php?show_all=yes'; } elseif ($surname) { $alpha=WT_Query_Name::initialLetter($surname); $show_all='no'; if ($surname=='@N.N.') { $legend=$UNKNOWN_NN; } else { $legend=htmlspecialchars($surname); } switch($falpha) { case '': break; case '@': $legend.=', '.$UNKNOWN_PN; break; default: $legend.=', '.htmlspecialchars($falpha); break; } $surname_sublist='no'; $url='indilist.php?surname='.rawurlencode($surname); } else { $show_all='no'; $surname=''; if ($alpha=='@') { $legend=$UNKNOWN_NN; $surname_sublist='no'; $surname='@N.N.'; } elseif ($alpha==',') { $legend=WT_I18N::translate('None'); $surname_sublist='no'; } else { $legend=htmlspecialchars($alpha); } $url='indilist.php?alpha='.rawurlencode($alpha); } $controller->setPageTitle(WT_I18N::translate('Individuals').' : '.$legend); $controller->pageHeader(); echo '
';
echo WT_I18N::translate('Choose a letter to show individuals whose family name starts with that letter.');
echo help_link('alpha');
echo '
', join(' | ', $list), '
'; if ($alpha!='@' && $alpha!=',' && !$surname) { if ($surname_sublist=='yes') { echo '', WT_I18N::translate('Skip surname lists'), ''; echo help_link('skip_sublist'); } else { echo '', WT_I18N::translate('Show surname lists'), ''; echo help_link('skip_sublist'); } echo ' '; } if ($showList) { if ($SHOW_MARRIED_NAMES) { echo '', WT_I18N::translate('Exclude married names'), ''; } else { echo '', WT_I18N::translate('Include married names'), ''; } echo help_link('show_marnm'); } echo '
'; } echo '';
echo WT_I18N::translate('Choose a letter to show individuals who have a given name which starts with that letter.');
echo help_link('alpha');
echo '
', join(' | ', $list), '