parent
dd08482038
commit
467fc2219a
546
index.php
546
index.php
|
|
@ -1,154 +1,200 @@
|
||||||
<?php
|
<?php
|
||||||
include "zefixAPI.php";
|
include "zefixAPI.php";
|
||||||
?>
|
?>
|
||||||
|
<!doctype html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="css/custom.css?v=1.2">
|
|
||||||
|
<!-- Bootstrap first, then your overrides -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.css">
|
<link rel="stylesheet" href="css/bootstrap.css">
|
||||||
|
<link rel="stylesheet" href="css/custom.css?v=1.3">
|
||||||
|
|
||||||
<title>Silias Zefix Suche</title>
|
<title>Silias Zefix Suche</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* Nice input for the search box */
|
||||||
#sitzInput {
|
#sitzInput {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-position: 14px 12px;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
padding: 14px 20px 12px 45px;
|
border: 1px solid #dee2e6;
|
||||||
border: none;
|
border-radius: .5rem;
|
||||||
border-bottom: 1px solid #ddd;
|
padding: .6rem .8rem;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sitzInput {outline: 3px solid #ddd;}
|
|
||||||
|
|
||||||
.button-small {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
padding: 0% 1%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown a:hover {background-color: #ddd;}
|
|
||||||
|
|
||||||
.show {display: block;}
|
|
||||||
|
|
||||||
.scrollWindow {
|
.scrollWindow {
|
||||||
max-height: 300px; /* Adjust the value as needed */
|
max-height: 320px;
|
||||||
overflow-y: auto; /* This will add a scrollbar when content exceeds max-height */
|
overflow-y: auto;
|
||||||
border: 1px solid #ccc; /* Optional: Add a border for visual clarity */
|
border: 1px solid #dee2e6;
|
||||||
padding: 10px; /* Optional: Add padding for better spacing */
|
border-radius: .75rem;
|
||||||
|
background: #fff;
|
||||||
|
padding: .75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-small {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
padding: .35rem .6rem;
|
||||||
|
border-radius: .5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gemeindeeintrag { margin-bottom: .25rem; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="bg-light">
|
||||||
|
|
||||||
<div class="wrapper">
|
|
||||||
<section>
|
|
||||||
|
|
||||||
|
|
||||||
|
<nav class="navbar navbar-light bg-white border-bottom">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>Silias Zefix Suche</h1>
|
<span class="navbar-brand mb-0 h1">Silias • ZEFIX Export</span>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<main class="container py-4 py-md-5">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-lg-10 col-xl-9">
|
||||||
|
|
||||||
<p>Willkommen bei Silias Zefix Suche. Diese Applikation ermöglicht es, eine Liste von Firmen als Excel Liste (xlsx) aus dem Zentralen Firmenindex zu exportieren.</p>
|
<div class="card shadow-sm">
|
||||||
|
<div class="card-body p-4 p-md-5">
|
||||||
<form action="submit.php" method="post">
|
|
||||||
<label for="firma">Firmenname:</label>
|
|
||||||
<p>* kann als Platzhalter verwendet werden</p>
|
|
||||||
<input type="text" id="firma" name="firma"><br><br>
|
|
||||||
|
|
||||||
<label for="kanton">Kanton:</label>
|
|
||||||
<p>Bitte beachten Sie, dass die Auswahl der Kantone von der Export Funktion ignoriert wird. Sie wird nur dazu verwendet, die untenstehenden Ortschaften zu filtern. Wenn Sie Firmen nach Kantonen exportieren möchten, klicken Sie alle gewünschten Kantone an und klicken Sie anschliessend bei den Ortschaften auf "alle Ergebnise auswählen".</p>
|
|
||||||
<div id="kantonauswahl" class="scrollWindow" onclick="filterFunction()">
|
|
||||||
|
|
||||||
</div><br><br>
|
|
||||||
|
|
||||||
<label for="sitz">Sitz (Ort):</label><br>
|
|
||||||
<div class="dropdown">
|
|
||||||
<div id="gemeindeDropdown" class="dropdown-content">
|
|
||||||
<table style="width: 100%">
|
|
||||||
<td>
|
|
||||||
<input type="text" placeholder="suchen (Ort)" id="sitzInput" onkeyup="filterFunction()" onchange="filterFunction()" name="sitzfilter" autocomplete="off">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<button type="button" class="button-small" onclick="gefundeneGemeindenAuswählen()">Alle Ergebnise auswählen</button>
|
|
||||||
<button type="button" class="button-small" onclick="ausgewählteGemeindenLöschen()">Auswahl löschen</button>
|
|
||||||
<button type="button" class="button-small" onclick="alleGemeindenAnzeigen()">Alle anzeigen</button>
|
|
||||||
<button type="button" class="button-small" onclick="nurAusgewählteGemeindenAnzeigen()">Nur ausgewählte anzeigen</button>
|
|
||||||
</td>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function alleGemeindenAnzeigen() {
|
|
||||||
sitzInput.value = ""
|
|
||||||
filterFunction()
|
|
||||||
}
|
|
||||||
|
|
||||||
function nurAusgewählteGemeindenAnzeigen() {
|
|
||||||
sitzInput.value = "(nur ausgewählte)"
|
|
||||||
filterFunction()
|
|
||||||
}
|
|
||||||
|
|
||||||
function ausgewählteGemeindenLöschen() {
|
|
||||||
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
|
|
||||||
checkbox.checked = false;
|
|
||||||
})
|
|
||||||
filterFunction()
|
|
||||||
}
|
|
||||||
|
|
||||||
function gefundeneGemeindenAuswählen() { // TODO diese Funktion aufrufen wenn keine Gemeinde ausgewählt und gesucht wird.
|
|
||||||
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
|
|
||||||
if(checkbox.parentNode.parentNode.style.display !== "none")
|
|
||||||
checkbox.checked = true;
|
|
||||||
})
|
|
||||||
filterFunction()
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="sitzauswahl" class="scrollWindow">
|
|
||||||
|
|
||||||
|
<div class="d-flex flex-column flex-md-row align-items-md-start justify-content-between gap-2 mb-3">
|
||||||
|
<div>
|
||||||
|
<h1 class="h3 mb-1">Silias Zefix Suche</h1>
|
||||||
|
<p class="text-muted mb-0">
|
||||||
|
Exportiere Firmen als Excel (xlsx) aus dem Zentralen Firmenindex (ZEFIX).
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<span class="badge bg-primary-subtle text-primary border border-primary-subtle align-self-md-center">
|
||||||
|
Export via E-Mail Link
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr class="my-4">
|
||||||
|
|
||||||
|
<form action="submit.php" method="post" class="needs-validation" novalidate>
|
||||||
|
|
||||||
|
<!-- Firmenname -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<label for="firma" class="form-label">Firmenname</label>
|
||||||
|
<div class="form-text mb-2">* kann als Platzhalter verwendet werden</div>
|
||||||
|
<input type="text" id="firma" name="firma" class="form-control" placeholder="z.B. Silias*">
|
||||||
</div>
|
</div>
|
||||||
</div><br><br><br><br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label for="rechtsform">Rechtsform:</label><br>
|
|
||||||
<div id = "rechtsformenauswahl" class="scrollWindow">
|
|
||||||
|
|
||||||
|
<!-- Kanton -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<label class="form-label">Kanton</label>
|
||||||
|
<div class="alert alert-warning py-2 mb-2" role="alert" style="font-size: .95rem;">
|
||||||
|
Die Kantonsauswahl wird vom Export ignoriert und dient nur zum Filtern der Ortschaften.
|
||||||
|
Für Export nach Kanton: gewünschte Kantone wählen und dann bei Ortschaften auf
|
||||||
|
<b>Alle Ergebnisse auswählen</b> klicken.
|
||||||
|
</div>
|
||||||
|
<div id="kantonauswahl" class="scrollWindow" onclick="filterFunction()"></div>
|
||||||
</div>
|
</div>
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<input type="checkbox" id="exakteSuche" name="exakteSuche" disabled>
|
<!-- Sitz / Ort -->
|
||||||
<label for="exakteSuche">Exakte Suche (noch in Entwicklung)</label><br>
|
<div class="mb-4">
|
||||||
|
<label class="form-label">Sitz (Ort)</label>
|
||||||
|
|
||||||
<input type="checkbox" id="geloeschteRechtseinheiten" name="geloeschteRechtseinheiten">
|
<div class="card border-0 bg-white">
|
||||||
<label for="geloeschteRechtseinheiten">Gelöschte Rechtseinheiten suchen</label><br>
|
<div class="card-body p-0">
|
||||||
|
<div class="d-flex flex-column flex-lg-row gap-2 mb-2">
|
||||||
|
<div class="flex-grow-1">
|
||||||
|
<input type="text"
|
||||||
|
placeholder="Suchen (Ort)"
|
||||||
|
id="sitzInput"
|
||||||
|
onkeyup="filterFunction()"
|
||||||
|
onchange="filterFunction()"
|
||||||
|
name="sitzfilter"
|
||||||
|
autocomplete="off">
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="checkbox" id="inBisherigenFirmen" name="inBisherigenFirmen" disabled>
|
<div class="d-flex flex-wrap gap-2">
|
||||||
<label for="inBisherigenFirmen">In bisherigen Firmen/Namen suchen (noch in Entwicklung)</label><br>
|
<button type="button" class="btn btn-outline-primary button-small" onclick="gefundeneGemeindenAuswählen()">
|
||||||
|
Alle Ergebnisse auswählen
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary button-small" onclick="ausgewählteGemeindenLöschen()">
|
||||||
|
Auswahl löschen
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary button-small" onclick="alleGemeindenAnzeigen()">
|
||||||
|
Alle anzeigen
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary button-small" onclick="nurAusgewählteGemeindenAnzeigen()">
|
||||||
|
Nur ausgewählte
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="checkbox" id="phonetischeSuche" name="phonetischeSuche" disabled>
|
<div id="sitzauswahl" class="scrollWindow"></div>
|
||||||
<label for="phonetischeSuche">Phonetische Suche (noch in Entwicklung)</label><br><br>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label for="email">Ihre E-Mail Adresse:</label>
|
<!-- Rechtsform -->
|
||||||
<p>Das aufbereiten der Daten kann lange dauern. Sie erhalten einen Download-Link per E-Mail sobald die Daten bereit sind.</p>
|
<div class="mb-4">
|
||||||
<input type="email" id="email" name="email" required><br><br>
|
<label class="form-label">Rechtsform</label>
|
||||||
|
<div id="rechtsformenauswahl" class="scrollWindow"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Optionen -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="exakteSuche" name="exakteSuche" disabled>
|
||||||
|
<label class="form-check-label" for="exakteSuche">Exakte Suche (noch in Entwicklung)</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="geloeschteRechtseinheiten" name="geloeschteRechtseinheiten">
|
||||||
|
<label class="form-check-label" for="geloeschteRechtseinheiten">Gelöschte Rechtseinheiten suchen</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="inBisherigenFirmen" name="inBisherigenFirmen" disabled>
|
||||||
|
<label class="form-check-label" for="inBisherigenFirmen">In bisherigen Firmen/Namen suchen (noch in Entwicklung)</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="phonetischeSuche" name="phonetischeSuche" disabled>
|
||||||
|
<label class="form-check-label" for="phonetischeSuche">Phonetische Suche (noch in Entwicklung)</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Email -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<label for="email" class="form-label">Ihre E-Mail Adresse</label>
|
||||||
|
<div class="form-text mb-2">
|
||||||
|
Das Aufbereiten der Daten kann länger dauern. Sie erhalten einen Download-Link per E-Mail sobald die Daten bereit sind.
|
||||||
|
</div>
|
||||||
|
<input type="email" id="email" name="email" class="form-control" required placeholder="name@firma.ch">
|
||||||
|
<div class="invalid-feedback">Bitte eine gültige E-Mail Adresse eingeben.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-grid">
|
||||||
|
<button type="submit" class="btn btn-primary btn-lg">Export starten</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input type="submit" value="Export starten">
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// Bootstrap validation (optional)
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
const forms = document.querySelectorAll('.needs-validation')
|
||||||
|
Array.prototype.slice.call(forms).forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
// Parse CSV-Daten und fülle das Dropdown-Feld
|
// CSV data injected by PHP
|
||||||
|
|
||||||
|
|
||||||
let communityCsvData;
|
let communityCsvData;
|
||||||
let legalFormsCsvData;
|
let legalFormsCsvData;
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -156,31 +202,44 @@ include "zefixAPI.php";
|
||||||
include 'legalForms.php';
|
include 'legalForms.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
// --- Helpers to create nicer checkbox rows (Bootstrap form-check) ---
|
||||||
|
function addCheckboxRow(container, checkboxName, checkboxValue, labelText) {
|
||||||
|
const wrapper = document.createElement('div');
|
||||||
|
wrapper.className = "form-check";
|
||||||
|
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.className = "form-check-input";
|
||||||
|
input.type = "checkbox";
|
||||||
|
input.name = checkboxName;
|
||||||
|
input.value = checkboxValue;
|
||||||
|
|
||||||
|
const label = document.createElement('label');
|
||||||
|
label.className = "form-check-label";
|
||||||
|
label.textContent = labelText;
|
||||||
|
|
||||||
|
wrapper.appendChild(input);
|
||||||
|
wrapper.appendChild(label);
|
||||||
|
container.appendChild(wrapper);
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Legal forms ---
|
||||||
const legalFormslines = legalFormsCsvData.trim().split('\n');
|
const legalFormslines = legalFormsCsvData.trim().split('\n');
|
||||||
const legalFormsheaders = legalFormslines[0].split(',');
|
const legalFormsheaders = legalFormslines[0].split(',');
|
||||||
const legalformIdIndex = legalFormsheaders.indexOf('id');
|
const legalformIdIndex = legalFormsheaders.indexOf('id');
|
||||||
const legalformNameIndex = legalFormsheaders.indexOf('name');
|
const legalformNameIndex = legalFormsheaders.indexOf('name');
|
||||||
|
|
||||||
|
const rechtsformenauswahl = document.getElementById("rechtsformenauswahl");
|
||||||
for (let i = 1; i < legalFormslines.length; i++) {
|
for (let i = 1; i < legalFormslines.length; i++) {
|
||||||
const cells = legalFormslines[i].split(',');
|
const cells = legalFormslines[i].split(',');
|
||||||
const id = cells[legalformIdIndex].trim();
|
const id = (cells[legalformIdIndex] || '').trim();
|
||||||
const name = cells[legalformNameIndex].trim();
|
const name = (cells[legalformNameIndex] || '').trim();
|
||||||
const label = document.createElement('label');
|
if (!id || !name) continue;
|
||||||
const rechtsformenauswahl = document.getElementById("rechtsformenauswahl")
|
addCheckboxRow(rechtsformenauswahl, "rechtsformen[]", id, " " + name);
|
||||||
rechtsformenauswahl.appendChild(label);
|
|
||||||
const input = document.createElement('input');
|
|
||||||
input.type = "checkbox";
|
|
||||||
input.name = "rechtsformen[]";
|
|
||||||
input.value = id;
|
|
||||||
label.textContent = " " + name;
|
|
||||||
label.style.marginBottom = '0';
|
|
||||||
label.prepend(input);
|
|
||||||
rechtsformenauswahl.appendChild(document.createElement("br"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Communities + Cantons ---
|
||||||
|
|
||||||
|
|
||||||
const lines = communityCsvData.trim().split('\n');
|
const lines = communityCsvData.trim().split('\n');
|
||||||
const headers = lines[0].split(',');
|
const headers = lines[0].split(',');
|
||||||
const gemeindeNameIndex = headers.indexOf('Gemeindename');
|
const gemeindeNameIndex = headers.indexOf('Gemeindename');
|
||||||
|
|
@ -189,158 +248,183 @@ include "zefixAPI.php";
|
||||||
const registryOfCommerceIdIndex = headers.indexOf('registryOfCommerceId');
|
const registryOfCommerceIdIndex = headers.indexOf('registryOfCommerceId');
|
||||||
|
|
||||||
const sitze = [];
|
const sitze = [];
|
||||||
const kantone = []
|
const kantone = [];
|
||||||
|
const kantonauswahl = document.getElementById("kantonauswahl");
|
||||||
|
const sitzauswahl = document.getElementById("sitzauswahl");
|
||||||
|
|
||||||
for (let i = 1; i < lines.length; i++) {
|
for (let i = 1; i < lines.length; i++) {
|
||||||
|
|
||||||
const cells = lines[i].split(',');
|
const cells = lines[i].split(',');
|
||||||
const bfsId = cells[bfsIdIndex].trim();
|
if (!cells || cells.length < 4) continue;
|
||||||
const gemeindeName = cells[gemeindeNameIndex].trim();
|
|
||||||
const kanton = cells[kantonIndex].trim();
|
|
||||||
const registryOfCommerceId = cells[registryOfCommerceIdIndex].trim();
|
|
||||||
|
|
||||||
// Falls Kanton noch nicht vorhanden -> hinzufügen
|
const bfsId = (cells[bfsIdIndex] || '').trim();
|
||||||
if (!kantone.includes(kanton)) {
|
const gemeindeName = (cells[gemeindeNameIndex] || '').trim();
|
||||||
kantone.push(kanton)
|
const kanton = (cells[kantonIndex] || '').trim();
|
||||||
const label = document.createElement('label');
|
const registryOfCommerceId = (cells[registryOfCommerceIdIndex] || '').trim();
|
||||||
const kantonsauswahl = document.getElementById("kantonauswahl")
|
|
||||||
kantonsauswahl.appendChild(label);
|
if (!bfsId || !gemeindeName) continue;
|
||||||
const input = document.createElement('input');
|
|
||||||
input.type = "checkbox";
|
// Add canton if new
|
||||||
input.name = "kantone[]";
|
if (kanton && !kantone.includes(kanton)) {
|
||||||
input.value = kanton;
|
kantone.push(kanton);
|
||||||
label.textContent = " " + kanton;
|
addCheckboxRow(kantonauswahl, "kantone[]", kanton, " " + kanton);
|
||||||
label.style.marginBottom = '0';
|
|
||||||
label.prepend(input);
|
|
||||||
kantonsauswahl.appendChild(document.createElement("br"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sitz hinzufügen
|
// Store row for filtering logic
|
||||||
sitze.push(cells)
|
sitze.push(cells);
|
||||||
const sitzString = gemeindeName
|
|
||||||
|
// Create nicer entry
|
||||||
const gemeindeEintrag = document.createElement("div");
|
const gemeindeEintrag = document.createElement("div");
|
||||||
gemeindeEintrag.classList.add("gemeindeeintrag");
|
gemeindeEintrag.classList.add("gemeindeeintrag");
|
||||||
const label = document.createElement('label');
|
|
||||||
const sitzauswahl = document.getElementById("sitzauswahl")
|
const wrapper = document.createElement('div');
|
||||||
sitzauswahl.appendChild(gemeindeEintrag);
|
wrapper.className = "form-check";
|
||||||
gemeindeEintrag.appendChild(label);
|
|
||||||
const input = document.createElement('input');
|
const input = document.createElement('input');
|
||||||
|
input.className = "form-check-input";
|
||||||
input.type = "checkbox";
|
input.type = "checkbox";
|
||||||
input.name = "sitze[]";
|
input.name = "sitze[]";
|
||||||
input.value = bfsId;
|
input.value = bfsId;
|
||||||
label.textContent = " " + sitzString;
|
|
||||||
label.style.marginBottom = '0';
|
const label = document.createElement('label');
|
||||||
label.prepend(input);
|
label.className = "form-check-label";
|
||||||
gemeindeEintrag.appendChild(document.createElement("br"))
|
label.textContent = " " + gemeindeName;
|
||||||
|
|
||||||
|
wrapper.appendChild(input);
|
||||||
|
wrapper.appendChild(label);
|
||||||
|
gemeindeEintrag.appendChild(wrapper);
|
||||||
|
|
||||||
|
sitzauswahl.appendChild(gemeindeEintrag);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterFunction() {
|
const sitzInput = document.getElementById('sitzInput');
|
||||||
const numKantoneAusgewählt = kantoneAusgewählt()
|
|
||||||
var input, filter, ul, li, a, i;
|
|
||||||
input = document.getElementById("sitzInput");
|
|
||||||
filter = input.value.toUpperCase();
|
|
||||||
div = document.getElementById("gemeindeDropdown");
|
|
||||||
a = div.getElementsByClassName("gemeindeeintrag");
|
|
||||||
for (i = 0; i < a.length; i++) {
|
|
||||||
txtValue = a[i].textContent || a[i].innerText;
|
|
||||||
if ((txtValue.toUpperCase().indexOf(filter) > -1 && (document.querySelector('input[name="kantone[]"][value=' + sitze[i][kantonIndex] + ']').checked || numKantoneAusgewählt === 0) ) || a[i].firstElementChild.firstElementChild.checked) {
|
|
||||||
a[i].style.display = "";
|
|
||||||
} else {
|
|
||||||
a[i].style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function kantoneAusgewählt() {
|
function kantoneAusgewählt() {
|
||||||
const checkboxes = document.querySelectorAll('input[name="kantone[]"]');
|
const checkboxes = document.querySelectorAll('input[name="kantone[]"]');
|
||||||
let countChecked = 0;
|
let countChecked = 0;
|
||||||
|
for (let i = 0; i < checkboxes.length; i++) {
|
||||||
for (var i = 0; i < checkboxes.length; i++) {
|
if (checkboxes[i].checked) countChecked++;
|
||||||
if (checkboxes[i].checked) {
|
|
||||||
countChecked = countChecked + 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return countChecked;
|
return countChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterFunction() {
|
||||||
|
const numKantoneAusgewählt = kantoneAusgewählt();
|
||||||
|
const filter = (sitzInput.value || "").toUpperCase();
|
||||||
|
const entries = sitzauswahl.getElementsByClassName("gemeindeeintrag");
|
||||||
|
|
||||||
const sitzInput = document.getElementById('sitzInput');
|
for (let i = 0; i < entries.length; i++) {
|
||||||
const sitzauswahl = document.getElementById('sitzauswahl');
|
const txtValue = entries[i].textContent || entries[i].innerText;
|
||||||
const gemeindedropdown = document.getElementById('gemeindeDropdown');
|
|
||||||
sitzauswahl.style.display = 'block';
|
|
||||||
|
|
||||||
gemeindedropdown.addEventListener('focusin', () => {
|
const selectedCheckbox = entries[i].querySelector('input[type="checkbox"]');
|
||||||
console.log("focusin")
|
const isSelected = selectedCheckbox ? selectedCheckbox.checked : false;
|
||||||
sitzauswahl.style.display = 'block';
|
|
||||||
|
// map entry->sitz row index: still aligned because we push sitze once per entry
|
||||||
|
const row = sitze[i];
|
||||||
|
const rowKanton = row ? row[kantonIndex] : "";
|
||||||
|
|
||||||
|
let cantonOk = true;
|
||||||
|
if (numKantoneAusgewählt > 0 && rowKanton) {
|
||||||
|
const cantonBox = document.querySelector('input[name="kantone[]"][value="' + rowKanton + '"]');
|
||||||
|
cantonOk = cantonBox ? cantonBox.checked : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const matchesText = txtValue.toUpperCase().indexOf(filter) > -1;
|
||||||
|
|
||||||
|
if ((matchesText && (cantonOk || numKantoneAusgewählt === 0)) || isSelected) {
|
||||||
|
entries[i].style.display = "";
|
||||||
|
} else {
|
||||||
|
entries[i].style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function alleGemeindenAnzeigen() {
|
||||||
|
sitzInput.value = "";
|
||||||
|
filterFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
function nurAusgewählteGemeindenAnzeigen() {
|
||||||
|
sitzInput.value = "(nur ausgewählte)";
|
||||||
|
filterFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
function ausgewählteGemeindenLöschen() {
|
||||||
|
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(cb) {
|
||||||
|
cb.checked = false;
|
||||||
});
|
});
|
||||||
|
filterFunction();
|
||||||
|
}
|
||||||
|
|
||||||
|
function gefundeneGemeindenAuswählen() {
|
||||||
|
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(cb) {
|
||||||
|
// show/hide is on the gemeindeeintrag wrapper
|
||||||
|
const entry = cb.closest('.gemeindeeintrag');
|
||||||
|
if (entry && entry.style.display !== "none") cb.checked = true;
|
||||||
|
});
|
||||||
|
filterFunction();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</section>
|
</div>
|
||||||
<div class="push"></div>
|
</div>
|
||||||
</div>
|
</main>
|
||||||
|
|
||||||
|
<footer class="border-top bg-white">
|
||||||
|
<div class="container py-4">
|
||||||
|
<div class="row g-4">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h2 class="h6 mb-2">Impressum</h2>
|
||||||
<footer class="text-center">
|
<div class="text-muted" style="font-size:.95rem;">
|
||||||
<div class="container footer">
|
|
||||||
<div class="row">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td class="footer">
|
|
||||||
<div class="col-12">
|
|
||||||
<p><span><b>Impressum</b></span><br>
|
|
||||||
Silias KLG<br>
|
Silias KLG<br>
|
||||||
Toggenburgstrasse 31<br>
|
Toggenburgstrasse 31<br>
|
||||||
8245 Feuerthalen<br>
|
8245 Feuerthalen<br>
|
||||||
<a href="https://www.silias.ch" target="_blank">www.silias.ch</a><br>
|
<a href="https://www.silias.ch" target="_blank" rel="noopener">www.silias.ch</a><br>
|
||||||
<a href="mailto:info@silias.ch">info@silias.ch</a><br>
|
<a href="mailto:info@silias.ch">info@silias.ch</a><br>
|
||||||
<a href="https://gitea.silias.ch/Silias-Public/Zefix_search">Projekt Repository</a>
|
<a href="https://gitea.silias.ch/Silias-Public/Zefix_search">Projekt Repository</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
<td class="footer">
|
|
||||||
<div class="col-12">
|
<div class="col-md-4">
|
||||||
<p><span><b>Datenquelle</b></span><br>
|
<h2 class="h6 mb-2">Datenquelle</h2>
|
||||||
|
<div class="text-muted" style="font-size:.95rem;">
|
||||||
Zentraler Firmenindex<br>
|
Zentraler Firmenindex<br>
|
||||||
Eidgenössisches Justiz- und Polizeidepartement (EJPD)<br>
|
Eidgenössisches Justiz- und Polizeidepartement (EJPD)<br>
|
||||||
Bundesamt für Justiz (BJ)<br>
|
Bundesamt für Justiz (BJ)<br>
|
||||||
Eidgenössisches Amt für das Handelsregister (EHRA)<br>
|
Eidgenössisches Amt für das Handelsregister (EHRA)<br>
|
||||||
Bundesrain 20<br>
|
Bundesrain 20, 3003 Bern<br>
|
||||||
3003 Bern<br>
|
<a href="https://www.zefix.admin.ch" target="_blank" rel="noopener">www.zefix.admin.ch</a><br>
|
||||||
<a href="https://www.zefix.admin.ch" target="_blank">www.zefix.admin.ch</a><br>
|
|
||||||
<a href="tel:+41584624197">+41 (0) 58 462 41 97</a><br>
|
<a href="tel:+41584624197">+41 (0) 58 462 41 97</a><br>
|
||||||
<a href="zefix@bj.admin.ch">zefix@bj.admin.ch</a>
|
<a href="mailto:zefix@bj.admin.ch">zefix@bj.admin.ch</a>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
<td class="footer">
|
|
||||||
<div class="col-12">
|
<div class="col-md-4">
|
||||||
<p>
|
<h2 class="h6 mb-2">Warteliste</h2>
|
||||||
|
<div class="text-muted" style="font-size:.95rem;">
|
||||||
<script>
|
<script>
|
||||||
const deleteFiles = function (){
|
const deleteFiles = function () {
|
||||||
let taskDeletePassword = prompt("Passwort eingeben:")
|
let taskDeletePassword = prompt("Passwort eingeben:");
|
||||||
let formdata = new FormData()
|
if (taskDeletePassword === null) return;
|
||||||
formdata.append('taskDeletePassword', taskDeletePassword)
|
let formdata = new FormData();
|
||||||
fetch("deleteFiles.php", {
|
formdata.append('taskDeletePassword', taskDeletePassword);
|
||||||
method: "POST",
|
fetch("deleteFiles.php", { method: "POST", body: formdata })
|
||||||
body: formdata,
|
.then(() => location.reload());
|
||||||
});
|
|
||||||
location.reload();
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Momentan sind <?php $taskDir = 'tasks'; echo count(scandir($taskDir)) - 2 ?> Aufträge in der Warteliste.<br>
|
|
||||||
<a href="#" onclick="deleteFiles()">alle löschen</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
Momentan sind
|
||||||
|
<b><?php $taskDir = 'tasks'; echo count(scandir($taskDir)) - 2 ?></b>
|
||||||
|
Aufträge in der Warteliste.<br>
|
||||||
|
<a href="#" onclick="deleteFiles(); return false;">alle löschen</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center text-muted mt-4" style="font-size:.9rem;">
|
||||||
|
© <?php echo date('Y'); ?> Silias KLG
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue