Sitze und Rechtsformen aus Zefix API
This commit is contained in:
parent
3c47b7ba97
commit
bd05621843
|
@ -1,66 +1,70 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//include 'env_vars.php';
|
include 'zefixAPI.php';
|
||||||
$username = getenv("username");
|
|
||||||
$password = getenv("password");
|
|
||||||
|
|
||||||
|
|
||||||
// API endpoint
|
|
||||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/apicompany/search';
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request Types:
|
||||||
|
* Count
|
||||||
|
* List
|
||||||
|
* Export
|
||||||
|
*/
|
||||||
// Request data
|
// Request data
|
||||||
$data = array(
|
$data = array();
|
||||||
"name" => "Silias KLG",
|
|
||||||
"legalFormId" => 4,
|
|
||||||
"legalFormUid" => "0107",
|
|
||||||
"registryOfCommerceId" => 36,
|
|
||||||
"legalSeatId" => 623,
|
|
||||||
"canton" => "BE",
|
|
||||||
"activeOnly" => true
|
|
||||||
);
|
|
||||||
|
|
||||||
// Headers
|
$results = array();
|
||||||
$headers = array(
|
|
||||||
"username:".$username,
|
|
||||||
"password:".$password
|
|
||||||
);
|
|
||||||
phpinfo();
|
|
||||||
// Initialize cURL session
|
|
||||||
$ch = curl_init();
|
|
||||||
|
|
||||||
// Set cURL options
|
// Wenn Firmenname vorhanden
|
||||||
curl_setopt($ch, CURLOPT_URL, $apiUrl);
|
if(isset($_POST['firma']) && !empty($_POST['firma'])) {
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
$data["name"] = $_POST['firma'];
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
||||||
|
|
||||||
// Execute cURL session and get the response
|
|
||||||
$response = curl_exec($ch);
|
|
||||||
|
|
||||||
// Check for cURL errors
|
|
||||||
if (curl_errno($ch)) {
|
|
||||||
echo 'Curl error: ' . curl_error($ch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close cURL session
|
// Wenn gelöschte auch gesucht werden sollen
|
||||||
curl_close($ch);
|
if(isset($_POST['geloeschteRechtseinheiten'])) {
|
||||||
|
$data["activeOnly"] = false;
|
||||||
|
} else {
|
||||||
|
$data["activeOnly"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rechtsformen = array();
|
||||||
|
if (isset($_POST['rechtsform']) && is_array($_POST['rechtsform']) && count($_POST['rechtsform']) > 0) {
|
||||||
|
$rechtsformen = $_POST['rechtsform'];
|
||||||
|
} else {
|
||||||
|
$rechtsformen = array(); //TODO alle Rechtsformen hinzufügen
|
||||||
|
$rechtsformen[] = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sitze = array();
|
||||||
|
if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']) > 0) {
|
||||||
|
$sitze = $_POST['sitze'];
|
||||||
|
} else {
|
||||||
|
$sitze = array(); //TODO alle Sitze hinzufügen
|
||||||
|
$sitze[] = 27;
|
||||||
|
}
|
||||||
|
// Loop through the selected values
|
||||||
|
foreach ($rechtsformen as $rechtsform) {
|
||||||
|
$data["legalFormId"] = $rechtsform;
|
||||||
|
|
||||||
|
// Loop through the selected values
|
||||||
|
foreach ($sitze as $sitz) {
|
||||||
|
$data["legalSeatId"] = $sitz;
|
||||||
|
$response = sendAPICompanySearchRequest($username, $password, $data);
|
||||||
|
|
||||||
// Output the API response
|
|
||||||
echo $response;
|
echo $response;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Close cURL
|
}
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
// Process the Zefix response and construct your own response
|
// Process the Zefix response and construct your own response
|
||||||
// ...
|
// ...
|
||||||
$constructed_response = $response;
|
$constructed_response = $response;
|
||||||
|
|
||||||
// Send the response back to the client
|
// Send the response back to the client
|
||||||
header('Content-Type: application/json');
|
//header('Content-Type: application/json');
|
||||||
echo $constructed_response;
|
//echo $constructed_response;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -0,0 +1,147 @@
|
||||||
|
<?php
|
||||||
|
include 'env_vars.php';
|
||||||
|
$username = getenv("username");
|
||||||
|
$password = getenv("password");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $
|
||||||
|
* @param string $
|
||||||
|
* @param array $data
|
||||||
|
* @return bool|string
|
||||||
|
*/
|
||||||
|
function sendAPICompanySearchRequest(string $username, string $password, array $data): string|bool
|
||||||
|
{
|
||||||
|
// API endpoint
|
||||||
|
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/company/search';
|
||||||
|
|
||||||
|
// Headers
|
||||||
|
$headers = array(
|
||||||
|
"accept: application/json",
|
||||||
|
"Content-Type: application/json"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Initialize cURL session
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// Set cURL options
|
||||||
|
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $apiUrl);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL verification
|
||||||
|
|
||||||
|
// Execute cURL session and get the response
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
// Check for cURL errors
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo 'Curl error: ' . curl_error($ch);
|
||||||
|
}
|
||||||
|
// Close cURL session
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Close cURL
|
||||||
|
curl_close($ch);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendAPICommunityRequest(string $username, string $password): string|bool
|
||||||
|
{
|
||||||
|
// API endpoint
|
||||||
|
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/community';
|
||||||
|
|
||||||
|
// Headers
|
||||||
|
$headers = array(
|
||||||
|
"accept: application/json",
|
||||||
|
"Content-Type: application/json"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Initialize cURL session
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// Set cURL options
|
||||||
|
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $apiUrl);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, false);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL verification
|
||||||
|
|
||||||
|
// Execute cURL session and get the response
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
// Check for cURL errors
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo 'Curl error: ' . curl_error($ch);
|
||||||
|
}
|
||||||
|
// Close cURL session
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Close cURL
|
||||||
|
curl_close($ch);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
function communityCSV(string $username, string $password): string {
|
||||||
|
$response = sendAPICommunityRequest($username, $password);
|
||||||
|
$communityArray = json_decode($response, true);
|
||||||
|
$csvOutput = 'bfsId,Kanton,Gemeindename,registryOfCommerceId\n';
|
||||||
|
// Create CSV rows
|
||||||
|
|
||||||
|
foreach ($communityArray as $item) {
|
||||||
|
$csvOutput .= implode(',', $item) . "\n";
|
||||||
|
}
|
||||||
|
return $csvOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendAPILegalFormRequest(string $username, string $password): string|bool
|
||||||
|
{
|
||||||
|
// API endpoint
|
||||||
|
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/legalForm';
|
||||||
|
|
||||||
|
// Headers
|
||||||
|
$headers = array(
|
||||||
|
"accept: application/json",
|
||||||
|
"Content-Type: application/json"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Initialize cURL session
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// Set cURL options
|
||||||
|
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $apiUrl);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, false);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Disable SSL verification
|
||||||
|
|
||||||
|
// Execute cURL session and get the response
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
// Check for cURL errors
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo 'Curl error: ' . curl_error($ch);
|
||||||
|
}
|
||||||
|
// Close cURL session
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Close cURL
|
||||||
|
curl_close($ch);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
function legalFormCSV(string $username, string $password): string {
|
||||||
|
$response = sendAPILegalFormRequest($username, $password);
|
||||||
|
$legalformArray = json_decode($response, true);
|
||||||
|
$csvOutput = 'id,name\n';
|
||||||
|
// Create CSV rows
|
||||||
|
|
||||||
|
foreach ($legalformArray as $item) {
|
||||||
|
$csvOutput .= $item["id"].",".$item["name"]["de"] . "\n";
|
||||||
|
}
|
||||||
|
return $csvOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
echo "csvData = `". file_get_contents('gemeinden.csv') ."`;";
|
echo "communityCsvData = `". communityCSV($username, $password) ."`;";
|
||||||
?>
|
?>
|
||||||
|
|
92
index.php
92
index.php
|
@ -51,21 +51,21 @@
|
||||||
<p>Diese Webseite wird gerade neu entwickelt und steht demnächst zur Verfügung.</p>
|
<p>Diese Webseite wird gerade neu entwickelt und steht demnächst zur Verfügung.</p>
|
||||||
|
|
||||||
<form action="submit.php" method="post">
|
<form action="submit.php" method="post">
|
||||||
<label for="firmenname">Firmenname:</label>
|
<label for="firma">Firmenname:</label>
|
||||||
<p>* kann als Platzhalter verwendet werden</p>
|
<p>* kann als Platzhalter verwendet werden</p>
|
||||||
<input type="text" id="firmenname" name="firmenname"><br><br>
|
<input type="text" id="firma" name="firma"><br><br>
|
||||||
|
|
||||||
<label for="kanton">Kanton:</label>
|
<label for="kanton">Kanton:</label>
|
||||||
<div id="kantonauswahl" class="scrollWindow" onclick="filterFunction()">
|
<div id="kantonauswahl" class="scrollWindow" onclick="filterFunction()">
|
||||||
|
|
||||||
</div><br><br>
|
</div><br><br>
|
||||||
|
|
||||||
<label for="sitz">Sitz (Postleitzahl / Ort):</label><br>
|
<label for="sitz">Sitz (Ort):</label><br>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<div id="gemeindeDropdown" class="dropdown-content">
|
<div id="gemeindeDropdown" class="dropdown-content">
|
||||||
<table style="width: 100%">
|
<table style="width: 100%">
|
||||||
<td>
|
<td>
|
||||||
<input type="text" placeholder="suchen (PLZ oder Ort)" id="sitzInput" onkeyup="filterFunction()" onchange="filterFunction()" name="sitzfilter" autocomplete="off">
|
<input type="text" placeholder="suchen (Ort)" id="sitzInput" onkeyup="filterFunction()" onchange="filterFunction()" name="sitzfilter" autocomplete="off">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="button-small" onclick="gefundeneGemeindenAuswählen()">Alle Ergebnise auswählen</button>
|
<button type="button" class="button-small" onclick="gefundeneGemeindenAuswählen()">Alle Ergebnise auswählen</button>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
filterFunction()
|
filterFunction()
|
||||||
}
|
}
|
||||||
|
|
||||||
function gefundeneGemeindenAuswählen() {
|
function gefundeneGemeindenAuswählen() { // TODO diese Funktion aufrufen wenn keine Gemeinde ausgewählt und gesucht wird.
|
||||||
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
|
sitzauswahl.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
|
||||||
if(checkbox.parentNode.parentNode.style.display !== "none")
|
if(checkbox.parentNode.parentNode.style.display !== "none")
|
||||||
checkbox.checked = true;
|
checkbox.checked = true;
|
||||||
|
@ -112,41 +112,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div><br><br><br><br>
|
</div><br><br><br><br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label for="rechtsform">Rechtsform:</label><br>
|
<label for="rechtsform">Rechtsform:</label><br>
|
||||||
<div class="scrollWindow">
|
<div id = "rechtsformenauswahl" class="scrollWindow">
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Einzelunternehmen"> Einzelunternehmen</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Kollektivgesellschaft"> Kollektivgesellschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Aktiengesellschaft"> Aktiengesellschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Gesellschaft mit beschränkter Haftung"> Gesellschaft mit beschränkter Haftung</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Genossenschaft"> Genossenschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Verein"> Verein</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Stiftung"> Stiftung</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Institut des öffentlichen Rechts"> Institut des öffentlichen Rechts</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Zweigniederlassung"> Zweigniederlassung</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Kommanditgesellschaft"> Kommanditgesellschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Zweigniederlassung einer ausl. Gesellschaft"> Zweigniederlassung einer ausl. Gesellschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Kommanditaktiengesellschaft"> Kommanditaktiengesellschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Besondere Rechtsform"> Besondere Rechtsform</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Gemeinderschaft"> Gemeinderschaft</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Investmentgesellschaft mit festem Kapital"> Investmentgesellschaft mit festem Kapital</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Investmentgesellschaft mit variablem Kapital"> Investmentgesellschaft mit variablem Kapital</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Kommanditgesellschaft für kollektive Kapitalanlagen"> Kommanditgesellschaft für kollektive Kapitalanlagen</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="Nichtkaufmännische Prokura"> Nichtkaufmännische Prokura</label><br>
|
|
||||||
<label><input type="checkbox" name="rechtsform[]" value="(unbekannt)"> (unbekannt)</label><br>
|
|
||||||
</div>
|
</div>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<input type="checkbox" id="exakteSuche" name="exakteSuche">
|
<input type="checkbox" id="exakteSuche" name="exakteSuche" disabled>
|
||||||
<label for="exakteSuche">Exakte Suche</label><br>
|
<label for="exakteSuche">Exakte Suche (noch in Entwicklung)</label><br>
|
||||||
|
|
||||||
<input type="checkbox" id="geloeschteRechtseinheiten" name="geloeschteRechtseinheiten">
|
<input type="checkbox" id="geloeschteRechtseinheiten" name="geloeschteRechtseinheiten">
|
||||||
<label for="geloeschteRechtseinheiten">Gelöschte Rechtseinheiten suchen</label><br>
|
<label for="geloeschteRechtseinheiten">Gelöschte Rechtseinheiten suchen</label><br>
|
||||||
|
|
||||||
<input type="checkbox" id="inBisherigenFirmen" name="inBisherigenFirmen">
|
<input type="checkbox" id="inBisherigenFirmen" name="inBisherigenFirmen" disabled>
|
||||||
<label for="inBisherigenFirmen">In bisherigen Firmen/Namen suchen</label><br>
|
<label for="inBisherigenFirmen">In bisherigen Firmen/Namen suchen (noch in Entwicklung)</label><br>
|
||||||
|
|
||||||
<input type="checkbox" id="phonetischeSuche" name="phonetischeSuche">
|
<input type="checkbox" id="phonetischeSuche" name="phonetischeSuche" disabled>
|
||||||
<label for="phonetischeSuche">Phonetische Suche</label><br><br>
|
<label for="phonetischeSuche">Phonetische Suche (noch in Entwicklung)</label><br><br>
|
||||||
|
|
||||||
<input type="submit" value="Suchergebnisse exportieren">
|
<input type="submit" value="Suchergebnisse exportieren">
|
||||||
</form>
|
</form>
|
||||||
|
@ -154,36 +138,58 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Parse CSV-Daten und fülle das Dropdown-Feld
|
// Parse CSV-Daten und fülle das Dropdown-Feld
|
||||||
|
|
||||||
let csvData;
|
|
||||||
|
let communityCsvData;
|
||||||
|
let legalFormsCsvData;
|
||||||
<?php
|
<?php
|
||||||
|
include 'api/zefixAPI.php';
|
||||||
include 'gemeinden.php';
|
include 'gemeinden.php';
|
||||||
|
include 'legalForms.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
csvData = csvData.slice(1);
|
const legalFormslines = legalFormsCsvData.trim().split('\n');
|
||||||
// csvData = "PLZ,ORTBEZ,KANTON
|
const legalFormsheaders = legalFormslines[0].split(',');
|
||||||
// 1000,Lausanne Dépôt,VD
|
const legalformIdIndex = legalFormsheaders.indexOf('id');
|
||||||
// 1001,Lausanne,VD
|
const legalformNameIndex = legalFormsheaders.indexOf('name');
|
||||||
// 1002,Lausanne,VD"
|
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"))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const lines = csvData.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');
|
||||||
const plzIndex = headers.indexOf('PLZ');
|
const bfsIdIndex = headers.indexOf('bfsId');
|
||||||
const kantonIndex = headers.indexOf('Kanton');
|
const kantonIndex = headers.indexOf('Kanton');
|
||||||
|
const registryOfCommerceIdIndex = headers.indexOf('registryOfCommerceId');
|
||||||
|
|
||||||
const sitze = [];
|
const sitze = [];
|
||||||
const kantone = []
|
const kantone = []
|
||||||
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 plz = cells[plzIndex].trim();
|
const bfsId = cells[bfsIdIndex].trim();
|
||||||
const gemeindeName = cells[gemeindeNameIndex].trim();
|
const gemeindeName = cells[gemeindeNameIndex].trim();
|
||||||
const kanton = cells[kantonIndex].trim();
|
const kanton = cells[kantonIndex].trim();
|
||||||
|
const registryOfCommerceId = cells[registryOfCommerceIdIndex].trim();
|
||||||
|
|
||||||
// Falls Kanton noch nicht vorhanden -> hinzufügen
|
// Falls Kanton noch nicht vorhanden -> hinzufügen
|
||||||
if (!kantone.includes(kanton)) {
|
if (!kantone.includes(kanton)) {
|
||||||
|
@ -203,7 +209,7 @@
|
||||||
|
|
||||||
// Sitz hinzufügen
|
// Sitz hinzufügen
|
||||||
sitze.push(cells)
|
sitze.push(cells)
|
||||||
const sitzString = plz + " " + gemeindeName
|
const sitzString = gemeindeName
|
||||||
const gemeindeEintrag = document.createElement("div");
|
const gemeindeEintrag = document.createElement("div");
|
||||||
gemeindeEintrag.classList.add("gemeindeeintrag");
|
gemeindeEintrag.classList.add("gemeindeeintrag");
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
|
@ -213,7 +219,7 @@
|
||||||
const input = document.createElement('input');
|
const input = document.createElement('input');
|
||||||
input.type = "checkbox";
|
input.type = "checkbox";
|
||||||
input.name = "sitze[]";
|
input.name = "sitze[]";
|
||||||
input.value = plz;
|
input.value = bfsId;
|
||||||
label.textContent = " " + sitzString;
|
label.textContent = " " + sitzString;
|
||||||
label.style.marginBottom = '0';
|
label.style.marginBottom = '0';
|
||||||
label.prepend(input);
|
label.prepend(input);
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo "legalFormsCsvData = `". legalFormCSV($username, $password) ."`;";
|
||||||
|
?>
|
Loading…
Reference in New Issue