Move accessible files to public folders and adjust paths.

This commit is contained in:
2023-12-29 13:34:49 +01:00
parent e090fdc63d
commit 73073186c0
65 changed files with 202 additions and 450 deletions

View File

@@ -1,110 +0,0 @@
html {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
body {
width: 960px;
margin: 20px;
}
label {
width: 150px;
display: block;
float: left;
}
input {
width: 250px;
display: block;
float: left;
}
form br {
clear: left;
}
#preise input {
width: 50px;
text-align: right;
margin-right: 5px;
}
#root {
position: absolute;
border: 1px solid #ccc;
}
#header {
height: 40px;
width: 960px;
background-color: #ccc;
}
#header ul {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}
#header li {
float: left;
}
#header li a {
height: 38px;
line-height: 38px;
width: 158px;
display: block;
border: 1px solid #000;
font-size: 14px;
font-weight: bold;
color: #00f;
text-decoration: none;
}
#links {
position: relative;
width: 160px;
height: 600px;
left: 0;
float: left;
background-color: #ccc;
}
#links ul {
font-size: 14px;
text-align: center;
margin: 20px 0;
padding: 0;
list-style-type: none;
}
#links ul li ul li {
height: 30px;
line-height: 30px;
}
#links ul li ul {
border: 1px solid #000;
}
#links li a {
width: 158px;
display: block;
border-top: 1px solid #000;
font-size: 14px;
font-weight: bold;
color: #00f;
text-decoration: none;
}
#inhalt {
position: relative;
width: 780px;
right: 10px;
top: 10px;
height: 580px;
float: right;
}

View File

@@ -13,6 +13,4 @@ if (!isset($_GET['t'])) {
} else {
include "inhalte/fotos/standard.php";
}
}
?>
}

View File

@@ -1,6 +1,6 @@
<ul>
<li><a href="index.php?section=fotos">Fotos</a></li>
<li><a href="index.php?section=angebote">Datenschutzerklärung</a></li>
<li><a href="index.php?section=angebote">Angebote</a></li>
<li><a href="index.php?section=gb">Gästebuch</a></li>
<li><a href="index.php?section=kal">Kalender</a></li>
<li><a href="index.php?section=preise">Preise</a></li>

View File

@@ -1,4 +0,0 @@
<?php
include "funktionen.php";
include "variablen.php";
include "konstanten.php";

View File

@@ -1,6 +0,0 @@
<?php
// Die Datei inc/funktionen.php

View File

@@ -1,6 +0,0 @@
<?php
// konstanten.php
const MYSQL_HOST = 'localhost';
const MYSQL_USER = 'web104';
const MYSQL_PASS = 'lmaa,dw.';
const MYSQL_DATABASE = 'usr_web104_1';

View File

@@ -1,18 +0,0 @@
<?php
// Die Leeren Arrays erzeugen
$dateien = array();
$links = array();
// Das Array f<>r die Inhaltsseite mit den entsprechenden Dateien f<>llen
$dateien['fotos'] = "fotos.php";
$dateien['angebote'] = "angebote.php";
$dateien['gb'] = "gb.php";
$dateien['kal'] = "kal.php";
$dateien['preise'] = "preise.php";
$dateien['will'] = "will.php";
// Das Array f<>r die linke Navigation mit den entsprechenden Dateien f<>llen
$links['fotos'] = "links/fotos.php";
$links['kal'] = "links/kal.php";
$links['preise'] = "links/preise.php";

View File

@@ -1,33 +0,0 @@
<?php
error_reporting(E_ALL);
include "inc/config.php"; // die Konfigurationsdateien lesen
// Verbindung zu MySQL Aufbauen
$db = @new MySQLi(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DATABASE);
if (mysqli_connect_errno()) {
die('Konnte keine Verbindung zu Datenbank aufbauen, MySQL meldete: ' . mysqli_connect_error());
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n";
echo " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
echo "<html>\n";
echo " <head>\n";
echo " <title>Administrationsbereich Ferienhaus - Wille</title>\n";
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"css/page.css\" />\n";
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />\n";
echo " </head>\n";
echo " <body>\n";
echo " <div id=\"root\">\n";
echo " <div id=\"header\">\n"; // Oben der Header
include "header.php";
echo " </div>\n";
echo " <div id=\"links\">\n"; // Navigation links
include "links.php";
echo " </div>\n";
echo " <div id=\"inhalt\">\n"; // In der Mitte der Inhalt
include "inhalt.php";
echo " </div>\n";
echo " </div>\n";
echo " </body>\n";
echo "</html>\n";

View File

@@ -1,6 +1,6 @@
<?php
if (isset($_GET['section']) and isset($dateien[$_GET['section']])) {
include $dateien[$_GET['section']];
if (isset($_GET['section']) and isset($admin[$_GET['section']])) {
include $admin[$_GET['section']];
} else {
include $dateien['will'];
}
include $admin['will'];
}

View File

@@ -14,6 +14,4 @@ if ($result2) {
} else {
echo "Fehler beim Löschen";
}
echo '<a href="index.php?section=angebote">Zurück zur Übersicht</a>';
echo '<a href="index.php?section=angebote">Zurück zur Übersicht</a>';

View File

@@ -81,7 +81,6 @@ if (!isset($_POST['Speichern'])) {
if (!$stmt2->execute()) {
die ('Query konnte nicht ausgef<65>hrt werden: ' . $stmt->error);
}
echo "Der Eintrag wurde ge<EFBFBD>ndert<br />";
echo '<a href="index.php?section=angebote">Zur<EFBFBD>ck zur <EFBFBD>bersicht</a>';
}
?>
echo "Der Eintrag wurde geändert<br />";
echo '<a href="index.php?section=angebote">Zurück zur Übersicht</a>';
}

View File

@@ -100,7 +100,6 @@ if (!isset($_POST['Speichern'])) {
imagedestroy($tmp);
unlink($uploaddir . $_FILES['Foto']['name']);
}
echo '<a href="index.php?section=angebote">Zur<EFBFBD>ck zur <EFBFBD>bersicht</a>';
echo '<a href="index.php?section=angebote">ZurÜck zur übersicht</a>';
}
?>
}

View File

@@ -1,22 +1,24 @@
<?php
$imgPath = __DIR__ . '/../../../public/img';
if ('will' == $_GET['t']) {
$path = "../img/will/";
$path = $imgPath . '/will/';
echo "<h2>Fotos auf der Seite Willkommen</h2>\n";
} elseif ('haus' == $_GET['t']) {
$path = "../img/haus/";
$path = $imgPath . '/haus/';
echo "<h2>Fotos auf der Seite Unser Haus</h2>\n";
} elseif ('lage' == $_GET['t']) {
$path = "../img/haus/lage/";
$path = $imgPath . '/haus/lage/';
echo "<h2>Fotos auf der Seite Unser Haus - Lage</h2>\n";
} elseif ('geschichte' == $_GET['t']) {
$path = "../img/haus/geschichte/";
$path = $imgPath . '/haus/geschichte/';
echo "<h2>Fotos auf der Seite Unser Haus - Geschichte</h2>\n";
} elseif ('gaby' == $_GET['t']) {
$path = "../img/gaby/";
$path = $imgPath . '/gaby/';
echo "<h2>Fotos auf der Seite Wohnung Gaby</h2>\n";
} elseif ('amelie' == $_GET['t']) {
$path = "../img/amelie/";
$path = $imgPath . '/amelie/';
echo "<h2>Fotos auf der Seite Wohnung Amelie</h2>\n";
} else {
die();
@@ -32,7 +34,7 @@ if (!isset($_GET['action'])) {
if (file_exists($pic)) {
$link = $ref . "&action=del&pic=" . $i;
echo "<a href=\"$link\">";
echo "<img style=\"margin: 20px 20px 20px 20px; border: 2px solid red;\" src=\"$pic\" width=\"100px\" height=\"100px\"/>";
echo "<img style=\"margin: 20px 20px 20px 20px; border: 2px solid red;\" src=\"" . str_replace(__DIR__ . '/../../../public', '', $pic) . "\" width=\"100px\" height=\"100px\"/>";
} else {
$link = $ref . "&action=add&pic=" . $i;
echo "<a href=\"$link\">";

View File

@@ -3,12 +3,11 @@
<?php
if (isset($_POST['add'])) {
include "inhalte/fotos/bilder/add.php";
include __DIR__ . '/bilder/add.php';
} elseif (isset($_POST['edit'])) {
include "inhalte/fotos/bilder/edit.php";
include __DIR__ . '/bilder/edit.php';
} elseif (isset($_POST['del'])) {
include "inhalte/fotos/bilder/del.php";
include __DIR__ . '/bilder/del.php';
} else {
include "inhalte/fotos/bilder/standard.php";
}
?>
include __DIR__ . '/bilder/standard.php';
}

View File

@@ -33,9 +33,9 @@ if (!isset($_POST['Speichern'])) {
$last = $result2->fetch_assoc();
$id = $last['last_insert_id()'];
$uploaddir = '../img/umgebung/bilder/';
$uploaddir = __DIR__ . '/../../../../public/img/umgebung/bilder/';
$uploadfile = $uploaddir . $_FILES['Foto']['name'];
move_uploaded_file($_FILES['Foto']['tmp_name'], $uploadfile);
$test = move_uploaded_file($_FILES['Foto']['tmp_name'], $uploadfile);
$src = imagecreatefromjpeg($uploadfile);
list($width, $height) = getimagesize($uploadfile);
if ($height > $width) {
@@ -55,4 +55,3 @@ if (!isset($_POST['Speichern'])) {
}
echo '<a href="index.php?section=fotos&t=bilder">Zurück zur Übersicht</a>';
}
?>

View File

@@ -32,6 +32,4 @@ if (!isset($_POST['Speichern'])) {
echo "Fehler beim L<>schen";
}
echo '<a href="index.php?section=fotos&t=bilder">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -33,5 +33,4 @@ if (!isset($_POST['Speichern'])) {
}
echo "Die Überschrift wurde gespeichert<br />";
echo '<a href="index.php?section=fotos&t=bilder">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -60,5 +60,4 @@ if (!isset($_GET['action'])) {
echo "<p>Bild hochgeladen</p>";
echo "<a href=\"index.php?section=fotos&t=$_GET[t]\">Zurück zur Übersicht</a>\n";
}
}
?>
}

View File

@@ -14,6 +14,4 @@ if ($result2) {
} else {
echo "Fehler beim L<>schen";
}
echo '<a href="index.php?section=gb">Zurück zur Übersicht</a>';
echo '<a href="index.php?section=gb">Zurück zur Übersicht</a>';

View File

@@ -41,5 +41,4 @@ if (!isset($_POST['Speichern'])) {
}
echo "Der Eintrag wurde geändert<br />";
echo '<a href="index.php?section=gb">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -62,5 +62,4 @@ if (!isset($_POST['Speichern'])) {
unlink($uploaddir . $_FILES['Foto']['name']);
}
echo '<a href="index.php?section=gb">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -5,15 +5,13 @@ $table = "Kal_Amelie";
$ref = "index.php?section=kal&t=amelie";
if (isset($_POST['add'])) {
include "inhalte/kal/belegung/add.php";
include __DIR__ . '/belegung/add.php';
} elseif (isset($_POST['edit'])) {
include "inhalte/kal/belegung/edit.php";
include __DIR__ . '/belegung/edit.php';
} elseif (isset($_POST['del'])) {
include "inhalte/kal/belegung/del.php";
include __DIR__ . '/belegung/del.php';
} elseif (isset($_POST['view'])) {
include "inhalte/kal/belegung/view.php";
include __DIR__ . '/belegung/view.php';
} else {
include "inhalte/kal/belegung/standard.php";
}
?>
include __DIR__ . '/belegung/standard.php';
}

View File

@@ -30,6 +30,4 @@ if (!isset($_POST['Speichern'])) {
}
echo '<a href="' . $ref . '">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -7,6 +7,4 @@ if ($result2) {
} else {
echo "Fehler beim L<>schen";
}
echo '<a href="' . $ref . '">Zurück zur Übersicht</a>';
echo '<a href="' . $ref . '">Zurück zur Übersicht</a>';

View File

@@ -5,7 +5,6 @@ $sql1 = 'SELECT * FROM ' . $table . ' WHERE ID = "' . $_POST['Titel'] . '";';
$result1 = $db->query($sql1);
$nt1 = $result1->fetch_assoc();
if (!isset($_POST['Speichern'])) {
var_dump($_POST);
echo "<br />";
?>
@@ -36,6 +35,4 @@ if (!isset($_POST['Speichern'])) {
}
echo '<a href="' . $ref . '">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -5,15 +5,13 @@ $table = "Kal_Gaby";
$ref = "index.php?section=kal&t=gaby";
if (isset($_POST['add'])) {
include "inhalte/kal/belegung/add.php";
include __DIR__ . '/belegung/add.php';
} elseif (isset($_POST['edit'])) {
include "inhalte/kal/belegung/edit.php";
include __DIR__ . '/belegung/edit.php';
} elseif (isset($_POST['del'])) {
include "inhalte/kal/belegung/del.php";
include __DIR__ . '/belegung/del.php';
} elseif (isset($_POST['view'])) {
include "inhalte/kal/belegung/view.php";
include __DIR__ . '/belegung/view.php';
} else {
include "inhalte/kal/belegung/standard.php";
}
?>
include __DIR__ . '/belegung/standard.php';
}

View File

@@ -1,12 +1,12 @@
<?php
if (isset($_POST['add'])) {
include "inhalte/kal/saison/add.php";
include __DIR__ . '/saison/add.php';
} elseif (isset($_POST['edit'])) {
include "inhalte/kal/saison/edit.php";
include __DIR__ . '/saison/edit.php';
} elseif (isset($_POST['del'])) {
include "inhalte/kal/saison/del.php";
include __DIR__ . '/saison/del.php';
} else {
include "inhalte/kal/saison/standard.php";
include __DIR__ . '/saison/standard.php';
}

View File

@@ -37,6 +37,4 @@ if (!isset($_POST['Speichern'])) {
die ('Query konnte nicht ausgeführt werden: ' . $stmt1->error);
}
echo '<a href="index.php?section=kal&t=saison">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -7,6 +7,4 @@ if ($result2) {
} else {
echo "Fehler beim L<>schen";
}
echo '<a href="index.php?section=kal&t=saison">Zurück zur Übersicht</a>';
echo '<a href="index.php?section=kal&t=saison">Zurück zur Übersicht</a>';

View File

@@ -45,6 +45,4 @@ if (!isset($_POST['Speichern'])) {
die ('Query konnte nicht ausgeführt werden: ' . $stmt1->error);
}
echo '<a href="index.php?section=kal&t=saison">Zurück zur übersicht</a>';
}
?>
}

View File

@@ -51,5 +51,4 @@ if (!isset($_POST['Speichern'])) {
}
echo "Der Eintrag wurde geändert<br />";
echo '<a href="index.php?section=preise">Zurück zur Übersicht</a>';
}
?>
}

View File

@@ -2,16 +2,15 @@
<?php
if (!isset($_GET['t'])) {
include "inhalte/kal/standard.php";
include __DIR__ . '/inhalte/kal/standard.php';
} else {
if ('saison' == $_GET['t']) {
include "inhalte/kal/saison.php";
include __DIR__ . '/inhalte/kal/saison.php';
} elseif ('gaby' == $_GET['t']) {
include "inhalte/kal/gaby.php";
include __DIR__ . '/inhalte/kal/gaby.php';
} elseif ('amelie' == $_GET['t']) {
include "inhalte/kal/amelie.php";
include __DIR__ . '/inhalte/kal/amelie.php';
} else {
include "inhalte/kal/standard.php";
include __DIR__ . '/inhalte/kal/standard.php.php';
}
}
}