2023-08-21 21:12:21 +02:00
|
|
|
<?php
|
2023-08-21 21:16:49 +02:00
|
|
|
include "zefixAPI.php";
|
2023-08-21 21:12:21 +02:00
|
|
|
?>
|
2023-08-16 18:26:11 +02:00
|
|
|
<html lang="de">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2023-08-16 21:43:54 +02:00
|
|
|
<link rel="stylesheet" href="css/custom.css?v=1.2">
|
2023-08-16 18:26:11 +02:00
|
|
|
<link rel="stylesheet" href="css/bootstrap.css">
|
|
|
|
<title>Silias Zefix Suche</title>
|
2023-08-16 17:23:44 +02:00
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
<style>
|
2023-08-17 21:38:35 +02:00
|
|
|
#sitzInput {
|
2023-08-16 21:15:28 +02:00
|
|
|
box-sizing: border-box;
|
|
|
|
background-position: 14px 12px;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
font-size: 16px;
|
|
|
|
padding: 14px 20px 12px 45px;
|
|
|
|
border: none;
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
}
|
|
|
|
|
2023-08-17 22:35:34 +02:00
|
|
|
#sitzInput {outline: 3px solid #ddd;}
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-08-17 22:35:34 +02:00
|
|
|
.button-small {
|
|
|
|
font-size: 0.7rem;
|
|
|
|
padding: 0% 1%;
|
2023-08-16 21:15:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown a:hover {background-color: #ddd;}
|
|
|
|
|
|
|
|
.show {display: block;}
|
2023-08-16 21:32:00 +02:00
|
|
|
|
|
|
|
.scrollWindow {
|
|
|
|
max-height: 300px; /* Adjust the value as needed */
|
|
|
|
overflow-y: auto; /* This will add a scrollbar when content exceeds max-height */
|
|
|
|
border: 1px solid #ccc; /* Optional: Add a border for visual clarity */
|
|
|
|
padding: 10px; /* Optional: Add padding for better spacing */
|
|
|
|
}
|
2023-08-16 21:15:28 +02:00
|
|
|
</style>
|
2023-08-16 18:26:11 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2023-08-16 17:36:41 +02:00
|
|
|
|
2023-08-16 18:27:32 +02:00
|
|
|
<div class="wrapper">
|
|
|
|
<section>
|
2023-08-16 18:21:11 +02:00
|
|
|
|
2023-08-16 18:27:32 +02:00
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
<div class="container">
|
2023-08-16 21:42:03 +02:00
|
|
|
<h1>Silias Zefix Suche</h1>
|
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-09-30 10:29:00 +02:00
|
|
|
<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>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
<form action="submit.php" method="post">
|
2023-08-21 20:37:59 +02:00
|
|
|
<label for="firma">Firmenname:</label>
|
2023-08-17 22:35:34 +02:00
|
|
|
<p>* kann als Platzhalter verwendet werden</p>
|
2023-08-21 20:37:59 +02:00
|
|
|
<input type="text" id="firma" name="firma"><br><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
<label for="kanton">Kanton:</label>
|
2023-09-30 10:29:00 +02:00
|
|
|
<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>
|
2023-08-17 22:35:34 +02:00
|
|
|
<div id="kantonauswahl" class="scrollWindow" onclick="filterFunction()">
|
2023-08-17 21:38:35 +02:00
|
|
|
|
|
|
|
</div><br><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
<label for="sitz">Sitz (Ort):</label><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
<div class="dropdown">
|
2023-08-17 21:38:35 +02:00
|
|
|
<div id="gemeindeDropdown" class="dropdown-content">
|
2023-08-17 22:35:34 +02:00
|
|
|
<table style="width: 100%">
|
|
|
|
<td>
|
2023-08-21 20:37:59 +02:00
|
|
|
<input type="text" placeholder="suchen (Ort)" id="sitzInput" onkeyup="filterFunction()" onchange="filterFunction()" name="sitzfilter" autocomplete="off">
|
2023-08-17 22:35:34 +02:00
|
|
|
</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()
|
|
|
|
}
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
function gefundeneGemeindenAuswählen() { // TODO diese Funktion aufrufen wenn keine Gemeinde ausgewählt und gesucht wird.
|
2023-08-17 22:35:34 +02:00
|
|
|
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
|
|
|
|
if(checkbox.parentNode.parentNode.style.display !== "none")
|
|
|
|
checkbox.checked = true;
|
|
|
|
})
|
|
|
|
filterFunction()
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
2023-08-17 21:38:35 +02:00
|
|
|
<div id="sitzauswahl" class="scrollWindow">
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2023-08-16 21:32:00 +02:00
|
|
|
</div><br><br><br><br>
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
|
|
|
|
|
2023-08-16 21:32:00 +02:00
|
|
|
<label for="rechtsform">Rechtsform:</label><br>
|
2023-08-21 20:37:59 +02:00
|
|
|
<div id = "rechtsformenauswahl" class="scrollWindow">
|
|
|
|
|
2023-08-16 21:32:00 +02:00
|
|
|
</div>
|
|
|
|
<br><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
<input type="checkbox" id="exakteSuche" name="exakteSuche" disabled>
|
|
|
|
<label for="exakteSuche">Exakte Suche (noch in Entwicklung)</label><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
<input type="checkbox" id="geloeschteRechtseinheiten" name="geloeschteRechtseinheiten">
|
|
|
|
<label for="geloeschteRechtseinheiten">Gelöschte Rechtseinheiten suchen</label><br>
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
<input type="checkbox" id="inBisherigenFirmen" name="inBisherigenFirmen" disabled>
|
|
|
|
<label for="inBisherigenFirmen">In bisherigen Firmen/Namen suchen (noch in Entwicklung)</label><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
<input type="checkbox" id="phonetischeSuche" name="phonetischeSuche" disabled>
|
|
|
|
<label for="phonetischeSuche">Phonetische Suche (noch in Entwicklung)</label><br><br>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-09-25 14:29:53 +02:00
|
|
|
<label for="email">Ihre E-Mail Adresse:</label>
|
2023-09-26 14:32:04 +02:00
|
|
|
<p>Das aufbereiten der Daten kann lange dauern. Sie erhalten einen Download-Link per E-Mail sobald die Daten bereit sind.</p>
|
2023-09-25 14:36:51 +02:00
|
|
|
<input type="email" id="email" name="email" required><br><br>
|
2023-09-25 14:29:53 +02:00
|
|
|
|
|
|
|
<input type="submit" value="Export starten">
|
2023-08-16 21:15:28 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
// Parse CSV-Daten und fülle das Dropdown-Feld
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
|
|
|
|
let communityCsvData;
|
|
|
|
let legalFormsCsvData;
|
2023-08-16 21:15:28 +02:00
|
|
|
<?php
|
|
|
|
include 'gemeinden.php';
|
2023-08-21 20:37:59 +02:00
|
|
|
include 'legalForms.php';
|
2023-08-16 21:15:28 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
const legalFormslines = legalFormsCsvData.trim().split('\n');
|
|
|
|
const legalFormsheaders = legalFormslines[0].split(',');
|
|
|
|
const legalformIdIndex = legalFormsheaders.indexOf('id');
|
|
|
|
const legalformNameIndex = legalFormsheaders.indexOf('name');
|
|
|
|
for (let i = 1; i < legalFormslines.length; i++) {
|
|
|
|
const cells = legalFormslines[i].split(',');
|
|
|
|
const id = cells[legalformIdIndex].trim();
|
|
|
|
const name = cells[legalformNameIndex].trim();
|
|
|
|
const label = document.createElement('label');
|
|
|
|
const rechtsformenauswahl = document.getElementById("rechtsformenauswahl")
|
|
|
|
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"))
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
|
2023-08-21 20:37:59 +02:00
|
|
|
const lines = communityCsvData.trim().split('\n');
|
2023-08-16 21:15:28 +02:00
|
|
|
const headers = lines[0].split(',');
|
|
|
|
const gemeindeNameIndex = headers.indexOf('Gemeindename');
|
2023-09-26 17:30:35 +02:00
|
|
|
const bfsIdIndex = headers.indexOf('id');
|
2023-08-16 21:15:28 +02:00
|
|
|
const kantonIndex = headers.indexOf('Kanton');
|
2023-08-21 20:37:59 +02:00
|
|
|
const registryOfCommerceIdIndex = headers.indexOf('registryOfCommerceId');
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
const sitze = [];
|
2023-08-17 21:38:35 +02:00
|
|
|
const kantone = []
|
2023-08-16 21:15:28 +02:00
|
|
|
for (let i = 1; i < lines.length; i++) {
|
2023-08-17 21:38:35 +02:00
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
const cells = lines[i].split(',');
|
2023-08-21 20:37:59 +02:00
|
|
|
const bfsId = cells[bfsIdIndex].trim();
|
2023-08-16 21:15:28 +02:00
|
|
|
const gemeindeName = cells[gemeindeNameIndex].trim();
|
|
|
|
const kanton = cells[kantonIndex].trim();
|
2023-08-21 20:37:59 +02:00
|
|
|
const registryOfCommerceId = cells[registryOfCommerceIdIndex].trim();
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
// Falls Kanton noch nicht vorhanden -> hinzufügen
|
2023-08-17 21:38:35 +02:00
|
|
|
if (!kantone.includes(kanton)) {
|
|
|
|
kantone.push(kanton)
|
|
|
|
const label = document.createElement('label');
|
|
|
|
const kantonsauswahl = document.getElementById("kantonauswahl")
|
|
|
|
kantonsauswahl.appendChild(label);
|
|
|
|
const input = document.createElement('input');
|
|
|
|
input.type = "checkbox";
|
|
|
|
input.name = "kantone[]";
|
|
|
|
input.value = kanton;
|
|
|
|
label.textContent = " " + kanton;
|
|
|
|
label.style.marginBottom = '0';
|
|
|
|
label.prepend(input);
|
|
|
|
kantonsauswahl.appendChild(document.createElement("br"))
|
2023-08-16 21:15:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Sitz hinzufügen
|
2023-08-17 21:38:35 +02:00
|
|
|
sitze.push(cells)
|
2023-08-21 20:37:59 +02:00
|
|
|
const sitzString = gemeindeName
|
2023-08-17 21:38:35 +02:00
|
|
|
const gemeindeEintrag = document.createElement("div");
|
|
|
|
gemeindeEintrag.classList.add("gemeindeeintrag");
|
|
|
|
const label = document.createElement('label');
|
|
|
|
const sitzauswahl = document.getElementById("sitzauswahl")
|
|
|
|
sitzauswahl.appendChild(gemeindeEintrag);
|
|
|
|
gemeindeEintrag.appendChild(label);
|
|
|
|
const input = document.createElement('input');
|
|
|
|
input.type = "checkbox";
|
|
|
|
input.name = "sitze[]";
|
2023-08-21 20:37:59 +02:00
|
|
|
input.value = bfsId;
|
2023-08-17 21:38:35 +02:00
|
|
|
label.textContent = " " + sitzString;
|
|
|
|
label.style.marginBottom = '0';
|
|
|
|
label.prepend(input);
|
|
|
|
gemeindeEintrag.appendChild(document.createElement("br"))
|
2023-08-16 21:15:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function filterFunction() {
|
2023-08-17 21:38:35 +02:00
|
|
|
const numKantoneAusgewählt = kantoneAusgewählt()
|
2023-08-16 21:15:28 +02:00
|
|
|
var input, filter, ul, li, a, i;
|
2023-08-17 21:38:35 +02:00
|
|
|
input = document.getElementById("sitzInput");
|
2023-08-16 21:15:28 +02:00
|
|
|
filter = input.value.toUpperCase();
|
2023-08-17 21:38:35 +02:00
|
|
|
div = document.getElementById("gemeindeDropdown");
|
|
|
|
a = div.getElementsByClassName("gemeindeeintrag");
|
2023-08-16 21:15:28 +02:00
|
|
|
for (i = 0; i < a.length; i++) {
|
|
|
|
txtValue = a[i].textContent || a[i].innerText;
|
2023-08-17 21:38:35 +02:00
|
|
|
if ((txtValue.toUpperCase().indexOf(filter) > -1 && (document.querySelector('input[name="kantone[]"][value=' + sitze[i][kantonIndex] + ']').checked || numKantoneAusgewählt === 0) ) || a[i].firstElementChild.firstElementChild.checked) {
|
2023-08-16 21:15:28 +02:00
|
|
|
a[i].style.display = "";
|
|
|
|
} else {
|
|
|
|
a[i].style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-17 21:38:35 +02:00
|
|
|
function kantoneAusgewählt() {
|
|
|
|
const checkboxes = document.querySelectorAll('input[name="kantone[]"]');
|
|
|
|
let countChecked = 0;
|
|
|
|
|
|
|
|
for (var i = 0; i < checkboxes.length; i++) {
|
|
|
|
if (checkboxes[i].checked) {
|
|
|
|
countChecked = countChecked + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return countChecked;
|
2023-08-16 21:15:28 +02:00
|
|
|
}
|
|
|
|
|
2023-08-17 21:38:35 +02:00
|
|
|
|
|
|
|
const sitzInput = document.getElementById('sitzInput');
|
|
|
|
const sitzauswahl = document.getElementById('sitzauswahl');
|
2023-08-17 22:35:34 +02:00
|
|
|
const gemeindedropdown = document.getElementById('gemeindeDropdown');
|
|
|
|
sitzauswahl.style.display = 'block';
|
2023-08-16 21:15:28 +02:00
|
|
|
|
2023-08-17 22:35:34 +02:00
|
|
|
gemeindedropdown.addEventListener('focusin', () => {
|
|
|
|
console.log("focusin")
|
|
|
|
sitzauswahl.style.display = 'block';
|
2023-08-16 21:15:28 +02:00
|
|
|
});
|
|
|
|
|
2023-08-17 21:38:35 +02:00
|
|
|
|
2023-08-16 21:15:28 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2023-08-16 18:27:32 +02:00
|
|
|
</section>
|
2023-08-16 21:42:03 +02:00
|
|
|
<div class="push"></div>
|
2023-08-16 18:27:32 +02:00
|
|
|
</div>
|
2023-08-16 21:15:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-16 18:19:50 +02:00
|
|
|
|
2023-08-16 18:26:11 +02:00
|
|
|
|
2023-08-16 18:19:50 +02:00
|
|
|
|
|
|
|
<footer class="text-center">
|
|
|
|
<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>
|
|
|
|
Toggenburgstrasse 31<br>
|
|
|
|
8245 Feuerthalen<br>
|
|
|
|
<a href="https://www.silias.ch" target="_blank">www.silias.ch</a><br>
|
|
|
|
<a href="mailto:info@silias.ch">info@silias.ch</a><br>
|
2023-08-16 18:21:47 +02:00
|
|
|
<a href="https://gitea.silias.ch/Silias-Public/Zefix_search">Projekt Repository</a>
|
2023-08-16 18:19:50 +02:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td class="footer">
|
|
|
|
<div class="col-12">
|
|
|
|
<p><span><b>Datenquelle</b></span><br>
|
2023-08-16 18:26:11 +02:00
|
|
|
Zentraler Firmenindex<br>
|
2023-08-16 18:19:50 +02:00
|
|
|
Eidgenössisches Justiz- und Polizeidepartement (EJPD)<br>
|
|
|
|
Bundesamt für Justiz (BJ)<br>
|
2023-08-16 18:42:20 +02:00
|
|
|
Eidgenössisches Amt für das Handelsregister (EHRA)<br>
|
|
|
|
Bundesrain 20<br>
|
|
|
|
3003 Bern<br>
|
2023-08-16 18:19:50 +02:00
|
|
|
<a href="https://www.zefix.admin.ch" target="_blank">www.zefix.admin.ch</a><br>
|
2023-08-16 18:43:20 +02:00
|
|
|
<a href="tel:+41584624197">+41 (0) 58 462 41 97</a><br>
|
2023-08-16 18:42:20 +02:00
|
|
|
<a href="zefix@bj.admin.ch">zefix@bj.admin.ch</a>
|
2023-08-16 18:19:50 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</td>
|
2023-09-26 21:46:44 +02:00
|
|
|
<td class="footer">
|
|
|
|
<div class="col-12">
|
|
|
|
<p>
|
|
|
|
<script>
|
|
|
|
const deleteFiles = function (){
|
|
|
|
let taskDeletePassword = prompt("Passwort eingeben:")
|
|
|
|
let formdata = new FormData()
|
|
|
|
formdata.append('taskDeletePassword', taskDeletePassword)
|
|
|
|
fetch("deleteFiles.php", {
|
|
|
|
method: "POST",
|
|
|
|
body: formdata,
|
|
|
|
});
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
</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>
|
2023-08-16 18:19:50 +02:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
|
2023-08-16 18:26:11 +02:00
|
|
|
</body>
|
2023-08-16 18:19:50 +02:00
|
|
|
</html>
|