0) { dbconnect(); $menu = dbquery("SELECT titel_".$lang." AS titel FROM menu WHERE id='$id' LIMIT 1"); list($titel) = mysql_fetch_array($menu); $pagina = dbquery("SELECT content_".$lang." AS content FROM pagina WHERE id='$id' LIMIT 1"); list($content) = mysql_fetch_array($pagina); dbclose(); } else { dbconnect(); $subsubmenu = dbquery("SELECT titel_".$lang." AS titel,parent_id FROM menu WHERE id='$id' LIMIT 1"); list($subtitel,$subparent_id) = mysql_fetch_array($subsubmenu); $submenu = dbquery("SELECT parent_id FROM menu WHERE id='$subparent_id' LIMIT 1"); list($parent_id) = mysql_fetch_array($submenu); $menu = dbquery("SELECT titel_".$lang." AS titel FROM menu WHERE id='$parent_id' LIMIT 1"); list($titel) = mysql_fetch_array($menu); $projecten = dbquery("SELECT id,refnr,titel_".$lang." AS titel,shortdesc_".$lang." AS shortdesc,afbeelding,status FROM projecten WHERE cid='$id' ORDER BY status ASC, refnr ASC"); dbclose(); $titel = $titel." ".$subtitel; } ?> ".$titel."\n"; if(mysql_num_rows($result) > 0) { print $content; } else { while($row = mysql_fetch_array($projecten)) { switch($row['status']) { case 1: $project = $row['titel']; break; case 2: $project = "".$ln['project_new']." ".$row['titel']; break; case 3: $project = $row['titel'] . " ".$ln['project_sold'].""; break; } print "\n"; print " \n"; if(file_exists("projecten/".$row['id']."/".$row['afbeelding'])) print " \n"; print " \n"; print " \n"; print "
\n"; print "".$project."
\n"; print "".$ln['refnr'].": ".$row['refnr']."
\n"; print $row['shortdesc']."
\n"; print "".$ln['read_more']." >>   ".$ln['contact_us']." >>\n"; print "
\n"; print "
\n"; } } ?>