Einchecken des Online-Codes

This commit is contained in:
2017-05-07 14:37:49 +00:00
parent 9c1d71cea6
commit 85cc95c574
635 changed files with 76260 additions and 0 deletions

110
admin/inhalte/8er.php Normal file
View File

@@ -0,0 +1,110 @@
<?php
$path = "../img/objekte/";
$tmp_path = "../img/temp/";
$ref = "index.php?section=objekte&t=fotos&o=".$_GET['o'];
if ( !isset ( $_SESSION['ID'] ) )
{
}
else
{
echo "<h1>Bildergalerie zu Objekt-Nummer ".$_GET['o']."</h1>\n";
if ( isset ( $_POST['Speichern'] ) AND 'Speichern' == $_POST['Speichern'] )
{
$uploadfile = $path. $_FILES['Foto']['name'];
move_uploaded_file ( $_FILES['Foto']['tmp_name'], $uploadfile );
$src = imagecreatefromjpeg ( $uploadfile );
list( $width, $height ) = getimagesize ( $uploadfile );
if ( $height > $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['o'] . "_" . $_POST['pic'] . ".jpg";
imagejpeg ( $tmp, $filename, 80);
imagedestroy ( $src );
imagedestroy ( $tmp );
unlink ( $path. $_FILES['Foto']['name'] );
echo "<h2 class=\"hinweis\">Das Bild wurde hochgeladen und gespeichert!</h2>\n";
}
if ( !isset ( $_GET['action'] ) OR "add" != $_GET['action'])
{
if ( isset ( $_GET['action'] ) AND 'del' == $_GET['action'])
{
$delfile = $path . $_GET['o'] . "_" . $_GET['pic'] . ".jpg";
if (unlink($delfile))
{
echo "<h2 class=\"hinweis\">Bild wurde gelöscht!</h2>";
}
else
{
echo "<h2 class=\"hinweis\">Fehler beim Löschen des Bildes!</h2>";
}
}
echo "<h2 class=\"hinweis\">Achtung: Beim Löschen gibt es keine weitere Abfrage mehr!</h2>\n";
echo "<p>Auf das rote X klicken um ein Bild zu löschen.<br />";
echo "Auf einen Platzhalter klicken um ein neues Bild hochzuladen.</p>\n";
echo "<ul id=\"sortable\">\n";
for ($i=1; $i<11; $i++)
{
echo " <li id=\"element_" . $i . "\" class=\"ui-state-default\">\n";
$pic = $path.$_GET['o']."_".$i.".jpg";
if (file_exists($pic))
{
$link = $ref."&action=del&pic=".$i;
echo "<img style=\"margin:0px;border:1px solid gray;float:left;\" src=\"$pic?ts=" . date ( 'YmdHis' ) . "\" width=\"100px\" height=\"100px\"/>";
echo "<a href=\"$link\">";
echo "<img width=\"20\" height=\"20\" style=\"margin: 0px;border: 2px solid red;\" src=\"../img/no.jpg\" />";
echo "</a>\n";
}
else
{
$link = $ref."&action=add&pic=".$i;
echo "<a href=\"$link\">";
echo "<img style=\"margin:0px; border:1px solid gray;\" src=\"../img/no_img.gif\" />";
echo "</a>\n";
}
echo " </li>\n";
}
echo "</ul>\n";
?>
<script>
$(function() {
$("#sortable").sortable({
update: function() {
var test = $("#sortable").sortable("serialize", { attribute: 'id' } );
document.FBesch.sorting.value = test;
}
});
});
</script>
<?php
echo "<br style=\"clear:both;\"/>";
echo "<form name=\"FBesch\" action=\"index.php?section=objekte&t=FBesch\" method=\"post\" >\n";
echo " <input type=\"hidden\" name=\"OBJ\" value=\"".$_GET['o']."\" />\n";
echo " <input type=\"hidden\" name=\"sorting\" value=\"\" />\n";
echo " <input class=\"lang\" type=\"submit\" name=\"FBesch\" value=\"Weiter zu den Bild-Beschreibungen\" />\n";
echo "</form>\n";
}
elseif ('add' == $_GET['action']) {
$timestamp = time();
$timestamp .= rand();
echo "<form action=\"".$ref."\" method=\"post\" enctype=\"multipart/form-data\">\n";
echo " <label>Foto ausw&auml;hlen</label>\n";
echo " <input type=\"file\" name=\"Foto\" />\n";
echo " <input type=\"hidden\" name=\"egal\" value=\"".$timestamp."\" />\n";
echo " <input type=\"hidden\" name=\"pic\" value=\"".$_GET['pic']."\" />\n";
echo " <img src=\"../img/help.gif\" title=\"Es kann immer nur ein Bild ausgewählt werden!\" />\n";
echo " <br />\n";
echo " <input type=\"submit\" name=\"Speichern\" value=\"Speichern\" />\n";
echo "</form>\n";
}
}
?>