<div id="container">
            <div id="header">
                <?php 
include 'inc/header.php';
?>
            </div>
            <div id="content">
            <?php 
if (isset($_SESSION['user'])) {
    //$matId = filter_input(INPUT_GET, 'material', FILTER_VALIDATE_INT);
    $subjectId = filter_input(INPUT_GET, 'subject', FILTER_VALIDATE_INT);
    if ($subjectId) {
        //Alles
        echo "<h2>Welkom " . $_SESSION['user']['voornaam'] . " " . $_SESSION['user']['achternaam'] . "</h2>";
        $subjectData = portfolio_get_subject($subjectId);
        if ($subjectData) {
            echo '<h2>Verwijder ' . $subjectData['vaknaam'] . '</h2>';
            /*
             * Checks + verwijderen van materiaal.
             */
            if (portfolio_user_is_of_type(array('admin'))) {
                $pwCorrect = false;
                $deleted = false;
                if (isset($_POST['submit']) && isset($_SESSION['user']) && $subjectId) {
                    $userId = $_SESSION['user']['gebruikersId'];
                    $userPass = filter_input(INPUT_POST, 'userPass');
                    $link = portfolio_connect();
                    if ($link) {
                        $sql = "SELECT * FROM " . TABLE_USER . " WHERE gebruikersId='" . mysqli_real_escape_string($link, $userId) . "'";
                        $result = mysqli_query($link, $sql);
include 'inc/header.php';
?>
            </div>
            <div id="content">
            <?php 
if (isset($_SESSION['user'])) {
    $targetId = filter_input(INPUT_GET, 'student', FILTER_VALIDATE_INT);
    $targetSubject = filter_input(INPUT_GET, 'subject', FILTER_VALIDATE_INT);
    if ($targetId) {
        //Alles
        echo "<h2>Welkom " . $_SESSION['user']['voornaam'] . " " . $_SESSION['user']['achternaam'] . "</h2>";
        $targetData = portfolio_get_user_details($targetId);
        if ($targetData) {
            if ($targetData['rol'] === 'student' && portfolio_user_is_of_type(array('slb', 'docent')) || portfolio_user_is_of_type(array('admin')) || $targetId == $_SESSION['user']['gebruikersId']) {
                echo '<h2>' . $targetData['voornaam'] . ' ' . $targetData['achternaam'] . '</h2>';
                $targetSubjectData = portfolio_get_subject($targetSubject);
                if ($targetSubjectData) {
                    echo '<h3>Cijfers voor vak ' . $targetSubjectData['vaknaam'] . '</h3>';
                } else {
                    echo '<h3>Cijfers</h3>';
                    $targetSubject = 0;
                }
                $notes = portfolio_get_student_notes_ext($targetId, $targetSubject);
                if (count($notes) > 0) {
                    echo '<table class="tableLeft">';
                    echo '<tr><th rel="col">naam materiaal</th><th rel="col">verbonden vakken</th><th rel="col">cijfer</th></tr>';
                    foreach ($notes as $n) {
                        $v = portfolio_get_material_subjects($n['materiaalId']);
                        echo '<tr>';
                        //naam
                        echo '<td><a href="viewmaterial.php?material=' . $n['materiaalId'] . '">' . $n['naam'] . '</a></td>';