Fotos auf der Seite Willkommen\n"; } elseif ('haus' == $_GET['t']) { $path = "../img/haus/"; echo "

Fotos auf der Seite Unser Haus

\n"; } elseif ('lage' == $_GET['t']) { $path = "../img/haus/lage/"; echo "

Fotos auf der Seite Unser Haus - Lage

\n"; } elseif ('geschichte' == $_GET['t']) { $path = "../img/haus/geschichte/"; echo "

Fotos auf der Seite Unser Haus - Geschichte

\n"; } elseif ('gaby' == $_GET['t']) { $path = "../img/gaby/"; echo "

Fotos auf der Seite Wohnung Gaby

\n"; } elseif ('amelie' == $_GET['t']) { $path = "../img/amelie/"; echo "

Fotos auf der Seite Wohnung Amelie

\n"; } $ref = "index.php?section=fotos&t=".$_GET['t']; if (!isset($_GET['action'])) { echo "

Auf ein vorhandenes Bild klicken um es zu löschen
"; echo "Auf einen Platzhalter klicken um ein neues Bild hochzuladen

"; for ($i=0; $i<10; $i++) { $pic = $path.$i.".jpg"; if (file_exists($pic)) { $link = $ref."&action=del&pic=".$i; echo ""; echo ""; echo "\n"; } else { $link = $ref."&action=add&pic=".$i; echo ""; echo ""; echo "\n"; } } } else { if ('del' == $_GET['action']) { $delfile = $path . $_GET['pic'] . ".jpg"; if (unlink($delfile)) { echo "

Bild gelöscht

"; } else { echo "

Fehler beim Löschen

"; } echo "Zurück zur Übersicht\n"; } elseif ('add' == $_GET['action']) { $ref .= "&action=speichern&pic=".$_GET['pic'] ?>

$width) { $newheight=480; $newwidth=($width/$height)*480; } else { $newwidth=480; $newheight=($height/$width)*480; } $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = $path . $_GET['pic'] . ".jpg"; imagejpeg($tmp,$filename,80); imagedestroy($src); imagedestroy($tmp); unlink($path. $_FILES['Foto']['name']); echo "

Bild hochgeladen

"; echo "Zurück zur Übersicht\n"; } }