From db064b36c04b64215f33f9f813c8e670b4ff2c80 Mon Sep 17 00:00:00 2001 From: R40fendt Date: Mon, 16 Jun 2025 21:42:22 +0200 Subject: [PATCH] =?UTF-8?q?Backend=20f=C3=BCr=20Modals=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - bulitipp/buli-punkte.php | 153 +++++++++++++++++++++++++++++++++---- bulitipp/check.php | 5 +- bulitipp/hatgetippt.php | 2 +- bulitipp/paarungen.php | 4 +- bulitipp/spieltag-user.php | 28 +++++++ 6 files changed, 173 insertions(+), 20 deletions(-) create mode 100755 bulitipp/spieltag-user.php diff --git a/README.md b/README.md index e97aa77..88b9b12 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # ritzenbergenapi - API für ritzenbergen.de diff --git a/bulitipp/buli-punkte.php b/bulitipp/buli-punkte.php index 12cc98f..7e3b7cd 100755 --- a/bulitipp/buli-punkte.php +++ b/bulitipp/buli-punkte.php @@ -1,16 +1,141 @@ + + + + + + BuLi-Punkte + + + + - $value) { - $id = $value[0]; - $score1 = $value[1]; - $score2 = $value[2]; - $tipp = getTipp($name, $spieltag, $id); - $paarungQuery = srowforeach("SELECT heim, gast from `buli-paarungen` where id=?;", [$id])[0]; - $heim = $paarungQuery[0]; - $gast = $paarungQuery[1]; - $punkte = ps($name, $spieltag, $id); - $result[]=["id"=>$id,"result"=>[$score1,$score2],"tipp"=>$tipp,"heim"=>$heim,"gast"=>$gast,"punkte"=>$punkte]; -} + +

Detailansicht, . Spieltag

+

-

+

-

+ + + + + + + + $value) { + $name=$value[0]; + $punkte=ps($name,$spieltag,$paarungid); + $gesamtpunkte=gs($name,$spieltag); + $tipp=getTipp($name,$spieltag,$paarungid); + $tippstr=($tipp==null)?"-":$tipp[0]." - ".$tipp[1]; + ?> + + + + + + + + + +
NameTippPunkteGesamtpunkte
+ +

Detailansicht für , . Spieltag

+ + + + + + + + $value){ + $id=$value[0]; + $score1=$value[1]; + $score2=$value[2]; + $tipp=getTipp($name,$spieltag,$id); + $paarungQuery=srowforeach("SELECT heim, gast from `buli-paarungen` where id=?;",[$id])[0]; + $heim=$paarungQuery[0]; + $gast=$paarungQuery[1]; + $punkte=ps($name,$spieltag,$id); + $tippstr=($tipp==null)?"-":$tipp[0]." - ".$tipp[1]; + ?> + + + + + + + + +
Tipp von ErgebnisTippPunkte
- -
+ + +

Detailansicht für , . Spieltag

+ + + + + + $value){ + $id=$value[0]; + $tipp=getTipp($name,$spieltag,$id); + $heim=$value[1]; + $gast=$value[2]; + $tippstr=($tipp==null)?"-":$tipp[0]." - ".$tipp[1]; + ?> + + + + + + +
PaarungTipp von
-
+ + + + + \ No newline at end of file diff --git a/bulitipp/check.php b/bulitipp/check.php index 607f280..c6a46bd 100755 --- a/bulitipp/check.php +++ b/bulitipp/check.php @@ -65,9 +65,10 @@ if ($responseData!=null) { } -if($spieltag>=34){ $spieltag=getmaxspieltag()+1; -if(srowforeach("SELECT COUNT(*) from `buli-results` where spieltag=?;",[$spieltag-1])[0][0]<9) $spieltag--; + +if($spieltag<=34){ + $response = file_get_contents("https://api.openligadb.de/getmatchdata/bl".$bundesliga."/".$year."/".$spieltag, false); diff --git a/bulitipp/hatgetippt.php b/bulitipp/hatgetippt.php index 1fcb5ea..f177063 100755 --- a/bulitipp/hatgetippt.php +++ b/bulitipp/hatgetippt.php @@ -12,6 +12,6 @@ if(count($userquery) == 0) die("User nicht gefunden"); $userid = $userquery[0][0]; -if(count(srowforeach("SELECT id FROM `buli-tipps` WHERE user = ? AND spieltag=?",[$userid,5])) == 0) echo "false"; +if(count(srowforeach("SELECT id FROM `buli-tipps` WHERE user = ? AND spieltag=?",[$userid,$spieltag])) == 0) echo "false"; else echo "true"; diff --git a/bulitipp/paarungen.php b/bulitipp/paarungen.php index b0fecf8..9942843 100755 --- a/bulitipp/paarungen.php +++ b/bulitipp/paarungen.php @@ -7,8 +7,8 @@ if(!isset($_GET["spieltag"])) die("GET spieltag fehlt"); $spieltag=$_GET["spieltag"]; $data=[]; -foreach (srowforeach("SELECT `heim`,`gast` from `buli-paarungen` where `spieltag`=?;",[$spieltag]) as $key => $value) { - array_push($data,[$value[0],$value[1]]); +foreach (srowforeach("SELECT `heim`,`gast`, `id` from `buli-paarungen` where `spieltag`=?;",[$spieltag]) as $key => $value) { + array_push($data,[$value[0],$value[1],$value[2]]); } $result=["reload"=>$reload,"data"=>$data]; diff --git a/bulitipp/spieltag-user.php b/bulitipp/spieltag-user.php new file mode 100755 index 0000000..9130a47 --- /dev/null +++ b/bulitipp/spieltag-user.php @@ -0,0 +1,28 @@ +$value){ + $paarungsid = $value[0]; + $tipp = getTipp($username, $spieltag, $paarungsid); + $result = getResult($paarungsid,$spieltag); + array_push($data, ["tipp"=>$tipp, "result"=> $result, "paarung"=>["id"=>$paarungsid, "heim"=>$value[1], "gast"=>$value[2]]]); +} + +$result=["reload"=>$reload, "data"=>$data]; +echo json_encode($result, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);