AdminPanel Formulare hinzugefügt, .gitignore aktualisiert

This commit is contained in:
R40fendt
2026-01-04 17:56:23 +01:00
parent 3c2c8a368e
commit 5cb0b78d27
8 changed files with 85 additions and 20 deletions

33
admin/formulare/ergebnisse.php Executable file
View File

@@ -0,0 +1,33 @@
<?php
include("../../../mysqlverbinden.php");
include("../secret.php");
include("../../vendor/autoload.php");
include("../check.php");
$payload=getUserInfo();
$username=$payload->username;
$id=$payload->id;
if(!isset($_GET["formular"])) die("GET formular fehlt");
$formular=$_GET["formular"];
$data=[];
foreach(mysqli_execute_query($db_id,"SELECT `id` FROM `formulare-ergebnisse` WHERE `formular`=?;",[$formular]) as $ergebnisidrow){
$ergebnisid=$ergebnisidrow["id"];
$ergebnis=[];
foreach(mysqli_execute_query($db_id,"SELECT `name`, `value` FROM `formulare-ergebnis` WHERE ergebnisid=?;",[$ergebnisid]) as $row){
$ergebnis[$row["name"]]=$row["value"];
}
$data[]=$ergebnis;
}
echo json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);

15
admin/formulare/newForm.php Executable file
View File

@@ -0,0 +1,15 @@
<?php
include("../../../mysqlverbinden.php");
include("../secret.php");
include("../../vendor/autoload.php");
include("../check.php");
$payload=getUserInfo();
$username=$payload->username;
$id=$payload->id;
mysqli_execute_query($db_id,"INSERT INTO `formulare` (`name`,`minitext`,`public`,`multiple`) VALUES ('','',1,1);");
echo '{"success":true}';