Files
ritzenbergen-backend/formulare/get_fields.php
2025-12-24 00:27:19 +01:00

30 lines
986 B
PHP
Executable File

<?php
header("Access-Control-Allow-Origin: *");
if(!isset($_GET["formular"])) die("GET formular fehlt");
$formular=$_GET["formular"];
include("../../mysqlverbinden.php");
$data=[];
foreach(mysqli_execute_query($db_id,"SELECT `id`,`formular`, `name`, `displayname`, `value`, `displayvalue`, `placeholder`, `type`, `title`, `required`, `maxlength`, `min`,`max`, `checked` FROM `formulare-fields` WHERE `formular`=? ORDER BY `id` ASC;",[$formular]) as $row){
$data[]=[
"id"=>$row["id"],
"formular"=>$row["formular"],
"name"=>$row["name"],
"displayname"=>$row["displayname"],
"value"=>$row["value"],
"displayvalue"=>$row["displayvalue"],
"placeholder"=>$row["placeholder"],
"type"=>$row["type"],
"title"=>$row["title"],
"required"=>$row["required"],
"maxlength"=>$row["maxlength"],
"min"=>$row["min"],
"max"=>$row["max"],
"checked"=>$row["checked"],
];
}
echo json_encode($data,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);