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/marriage/data.json/index.php | 39 ++++++++++++ app/genealogy/search/marriage/index.php | 73 +++++++++++++++++++++++ app/genealogy/search/marriage/results/index.php | 38 ++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 app/genealogy/search/marriage/data.json/index.php create mode 100644 app/genealogy/search/marriage/index.php create mode 100644 app/genealogy/search/marriage/results/index.php (limited to 'app/genealogy/search/marriage') diff --git a/app/genealogy/search/marriage/data.json/index.php b/app/genealogy/search/marriage/data.json/index.php new file mode 100644 index 0000000..5e57689 --- /dev/null +++ b/app/genealogy/search/marriage/data.json/index.php @@ -0,0 +1,39 @@ + $person) { + if (isset($person["family"]) && isset($person["family"]["marriage"]["date"]) && isset($person["family"]["marriage"]["date"]["year"])) { + if (isset($counts[(string)$person["family"]["marriage"]["date"]["year"]])) { + $counts[(string)$person["family"]["marriage"]["date"]["year"]]++; + } else { + $counts[(string)$person["family"]["marriage"]["date"]["year"]] = 1; + } + if (!in_array((string)$person["family"]["marriage"]["date"]["year"], $names)) { + $names[] = (string)$person["family"]["marriage"]["date"]["year"]; + } + } +} + +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/marriage/index.php b/app/genealogy/search/marriage/index.php new file mode 100644 index 0000000..90db3e2 --- /dev/null +++ b/app/genealogy/search/marriage/index.php @@ -0,0 +1,73 @@ + +
+

Rechercher par date de mariage

+

Patientez...

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