api creating task files
This commit is contained in:
parent
9ede060821
commit
2366370e67
28
api.php
28
api.php
|
@ -2,6 +2,7 @@
|
||||||
include 'zefixAPI.php';
|
include 'zefixAPI.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request Types:
|
* Request Types:
|
||||||
* Count
|
* Count
|
||||||
|
@ -44,29 +45,32 @@ if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']
|
||||||
$sitze[] = $community["bfsId"];
|
$sitze[] = $community["bfsId"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
phpinfo();
|
|
||||||
// Loop through the selected values
|
// Loop through the selected values
|
||||||
|
$taskString = '';
|
||||||
foreach ($rechtsformen as $rechtsform) {
|
foreach ($rechtsformen as $rechtsform) {
|
||||||
$data["legalFormId"] = $rechtsform;
|
$data["legalFormId"] = $rechtsform;
|
||||||
|
|
||||||
// Loop through the selected values
|
// Loop through the selected values
|
||||||
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) {
|
$taskString = $taskString.json_encode($data).'\n';
|
||||||
// echo "Key: " . $key . ", Value: " . $value . "<br>";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// echo "-----------------------------------";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
echo $rechtsform;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the Zefix response and construct your own response
|
|
||||||
// ...
|
$taskfilename = '/tasks/'.time().bin2hex(random_bytes(4)).'txt';
|
||||||
$constructed_response = $response;
|
$taskfile = fopen($taskfilename, 'w');
|
||||||
|
if($taskfile){
|
||||||
|
echo "writing to file";
|
||||||
|
fwrite($taskfile, $taskString);
|
||||||
|
fclose($taskfile);
|
||||||
|
} else {
|
||||||
|
echo "not writing to file";
|
||||||
|
}
|
||||||
|
|
||||||
|
//$constructed_response = $response;
|
||||||
|
|
||||||
// Send the response back to the client
|
// Send the response back to the client
|
||||||
//header('Content-Type: application/json');
|
//header('Content-Type: application/json');
|
||||||
|
|
3487
gemeinden.csv
3487
gemeinden.csv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue