echo '<tr><th rel="row">' . 'Bestandstype' . '</th><td>' . $targetData['bestandsType'] . '</td></tr>';
 echo '<tr><th rel="row">' . 'Naam' . '</th><td>' . '<input type="text" name="naam" value="' . $targetData['naam'] . '">' . '</td></tr>';
 $janee = $targetData['isOpenbaar'] ? 'Ja' : 'Nee';
 echo '<tr><th rel="row">' . 'Is openbaar' . '</th><td>';
 echo '<select name="isOpenbaar">';
 if ($targetData['isOpenbaar']) {
     echo '<option value="1" selected="selected">Ja</option><option value="0">Nee</option>';
 } else {
     echo '<option value="1">Ja</option><option value="0" selected="selected">Nee</option>';
 }
 echo '</select>';
 echo '</td></tr>';
 /*
  * Iets met vakken
  */
 $vakkenActief = portfolio_get_material_subjects($targetId);
 echo '<tr><th rel="row">' . 'Vakken' . '</th><td>';
 $vakken = portfolio_get_user_subjects($targetData['eigenaarId']);
 foreach ($vakken as $r) {
     echo '<input type="checkbox" name="vak' . $r['vakId'] . '"';
     foreach ($vakkenActief as $va) {
         if ($r['vakId'] === $va['vakId']) {
             echo ' checked="checked"';
             continue;
         }
     }
     echo '>' . $r['vaknaam'] . '<br>';
 }
 echo '</td></tr>';
 echo '</table>';
 echo '<input type="submit" name="submit" value="Apply">';
 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>';
                 //vakken
                 echo '<td>';
                 for ($i = 0; $i < count($v); $i++) {
                     echo $v[$i]['vaknaam'];
                     if ($i !== count($v) - 1) {
                         echo ', ';
                     }
                 }
                 echo '</td>';
                 //cijfer
                 echo '<td>' . $n['cijfer'] . '</td>';
                 echo '</tr>';
 //Technische info eigenlijk alleen nuttig voor admin
 if (portfolio_user_is_of_type(array('admin'))) {
     echo '<tr><th rel="row">' . 'Bestandslocatie' . '</th><td>' . $matData['bestandsPad'] . '</td></tr>';
     echo '<tr><th rel="row">' . 'MIME type' . '</th><td>' . $matData['bestandsType'] . '</td></tr>';
 }
 if (portfolio_user_is_of_type(array('admin', 'slb', 'docent'))) {
     echo '<tr><th rel="row">' . 'Eigenaar' . '</th><td><a href="viewuser.php?user='******'eigenaarId'] . '">' . $eigenaar['voornaam'] . ' ' . $eigenaar['achternaam'] . ' (' . $matData['eigenaarId'] . ')' . '</a></td></tr>';
 } else {
     echo '<tr><th rel="row">' . 'Eigenaar' . '</th><td>' . $eigenaar['voornaam'] . ' ' . $eigenaar['achternaam'] . ' (' . $matData['eigenaarId'] . ')' . '</td></tr>';
 }
 $janee = $matData['isOpenbaar'] ? 'Ja' : 'Nee';
 echo '<tr><th rel="row">' . 'Openbaar' . '</th><td>' . $janee . '</td></tr>';
 /*
  * Extra tabelrij voor vakken
  */
 $vakken = portfolio_get_material_subjects($matId);
 if (count($vakken) > 0) {
     echo '<tr><th rel="row">' . 'Vakken' . '</th><td>';
     for ($i = 0; $i < count($vakken); $i++) {
         echo $vakken[$i]['vaknaam'];
         if ($i !== count($vakken) - 1) {
             echo ', ';
         }
     }
     echo '</td></tr>';
 }
 echo '</table>';
 /*
  * Cijfer
  */
 echo '<h3>Beoordeling</h3>';