gymrooster_php/php/dashboard.php

18 lines
469 B
PHP
Raw Permalink Normal View History

<?php
session_start();
require 'conn.php';
$result = $conn->query("SELECT * FROM docenten WHERE username = '" . $_SESSION['username'] . "';");
$docent = $result->fetch_assoc();
2020-03-09 19:09:41 +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.
}
$rooster = $conn->query("SELECT * FROM rooster WHERE docent = " . $docent['id'] . " AND dag = DATE('" . $date . "')")->fetch_assoc();