Sitze und Rechtsformen aus Zefix API
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
include 'zefixAPI.php';
|
||||
|
||||
|
||||
/*
|
||||
* Request Types:
|
||||
* Count
|
||||
* List
|
||||
* Export
|
||||
*/
|
||||
// Request data
|
||||
$data = array();
|
||||
|
||||
$results = array();
|
||||
|
||||
// Wenn Firmenname vorhanden
|
||||
if(isset($_POST['firma']) && !empty($_POST['firma'])) {
|
||||
$data["name"] = $_POST['firma'];
|
||||
}
|
||||
|
||||
// Wenn gelöschte auch gesucht werden sollen
|
||||
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);
|
||||
|
||||
// echo $response;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Process the Zefix response and construct your own response
|
||||
// ...
|
||||
$constructed_response = $response;
|
||||
|
||||
// Send the response back to the client
|
||||
//header('Content-Type: application/json');
|
||||
//echo $constructed_response;
|
||||
|
||||
echo communityCSV($username, $password);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user