<?php
    echo '<table>';
    echo '<tr>';      
        foreach($data[1] as $key => $value) {
            echo '<th>' . $key . '</th>';
        }
        echo '</tr>';
    for($i=1;$i <= (sizeof($data));$i++) {
        echo '<tr>';        
        foreach($data[$i] as $key => $value) {
            echo '<td>' . $value . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
    //echo '<p>Summe: ' .$data['sum'] . '</p>';
?>
<div class="budget form large-9 medium-8 columns content">
    <?= $this->Form->create($budget) ?>
    <fieldset>
        <legend><?= __('Add Budget') ?></legend>
        <?php
            echo $this->Form->hidden('wl_schooltype_id', ['value' => '04']);
            echo $this->Form->hidden('snr', ['value' => $snr]);
            echo $this->Form->control('wl_budget_id', ['options' => $wlBudgets]);
            echo $this->Form->control('count');
            echo $this->Form->control('comment');
            echo $this->Form->hidden('year', ['value' => '2018']);
        ?>
    </fieldset>
    <?= $this->Form->button(__('Submit')) ?>
    <?= $this->Form->end() ?>
</div>