Sitze und Rechtsformen aus Zefix API
This commit is contained in:
parent
b2332b790b
commit
9ede060821
22
api.php
22
api.php
|
@ -29,17 +29,22 @@ $rechtsformen = array();
|
||||||
if (isset($_POST['rechtsform']) && is_array($_POST['rechtsform']) && count($_POST['rechtsform']) > 0) {
|
if (isset($_POST['rechtsform']) && is_array($_POST['rechtsform']) && count($_POST['rechtsform']) > 0) {
|
||||||
$rechtsformen = $_POST['rechtsform'];
|
$rechtsformen = $_POST['rechtsform'];
|
||||||
} else {
|
} else {
|
||||||
$rechtsformen = array(); //TODO alle Rechtsformen hinzufügen
|
$legalFormArray = json_decode(sendAPILegalFormRequest($username, $password), true);
|
||||||
$rechtsformen[] = 2;
|
foreach ($legalFormArray as $rechtsform) {
|
||||||
|
$rechtsformen[] = $rechtsform["id"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sitze = array();
|
$sitze = array();
|
||||||
if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']) > 0) {
|
if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']) > 0) {
|
||||||
$sitze = $_POST['sitze'];
|
$sitze = $_POST['sitze'];
|
||||||
} else {
|
} else {
|
||||||
$sitze = array(); //TODO alle Sitze hinzufügen
|
$communityArray = json_decode(sendAPICommunityRequest($username, $password), true);
|
||||||
$sitze[] = 27;
|
foreach ($communityArray as $community) {
|
||||||
|
$sitze[] = $community["bfsId"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
phpinfo();
|
||||||
// Loop through the selected values
|
// Loop through the selected values
|
||||||
foreach ($rechtsformen as $rechtsform) {
|
foreach ($rechtsformen as $rechtsform) {
|
||||||
$data["legalFormId"] = $rechtsform;
|
$data["legalFormId"] = $rechtsform;
|
||||||
|
@ -48,11 +53,14 @@ if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']
|
||||||
foreach ($sitze as $sitz) {
|
foreach ($sitze as $sitz) {
|
||||||
$data["legalSeatId"] = $sitz;
|
$data["legalSeatId"] = $sitz;
|
||||||
$response = sendAPICompanySearchRequest($username, $password, $data);
|
$response = sendAPICompanySearchRequest($username, $password, $data);
|
||||||
|
// foreach ($data as $key => $value) {
|
||||||
// echo $response;
|
// echo "Key: " . $key . ", Value: " . $value . "<br>";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// echo "-----------------------------------";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
echo $rechtsform;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue