organic: Add exernal BioQS api

This commit is contained in:
2025-07-15 18:10:48 +02:00
parent 3a39cb6635
commit a44f886086
4 changed files with 224 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
header('Access-Control-Allow-Origin: *');
if ($_SERVER['REQUEST_METHOD'] !== 'GET' && $_SERVER['REQUEST_METHOD'] !== 'HEAD') {
header('Status: 405');
header('Content-Length: 0');
header('Allow: GET, HEAD');
exit;
}
$info = $_SERVER['PATH_INFO'];
if ($info !== '') {
header('Status: 404');
header('Content-Length: 0');
exit;
}
$query = [];
if (isset($_GET['country'])) {
$query[] = 'country=' . [
'AT' => '1',
'DE' => '2',
][$_GET['country']] ?? '';
}
if (isset($_GET['postalCode'])) {
$query[] = 'zipcode=' . urlencode($_GET['postalCode']);
}
if (isset($_GET['name'])) {
$query[] = 'aname=' . urlencode($_GET['name']);
}
if (isset($_GET['idNr'])) {
$query[] = 'clientcode=' . urlencode($_GET['idNr']);
}
if (isset($_GET['lfbisNr'])) {
$query[] = 'lfbis=' . urlencode($_GET['lfbisNr']);
}
header('Content-Type: application/json; charset=UTF-8');
echo "{\"data\":";
passthru("python3 .operators.py " . escapeshellarg(implode('&', $query)));
echo "}\n";