From 41556be35cba41643d18f27c4c9ba264dde6a186 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 12 Apr 2022 11:47:01 +0200 Subject: Commit --- tree/index.php | 96 ++++++++--------- tree/mktree.php | 330 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 213 insertions(+), 213 deletions(-) (limited to 'tree') diff --git a/tree/index.php b/tree/index.php index 837c6f1..76e1ca1 100644 --- a/tree/index.php +++ b/tree/index.php @@ -1,49 +1,49 @@ -" . $place["city"] . "
"); - } - - if (isset($place["dept"])) { - $info = true; - echo("" . $place["dept"] . "
"); - } - - if (isset($place["country"])) { - $info = true; - echo($place["country"] . "
"); - } - - if (!$info) { - echo("Non renseigné"); - } -} - -if (isset($_GET['_']) && trim($_GET['_']) !== "" && isset($data[$_GET['_']])) { - $id = $_GET['_']; - $person = $data[$_GET['_']]; -} else { - header("Location: /"); - die(); -} - -$_TITLE = "Arbre généalogique | " . $person["famname"] . " " . $person["surname"] . " (#" . $id . ")"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> -
-

- #" . $id . "" ?> - Voir les détails -

-
-
- - -
-
+" . $place["city"] . "
"); + } + + if (isset($place["dept"])) { + $info = true; + echo("" . $place["dept"] . "
"); + } + + if (isset($place["country"])) { + $info = true; + echo($place["country"] . "
"); + } + + if (!$info) { + echo("Non renseigné"); + } +} + +if (isset($_GET['_']) && trim($_GET['_']) !== "" && isset($data[$_GET['_']])) { + $id = $_GET['_']; + $person = $data[$_GET['_']]; +} else { + header("Location: /"); + die(); +} + +$_TITLE = "Arbre généalogique | " . $person["famname"] . " " . $person["surname"] . " (#" . $id . ")"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?> +
+

+ #" . $id . "" ?> + Voir les détails +

+
+
+ + +
+
\ No newline at end of file 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