Civilian Biography

[insert_php]

/* Author: Gerry Haran
* Original Program name: getCivilBiography1.php
* Bastardised version for WordPress: civilian-biography
* Sub menu in WordPress : Civilian Biography
* Menu structure in WordPress : World War 1 \ Families \ Family Trees \ no menu displayed for this page
* Description: Program displays the civilian biography for the serviceman name in the family tree clicked by the user
* Linked pages: Each name links to page Service Biography which shows service biography for serviceman selected by user
*
* Functions called: getName($chosenID); getebWife($chosenID); getebWifeAddress($wifeIdNo); getCivilBiog($chosenID); get1901Basics($chosenID); get1911Basics($chosenID); getPostWar($chosenID);
* getOccasiondate($chosenID, dbTABLE_Field, ‘names’, ‘ebID’);
*
* Backed up as CivilianBiography.wp 21 April 2016
*
* Date of original program : 25 September 2014
* Date of WordPress program : 19 March 2016
* Date of WordPress program version 1.1 : 12 October 2016
*
* Revision in v1.1 : (1) latest data for servicemen from Carol Short contains 1871 and 1818 census info for 1 person
* viz George Cartwright. Not worth setting up two database tables for 1 person, so hard wire the information
* into the code with a test for $chosenID = 62
* (2) Modified date of marriage flag to show marriage independent of census data – corrects error where if no data for a particular
* census is present then the marriage data is not shown
*
* v1.1 backed up 30 November 2016 as CivilianBiography_30Nov2016.wp
*
* Rev 1.2 – last 1/3 of data researched by Lynne Black added to database; modified display of birth dates of any offspring to make appearance less clumsy
* Backed up as CivilianBiography_12Dec2017.wp on 12 December 2017
*
*/

$chosenID= $_GET[‘ebName’];
/*echo “Have fetched authorID from POST as $chosenID.
\n”;

*Now have the serviceman ID so can retrieve name and biography details*/

$servicemanInfo = getName($chosenID);

$forename=$servicemanInfo[‘forename’];
$middle=$servicemanInfo [‘middle’];
$surname=$servicemanInfo[‘surname’];
$fullname=$forename.” “.$middle.” “.$surname;
$wedFlag = 0;

$ebWifeInfo = getebWife($chosenID);
if (!empty ($ebWifeInfo))
{
$maidenName = $ebWifeInfo[‘nee’];
if (empty ($maidenName))
{
$maidenName = ‘(maiden name not known)’;
}
$wifeName = $ebWifeInfo[‘marriedN’].” “.$maidenName;

$marriedY = $ebWifeInfo[‘year(dofm)’];
$marriedM = $ebWifeInfo[‘monthname(dofm)’];
$marriedD = $ebWifeInfo[‘day(dofm)’];
$wifeIdNo = $ebWifeInfo[‘wifeID’];

$Marrieddatestr = “in “.$marriedD.” “.$marriedM.” “.$marriedY.” “;

if ((empty ($marriedD)) or ($marriedD = 0 ))
{
$Marrieddatestr = “in “.$marriedM.” “.$marriedY.” “;

if ((empty ($marriedM) ) or ($marriedM= 0))
{
$Marrieddatestr = “in “.$marriedY.” “;
}

}

$EbWifeAddr = getebWifeAddress($wifeIdNo);
if (!empty ($EbWifeAddr))
{
$HomeAddress = $EbWifeAddr[‘Waddress’];
}
else
{
$HomeAddress = “”;
}

if ($marriedY == 1700)
{
$wedFlag = 1;
$marriedText = “to “.$wifeName.” “.$HomeAddress;

}
elseif ($marriedY < 1901) { $wedFlag = 2; $marriedText = $Marrieddatestr."to ".$wifeName." ".$HomeAddress; } elseif ($marriedY < 1911) { $wedFlag = 3; $marriedText = $Marrieddatestr."to ".$wifeName." ".$HomeAddress; } elseif (($marriedY < 1918) or ($marriedY == 1918)) { $wedFlag = 4; $marriedText = $Marrieddatestr."to ".$wifeName." ".$HomeAddress; } elseif ($marriedY > 1918)
{
$wedFlag = 5;
$marriedText = $Marrieddatestr.”to “.$wifeName.” “.$HomeAddress;

}

/*
echo (“Year married is $marriedY
\n”);
echo (“Wife name is $wifeName
\n”);
echo (“Wedding date flag is $wedFlag
\n”);
echo (“Date of wedding is $Marrieddatestr
\n”);
echo (“Wife address is $HomeAddress
\n”);
*/
}

$ebCivilBiog = getCivilBiog($chosenID);

$Pob = $ebCivilBiog[‘birthplace’];
if (empty ($Pob))
{
$Pob = “Not recorded”;
}

$PoD = $ebCivilBiog[‘deathplace’];
if (empty ($PoD))
{
$PoD = “Not recorded”;
}
/*
$ebPreWarRec = getPreWar($chosenID);

$ebPreWarAddress = $ebPreWarRec[‘preWaddress’];
$ebPreWarInfo = $ebPreWarRec[‘preWinfo’];

if (empty ($ebPreWarAddress))
{
$ebPreWarAddress = “Not recorded”;
}
*/

$eb1891Rec = get1891Basics($chosenID);

$eb1891Age = $eb1891Rec[‘c9age’];
if (empty ($eb1891Age))
{
$eb1891Age = “Not recorded”;
}

$eb1891Address = $eb1891Rec[‘c9address’];
if (empty ($eb1891Address))
{
$eb1891Address = “Not recorded”;
}

$eb1891Occupation = $eb1891Rec[‘c9Occupation’];
if (empty ($eb1891Occupation))
{
$eb1891Occupation = “Not recorded”;
}

$eb1901Rec = get1901Basics($chosenID);

$eb1901Age = $eb1901Rec[‘c0Age’];
if (empty ($eb1901Age))
{
$eb1901Age = “Not recorded”;
}

$eb1901Address = $eb1901Rec[‘c0Address’];
if (empty ($eb1901Address))
{
$eb1901Address = “Not recorded”;
}

$eb1901Occupation = $eb1901Rec[‘c0Occupation’];
if (empty ($eb1901Occupation))
{
$eb1901Occupation = “Not recorded”;
}

$eb1911Rec = get1911Basics($chosenID);

$eb1911Age = $eb1911Rec[‘c0Age’];
if (empty ($eb1911Age))
{
$eb1911Age = “Not recorded”;
}

$eb1911Address = $eb1911Rec[‘c1Address’];
if (empty ($eb1911Address))
{
$eb1911Address = “Not recorded”;
}

$eb1911Occupation = $eb1911Rec[‘c1Occupation’];
if (empty ($eb1911Occupation))
{
$eb1911Occupation = “Not recorded”;
}

$ebPostWarInfo = getPostWar($chosenID);
$ebpwDate = $ebPostWarInfo[‘pwDate’];
$ebpwInfo = $ebPostWarInfo[‘pwInfo’];
/*
$ebpwDate = ‘1920s’;
$ebpwInfo= ‘trial prose’;
*/

$ebBirthDate = getOccasiondate($chosenID, ‘birth’, ‘names’, ‘ebID’);
$ebDeathDate = getOccasionDate($chosenID, ‘death’, ‘names’, ‘ebID’);

/*Look for any additional info*/

$offspringInfo = getOffspring($chosenID);

if (!empty ($offspringInfo))
{
for ($i=1;$i<=sizeof($offspringInfo);$i++) { $FirstName=$offspringInfo[$i]['cforename']; $MidName=$offspringInfo[$i]['cmiddle']; $BBorC = $offspringInfo[$i]['BBorC']; $offspringID = $offspringInfo[$i]['childID']; if ($BBorC == '3') { $bornTxt = "christened on "; } elseif ($BBorC == '2') { $bornTxt = "baptised on "; } else { $bornTxt = "Date of birth "; } $offspringBirthDate = getOccasiondate($offspringID, 'bdate', 'children', 'childID'); $offspringBirthTxt[$i] = $FirstName. " " .$MidName. " (" .$bornTxt.$offspringBirthDate.")"; } } /*Have all details so now write to screen*/ echo "

Civilian biography of $fullname.
\n”;
echo “

\n”;

echo “

“;
echo (“Click here to view service biography
\n”);

echo “

“;
/*echo “

\n”;
echo “

“;

echo “

\n”;*/

echo “
\n”;
echo “
\n”;
echo (“
\n”);

if ($chosenID == 62)
{
echo (“

1871 Census Information

\n”);
echo “
\n”;
echo “
\n”;

echo (“
\n”);

echo (“

1881 Census Information

\n”);
echo “
\n”;
echo “
\n”;
echo “
\n”;
echo (“
\n”);

}

if ($chosenID == 110)
{

echo (“

1881 Census Information

\n”);
echo “
\n”;
echo “
\n”;
echo (“
\n”);

}

if (!empty ($eb1891Rec))
{

echo (“

1891 Census Information

\n”);

echo “
\n”;
echo “
\n”;

echo “
\n”;
echo (“
\n”);
}

if (!empty ($eb1901Rec))
{

echo (“

1901 Census Information

\n”);

echo “
\n”;
echo “
\n”;

echo “
\n”;
echo (“
\n”);
}
if ($wedFlag == 3)
{
echo “
\n”;
echo (“
\n”);

}
if (!empty ($eb1911Rec))
{
echo (“

1911 Census Information

\n”);

echo “
\n”;
echo “
\n”;
echo “
\n”;
echo (“
\n”);
}

if ($wedFlag == 4)
{
echo “
\n”;
echo (“
\n”);

}
if (!empty ($ebPostWarInfo))
{

echo (“

Post War Information

\n”);
echo “
\n”;
echo “
\n”;
echo (“
\n”);
}

if ($wedFlag == 5)
{
echo “
\n”;
echo (“
\n”);

}

if ($chosenID == 148) /*id 148 is the only son with 2 wives so had wire the display of info here */
{
echo “
\n”;
echo (“
\n”);

}

elseif ($wedFlag == 1)
{
echo “
\n”;
echo (“
\n”);

}

$placeholder = ” “;
if (!empty ($offspringInfo))
{

echo (“
\n”);
if (!empty ($offspringBirthTxt[2]))
{
echo (“
\n”);
}
echo (“
\n”);

}

echo “
\n”;

echo “
\n”;

/*echo “

\n”;*/

/*Leave this code for future in case some extra info turns up */
$HaveInfo = ”;

/*Now write any additional information found
*/
if (! empty ($HaveInfo))
{
echo ““;
echo (“$HaveInfo”);
echo “
“;
}

[/insert_php]