// CHECK FOR LOGIN STATUS
if ($ph<1) {
?>
} // end if $ph < 1
// META REFRESH HEADERS - ONLY NEEDED AT BEGINNING PHASE WHEN BUILDING Fractal TreeS FOR INITIAL ENTRY
if ($ph<3 && $ph>0 ) {
echo '';
} elseif ($ph==3 && $init == 'Y' && $_SESSION['NumGens'] < $_SESSION['MaxNumGens']) {
echo '';
}
?>
if ($ph > 0) {
echo '
";
// ========================================================================================================================================================================
// CUSTOMIZE the PHASE # note at the TOP OF THE PAGE - OR - the BR's that line up the spacing (THIS SHOULD NOT BE NEEDED ... CHECK AND FIX THIS FOR LATER!!!!)
// ========================================================================================================================================================================
// if ($ph > 0 && $ph < 3) {
// // echo "
Phase # " . $_SESSION['ph'] . " of 3";
// } else {
// // echo " ";
// // echo " ";
// }
// ==============================================================================================================================
// MENU BAR - FAN OPTIONS on LEFT (various angle options) | SUMMARY of PERSON ID & NUM of GENS in MIDDLE | RESET btn on RIGHT
// ==============================================================================================================================
if ($ph >= 1 ) {
echo "
";
// if ($ph >=3 ){
// // don't show during calculation phases of 1 and 2 as they whip by
// echo "
//
";
echo "
";
}
// echo "
";
echo "";
// =======================
// MEAT & POTATOES - here's where the PHASES display different things
// =======================
// ====================================================
// PHASE 1 and PHASE 2 - Pure calculations - no display
// ====================================================
// =========================================
// PHASE 3 - DISPLAY the Fractal Tree
// =========================================
if ($ph == 3) {
// CLEAR OUT all previous coordinate placements
$NumGens4ThisGraph = $_SESSION['NumGens'] - 1;
foreach ($_SESSION['IndexFullerList'] as $key => $value) {
$_SESSION['IndexFullerList'][$key][$COORDS] = [0,0,0,0,0, array() , 0, 0];
$_SESSION['IndexFullerList'][ $key ][$PATHS] = array();
}
$ListOfPeeps = "";
$ThePrimary = 'Primary1';
// CALCULATE FULL WIDTHs and HEIGHTs - especially MAX WIDTH and CENTERING BUFFER
$EachNameWidth = 100;
$EachNameHeight = 70;
$CellWidth = $EachNameWidth;
$CellHeight = $EachNameHeight;
$maxWidth = $GraphMargin + ($EachNameWidth + $InnerSpacing) * (2**(floor(($_SESSION['NumGens']+2)/2)) );
if ($maxWidth < $window_width) {
$centeringBuffer = ($window_width - $maxWidth)/2;
} else {
$centeringBuffer = 0;
}
$InitialX = $centeringBuffer + $maxWidth/2;
// $InitialY = 3 * $maxWidth / 8 + 0*500;
$InitialY = $GraphMargin + (2 ** ceil($_SESSION['NumGens']/2) - 1) * ($EachNameWidth + $InnerSpacing)/2;
$InitialRadius = $maxWidth / 4;
$CurrGenNum = 1;
// if ($alt == "Y"){
// $AccumulatedHeight = $InitialRadius ;
// for ($i=5; $i <= $_SESSION['NumGens']; $i+=2) {
// // $AccumulatedHeight += $EachNameHeight;// / (2** ( ($i - 3)/2 ));
// $AccumulatedHeight += $InitialRadius / (2** ( ($i - 3)/2 ));
// }
// if ($_SESSION['NumGens'] % 2 == 1) {
// $AccumulatedHeight += $EachNameHeight/2;
// } else {
// $AccumulatedHeight += $EachNameWidth/2;
// }
// } else {
// $AccumulatedHeight = $InitialRadius + $EachNameHeight/2;
// for ($i=5; $i <= $_SESSION['NumGens']; $i+=2) {
// // $AccumulatedHeight += $EachNameHeight;// / (2** ( ($i - 3)/2 ));
// $AccumulatedHeight += $InitialRadius / (2** ( ($i - 3)/2 ));
// }
// // }
// echo " InitialY = $InitialY AccumulatedHeight = $AccumulatedHeight InitialRadius = $InitialRadius";
// $InitialY = max(0*$InitialY, $AccumulatedHeight);
// $CurrGenNum = 1;
buildPathFor($_SESSION[$ThePrimary ][$ID], "", 1);
assignColoursForRepeats($_SESSION[$ThePrimary ][$ID], 1);
$XFullAhfenIndexArray = [1];
populateXtable(3, "F", 2) ;
if ($_SESSION[$ThePrimary ][$GENDER] == "Female") {
populateXtable(2, "M", 2) ;
}
// var_dump($XFullAhfenIndexArray);
// drawFractal();
// CALCULATE PIX DOWN - starting position
$PixDown = $PixDownStartingPoint;
// CREATE the DIV to HOLD the GRAPH (FRACTAL TREE)
// CALCULATE all the DIV info needed for the ancestors, and store in LinesHTML and NamesHTML
graphPerson($_SESSION[$ThePrimary][$FATHER], $InitialX, $InitialY, "H", "Male", $InitialRadius, $CurrGenNum , "" , 2);
graphPerson($_SESSION[$ThePrimary][$MOTHER], $InitialX, $InitialY, "H", "Female", $InitialRadius, $CurrGenNum , "" , 3 );
// Now, print those out
echo "";
// echo "
";
// echo $LinesHTML;
// echo $NamesHTML;
// END it off with the INFO for the PRIMARY PERSON in the MIDDLE
$detailsArray = getDetailsForGraphing ( $_SESSION[ $ThePrimary ][$ID] );
$heightAdjustment = ($detailsArray[0]-1)*16;
// echo "