Sitze und Rechtsformen aus Zefix API

This commit is contained in:
schrom01
2023-09-25 11:13:53 +02:00
parent b2332b790b
commit 9ede060821
+15 -7
View File
@@ -29,17 +29,22 @@ $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;
$legalFormArray = json_decode(sendAPILegalFormRequest($username, $password), true);
foreach ($legalFormArray as $rechtsform) {
$rechtsformen[] = $rechtsform["id"];
}
}
$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;
$communityArray = json_decode(sendAPICommunityRequest($username, $password), true);
foreach ($communityArray as $community) {
$sitze[] = $community["bfsId"];
}
}
phpinfo();
// Loop through the selected values
foreach ($rechtsformen as $rechtsform) {
$data["legalFormId"] = $rechtsform;
@@ -48,11 +53,14 @@ if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']
foreach ($sitze as $sitz) {
$data["legalSeatId"] = $sitz;
$response = sendAPICompanySearchRequest($username, $password, $data);
// echo $response;
// foreach ($data as $key => $value) {
// echo "Key: " . $key . ", Value: " . $value . "<br>";
// }
//
// echo "-----------------------------------";
}
echo $rechtsform;
}