<?php
$img_id = $_GET['img_id'];
$page = $_GET['img_id'];
$gallery_id = $_GET['gallery_id'];
$abfrage = "SELECT * FROM gallery WHERE gallery_id = '$gallery_id' AND gallery_activ = '1'";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
{
$gallery_id = $row->gallery_id;
$gallery_src = $row->gallery_src;
$gallery_date = $row->gallery_date;
$gallery_titel = $row->gallery_titel;
if ($gallery_titel != "") {$gallery_titel = ", <i>$gallery_titel</i>";}
$result = mysql_query("SELECT img_id FROM gala_$gallery_src");
$menge = mysql_num_rows($result);
echo "<center><b>$gallery_date</b>$gallery_titel<br><br><br><br>";
$abfrage2 = "SELECT * FROM gala_$gallery_src WHERE img_id = $img_id";
$ergebnis2 = mysql_query($abfrage2);
while($row2 = mysql_fetch_object($ergebnis2))
{
$img_id = $row2->img_id;
$img_src = $row2->img_src;
if($img_id <="12") {$img_page="1";}
else {if($img_id <="24") {$img_page="2";}
else {if($img_id <="36") {$img_page="3";}
else {if($img_id <="48") {$img_page="4";}
else {if($img_id <="60") {$img_page="5";}
else {if($img_id <="72") {$img_page="6";}
else {if($img_id <="84") {$img_page="7";}
else {if($img_id <="96") {$img_page="8";}
else {if($img_id <="108") {$img_page="9";}
else {if($img_id <="120") {$img_page="10";}
else {if($img_id <="132") {$img_page="11";}
else {if($img_id <="144") {$img_page="12";}
else {if($img_id <="156") {$img_page="13";}
else {if($img_id <="168") {$img_page="14";}
else {if($img_id <="180") {$img_page="15";}
else {if($img_id <="192") {$img_page="16";}
else {if($img_id <="204") {$img_page="17";}
else {if($img_id <="216") {$img_page="18";}
else {if($img_id <="228") {$img_page="19";}
else {if($img_id <="240") {$img_page="20";}}}}}}}}}}}}}}}}}}}}
if($img_id == "1") {$r_1 = $menge;} else {$r_1 = $img_id-1;}
if($img_id == $menge) {$f_1 = "1";} else {$f_1 = $img_id+1;}
echo "<table width=\"700px\" align=\"center\" border=\"0\">";
echo "<tr><td align=\"center\"><a href=\"?class=gallery§ion=main_img&gallery_id=$gallery_id&img_id=$r_1#image\"><</a> Bild $img_id von $menge <a href=\"?class=gallery§ion=main_img&gallery_id=$gallery_id&img_id=$f_1#image\">></a></td></tr></table>";
echo "<table width=\"700px\" align=\"center\" border=\"0\">";
echo "<tr><td align=\"center\"><a href=\"?class=gallery§ion=main_img&gallery_id=$gallery_id&img_id=$f_1#image\"><a name=\"image\" id=\"image\"></a><img src=\"././img/gal/$gallery_src/$img_src\" border=\"0\"></a></td></tr></table>";
echo "<center><a href=\"?class=gallery§ion=main_thb&gallery_id=$gallery_id&img_page=$img_page\">zu den Vorschaubildern</a></center>";
}
}
?>