require("../includes/config.inc.php");
if($_GET['main'] == "submit") {
include("./suggest.php");
exit;
}
if($_GET['main'] == "newsletter") {
include("./newsletter.php");
exit;
}
$res2 = mysql_query("SELECT * FROM Categories WHERE DirName = '".mysql_real_escape_string($_GET['main'])."' AND Type = 'Main'");
$rij2 = mysql_fetch_object($res2);
$main_name = $rij2->Name;
$main_id = $rij2->CategoryID;
$content = "
| " . file_get_contents("./adsense_code2.php") ." |
";
$sublinks = "";
$res3 = mysql_query("SELECT * FROM Categories WHERE CategoryLink = '$main_id' AND Type = 'SubCat' ORDER BY Name ASC");
$ant3 = mysql_num_rows($res3);
$tlr3 = 0;
while($tlr3 < $ant3) {
$tlr3++;
$rij3 = mysql_fetch_object($res3);
$name = $rij3->Name;
$dirname = $rij3->DirName;
$cat_id = $rij3->CategoryID;
if(file_exists("./images/flags/$dirname.gif")) {
$content = $content . " | $name |
|
";
}
else {
$content = $content . " | $name |
|
";
}
$sublinks = $sublinks . "$name - ";
$res4 = mysql_query("SELECT * FROM Objects WHERE CategoryLink = '$cat_id' ORDER BY AVRrate DESC LIMIT 10");
$ant4 = mysql_num_rows($res4);
$tlr4 = 0;
$tips = "";
while($tlr4 < $ant4) {
$tlr4++;
$rij4 = mysql_fetch_object($res4);
$ttitle = $rij4->Title;
$filename = $rij4->FileName;
$tips = $tips . "" . $ttitle . ", ";
}
$res5 = mysql_query("SELECT * FROM Objects WHERE CategoryLink = '$cat_id' ORDER BY AVRrate DESC");
$ant5 = mysql_num_rows($res5);
if($ant5 > 10) {
$tips = $tips . "all $ant5 attractions";
}
else {
$tips = $tips . "all attractions";
}
if($ant4 == 0) {
$content = $content . "No attractions available yet.
";
}
else {
$content = $content . "" . $tips . "
";
}
$content = $content . "
";
}
$titlelinks = substr($sublinks, 0, -4);
$content = substr($content, 0, -4);
$title = $main_name;
require("./template_header.php");
require("./template_content.php");
require("./template_footer.php");
exit;
?>