From 879a6237b186768356f99caf992f0d25d5ec8612 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 5 Dec 2021 16:38:49 +0100 Subject: Commit --- app/genealogy/search/dept/data.json/index.php | 39 ++++++++++++++ app/genealogy/search/dept/index.php | 73 +++++++++++++++++++++++++++ app/genealogy/search/dept/results/index.php | 38 ++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 app/genealogy/search/dept/data.json/index.php create mode 100644 app/genealogy/search/dept/index.php create mode 100644 app/genealogy/search/dept/results/index.php (limited to 'app/genealogy/search/dept') diff --git a/app/genealogy/search/dept/data.json/index.php b/app/genealogy/search/dept/data.json/index.php new file mode 100644 index 0000000..fb27645 --- /dev/null +++ b/app/genealogy/search/dept/data.json/index.php @@ -0,0 +1,39 @@ + $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["dept"])) { + if (isset($counts[$person["birth"]["place"]["dept"]])) { + $counts[$person["birth"]["place"]["dept"]]++; + } else { + $counts[$person["birth"]["place"]["dept"]] = 1; + } + if (!in_array($person["birth"]["place"]["dept"], $names)) { + $names[] = $person["birth"]["place"]["dept"]; + } + } +} + +foreach ($names as $name) { + $arr[] = [ + 'name' => $name, + 'occurrences' => $counts[$name] . " personne" . ($counts[$name] > 1 ? "s" : "") + ]; +} + +echo(json_encode($arr)); \ No newline at end of file diff --git a/app/genealogy/search/dept/index.php b/app/genealogy/search/dept/index.php new file mode 100644 index 0000000..b789f8b --- /dev/null +++ b/app/genealogy/search/dept/index.php @@ -0,0 +1,73 @@ + +
+

Rechercher par département de naissance

+

Patientez...

+ + + + +
+
+
+ \ No newline at end of file diff --git a/app/genealogy/search/dept/results/index.php b/app/genealogy/search/dept/results/index.php new file mode 100644 index 0000000..3e09605 --- /dev/null +++ b/app/genealogy/search/dept/results/index.php @@ -0,0 +1,38 @@ + $person) { + if (isset($person["birth"]["place"]) && isset($person["birth"]["place"]["dept"])) { + if ($person["birth"]["place"]["dept"] === $q) { + $results[] = $id; + } + } +} +if (count($results) === 0): ?> + + +
+ + # + +
+ \ No newline at end of file -- cgit