api creating task files

This commit is contained in:
schrom01 2023-09-25 11:55:08 +02:00
parent 9ede060821
commit 2366370e67
2 changed files with 16 additions and 3499 deletions

28
api.php
View File

@ -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');

File diff suppressed because it is too large Load Diff