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 " >
< link rel = " stylesheet " href = " css/custom.css?v=1.1 " >
< 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 >
#myInput {
box - sizing : border - box ;
background - position : 14 px 12 px ;
background - repeat : no - repeat ;
font - size : 16 px ;
padding : 14 px 20 px 12 px 45 px ;
border : none ;
border - bottom : 1 px solid #ddd;
}
#myInput:focus {outline: 3px solid #ddd;}
. dropdown {
position : relative ;
display : inline - block ;
}
. dropdown - content {
position : absolute ;
background - color : #f6f6f6;
min - width : 230 px ;
overflow : auto ;
border : 1 px solid #ddd;
z - index : 1 ;
}
. dropdown - content a {
color : black ;
padding : 12 px 16 px ;
text - decoration : none ;
display : block ;
}
. dropdown a : hover { background - color : #ddd;}
. show { display : block ;}
2023-08-16 21:32:00 +02:00
. scrollWindow {
max - height : 300 px ; /* Adjust the value as needed */
overflow - y : auto ; /* This will add a scrollbar when content exceeds max-height */
border : 1 px solid #ccc; /* Optional: Add a border for visual clarity */
padding : 10 px ; /* 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 >
< div class = " container " >
2023-08-16 18:28:03 +02:00
< h1 > Silias Zefix Suche </ h1 >
2023-08-16 18:21:11 +02:00
2023-08-16 18:27:32 +02:00
< p > Diese Webseite wird gerade neu entwickelt und steht demnächst zur Verfügung .</ p >
</ div >
2023-08-16 21:15:28 +02:00
< div class = " container " >
< form action = " submit.php " method = " post " >
< label for = " firmenname " > Firmenname :</ label >
2023-08-16 21:32:00 +02:00
< input type = " text " id = " firmenname " name = " firmenname " >< br >< br >
2023-08-16 21:15:28 +02:00
< label for = " kanton " > Kanton :</ label >
< select id = " kanton " name = " kanton " >
<!-- Hier kannst du die Optionen für die Kantone einfügen -->
</ select >< br >< br >
2023-08-16 21:32:00 +02:00
< label for = " sitz " > Sitz ( Postleitzahl / Gemeinde ) :</ label >< br >
2023-08-16 21:15:28 +02:00
< div class = " dropdown " >
< div id = " myDropdown " class = " dropdown-content " >
2023-08-16 21:32:00 +02:00
< input type = " text " placeholder = " Postleitzahl / Ort " id = " myInput " onkeyup = " filterFunction() " name = " sitz " autocomplete = " off " >
< div id = " results " 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 >
< label for = " rechtsform " > Rechtsform :</ label >< br >
< div 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 >
< br >< br >
2023-08-16 21:15:28 +02:00
< input type = " checkbox " id = " exakteSuche " name = " exakteSuche " >
< label for = " exakteSuche " > Exakte Suche </ label >< br >
< input type = " checkbox " id = " geloeschteRechtseinheiten " name = " geloeschteRechtseinheiten " >
< label for = " geloeschteRechtseinheiten " > Gelöschte Rechtseinheiten suchen </ label >< br >
< input type = " checkbox " id = " inBisherigenFirmen " name = " inBisherigenFirmen " >
< label for = " inBisherigenFirmen " > In bisherigen Firmen / Namen suchen </ label >< br >
< input type = " checkbox " id = " phonetischeSuche " name = " phonetischeSuche " >
< label for = " phonetischeSuche " > Phonetische Suche </ label >< br >< br >
2023-08-16 21:32:00 +02:00
< input type = " submit " value = " Suchergebnisse herunterladen " >
2023-08-16 21:15:28 +02:00
</ form >
< script >
const kantonDropdown = document . getElementById ( 'kanton' );
const sitzInput = document . getElementById ( 'sitz' );
// Parse CSV-Daten und fülle das Dropdown-Feld
let csvData ;
< ? php
include 'gemeinden.php' ;
?>
csvData = csvData . slice ( 1 );
// csvData = "PLZ,ORTBEZ,KANTON
// 1000,Lausanne Dépôt,VD
// 1001,Lausanne,VD
// 1002,Lausanne,VD"
const lines = csvData . trim () . split ( '\n' );
const headers = lines [ 0 ] . split ( ',' );
const gemeindeNameIndex = headers . indexOf ( 'Gemeindename' );
const plzIndex = headers . indexOf ( 'PLZ' );
const kantonIndex = headers . indexOf ( 'Kanton' );
const sitze = [];
for ( let i = 1 ; i < lines . length ; i ++ ) {
const cells = lines [ i ] . split ( ',' );
const plz = cells [ plzIndex ] . trim ();
const gemeindeName = cells [ gemeindeNameIndex ] . trim ();
const kanton = cells [ kantonIndex ] . trim ();
// Falls Kanton noch nicht vorhanden -> hinzufügen
if ( ! kantonDropdown . querySelector ( `[value="${kanton}"]` )) {
const option = document . createElement ( 'option' );
option . value = kanton ;
option . textContent = kanton ;
kantonDropdown . appendChild ( option );
}
// Sitz hinzufügen
const sitzString = plz + " " + gemeindeName
sitze . push ( sitzString )
const anchorElement = document . createElement ( 'a' );
anchorElement . textContent = sitzString
anchorElement . href = " # "
anchorElement . classList . add ( " result " )
anchorElement . addEventListener ( 'click' , function ( event ) {
const index = i - 1 ; // Make sure 'i' is defined before using it here
chooseResult ( index . toString ());
});
document . getElementById ( " results " ) . appendChild ( anchorElement )
}
function filterFunction () {
var input , filter , ul , li , a , i ;
input = document . getElementById ( " myInput " );
filter = input . value . toUpperCase ();
div = document . getElementById ( " myDropdown " );
a = div . getElementsByTagName ( " a " );
for ( i = 0 ; i < a . length ; i ++ ) {
txtValue = a [ i ] . textContent || a [ i ] . innerText ;
if ( txtValue . toUpperCase () . indexOf ( filter ) > - 1 ) {
a [ i ] . style . display = " " ;
} else {
a [ i ] . style . display = " none " ;
}
}
}
function chooseResult ( index ) {
document . getElementById ( " myInput " ) . value = sitze [ index ]
console . log ( " Choosen " + index )
}
const myInput = document . getElementById ( 'myInput' );
const results = document . getElementById ( 'results' );
results . style . display = 'none' ;
myInput . addEventListener ( 'focus' , () => {
results . style . display = 'block' ;
});
myInput . addEventListener ( 'blur' , () => {
setTimeout (() => {
results . style . display = 'none' ;
}, 100 ); // 1000 milliseconds = 1 second
});
</ script >
</ div >
2023-08-16 18:27:32 +02:00
</ section >
</ div >
2023-08-16 21:15:28 +02:00
2023-08-16 17:36:41 +02:00
< ? php
2023-08-16 18:02:00 +02:00
include 'env_vars.php' ;
2023-08-16 18:21:11 +02:00
//echo "My API Key is:" . $_ENV["APIKEY"];
//echo "Getenv:" . getenv('APIKEY');
2023-08-16 17:36:41 +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 >
</ tr >
</ table >
</ div >
</ div >
</ footer >
2023-08-16 18:26:11 +02:00
</ body >
2023-08-16 18:19:50 +02:00
</ html >