';
foreach ($a['bestellung'] as $best) {
// Evtl. Mehrere Posten in dieser Bestellung
$content .= '
';
$obst = array();
foreach ($best['gitterbox'] as $gb) {
$img = '
';
if ($gb['id']) {
$img .= 'GB #'.$gb['id'];
} else {
$img .= 'Gitterbox';
}
$obst[] = '
'.$img.'';
}
foreach ($best['anhaenger'] as $anh) {
$img = '
';
if (isset($anh['kennz'])) {
$img .= '
'.$anh['kennz'].' ';
} else {
$img .= '
Anhänger';
}
$obst[] = '
'.$img.'';
}
foreach ($obst as $key => $val) {
$obst[$key] = '
'.$val.'
';
}
$content .= '
';
$content .= '
';
$val = 0;
if (isset($best['obstmenge'])) {
$val = $best['obstmenge'];
}
$content .= '
';
foreach (array(50, 100, 150, 200, 250, 300, 350, 400) as $v) {
$v = max((count($best['gitterbox'])-1),0) * 400 + $v;
$content .= '
';
}
$content .= '
';
// Gebrauchte
$sel = 'gebrauchte_nein';
if ($best['gebrauchte']) {
$sel = 'gebrauchte_ja';
}
$content .= '
';
// Neue
$content .= '
';
$neue = array("3er" => '', "5er" => '', "10er" => '');
foreach ($neue as $key => $val) {
$val = '';
if (isset($best['neue'][$key])) {
$val = $best['neue'][$key];
}
$neue[] = '
Neue '.$key.':
';
}
if (isset($best['neue']['sonstiges'])) {
$neue[] = '
'.$best['neue']['sonstiges'].'';
}
$content .= '
'.implode('', $neue).'
';
$content .= '
';
$content .= '
';
$content .= '
';
if (count($a['bestellung']) > 1) {
$content .= '
';
}
$content .= '