Startseite und Galerie API hinzugefügt

This commit is contained in:
R40fendt
2025-04-17 11:37:05 +02:00
parent 5bd5fcb02c
commit f9d9a944cf
8 changed files with 80 additions and 0 deletions

23
get_ergebnisse.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
header("Access-Control-Allow-Origin: *");
include("../mysqlverbinden.php");
include("rowforeach.php");
if(!isset($_GET["formid"])) die("GET formid fehlt");
$formid=$_GET["formid"];
if(srowforeach("SELECT COUNT(*) from `ritzenbergen-formulare` where `id`=?;",[$formid])[0][0]==0) die("Invalid Form ID");
if(srowforeach("SELECT public from `ritzenbergen-formulare` where `id`=?;",[$formid])[0][0]==0) die("Diese Form ist nicht öffentlich!");
$result=[];
foreach (srowforeach("SELECT `labelone`,`labeltwo`,`timestamp` from `ritzenbergen-formular-ergebnisse` where `formularid`=?;",[$formid]) as $key => $value) {
array_push($result,[
"value1"=>$value[0],
"value2"=>$value[1],
"timestamp"=>$value[2]
]);
}
echo json_encode($result,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);