<?php

$results_array = json_decode(json_encode($results), true);
$anzahl = sizeof($results_array);

//debug($results_array);die;

echo $this->Html->link('Export CSV',['controller' => 'budget', 'action' => 'export-csv']) . ' ';
echo $this->Html->link('Import CSV',['controller' => 'budget', 'action' => 'import-csv']);

echo '<table>';
for($i = 0;$i < $anzahl/2;$i++) {
    $l = $results_array[$i*2];
    $r = $results_array[$i*2+1];
    echo '<tr>
            <td>' . $this->Html->link($l['dst_schluessel'] . ' ' .  $l['dst_name'],['controller' => 'budget', 'action' => 'readAsd',$l['dst_schluessel'] ]) . '</td>
            <td>' . $this->Html->link($r['dst_schluessel'] . ' ' .  $r['dst_name'],['controller' => 'budget', 'action' => 'readAsd',$r['dst_schluessel'] ]) . '</td>
        </tr>'; 
    //debug($results);
}
echo '</table>';

?>