deadline hinzugefügt
This commit is contained in:
19
bulitipp/deadline.php
Executable file
19
bulitipp/deadline.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
include("../../mysqlverbinden.php");
|
||||
include("../rowforeach.php");
|
||||
|
||||
if(!isset($_GET["spieltag"])) die("GET spieltag fehlt");
|
||||
$spieltag = $_GET["spieltag"];
|
||||
|
||||
$deadline = srowforeach("SELECT deadline from `buli-paarungen` where spieltag=? ORDER BY `deadline` ASC;", [$spieltag])[0][0];
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
|
||||
$data=[
|
||||
"deadline" => strtotime($deadline),
|
||||
"now" => time(),
|
||||
"deadlinePassed" => strtotime($deadline) < time()
|
||||
];
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
6
bulitipp/maxtippspieltag.php
Executable file
6
bulitipp/maxtippspieltag.php
Executable file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/json");
|
||||
include("./check.php");
|
||||
|
||||
echo getmaxtippspieltag();
|
||||
@@ -15,6 +15,8 @@ use Firebase\JWT\Key;
|
||||
|
||||
include("jwtsecret.php");
|
||||
include("../../mysqlverbinden.php");
|
||||
include("../rowforeach.php");
|
||||
include("inc.php");
|
||||
|
||||
$headers = getallheaders();
|
||||
if(isset($headers['Authorization'])) {
|
||||
@@ -40,6 +42,10 @@ $spieltag = $_GET["spieltag"];
|
||||
if(!isset($_GET["tipps"])) die("GET tipps fehlt");
|
||||
$tipps = json_decode($_GET["tipps"],true);
|
||||
|
||||
if(deadline($spieltag)){
|
||||
die("deadline überschritten");
|
||||
}
|
||||
|
||||
$tippids=[];
|
||||
foreach($tipps as $tipp){
|
||||
$paarungsid = $tipp['paarung']["id"];
|
||||
|
||||
Reference in New Issue
Block a user