setTitle('Drzwi przeciwpożarowe'); $tpl -> assign('foto_class', 'foto_glowna'); $items = new dataDao; $data = $items -> select(1, '1 OR d.type = 2 OR d.type = 0 OR d.type = 4'); $current = ''; $images = array(); foreach($data as $id => $item) { if($item['depth'] == 0) { unset($data[$id]); continue; } if($item['type'] == 4) { if($current == 'IDX') { $images[] = $item; } unset($data[$id]); continue; } if($item['depth'] == 1) { $data[$id]['general'] = 1; } if($item['depth'] == @$data[$id+1]['depth']) { $data[$id]['leaf'] = 1; } if($item['depth'] < @$data[$id+1]['depth']) { $data[$id]['opening'] = 1; } if($item['depth'] > @$data[$id+1]['depth']) { $data[$id]['closing'] = 1; } switch($item['id']) { case 2: $current = 'ppoz.html'; break; case 3: $current = 'alu.html'; break; case 4: $current = 'stal.html'; break; case 5: $current = 'IDX'; unset($data[$id]); break; } $data[$id]['link'] = $current; } $tpl -> assign('data', $data); $view -> setImages($images); $view -> setTemplate('index.tpl'); } // end display(); } $main -> start(new IndexAction); ?>