mirror of
https://github.com/JannikKoester/Tischverwaltung.git
synced 2026-01-09 14:20:08 +01:00
Compare commits
4 Commits
6600f5f381
...
jannik
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc6a50f52 | ||
|
|
69bcdb1e00 | ||
|
|
0790b1d8e7 | ||
|
|
55cd862c24 |
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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
136
index.php
136
index.php
@@ -24,71 +24,8 @@
|
||||
<?php
|
||||
if (isset($_GET['result'])) {
|
||||
if ($_GET['result'] == "gotrecords" || $_GET['result'] == "loggedin") {
|
||||
$selectedjan = '';
|
||||
$selectedfeb = '';
|
||||
$selectedmar = '';
|
||||
$selectedapr = '';
|
||||
$selectedmai = '';
|
||||
$selectedjun = '';
|
||||
$selectedjul = '';
|
||||
$selectedaug = '';
|
||||
$selectedsep = '';
|
||||
$selectedokt = '';
|
||||
$selectednov = '';
|
||||
$selecteddez = '';
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
//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>
|
||||
@@ -104,26 +41,25 @@
|
||||
|
||||
|
||||
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()">
|
||||
<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>';
|
||||
|
||||
<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 TAGE
|
||||
|
||||
echo '<div class="form-group">
|
||||
|
||||
@@ -145,6 +81,7 @@
|
||||
} 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>
|
||||
@@ -158,25 +95,24 @@
|
||||
}
|
||||
}
|
||||
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()">
|
||||
<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>';
|
||||
|
||||
<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>
|
||||
|
||||
274
insertEntry.php
274
insertEntry.php
@@ -2,260 +2,64 @@
|
||||
session_start();
|
||||
|
||||
require 'settings.php';
|
||||
require 'functions.php';
|
||||
|
||||
if(isset($_POST['reservierenBtnTisch1'])){
|
||||
$month = $_SESSION["month"];
|
||||
$daystart=intval($_POST['daystart']);
|
||||
$dayend = intval($_POST['dayend']);
|
||||
$name = $_POST['reservierterName'];
|
||||
$year = $_SESSION["year"];
|
||||
$table = 1;
|
||||
|
||||
|
||||
if($daystart > $dayend)
|
||||
{
|
||||
$_SESSION["errmsg"] = '<div class="alert alert-danger">
|
||||
Fehler! Der Starttag lag über dem Endtag.</div>';
|
||||
header("location:index.php?result=gotrecords");
|
||||
}
|
||||
else{
|
||||
for ($daystart; $daystart <= $dayend ; $daystart++) {
|
||||
|
||||
$sql = "INSERT INTO calenderplanner (year, month, day,reserviert,reserviertvon,tisch)
|
||||
VALUES ('$year', '$month', '$daystart', '1', '$name', '$table')";
|
||||
$conn->query($sql);
|
||||
|
||||
|
||||
}
|
||||
$_SESSION["sucessmessage"] = '<div class="alert alert-success">
|
||||
Du hast den Tisch erfolgreich reserviert.</div>';
|
||||
header("location:index.php");
|
||||
}
|
||||
|
||||
$daystart=$_POST['daystart'];
|
||||
$dayend = $_POST['dayend'];
|
||||
$name = $_POST['reservierterName'];
|
||||
funcs::InsertDatas($conn, $daystart, $dayend, $name,1,"Tisch1");
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
}
|
||||
|
||||
257
modal.php
257
modal.php
@@ -28,9 +28,8 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
|
||||
}
|
||||
?>
|
||||
<!-- 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">
|
||||
@@ -39,7 +38,7 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Tisch 1 neu</h4>
|
||||
<h4 class="modal-title">Tisch 1</h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
@@ -71,30 +70,23 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
echo "<option value='$i' selected>$i. $month</option>";
|
||||
} else {
|
||||
echo "<option value ='$i'> $i. $month</option>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
echo '</select>';
|
||||
|
||||
echo '</select>';
|
||||
?>
|
||||
<br>
|
||||
|
||||
|
||||
<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 -->
|
||||
@@ -109,12 +101,39 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
@@ -144,12 +163,39 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
@@ -179,12 +225,39 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
@@ -214,12 +287,39 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
@@ -249,12 +349,39 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
@@ -284,13 +411,40 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
|
||||
@@ -320,13 +474,40 @@ if (session_status() == PHP_SESSION_NONE) {
|
||||
<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>
|
||||
|
||||
|
||||
@@ -14,10 +14,9 @@
|
||||
|
||||
$("#refresh").click();
|
||||
}
|
||||
function ValidInputs(){
|
||||
//var daystart = $( "#daystart:selected" ).text();
|
||||
alert("daystart");
|
||||
}
|
||||
$(function () {
|
||||
$('[data-toggle="popover"]').popover()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
36
test.php
36
test.php
@@ -1,16 +1,24 @@
|
||||
<?php
|
||||
require './required/header.php';
|
||||
?>
|
||||
<label for="cars">Choose a car:</label>
|
||||
|
||||
<select id="cars" onchange="test()">
|
||||
<option value="volvo">Volvo</option>
|
||||
<option value="saab">Saab</option>
|
||||
<option value="vw">VW</option>
|
||||
<option value="audi" selected>Audi</option>
|
||||
</select>
|
||||
<script>
|
||||
function test() {
|
||||
alert( "ready!" );
|
||||
/*
|
||||
for ($i=0; $i <12 ; $i++) {
|
||||
echo $monate[$i]."\n";
|
||||
}
|
||||
</script>
|
||||
*/
|
||||
$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