add new block dialog to scheduler

This commit is contained in:
Sundog Jones 2024-09-24 14:35:32 -04:00
parent 13c8b14985
commit 0cd0d860c4
1 changed files with 3 additions and 5 deletions

View File

@ -5,7 +5,7 @@
if (isset($_GET['date']) && $_GET['date'] !== "") { if (isset($_GET['date']) && $_GET['date'] !== "") {
// get info about single day's schedule // get info about single day's schedule
$query = $db->prepare("SELECT * FROM schedules s $query = $db->prepare("SELECT * FROM schedules s
LEFT JOIN schedule_blocks sb ON s.id = sb.schedule_id LEFT JOIN schedule_blocks sb ON s.day = sb.schedule_day
LEFT JOIN blocks b ON sb.block_id = b.id LEFT JOIN blocks b ON sb.block_id = b.id
WHERE s.day = :date"); WHERE s.day = :date");
$query->bindValue(":date", intval(strtotime($_GET['date']))); $query->bindValue(":date", intval(strtotime($_GET['date'])));
@ -14,11 +14,9 @@
$row = $result->fetchArray(SQLITE3_ASSOC); $row = $result->fetchArray(SQLITE3_ASSOC);
echo(json_encode($row)); echo(json_encode($row));
} }
} else if (isset($_POST['id']) && intval($_POST['id']) > 0) {
// update single schedule
} else if (isset($_POST['day']) && strtotime($_POST['day'])) { } else if (isset($_POST['day']) && strtotime($_POST['day'])) {
// add new schedule // add or update a single schedule
} else { } else {
echo("{}"); echo("{}");
} }