diff --git a/api.php b/api.php index 3e16aa8..15ed3ce 100644 --- a/api.php +++ b/api.php @@ -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 . "
"; +// } +// +// echo "-----------------------------------"; } + echo $rechtsform; }