mirror of
https://github.com/JannikKoester/Tischverwaltung.git
synced 2026-01-09 14:20:08 +01:00
Compare commits
6 Commits
Jordan
...
ebc6a50f52
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc6a50f52 | ||
|
|
69bcdb1e00 | ||
|
|
0790b1d8e7 | ||
|
|
55cd862c24 | ||
|
|
6600f5f381 | ||
|
|
4ed8831781 |
2
assets/bootstrap/css/bootstrap.min.css
vendored
2
assets/bootstrap/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
|
||||
body {
|
||||
background: url(../../assets/img/mountain_bg.jpg) blue;
|
||||
background: url(../../assets/img/mountain_bg.jpg) grey;
|
||||
height:100%;
|
||||
padding-bottom: 80px;
|
||||
background-repeat:no-repeat;
|
||||
|
||||
80
functions.php
Normal file
80
functions.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
require 'settings.php';
|
||||
class Funcs
|
||||
{
|
||||
|
||||
public static function InsertDatas($conn, $ds, $de, $n, $tisch, $tnum)
|
||||
{
|
||||
$day = $_SESSION["day"];
|
||||
$month = $_SESSION["month"];
|
||||
$year = $_SESSION["year"];
|
||||
$daystart = $ds;
|
||||
$dayend = $de;
|
||||
$name = $n;
|
||||
|
||||
$besetzt = array();
|
||||
$table = $tisch;
|
||||
|
||||
for ($daystart; $daystart <= $dayend; $daystart++) {
|
||||
|
||||
$sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$daystart'AND year='$year' AND tisch='$table'";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$besetzt[$row['day']] = $row['reserviertvon'];
|
||||
//array_push($besetzt[$row['day'] = $row['reserviertvon']]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$daystart', '1', '$name', '$table')";
|
||||
$conn->query($sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$sql = "SELECT * FROM calenderplanner WHERE month='$month' AND day='$day'AND year='$year' AND tisch='$table'";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$_SESSION[$tnum] = array($row['uniqueid'], $row['month'], $row['day'], $row['reserviert'], $row['reserviertvon'], $row['tisch'], $row['year']);
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($besetzt)) {
|
||||
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den/die Tisch/e erfolgreich reserviert.</div>';
|
||||
|
||||
header("location:index.php?result=gotrecords");
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-danger">
|
||||
|
||||
Folgende Tische sind schon belegt von: <br>
|
||||
';
|
||||
|
||||
foreach ($besetzt as $key => $value)
|
||||
{
|
||||
|
||||
$_SESSION["sucessmessage"].= "Tag ".$key." belegt von: ".$value." <br>";
|
||||
}
|
||||
|
||||
$_SESSION["sucessmessage"].='</div><br>';
|
||||
$_SESSION["sucessmessage"].='<div class="alert alert-success">
|
||||
|
||||
Die freien Tische wurden belegt! <br>
|
||||
</div><br>';
|
||||
|
||||
header("location:index.php?result=gotrecords");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -493,4 +493,5 @@ if(isset($_POST['getTables']))
|
||||
|
||||
}
|
||||
//Parkplatz 2 Ende
|
||||
?>
|
||||
?>
|
||||
|
||||
|
||||
816
index.php
816
index.php
@@ -1,479 +1,339 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
if(!file_exists("settings.php"))
|
||||
{
|
||||
|
||||
header("location:install.php");
|
||||
}
|
||||
<?php
|
||||
if (!file_exists("settings.php")) {
|
||||
|
||||
header("location:install.php");
|
||||
}
|
||||
require 'required/header.php';
|
||||
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}else
|
||||
{
|
||||
session_destroy();
|
||||
session_start();
|
||||
}
|
||||
require 'settings.php';
|
||||
require 'modal.php';
|
||||
?>
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
} else {
|
||||
session_destroy();
|
||||
session_start();
|
||||
}
|
||||
require 'settings.php';
|
||||
require 'modal.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords" || $_GET['result'] == "loggedin")
|
||||
{
|
||||
$selectedjan ='';
|
||||
$selectedfeb ='';
|
||||
$selectedmar ='';
|
||||
$selectedapr ='';
|
||||
$selectedmai ='';
|
||||
$selectedjun ='';
|
||||
$selectedjul ='';
|
||||
$selectedaug ='';
|
||||
$selectedsep ='';
|
||||
$selectedokt ='';
|
||||
$selectednov ='';
|
||||
$selecteddez ='';
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords" || $_GET['result'] == "loggedin") {
|
||||
|
||||
switch($_SESSION["month_string"])
|
||||
{
|
||||
|
||||
case "Januar":
|
||||
$selectedjan ='selected';
|
||||
break;
|
||||
|
||||
case "Februar":
|
||||
$selectedfeb ='selected';
|
||||
break;
|
||||
|
||||
case "März":
|
||||
$selectedmar ='selected';
|
||||
break;
|
||||
|
||||
case "April":
|
||||
$selectedapr ='selected';
|
||||
break;
|
||||
|
||||
case "Mai":
|
||||
$selectedmai ='selected';
|
||||
break;
|
||||
|
||||
case "Juni":
|
||||
$selectedjun ='selected';
|
||||
break;
|
||||
|
||||
case "Juli":
|
||||
$selectedjul ='selected';
|
||||
break;
|
||||
|
||||
case "August":
|
||||
$selectedjaug ='selected';
|
||||
break;
|
||||
|
||||
case "September":
|
||||
$selectedsep ='selected';
|
||||
break;
|
||||
|
||||
case "Oktober":
|
||||
$selectedokt ='selected';
|
||||
break;
|
||||
|
||||
case "November":
|
||||
$selectednov ='selected';
|
||||
break;
|
||||
|
||||
case "Dezember":
|
||||
$selecteddez ='selected';
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
//DROPDOWN JAHRE
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Jahr:</label>
|
||||
<select class="form-control" name="year">';
|
||||
for ($i=2020; $i <2030 ; $i++) {
|
||||
<select class="form-control" name="year" onchange="refreshListe()">';
|
||||
for ($i = 2020; $i < 2030; $i++) {
|
||||
|
||||
if ($i == $_SESSION["year"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo '<option value ='.$i.'>'. $i.'</option>';
|
||||
}
|
||||
|
||||
}
|
||||
if ($i == $_SESSION["year"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo '<option value =' . $i . '>' . $i . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '</select>';
|
||||
echo '</select>';
|
||||
//DROPDOWN MONATE
|
||||
$monate = array('Januar','Februar','März','April','Mai','Juni','Juli','August',
|
||||
'September','Oktober','November','Dezember');
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Monat:</label>
|
||||
<select class="form-control" name="month"onchange="refreshListe()">';
|
||||
for ($i=0; $i <12 ; $i++) {
|
||||
if($monate[$i] == $_SESSION["month_string"])
|
||||
{
|
||||
echo ("<option value='$monate[$i]'selected>$monate[$i]</option>");
|
||||
}
|
||||
echo '<option value ='.$monate[$i].'>'.$monate[$i].'</option>';
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Monat:</label>
|
||||
<select class="form-control" name="month">
|
||||
<option value ="Januar"'. $selectedjan.'>Januar</option>
|
||||
<option value ="Februar"'. $selectedfeb.'>Februar</option>
|
||||
<option value ="März"'. $selectedmar.'>März</option>
|
||||
<option value ="April"'. $selectedapr.'>April</option>
|
||||
<option value ="Mai"'. $selectedmai.'>Mai</option>
|
||||
<option value ="Juni"'. $selectedjun.'>Juni</option>
|
||||
<option value ="Juli"'. $selectedjul.'>Juli</option>
|
||||
<option value ="August"'. $selectedaug.'>August</option>
|
||||
<option value ="September"'. $selectedsep.'>September</option>
|
||||
<option value ="Oktober"'. $selectedokt.'>Oktober</option>
|
||||
<option value ="November"'. $selectednov.'>November</option>
|
||||
<option value ="Dezember"'. $selecteddez.'>Dezember</option>
|
||||
</select>';
|
||||
//DROPDOWN TAGE
|
||||
|
||||
|
||||
|
||||
echo '<div class="form-group">
|
||||
echo '<div class="form-group">
|
||||
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Tag:</label>
|
||||
<select class="form-control" name="day">';
|
||||
<select class="form-control" name="day" onchange="refreshListe()">';
|
||||
|
||||
for ($i = 1; $i < 32; $i++) {
|
||||
if ($i == $_SESSION["day"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo ("<option value='$i'>$i</option>");
|
||||
}
|
||||
for ($i = 1; $i < 32; $i++) {
|
||||
if ($i == $_SESSION["day"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo ("<option value='$i'>$i</option>");
|
||||
}
|
||||
echo '</select>
|
||||
}
|
||||
echo '</select>
|
||||
</div>
|
||||
<button id="trigger" name="getTables" type="submit" class="btnchange" id="aktualisiere">Aktualisiere erneut</button>
|
||||
<button id="refresh" name="getTables" type="submit" class="btnchange"style="display:none;" >Aktualisiere erneut</button>
|
||||
</form>
|
||||
<h2 style="color:white;font-family:Bitter; text-align:center;">'.$_SESSION["day_string"].'. '.$_SESSION["month_string"].' '.$_SESSION["year"].' </h2>';
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<h2 style="color:white;font-family:Bitter; text-align:center;">' . $_SESSION["day_string"] . '. ' . $_SESSION["month_string"] . ' ' . $_SESSION["year"] . ' </h2>';
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
//DROPDOWN JAHRE
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Jahr:</label>
|
||||
<select class="form-control" name="year">';
|
||||
for ($i=2020; $i <2030 ; $i++) {
|
||||
<select class="form-control" name="year" onchange="refreshListe()">';
|
||||
for ($i = 2020; $i < 2030; $i++) {
|
||||
|
||||
if ($i == $_SESSION["year"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo '<option value ='.$i.'>'. $i.'</option>';
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1" style="color:white;font-family:Bitter;font-size:24px;">Monat:</label>
|
||||
<select class="form-control" name="month">
|
||||
<option value ="Januar">Januar</option>
|
||||
<option value ="Februar">Februar</option>
|
||||
<option value ="März">März</option>
|
||||
<option value ="April">April</option>
|
||||
<option value ="Mai">Mai</option>
|
||||
<option value ="Juni">Juni</option>
|
||||
<option value ="Juli">Juli</option>
|
||||
<option value ="August">August</option>
|
||||
<option value ="September">September</option>
|
||||
<option value ="Oktober">Oktober</option>
|
||||
<option value ="November">November</option>
|
||||
<option value ="Dezember">Dezember</option>
|
||||
</select>';
|
||||
|
||||
echo '<div class="form-group">
|
||||
if ($i == $_SESSION["year"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo '<option value =' . $i . '>' . $i . '</option>';
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
//DROPDOWN MONATE
|
||||
$monate = array('Januar','Februar','März','April','Mai','Juni','Juli','August',
|
||||
'September','Oktober','November','Dezember');
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Monat:</label>
|
||||
<select class="form-control" name="month"onchange="refreshListe()">';
|
||||
for ($i=0; $i <12 ; $i++) {
|
||||
if($monate[$i] == $_SESSION["month_string"])
|
||||
{
|
||||
echo ("<option value='$monate[$i]'selected>$monate[$i]</option>");
|
||||
}
|
||||
echo '<option value ='.$monate[$i].'>'.$monate[$i].'</option>';
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
//DROPDOWN JAHRE
|
||||
echo '<div class="form-group">
|
||||
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Tag:</label>
|
||||
<select class="form-control" name="day">';
|
||||
|
||||
for ($i = 1; $i < 32; $i++) {
|
||||
if ($i == $_SESSION["day"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo ("<option value='$i'>$i</option>");
|
||||
}
|
||||
}
|
||||
echo '</select>
|
||||
<select class="form-control" name="day" onchange="refreshListe()">';
|
||||
|
||||
for ($i = 1; $i < 32; $i++) {
|
||||
if ($i == $_SESSION["day"]) {
|
||||
echo ("<option value='$i' selected>$i</option>");
|
||||
} else {
|
||||
echo ("<option value='$i'>$i</option>");
|
||||
}
|
||||
}
|
||||
echo '</select>
|
||||
</div>
|
||||
<button name="getTables" type="submit" class="btnchange">Aktualisieren</button>
|
||||
</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<div class="container-fluid" style="background-color:lightgrey;opacity: 0.6;border:solid; width:800px;" >
|
||||
|
||||
<div class="right-tables">
|
||||
<ul> <li>
|
||||
<div id="table4">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch4"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal4" style="color:green; width:120px;">Tisch 4 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change4" style="color:red;width:120px;" >Tisch 4 ist belegt durch <br>'.$_SESSION["Tisch4"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="table3">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch3"] == "FREI" || $_SESSION["Tisch3"][6] != $_SESSION["year"] )
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal3" style="color:green;opacity: 1.5;width:120px;">Tisch 3 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change3" style="color:red;width:120px;">Tisch 3 ist belegt durch <br>'.$_SESSION["Tisch3"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<div id="table2">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch2"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal2" style="color:green;">Tisch 2 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change2" style="color:red;">Tisch 2 ist belegt durch <br>'.$_SESSION["Tisch2"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<div id="table1">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch1"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal" style="color:green;">Tisch 1 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change" style="color:red;">Tisch 1 ist belegt durch <br>'.$_SESSION["Tisch1"][4].'</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="left-tables">
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<div id="table5">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch5"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal5" style="color:green;">Tisch 5 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change5" style="color:red;">Tisch 5 ist belegt durch <br>'.$_SESSION["Tisch5"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<div id="table6">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Tisch6"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal6" style="color:green;">Tisch 6 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change6" style="color:red;">Tisch 6 ist belegt durch <br>'.$_SESSION["Tisch6"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="park1" style="margin-left:250px;margin-top:-268px;">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Park1"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModalpark1" style="color:green; height:265px;">Parkplatz 1 <br> ist frei.</button>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_changepark1" style="color:red; height:265px;">Parkplatz 1 ist belegt durch <br>'.$_SESSION["Park1"][4].'.</button>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
<button id="refresh" name="getTables" type="submit" class="btnchange style="display:none;"" >Aktualisiere</button>
|
||||
</form>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="park2" style="margin-left:500px;margin-top:-273px;">
|
||||
<?php
|
||||
if(isset($_GET['result']))
|
||||
{
|
||||
if($_GET['result'] == "gotrecords")
|
||||
{
|
||||
if($_SESSION["Park2"] == "FREI")
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModalpark2" style="color:green; height:265px;">Parkplatz 2 <br> ist frei.</button>';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<div class="container-fluid" style="background-color:lightgrey;opacity: 0.6;border:solid; width:800px;">
|
||||
|
||||
<div class="right-tables">
|
||||
<ul>
|
||||
<li>
|
||||
<div id="table4">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch4"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal4" style="color:green; width:120px;">Tisch 4 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change4" style="color:red;width:120px;" >Tisch 4 ist belegt durch <br>' . $_SESSION["Tisch4"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="table3">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch3"] == "FREI" || $_SESSION["Tisch3"][6] != $_SESSION["year"]) {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal3" style="color:green;opacity: 1.5;width:120px;">Tisch 3 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change3" style="color:red;width:120px;">Tisch 3 ist belegt durch <br>' . $_SESSION["Tisch3"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<div id="table2">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch2"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal2" style="color:green;">Tisch 2 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change2" style="color:red;">Tisch 2 ist belegt durch <br>' . $_SESSION["Tisch2"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<div id="table1">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch1"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal" style="color:green;">Tisch 1 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change" style="color:red;">Tisch 1 ist belegt durch <br>' . $_SESSION["Tisch1"][4] . '</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="left-tables">
|
||||
<ul>
|
||||
|
||||
|
||||
<li>
|
||||
|
||||
<div id="table5">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch5"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal5" style="color:green;">Tisch 5 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change5" style="color:red;">Tisch 5 ist belegt durch <br>' . $_SESSION["Tisch5"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<div id="table6">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Tisch6"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal6" style="color:green;">Tisch 6 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_change6" style="color:red;">Tisch 6 ist belegt durch <br>' . $_SESSION["Tisch6"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="park1" style="margin-left:250px;margin-top:-268px;">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Park1"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModalpark1" style="color:green; height:265px;">Parkplatz 1 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_changepark1" style="color:red; height:265px;">Parkplatz 1 ist belegt durch <br>' . $_SESSION["Park1"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="park2" style="margin-left:500px;margin-top:-273px;">
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords") {
|
||||
if ($_SESSION["Park2"] == "FREI") {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModalpark2" style="color:green; height:265px;">Parkplatz 2 <br> ist frei.</button>';
|
||||
} else {
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_changepark2" style="color:red; height:265px;">Parkplatz 2 ist belegt durch <br>' . $_SESSION["Park2"][4] . '.</button>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php
|
||||
if (isset($_SESSION["sucessmessage"])) {
|
||||
echo $_SESSION["sucessmessage"];
|
||||
$_SESSION["sucessmessage"] = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<button id="buttonTable1" type="button" class="btn btn-light" data-toggle="modal" data-target="#myModal_changepark2" style="color:red; height:265px;">Parkplatz 2 ist belegt durch <br>'.$_SESSION["Park2"][4].'.</button>';
|
||||
|
||||
if (isset($_SESSION["sucessmessagedeleted"])) {
|
||||
echo $_SESSION["sucessmessagedeleted"];
|
||||
$_SESSION["sucessmessagedeleted"] = "";
|
||||
}
|
||||
if (isset($_SESSION["sucessmessagereplaced"])) {
|
||||
echo $_SESSION["sucessmessagereplaced"];
|
||||
$_SESSION["sucessmessagereplaced"] = "";
|
||||
}
|
||||
if (isset($_SESSION["errmsg"])) {
|
||||
echo $_SESSION["errmsg"];
|
||||
$_SESSION["errmsg"] = "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if(isset( $_SESSION["sucessmessage"])){
|
||||
echo $_SESSION["sucessmessage"];
|
||||
$_SESSION["sucessmessage"]="";
|
||||
}
|
||||
if(isset( $_SESSION["sucessmessagedeleted"])){
|
||||
echo $_SESSION["sucessmessagedeleted"];
|
||||
$_SESSION["sucessmessagedeleted"]="";
|
||||
}
|
||||
if(isset( $_SESSION["sucessmessagereplaced"])){
|
||||
echo $_SESSION["sucessmessagereplaced"];
|
||||
$_SESSION["sucessmessagereplaced"]="";
|
||||
}
|
||||
if(isset( $_SESSION["accnotfound"])){
|
||||
echo $_SESSION["accnotfound"];
|
||||
$_SESSION["accnotfound"]="";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
require 'required/footer.php';
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<?php
|
||||
require 'required/footer.php';
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -482,51 +342,51 @@ require 'modal.php';
|
||||
|
||||
|
||||
<style>
|
||||
.left-tables button {
|
||||
width: 220px;
|
||||
height: 130px;
|
||||
border: solid;
|
||||
|
||||
}
|
||||
.left-tables ul li {
|
||||
|
||||
list-style-type: none;
|
||||
padding-top: 5px;
|
||||
|
||||
}
|
||||
.left-tables button {
|
||||
width: 220px;
|
||||
height: 130px;
|
||||
border: solid;
|
||||
|
||||
.right-tables button {
|
||||
width: 225px;
|
||||
height: 130px;
|
||||
border: solid;
|
||||
|
||||
}
|
||||
.right-tables ul li {
|
||||
list-style-type: none;
|
||||
display: inline-block;
|
||||
padding-top: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.btnchange {
|
||||
background: #208f8f;
|
||||
border-radius: 20px;
|
||||
font-size: inherit;
|
||||
color: #fff;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
text-shadow: none;
|
||||
padding: .5rem .8rem;
|
||||
transition: background-color 0.25s;
|
||||
height:50px;
|
||||
width:200px;
|
||||
}
|
||||
.btnchange:hover {
|
||||
background: #269d9d;
|
||||
}
|
||||
.left-tables ul li {
|
||||
|
||||
list-style-type: none;
|
||||
padding-top: 5px;
|
||||
|
||||
}
|
||||
|
||||
.right-tables button {
|
||||
width: 225px;
|
||||
height: 130px;
|
||||
border: solid;
|
||||
|
||||
}
|
||||
|
||||
.right-tables ul li {
|
||||
list-style-type: none;
|
||||
display: inline-block;
|
||||
padding-top: 10px;
|
||||
|
||||
}
|
||||
|
||||
.btnchange {
|
||||
background: #208f8f;
|
||||
border-radius: 20px;
|
||||
font-size: inherit;
|
||||
color: #fff;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
text-shadow: none;
|
||||
padding: .5rem .8rem;
|
||||
transition: background-color 0.25s;
|
||||
height: 50px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.btnchange:hover {
|
||||
background: #269d9d;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
276
insertEntry.php
276
insertEntry.php
@@ -2,260 +2,64 @@
|
||||
session_start();
|
||||
|
||||
require 'settings.php';
|
||||
require 'functions.php';
|
||||
|
||||
if(isset($_POST['reservierenBtnTisch1'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 1;
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,1,"Tisch1");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
}
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
echo "New record created successfully";
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
else if(isset($_POST['reservierenBtnTisch2'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 2;
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,2,"Tisch2");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if(isset($_POST['reservierenBtnTisch3'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 3;
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,3,"Tisch3");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if(isset($_POST['reservierenBtnTisch4'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 4;
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,4,"Tisch4");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if(isset($_POST['reservierenBtnTisch5'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 5;
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,5,"Tisch5");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if(isset($_POST['reservierenBtnTisch6'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 6;
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,6,"Tisch6");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
}
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if(isset($_POST['reservierenBtnpark1'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
else if(isset($_POST['reservierenBtnPark1'])){
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 7;
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,7,"Park1");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
}
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Parkplatz 1 erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if(isset($_POST['reservierenBtnpark2'])){
|
||||
$month = $_SESSION["month"];
|
||||
$day = $_SESSION["day"];
|
||||
else if(isset($_POST['reservierenBtnPark2'])){
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 8;
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,8,"Park2");
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$day', '1', '$name', '$table')";
|
||||
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Parkplatz 2 erfolgreich reserviert.</div>';
|
||||
$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']."<br>" ;
|
||||
$_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 {
|
||||
echo "Error: " . $sql . "<br>" . $conn->error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
}
|
||||
|
||||
300
modal.php
300
modal.php
@@ -1,18 +1,35 @@
|
||||
|
||||
<script>
|
||||
function ValidInputs(){
|
||||
var e = document.getElementById("daystart");
|
||||
var daystart = e.options[e.selectedIndex].value;
|
||||
var b = document.getElementById("dayend");
|
||||
var dayend = b.options[b.selectedIndex].value;
|
||||
if(daystart > dayend)
|
||||
{
|
||||
document.getElementById("reservierenbutton").disabled = true;
|
||||
|
||||
alert("Starttag liegt nach dem Endtag");
|
||||
}
|
||||
else{
|
||||
|
||||
document.getElementById("reservierenbutton").disabled = false;
|
||||
}
|
||||
//alert(daystart +" " + dayend);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}else
|
||||
{
|
||||
|
||||
}
|
||||
function selected()
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
<!-- Modals für erstes belegen-->
|
||||
<!-- Modals für erstes belegen Mehrfachauswahl-->
|
||||
<div class="container">
|
||||
|
||||
<!-- The Modal Tisch 1 -->
|
||||
<form action="insertEntry.php" method="post">
|
||||
<div class="modal" id="myModal">
|
||||
@@ -31,21 +48,45 @@ function selected()
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch1" >
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" id="reservierenbutton"value="Reservieren" name="reservierenBtnTisch1" >
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<!-- The Modal Tisch 2 -->
|
||||
@@ -60,12 +101,39 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch2" >
|
||||
</form>
|
||||
</div>
|
||||
@@ -95,12 +163,39 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch3" >
|
||||
</form>
|
||||
</div>
|
||||
@@ -130,12 +225,39 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch4" >
|
||||
</form>
|
||||
</div>
|
||||
@@ -165,12 +287,39 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch5" >
|
||||
</form>
|
||||
</div>
|
||||
@@ -200,12 +349,39 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnTisch6" >
|
||||
</form>
|
||||
</div>
|
||||
@@ -235,13 +411,40 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="/action_page.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnpark1" >
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnPark1" >
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -271,13 +474,40 @@ function selected()
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="/action_page.php">
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<form action="getTables.php" method="post">
|
||||
<h2>Geben Sie Ihren Namen ein:</h2>
|
||||
<label for="lname">Name:</label>
|
||||
<input type="text" id="lname" name="reservierterName"required><br><br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnpark2" >
|
||||
|
||||
<?php
|
||||
echo '<h3>Reservieren von</h3>';
|
||||
echo '<select class="form-control" name="daystart" id="daystart" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<h3>bis</h3>';
|
||||
echo '<select class="form-control" name="dayend" id="dayend" onchange="ValidInputs()">';
|
||||
for ($i=1; $i <32 ; $i++) {
|
||||
$month = $_SESSION['month_string'];
|
||||
if ($i == 1) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
<input class="btn btn-primary" type="submit" value="Reservieren" name="reservierenBtnPark2" >
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,6 +8,18 @@
|
||||
<link rel="stylesheet" href="assets/css/Footer-Dark.css">
|
||||
<link rel="stylesheet" href="assets/css/Header-Dark.css">
|
||||
<link rel="stylesheet" href="assets/css/styles.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script>
|
||||
function refreshListe() {
|
||||
|
||||
$("#refresh").click();
|
||||
}
|
||||
$(function () {
|
||||
$('[data-toggle="popover"]').popover()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -20,17 +32,6 @@
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item" role="presentation"><a class="nav-link" href="#">Tischverwaltung</a></li>
|
||||
</ul>
|
||||
<!--
|
||||
<div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<form class="form-inline" action="/action_page.php">
|
||||
<input type="text" class="form-control" placeholder="Username" style="margin-right:10px;">
|
||||
<input type="password" class="form-control" placeholder="Password"style="margin-right:10px;">
|
||||
<button type="submit" class="btnheader">Einloggen</button>
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
-->
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
24
test.php
Normal file
24
test.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
for ($i=0; $i <12 ; $i++) {
|
||||
echo $monate[$i]."\n";
|
||||
}
|
||||
*/
|
||||
$monate = array('Januar','Februar','März','April','Mai','Juni','Juli','August',
|
||||
'September','Oktober','November','Dezember');
|
||||
|
||||
echo '<form action="getTables.php" method="post">
|
||||
<div class="form-group">
|
||||
<label for="sel1"style="color:white;font-family:Bitter;font-size:24px;">Monat:</label>
|
||||
<select class="form-control" name="month"onchange="refreshListe()">';
|
||||
for ($i=0; $i <12 ; $i++) {
|
||||
if($monate[$i] == $_SESSION["month_string"])
|
||||
{
|
||||
echo '<option value ='.$monate[$i].'selected>'.$monate[$i].'</option>';
|
||||
}
|
||||
echo '<option value ='.$monate[$i].'>'.$monate[$i].'</option>';
|
||||
}
|
||||
|
||||
echo '</select>';
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user