initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
require_once "config/config.php";
|
||||
include("Data.class.php");
|
||||
|
||||
$Data = new Data($pdo);
|
||||
|
||||
if (!isset($_GET["ts"])) {
|
||||
echo json_encode(["error" => "missing timestamp"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$ts = intval($_GET["ts"]);
|
||||
|
||||
// Tages-Start/Ende berechnen
|
||||
$dayStart = strtotime("00:00", $ts);
|
||||
$dayEnd = strtotime("23:59", $ts);
|
||||
|
||||
$sql = $pdo->prepare("
|
||||
SELECT id, startzeit, location
|
||||
FROM termine
|
||||
WHERE startzeit BETWEEN :s AND :e
|
||||
");
|
||||
$sql->execute([
|
||||
":s" => $dayStart,
|
||||
":e" => $dayEnd
|
||||
]);
|
||||
|
||||
$results = $sql->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
echo json_encode($results);
|
||||
Reference in New Issue
Block a user