Files
ritzenbergen-backend/bulitipp/deadline.php
2025-08-19 12:58:42 +02:00

19 lines
634 B
PHP
Executable File

<?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);