2020-03-09 16:49:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require "conn.php";
|
|
|
|
|
2020-03-09 18:05:36 +01:00
|
|
|
if (isset($_GET['date'])) {
|
|
|
|
$date = date("Y-m-d", strtotime($_GET['date']));
|
|
|
|
} else {
|
|
|
|
$date = date("Y-m-d"); // Create date in mysql DATE format.
|
|
|
|
}
|
2020-03-09 16:49:36 +01:00
|
|
|
|
2020-03-09 18:05:36 +01:00
|
|
|
$result = $conn->query("SELECT * FROM rooster INNER JOIN docenten ON rooster.docent = docenten.id WHERE dag = DATE('" . $date . "');");
|
2020-03-09 16:49:36 +01:00
|
|
|
|
|
|
|
if ($result->num_rows === 1) {
|
|
|
|
$rooster = [$result->fetch_assoc()];
|
|
|
|
} else {
|
|
|
|
$rooster = $result;
|
|
|
|
}
|