start of schedules api endpoint
This commit is contained in:
parent
5ecb9b4944
commit
66ac62f6da
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$db = new SQLite3('netv-mam.sqlite');
|
||||||
|
|
||||||
|
if (isset($_GET['date']) && $_GET['date'] !== "") {
|
||||||
|
// get info about single day's schedule
|
||||||
|
$query = $db->prepare("SELECT * FROM schedules WHERE date = :date");
|
||||||
|
$query->bindValue(":date", intval($_GET['date']));
|
||||||
|
$result = $query->execute();
|
||||||
|
if ($result) {
|
||||||
|
$row = $result->fetchArray(SQLITE3_ASSOC);
|
||||||
|
echo(json_encode($row));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo("{}");
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in New Issue