East Bridgford World War 1 servicemen in regiments
Welcome to East Bridgford History Society
[insert_php]
/* Author: Gerry Haran
* Original Program name: ListRegimentEBNames1.php
* Bastardised version for WordPress: east-bridgford-world-war-1-servicemen-in-regiments
* Sub menu in WordPress : East Bridgford World War 1 servicemen in Regiments
* Menu structure in WordPress : World War 1 \ Regiments \ no menu displayed for this page
* Description: Program displays a list of all the servicemen enrolled in the regiment chosen by the user in the previous screen
* User clicks on the name of a serviceman to display the service biography of that serviceman
*
* Linked pages: Each name links to page Service Biography which shows service biography for serviceman selected by user
*
* Functions called: getRegEbNames($chosenID); getTransferEbNames($chosenID), getARegName($chosenID);
*
* Backed up as EastBridgfordWorldWar1_servicemen_in_regiments.wp 21 April 2016
*
* Date of original program : 25 September 2014
* Date of WordPress program : 19 March 2016
*
*
* Revision 1.1
* On 20 October 2017, it was noticed that Regiment Name passed by the calling program Regiments.wp (armyandnavy) failed when the regiment name contains
* an apostrophe, eg King’s Own Rifles is truncated as King; this did not appear as a problem before but it is now. So the regiment name is
* no longer passed to this page by armyandnavy; instead the regiment id (which has always been passed as a parameter) is used in this page
* to call the function getARegName($chosenID) which returns the Regiment Name for the given reg id
* Page backed up on 30 October 2017 as EastBridgfordWorldWar1_servicemen_in_regiments_30Oct2017.wp.
* Backed up again for the sake of completeness as EastBridgfordWorldWar1_servicemen_in_regiments_12Dec2017.wp on 12 December 2017
*/
$chosenID= $_GET[‘ebRegID’];
/*echo “the chosrnID is $chosenID \n”;
$RegimentName= $_GET[‘ebRegName’];
echo “Have fetched ID from POST as $chosenID.\n”;
echo “Have fetched name from POST as $RegimentName.\n”;
Now have the regiment ID so can retrieve names of eb servicemen in that regiment
*/
$OneRegName = getARegName($chosenID);
$RegimentName=$OneRegName[‘RegName’];
$RegEbInfo = getRegEbNames($chosenID);
$TransferInfo = getTransferEbNames($chosenID);
echo “
$RegimentName
\n”;
echo “
“;
echo “The following is a list of the East Bridgford men enlisted in $RegimentName in World War 1.”;
echo “
“;
echo “
“;
echo “Click on a name to obtain biography.”;
echo “
“;
if (!empty($RegEbInfo))
{
for ($i=1;$i<=sizeof($RegEbInfo);$i++)
{
$forename=$RegEbInfo[$i]['forename'];
$middlename=$RegEbInfo[$i]['middle'];
$surname=$RegEbInfo[$i]['surname'];
$fullname=$forename." ".$middlename." ".$surname;
$ebindex=$RegEbInfo[$i]['ebID'];
echo "