From 41556be35cba41643d18f27c4c9ba264dde6a186 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 12 Apr 2022 11:47:01 +0200 Subject: Commit --- tree/mktree.php | 330 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 165 insertions(+), 165 deletions(-) (limited to 'tree/mktree.php') diff --git a/tree/mktree.php b/tree/mktree.php index d296c61..095de92 100644 --- a/tree/mktree.php +++ b/tree/mktree.php @@ -1,165 +1,165 @@ - $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] !== "F") { - $found = true; - $dad = $potential["famname"] . " " . $potential["surname"]; - $dadId = $potid; - } -} - -if (!$found) { - $dad = "???"; -} - -// Mother -$found = false; -foreach ($data as $potid => $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] === "F") { - $found = true; - $mom = $potential["famname"] . " " . $potential["surname"]; - $momId = $potid; - } -} - -if (!$found) { - $mom = "???"; -} - -// Mother's data -if (isset($momId)) { - // Father - $found = false; - foreach ($data as $potid => $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] !== "F") { - $found = true; - $momDad = $potential["famname"] . " " . $potential["surname"]; - $momDadId = $potid; - } - } - - if (!$found) { - $momDad = "???"; - } - - // Mother - $found = false; - foreach ($data as $potid => $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] === "F") { - $found = true; - $momMom = $potential["famname"] . " " . $potential["surname"]; - $momMomId = $potid; - } - } - - if (!$found) { - $momMom = "???"; - } -} else { - $momMom = "???"; - $momDad = "???"; -} - -// Father's data -if (isset($dadId)) { - // Father - $found = false; - foreach ($data as $potid => $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] !== "F") { - $found = true; - $dadDad = $potential["famname"] . " " . $potential["surname"]; - $dadDadId = $potid; - } - } - - if (!$found) { - $dadDad = "???"; - } - - // Mother - $found = false; - foreach ($data as $potid => $potential) { - if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] === "F") { - $found = true; - $dadMom = $potential["famname"] . " " . $potential["surname"]; - $dadMomId = $potid; - } - } - - if (!$found) { - $dadMom = "???"; - } -} else { - $dadMom = "???"; - $dadDad = "???"; -} - -?> - - - - - Tree maker 🌳 - - - - -
- - - - + $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $dad = $potential["famname"] . " " . $potential["surname"]; + $dadId = $potid; + } +} + +if (!$found) { + $dad = "???"; +} + +// Mother +$found = false; +foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($id, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $mom = $potential["famname"] . " " . $potential["surname"]; + $momId = $potid; + } +} + +if (!$found) { + $mom = "???"; +} + +// Mother's data +if (isset($momId)) { + // Father + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $momDad = $potential["famname"] . " " . $potential["surname"]; + $momDadId = $potid; + } + } + + if (!$found) { + $momDad = "???"; + } + + // Mother + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($momId, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $momMom = $potential["famname"] . " " . $potential["surname"]; + $momMomId = $potid; + } + } + + if (!$found) { + $momMom = "???"; + } +} else { + $momMom = "???"; + $momDad = "???"; +} + +// Father's data +if (isset($dadId)) { + // Father + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] !== "F") { + $found = true; + $dadDad = $potential["famname"] . " " . $potential["surname"]; + $dadDadId = $potid; + } + } + + if (!$found) { + $dadDad = "???"; + } + + // Mother + $found = false; + foreach ($data as $potid => $potential) { + if (isset($potential["family"]) && count($potential["family"]["children"]) > 0 && in_array($dadId, $potential["family"]["children"]) && $potential["sex"] === "F") { + $found = true; + $dadMom = $potential["famname"] . " " . $potential["surname"]; + $dadMomId = $potid; + } + } + + if (!$found) { + $dadMom = "???"; + } +} else { + $dadMom = "???"; + $dadDad = "???"; +} + +?> + + + + + Tree maker 🌳 + + + + +
+ + + + -- cgit