From fec81def0e7c872fba78a3f9a1b1989e0a89ded1 Mon Sep 17 00:00:00 2001 From: R40fendt Date: Mon, 18 Aug 2025 21:47:25 +0200 Subject: [PATCH] =?UTF-8?q?tippeintragen.php=20Datenbankverbindung=20hinzu?= =?UTF-8?q?gef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bulitipp/tippeintragen.php | 42 +++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/bulitipp/tippeintragen.php b/bulitipp/tippeintragen.php index 397c61a..b7f4394 100755 --- a/bulitipp/tippeintragen.php +++ b/bulitipp/tippeintragen.php @@ -1,12 +1,32 @@ exp < time()){ die("Token abgelaufen"); } -print_r($payload); +if(!isset($_GET["spieltag"])) die("GET spieltag fehlt"); +$spieltag = $_GET["spieltag"]; +if(!isset($_GET["tipps"])) die("GET tipps fehlt"); +$tipps = json_decode($_GET["tipps"],true); + +$tippids=[]; +foreach($tipps as $tipp){ + $paarungsid = $tipp['paarung']["id"]; + $score1 = $tipp['heim']; + $score2 = $tipp['gast']; + mysqli_execute_query($db_id,"INSERT INTO `buli-tipp` (`spieltag`,`paarung`,`score1`,`score2`) VALUES (?,?,?,?);",[$spieltag,$paarungsid,$score1,$score2]); + $tippids[] = mysqli_insert_id($db_id); +} +array_push($tippids, $spieltag); +array_push($tippids, $payload->id); + +mysqli_execute_query($db_id,"INSERT INTO `buli-tipps` (`tipp1`, `tipp2`, `tipp3`, `tipp4`, `tipp5`, `tipp6`, `tipp7`, `tipp8`, `tipp9`, `spieltag`, `user`) VALUES (?,?,?,?,?,?,?,?,?,?,?);",$tippids);