query("SELECT * FROM fahrzeuge WHERE aktiv>0 and besitz<3 and hudate>1 ORDER BY kz"); while($row = $tempcar1->fetch_assoc()) { $temptime=time(); $temptime=$temptime+2678400; if($row['hudate']<=time()) { $anzeige=1; $hudata[$key]['typ']=1; $hudata[$key]['kz']=$row['kz']; $hudata[$key]['hudate']=$row['hudate']; $key++; } elseif($row['hudate']<=$temptime) { $anzeige=1; $hudata[$key]['typ']=2; $hudata[$key]['kz']=$row['kz']; $hudata[$key]['hudate']=$row['hudate']; $key++; } } $template->assign('anzeige', $anzeige); $template->assign('hudata', $hudata); $template->assign('content', 'tpl/ajax/huau.tpl'); ?>