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';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Request Types:
|
||||
* Count
|
||||
|
@ -44,29 +45,32 @@ if (isset($_POST['sitze']) && is_array($_POST['sitze']) && count($_POST['sitze']
|
|||
$sitze[] = $community["bfsId"];
|
||||
}
|
||||
}
|
||||
phpinfo();
|
||||
// Loop through the selected values
|
||||
$taskString = '';
|
||||
foreach ($rechtsformen as $rechtsform) {
|
||||
$data["legalFormId"] = $rechtsform;
|
||||
|
||||
// Loop through the selected values
|
||||
foreach ($sitze as $sitz) {
|
||||
$data["legalSeatId"] = $sitz;
|
||||
$response = sendAPICompanySearchRequest($username, $password, $data);
|
||||
// foreach ($data as $key => $value) {
|
||||
// echo "Key: " . $key . ", Value: " . $value . "<br>";
|
||||
// }
|
||||
//
|
||||
// echo "-----------------------------------";
|
||||
|
||||
//$response = sendAPICompanySearchRequest($username, $password, $data);
|
||||
$taskString = $taskString.json_encode($data).'\n';
|
||||
}
|
||||
echo $rechtsform;
|
||||
|
||||
}
|
||||
|
||||
// Process the Zefix response and construct your own response
|
||||
// ...
|
||||
$constructed_response = $response;
|
||||
|
||||
$taskfilename = '/tasks/'.time().bin2hex(random_bytes(4)).'txt';
|
||||
$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
|
||||
//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