Abgleich mit Live-Daten

This commit is contained in:
2026-03-24 14:45:06 +01:00
parent 00077aa09a
commit 211ce11e06
116 changed files with 16602 additions and 16612 deletions
+44 -44
View File
@@ -1,45 +1,45 @@
<?php
require_once __DIR__ . '/../inc/config.inc.php';
require_once __DIR__ . '/../inc/functions.inc.php';
header('Content-Type: application/json');
try {
$templetid = $_POST['templetid'] ?? '';
$anfrageid = (int)($_POST['anfrageid'] ?? 0);
if ($templetid === '' || $anfrageid <= 0) {
throw new RuntimeException('Fehlende Parameter');
}
// URL aus config-Tabelle holen (sicher, unabhängig von globalen Variablen)
$stmt = $pdo->query("SELECT anfragebestaetigung FROM config LIMIT 1");
$anfragebestaetigung = (string)$stmt->fetchColumn();
if ($anfragebestaetigung === '') {
throw new RuntimeException('Config anfragebestaetigung ist leer');
}
$result = renderTemplateForAnfrage(
$pdo,
$anfrageid,
$templetid,
$anfragebestaetigung, // aus config
[
// optional:
// '%TERMINZEITVORGABE%' => $Zeitanzeige,
],
false // CP1252 nur wenn nötig
);
echo json_encode([
'betreff' => $result['betreff'],
'body' => $result['body']
]);
} catch (Throwable $e) {
http_response_code(500);
echo json_encode([
'error' => $e->getMessage()
]);
<?php
require_once __DIR__ . '/../inc/config.inc.php';
require_once __DIR__ . '/../inc/functions.inc.php';
header('Content-Type: application/json');
try {
$templetid = $_POST['templetid'] ?? '';
$anfrageid = (int)($_POST['anfrageid'] ?? 0);
if ($templetid === '' || $anfrageid <= 0) {
throw new RuntimeException('Fehlende Parameter');
}
// URL aus config-Tabelle holen (sicher, unabhängig von globalen Variablen)
$stmt = $pdo->query("SELECT anfragebestaetigung FROM config LIMIT 1");
$anfragebestaetigung = (string)$stmt->fetchColumn();
if ($anfragebestaetigung === '') {
throw new RuntimeException('Config anfragebestaetigung ist leer');
}
$result = renderTemplateForAnfrage(
$pdo,
$anfrageid,
$templetid,
$anfragebestaetigung, // aus config
[
// optional:
// '%TERMINZEITVORGABE%' => $Zeitanzeige,
],
false // CP1252 nur wenn nötig
);
echo json_encode([
'betreff' => $result['betreff'],
'body' => $result['body']
]);
} catch (Throwable $e) {
http_response_code(500);
echo json_encode([
'error' => $e->getMessage()
]);
}