<?php

//debug($list);

foreach ($list as $exams) {
    //debug($exams);
    echo '<h1>' . $exams->title . '</h1>';
    echo $this->Html->link('Anzeigen',array('controller' => 'departments', 'action' => 'listDep/'.$exams->id));
    echo $this->Form->create('input', ['type' => 'file','url' => ['controller' => 'Imports', 'action' => 'list_imports']]);
    echo $this->Form->hidden('examination_id',['value'=>$exams->id]);
    echo '<table>';
    foreach ($exams->imports as $item) {
        //debug($item->filename);
        echo '<tr>';
        
        echo '<td>' . $item->title . '</td>';
        echo '<td>' . $this->Form->input('files.file-'.$item->id.'.filename' ,['value' => $item->filename, 'label' => 'Filename']) . '</td>';
        echo '<td>' . $this->Form->input('files.file-'.$item->id.'.csv', ['type' => 'file']) . '</td>';
        echo '</tr>';
    }
    echo '</table>';
    echo $this->Form->button(__('Submit'));
    echo $this->Form->end();
    
}
?>

