query($select); } // Query getTheNews(DB $db); function getTheNews($db, $news_id){ $select = sprintf("SELECT * FROM news WHERE news_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto1(DB $db); function getFoto1($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_1_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto2(DB $db); function getFoto2($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_2_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto3(DB $db); function getFoto3($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_3_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto4(DB $db); function getFoto4($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_4_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto5(DB $db); function getFoto5($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_5_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getFoto6(DB $db); function getFoto6($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_foto_6_mini WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } // Query getPlanimetria(DB $db); function getPlanimetria($db, $news_id){ $select = sprintf("SELECT ref_id FROM news_planimetria WHERE ref_id ='$news_id'"); //printf("%s", $select); return $db->query($select); } switch($action){ case "news": $news = getNews($db); include "news.php"; break; case "thenews": $thenews = getTheNews($db, $news_id); $foto1 = getFoto1($db, $news_id); $foto2 = getFoto2($db, $news_id); $foto3 = getFoto3($db, $news_id); $foto4 = getFoto4($db, $news_id); $foto5 = getFoto5($db, $news_id); $foto6 = getFoto6($db, $news_id); $planimetria = getPlanimetria($db, $news_id); include "thenews.php"; break; } ?>