aboutsummaryrefslogtreecommitdiff
path: root/app/genealogy/search/birth/index.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-05 16:38:49 +0100
committerMinteck <contact@minteck.org>2021-12-05 16:38:49 +0100
commit879a6237b186768356f99caf992f0d25d5ec8612 (patch)
tree733aacd4845e918b484d8f46951d925f05f91b4c /app/genealogy/search/birth/index.php
parent4bad8bcfb984cf017495b8fd31f174c32cebe805 (diff)
downloadcore-879a6237b186768356f99caf992f0d25d5ec8612.tar.gz
core-879a6237b186768356f99caf992f0d25d5ec8612.tar.bz2
core-879a6237b186768356f99caf992f0d25d5ec8612.zip
Commit
Diffstat (limited to 'app/genealogy/search/birth/index.php')
-rw-r--r--app/genealogy/search/birth/index.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/app/genealogy/search/birth/index.php b/app/genealogy/search/birth/index.php
new file mode 100644
index 0000000..6817390
--- /dev/null
+++ b/app/genealogy/search/birth/index.php
@@ -0,0 +1,73 @@
+<?php $_TITLE = "Recherche par date de naissance"; require_once $_SERVER['DOCUMENT_ROOT'] . "/private/header.php"; ?>
+<div class="container">
+ <h2>Rechercher par date de naissance</h2>
+ <p id="preview">Patientez...</p>
+ <script src="/dllib/jquery.flexdatalist.min.js"></script>
+ <div class="input-group mt-3 mb-3">
+ <div class="input-group-prepend">
+ <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
+ Par date de naissance
+ </button>
+ <div class="dropdown-menu">
+ <a class="dropdown-item" href="/search/name">Par prénom</a>
+ <a class="dropdown-item" href="/search/lastname">Par nom</a>
+ <a class="dropdown-item active" href="/search/birth">Par date de naissance</a>
+ <a class="dropdown-item" href="/search/death">Par date de décès</a>
+ <a class="dropdown-item" href="/search/marriage">Par date de mariage</a>
+ <a class="dropdown-item" href="/search/city">Par ville</a>
+ <a class="dropdown-item" href="/search/dept">Par département</a>
+ <a class="dropdown-item" href="/search/state">Par région</a>
+ </div>
+ </div>
+ <input onchange="reload();" class="form-control" type="text"
+ placeholder="Commencer à taper une année..."
+ id="search">
+ </div>
+ <script>
+ setInterval(() => {
+ if (document.getElementById("search").value.trim() !== "") {
+ document.getElementById("preview").innerText = "Affiche toutes les personnes nées en " + document.getElementById("search").value;
+ } else {
+ document.getElementById("preview").innerText = "Sélectionnez une année";
+ }
+ }, 100)
+
+ function reload() {
+ window.fetch("./results/?q=" + encodeURI(document.getElementById("search").value.trim())).then((a) => {
+ a.text().then((b) => {
+ document.getElementById("results").innerHTML = b;
+ })
+ })
+ }
+
+ window.addEventListener("load", () => {
+ i = Math.random().toString().substr(2);
+ document.getElementById('search').classList.add(i);
+ $('#search.' + i).flexdatalist({
+ cache: false,
+ minLength: 0,
+ selectionRequired: true,
+ visibleProperties: ["name","occurrences"],
+ searchIn: 'name',
+ data: "data.json"
+ });
+ })
+ </script>
+ <style>
+ .flexdatalist-results li {
+ cursor: pointer;
+ }
+ .flexdatalist-results li .item-occurrences {
+ color: rgba(0, 0, 0, .25);
+ }
+ .flexdatalist-results li:hover {
+ opacity: .75;
+ }
+ .flexdatalist-results li:active {
+ opacity: .5;
+ }
+ </style>
+ <div id="results"></div>
+</div>
+<br>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/private/footer.php"; ?> \ No newline at end of file