From cef01bf0ef77e1c84888057ade81540b5f01e684 Mon Sep 17 00:00:00 2001 From: JannikKoester Date: Mon, 17 Aug 2020 18:59:41 +0200 Subject: [PATCH] =?UTF-8?q?jahr=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/Footer-Dark.css | 9 +-- assets/css/Header-Dark.css | 3 +- getTables.php | 53 ++++++++-------- index.php | 125 +++++++++++++++---------------------- insertEntry.php | 121 ++++++++++++++++++++++++++++++----- required/footer.php | 1 - required/header.php | 2 +- 7 files changed, 189 insertions(+), 125 deletions(-) diff --git a/assets/css/Footer-Dark.css b/assets/css/Footer-Dark.css index 122d57f..29037de 100644 --- a/assets/css/Footer-Dark.css +++ b/assets/css/Footer-Dark.css @@ -1,18 +1,13 @@ .footer-dark { - margin-top:25px; - margin-left:-520px; + margin-left:-530px; color: #f0f9ff; background-color: #282d32; position: fixed; - height: 130px; + height: 60px; bottom: 0; width: 100%; } -.footer-dark .row { - margin-top:30px; - -} .footer-dark h3 { margin-top: 0; diff --git a/assets/css/Header-Dark.css b/assets/css/Header-Dark.css index 913cccb..577dc1e 100644 --- a/assets/css/Header-Dark.css +++ b/assets/css/Header-Dark.css @@ -7,7 +7,7 @@ body { @media (min-width:768px) { .header-dark { - padding-bottom: 120px; + } } @@ -33,6 +33,7 @@ body { .header-dark .navbar .navbar-brand:hover { color: #f0f0f0; + } .header-dark .navbar .navbar-collapse span { diff --git a/getTables.php b/getTables.php index 11c73d2..3d6d22a 100644 --- a/getTables.php +++ b/getTables.php @@ -14,6 +14,7 @@ if(isset($_POST['getTables'])) $_SESSION["month_string"] = $_POST['month']; $_SESSION["day"] = $_POST['day']; + $_SESSION["year"] = $_POST['year']; $_SESSION["day_string"] = $_POST['day']; @@ -63,126 +64,128 @@ if(isset($_POST['getTables'])) $month = $_SESSION["month"]; $day = $_SESSION["day"]; + $year = $_SESSION["year"]; - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='1'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='1'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Tisch1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Tisch1"] = "FREI"; - echo $_SESSION["Tisch1"]."
"; + //echo $_SESSION["Tisch1"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='2'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='2'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Tisch2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Tisch2"] = "FREI"; - echo $_SESSION["Tisch2"]."
"; + //echo $_SESSION["Tisch2"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='3'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='3'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { - echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch3"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch3"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; } } else { $_SESSION["Tisch3"] = "FREI"; - echo $_SESSION["Tisch3"]."
"; + //echo $_SESSION["Tisch3"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='4'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='4'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch4"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Tisch4"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Tisch4"] = "FREI"; - echo $_SESSION["Tisch4"]."
"; + // echo $_SESSION["Tisch4"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='5'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='5'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch5"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Tisch5"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Tisch5"] = "FREI"; - echo $_SESSION["Tisch5"]."
"; + //echo $_SESSION["Tisch5"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='6'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='6'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Tisch6"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Tisch6"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Tisch6"] = "FREI"; - echo $_SESSION["Tisch6"]."
"; + //echo $_SESSION["Tisch6"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='7'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='7'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Park1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Park1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Park1"] = "FREI"; - echo $_SESSION["Park1"]."
"; + // echo $_SESSION["Park1"]."
"; } - $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day' AND tisch='8'"; + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='8'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; - $_SESSION["Park2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch']); + $_SESSION["Park2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); } } else { $_SESSION["Park2"] = "FREI"; - echo $_SESSION["Park2"]."
"; + //echo $_SESSION["Park2"]."
"; } header("location:index.php?result=gotrecords"); diff --git a/index.php b/index.php index 2204f52..fde879f 100644 --- a/index.php +++ b/index.php @@ -89,11 +89,26 @@ require 'modal.php'; } + echo '
+
+ + '; echo '
- + '; for ($i = 1; $i < 32; $i++) { @@ -123,43 +138,11 @@ require 'modal.php'; echo (""); } } - - /*echo ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ echo '
-

'.$_SESSION["day_string"].'. '.$_SESSION["month_string"].'

'; +

'.$_SESSION["day_string"].'. '.$_SESSION["month_string"].' '.$_SESSION["year"].'

'; @@ -171,7 +154,22 @@ require 'modal.php'; else{ echo '
- + + '; + + echo ' +
+ '; - echo '
- - - -
+ + echo '
+ + + +
'; @@ -249,7 +226,7 @@ require 'modal.php'; { if($_GET['result'] == "gotrecords") { - if($_SESSION["Tisch3"] == "FREI") + if($_SESSION["Tisch3"] == "FREI" || $_SESSION["Tisch3"][6] != $_SESSION["year"] ) { echo ''; @@ -535,7 +512,7 @@ require 'modal.php'; text-shadow: none; padding: .5rem .8rem; transition: background-color 0.25s; - height:90px; + height:50px; width:200px; } .btnchange:hover { diff --git a/insertEntry.php b/insertEntry.php index 8f49b6a..f576bab 100644 --- a/insertEntry.php +++ b/insertEntry.php @@ -7,16 +7,27 @@ if(isset($_POST['reservierenBtnTisch1'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 1; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch1"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='1'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -28,15 +39,26 @@ else if(isset($_POST['reservierenBtnTisch2'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 2; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch2"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='2'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -48,15 +70,27 @@ else if(isset($_POST['reservierenBtnTisch3'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 3; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch3"] = array(1,2,3,4,$name); + + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='3'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch3"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -68,15 +102,26 @@ else if(isset($_POST['reservierenBtnTisch4'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 4; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch4"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='4'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch4"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -88,15 +133,26 @@ else if(isset($_POST['reservierenBtnTisch5'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 5; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch5"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='5'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch5"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -108,15 +164,26 @@ else if(isset($_POST['reservierenBtnTisch6'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 6; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Tisch erfolgreich reserviert.
'; - $_SESSION["Tisch6"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='6'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Tisch6"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -129,15 +196,26 @@ else if(isset($_POST['reservierenBtnpark1'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 7; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Parkplatz 1 erfolgreich reserviert.
'; - $_SESSION["Park1"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='7'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Park1"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { @@ -150,15 +228,26 @@ else if(isset($_POST['reservierenBtnpark2'])){ $month = $_SESSION["month"]; $day = $_SESSION["day"]; $name = $_POST['reservierterName']; + $year = $_SESSION["year"]; $table = 8; $sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch) -VALUES ('2020', '$month', '$day', '1', '$name', '$table')"; +VALUES ('$year', '$month', '$day', '1', '$name', '$table')"; if ($conn->query($sql) === TRUE) { $_SESSION["sucessmessage"] = '
Du hast den Parkplatz 2 erfolgreich reserviert.
'; - $_SESSION["Park2"] = array(1,2,3,4,$name); + $sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='4'"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + // output data of each row + while($row = $result->fetch_assoc()) { + //echo $row['uniqueid'].$row['year'].$row['month'].$row['day'].$row['reserviert'].$row['reserviertvon'].$row['tisch']."
" ; + $_SESSION["Park2"] = array($row['uniqueid'],$row['month'],$row['day'],$row['reserviert'],$row['reserviertvon'],$row['tisch'],$row['year']); + //echo $_SESSION["Tisch3"][6]; + } + } header("location:index.php?result=gotrecords"); } else { diff --git a/required/footer.php b/required/footer.php index 8ea9378..72e0de2 100644 --- a/required/footer.php +++ b/required/footer.php @@ -17,7 +17,6 @@