19 lines
423 B
PHP
19 lines
423 B
PHP
|
<?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("{}");
|
||
|
}
|
||
|
|
||
|
?>
|