Initial commit from online.
This commit is contained in:
19
admin/inhalte/kal/amelie.php
Normal file
19
admin/inhalte/kal/amelie.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<h2>Belegungsplan Amelie</h2>
|
||||
|
||||
<?php
|
||||
$table = "Kal_Amelie";
|
||||
$ref = "index.php?section=kal&t=amelie";
|
||||
|
||||
if (isset($_POST['add'])) {
|
||||
include "inhalte/kal/belegung/add.php";
|
||||
} elseif (isset($_POST['edit'])) {
|
||||
include "inhalte/kal/belegung/edit.php";
|
||||
} elseif (isset($_POST['del'])) {
|
||||
include "inhalte/kal/belegung/del.php";
|
||||
} elseif (isset($_POST['view'])) {
|
||||
include "inhalte/kal/belegung/view.php";
|
||||
} else {
|
||||
include "inhalte/kal/belegung/standard.php";
|
||||
}
|
||||
|
||||
?>
|
||||
36
admin/inhalte/kal/belegung/add.php
Normal file
36
admin/inhalte/kal/belegung/add.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<h3>Neue Belegung hinzufügen</h3>
|
||||
|
||||
<?php
|
||||
if (!isset($_POST['Speichern'])) {
|
||||
?>
|
||||
|
||||
<form action="<?php echo $ref; ?>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="add" value="speichern" />
|
||||
<label>Mieter:</label>
|
||||
<input type="text" name="Mieter" />
|
||||
<br />
|
||||
<label>Von (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Start" />
|
||||
<br />
|
||||
<label>Bis (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Ende" />
|
||||
<br />
|
||||
<input type="submit" name="Speichern" value="Speichern" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$sql2 = 'INSERT INTO '.$table.' (ID, Mieter, Start, Ende) VALUES (NULL, "'.$_POST['Mieter'].'", "'.$_POST['Start'].'", "'.$_POST['Ende'].'");';
|
||||
$stmt2 = $db->prepare($sql2);
|
||||
if (!$stmt2) {
|
||||
die ('Es konnte kein SQL-Query vorbereitet werden: '.$db->error);
|
||||
}
|
||||
if (!$stmt2->execute()) {
|
||||
die ('Query konnte nicht ausgef<65>hrt werden: '.$stmt1->error);
|
||||
}
|
||||
echo '<a href="'.$ref.'">Zur<75>ck zur <20>bersicht</a>';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
13
admin/inhalte/kal/belegung/del.php
Normal file
13
admin/inhalte/kal/belegung/del.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$sql2 = 'DELETE FROM '.$table.' WHERE ID = "'.$_POST['Titel'].'"';
|
||||
$result2 = $db->query($sql2);
|
||||
if ($result2) {
|
||||
echo "<p>Datenbankeintrag gel<65>scht</p>\n";
|
||||
} else {
|
||||
echo "Fehler beim L<>schen";
|
||||
}
|
||||
echo '<a href="'.$ref.'">Zur<75>ck zur <20>bersicht</a>';
|
||||
|
||||
|
||||
?>
|
||||
42
admin/inhalte/kal/belegung/edit.php
Normal file
42
admin/inhalte/kal/belegung/edit.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<h3>Bestehende Belegung Ändern</h3>
|
||||
|
||||
<?php
|
||||
$sql1 = 'SELECT * FROM '.$table.' WHERE ID = "'.$_POST['Titel'].'";';
|
||||
$result1 = $db->query($sql1);
|
||||
$nt1 = $result1->fetch_assoc();
|
||||
if (!isset($_POST['Speichern'])) {
|
||||
var_dump($_POST);
|
||||
echo "<br />";
|
||||
?>
|
||||
|
||||
<form action="<?php echo $ref; ?>" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="ID" value="<?php echo $_POST['Titel']; ?>" />
|
||||
<input type="hidden" name="edit" value="speichern" />
|
||||
<label>Mieter:</label>
|
||||
<input type="text" name="Mieter" value="<?php echo $nt1['Mieter']; ?>" />
|
||||
<br />
|
||||
<label>Von (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Start" value="<?php echo $nt1['Start']; ?>" />
|
||||
<br />
|
||||
<label>Bis (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Ende" value="<?php echo $nt1['Ende']; ?>" />
|
||||
<br />
|
||||
<input type="submit" name="Speichern" value="Speichern" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$sql2 = 'UPDATE '.$table.' SET Mieter = "'.$_POST['Mieter'].'", Start = "'.$_POST['Start'].'", Ende = "'.$_POST['Ende'].'" WHERE ID = "'.$_POST['ID'].'";';
|
||||
$stmt2 = $db->prepare($sql2);
|
||||
if (!$stmt2) {
|
||||
die ('Es konnte kein SQL-Query vorbereitet werden: '.$db->error);
|
||||
}
|
||||
if (!$stmt2->execute()) {
|
||||
die ('Query konnte nicht ausgef<65>hrt werden: '.$stmt1->error);
|
||||
}
|
||||
echo '<a href="'.$ref.'">Zur<75>ck zur <20>bersicht</a>';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
38
admin/inhalte/kal/belegung/standard.php
Normal file
38
admin/inhalte/kal/belegung/standard.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
$sql1 = 'SELECT * FROM '.$table.'';
|
||||
$result1 = $db->query($sql1);
|
||||
?>
|
||||
<fieldset>
|
||||
<form action="<?php echo $ref; ?>" method="post">
|
||||
<fieldset>
|
||||
<legend>neue Belegung erstellen</legend>
|
||||
<input type="submit" name="add" value="Erstellen" />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<select name="Titel">
|
||||
<?php
|
||||
while ($nt1 = $result1->fetch_assoc()) {
|
||||
echo '<option value="'.$nt1['ID'].'">'.$nt1['Mieter'].' '.$nt1['Start'].'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>Belegung bearbeiten</legend>
|
||||
<input type="submit" name="edit" value="Bearbeiten" />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>Belegung löschen</legend>
|
||||
<input type="submit" name="del" value="L<>schen" />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>vollständigen Belegungsplan anzeigen</legend>
|
||||
<input type="submit" name="view" value="Anzeigen" />
|
||||
<br />
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
20
admin/inhalte/kal/belegung/view.php
Normal file
20
admin/inhalte/kal/belegung/view.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$sql1 = 'SELECT * FROM '.$table.'';
|
||||
$result1 = $db->query($sql1);
|
||||
|
||||
echo "<label><b>Mieter</b></label>";
|
||||
echo "<label><b>Von</b></label>";
|
||||
echo "<label><b>Bis</b></label>";
|
||||
echo "<br />";
|
||||
while ($nt1 = $result1->fetch_assoc()) {
|
||||
$Start = date("d.m.y",strtotime($nt1['Start']));
|
||||
$Ende = date("d.m.y",strtotime($nt1['Ende']));
|
||||
if ('' == $nt1['Mieter']) {
|
||||
echo "<label> </label>";
|
||||
} else {
|
||||
echo "<label>".$nt1['Mieter']."</label>";
|
||||
}
|
||||
echo "<label>".$Start."</label>";
|
||||
echo "<label>".$Ende."</label>";
|
||||
echo "<br />";
|
||||
}
|
||||
19
admin/inhalte/kal/gaby.php
Normal file
19
admin/inhalte/kal/gaby.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<h2>Belegungsplan Gaby</h2>
|
||||
|
||||
<?php
|
||||
$table = "Kal_Gaby";
|
||||
$ref = "index.php?section=kal&t=gaby";
|
||||
|
||||
if (isset($_POST['add'])) {
|
||||
include "inhalte/kal/belegung/add.php";
|
||||
} elseif (isset($_POST['edit'])) {
|
||||
include "inhalte/kal/belegung/edit.php";
|
||||
} elseif (isset($_POST['del'])) {
|
||||
include "inhalte/kal/belegung/del.php";
|
||||
} elseif (isset($_POST['view'])) {
|
||||
include "inhalte/kal/belegung/view.php";
|
||||
} else {
|
||||
include "inhalte/kal/belegung/standard.php";
|
||||
}
|
||||
|
||||
?>
|
||||
16
admin/inhalte/kal/saison.php
Normal file
16
admin/inhalte/kal/saison.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
if (isset($_POST['add'])) {
|
||||
include "inhalte/kal/saison/add.php";
|
||||
}
|
||||
elseif (isset($_POST['edit'])) {
|
||||
include "inhalte/kal/saison/edit.php";
|
||||
}
|
||||
elseif (isset($_POST['del'])) {
|
||||
include "inhalte/kal/saison/del.php";
|
||||
}
|
||||
else {
|
||||
include "inhalte/kal/saison/standard.php";
|
||||
}
|
||||
|
||||
?>
|
||||
43
admin/inhalte/kal/saison/add.php
Normal file
43
admin/inhalte/kal/saison/add.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<h3>Neuen Zeitraum hinzufügen</h3>
|
||||
|
||||
<?php
|
||||
if (!isset($_POST['Speichern'])) {
|
||||
$sql2 = "SELECT Typ FROM Saison_Typ ORDER BY ID";
|
||||
$result2 = $db->query($sql2);
|
||||
?>
|
||||
|
||||
<form action="index.php?section=kal&t=saison" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="add" value="speichern" />
|
||||
<label>Von (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Von" />
|
||||
<br />
|
||||
<label>Bis (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Bis" />
|
||||
<br />
|
||||
<label>Saisontyp:</label>
|
||||
<select name="Typ">
|
||||
<?php
|
||||
while ($nt2 = $result2->fetch_assoc()) {
|
||||
echo "<option>".$nt2['Typ']."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
<input type="submit" name="Speichern" value="Speichern" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$sql1 = 'INSERT INTO Saison (ID, Von, Bis, Typ) VALUES (NULL, "'.$_POST['Von'].'", "'.$_POST['Bis'].'", "'.$_POST['Typ'].'");';
|
||||
$stmt1 = $db->prepare($sql1);
|
||||
if (!$stmt1) {
|
||||
die ('Es konnte kein SQL-Query vorbereitet werden: '.$db->error);
|
||||
}
|
||||
if (!$stmt1->execute()) {
|
||||
die ('Query konnte nicht ausgef<65>hrt werden: '.$stmt1->error);
|
||||
}
|
||||
echo '<a href="index.php?section=kal&t=saison">Zur<75>ck zur <20>bersicht</a>';
|
||||
}
|
||||
|
||||
?>
|
||||
13
admin/inhalte/kal/saison/del.php
Normal file
13
admin/inhalte/kal/saison/del.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$sql2 = 'DELETE FROM Saison WHERE ID = "'.$_POST['Titel'].'"';
|
||||
$result2 = $db->query($sql2);
|
||||
if ($result2) {
|
||||
echo "<p>Datenbankeintrag gelöscht</p>\n";
|
||||
} else {
|
||||
echo "Fehler beim Löschen";
|
||||
}
|
||||
echo '<a href="index.php?section=kal&t=saison">Zurück zur Übersicht</a>';
|
||||
|
||||
|
||||
?>
|
||||
51
admin/inhalte/kal/saison/edit.php
Normal file
51
admin/inhalte/kal/saison/edit.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<h3>Zeitraum Ändern</h3>
|
||||
|
||||
<?php
|
||||
if (!isset($_POST['Speichern'])) {
|
||||
$sql2 = "SELECT Typ FROM Saison_Typ ORDER BY ID";
|
||||
$result2 = $db->query($sql2);
|
||||
$sql3 = 'SELECT * FROM Saison WHERE ID = "'.$_POST['Titel'].'"';
|
||||
$result3 = $db->query($sql3);
|
||||
$nt3 = $result3->fetch_assoc();
|
||||
?>
|
||||
|
||||
<form action="index.php?section=kal&t=saison" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="edit" value="speichern" />
|
||||
<input type="hidden" name="ID" value="<?php echo $_POST['Titel']; ?>" />
|
||||
<label>Von (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Von" value="<?php echo $nt3['Von']; ?>" />
|
||||
<br />
|
||||
<label>Bis (YYYY-MM-TT):</label>
|
||||
<input type="text" name="Bis" value="<?php echo $nt3['Bis']; ?>"/>
|
||||
<br />
|
||||
<label>Saisontyp:</label>
|
||||
<select name="Typ">
|
||||
<?php
|
||||
while ($nt2 = $result2->fetch_assoc()) {
|
||||
if ($nt3['Typ'] == $nt2['Typ']) {
|
||||
echo "<option selected=\"selected\">".$nt2['Typ']."</option>";
|
||||
} else {
|
||||
echo "<option>".$nt2['Typ']."</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
<input type="submit" name="Speichern" value="Speichern" />
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$sql1 = 'UPDATE Saison SET Von = "'.$_POST['Von'].'", Bis = "'.$_POST['Bis'].'", Typ = "'.$_POST['Typ'].'" WHERE ID = "'.$_POST['ID'].'";';
|
||||
$stmt1 = $db->prepare($sql1);
|
||||
if (!$stmt1) {
|
||||
die ('Es konnte kein SQL-Query vorbereitet werden: '.$db->error);
|
||||
}
|
||||
if (!$stmt1->execute()) {
|
||||
die ('Query konnte nicht ausgeführt werden: '.$stmt1->error);
|
||||
}
|
||||
echo '<a href="index.php?section=kal&t=saison">Zurück zur übersicht</a>';
|
||||
}
|
||||
|
||||
?>
|
||||
34
admin/inhalte/kal/saison/standard.php
Normal file
34
admin/inhalte/kal/saison/standard.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<h2>Saisonverlauf</h2>
|
||||
|
||||
<?php
|
||||
$sql1 = 'SELECT * FROM Saison';
|
||||
$result1 = $db->query($sql1);
|
||||
?>
|
||||
<fieldset>
|
||||
<form action="index.php?section=kal&t=saison" method="post">
|
||||
<fieldset>
|
||||
<legend>neuen Zeitraum erstellen</legend>
|
||||
<input type="submit" name="add" value="Erstellen" />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<select name="Titel">
|
||||
<?php
|
||||
while ($nt1 = $result1->fetch_assoc()) {
|
||||
echo '<option value="'.$nt1['ID'].'">'.$nt1['Von'].' '.$nt1['Bis'].' '.$nt1['Typ'].'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>Zeitraum bearbeiten</legend>
|
||||
<input type="submit" name="edit" value="Bearbeiten" />
|
||||
<br />
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>Zeitraum löschen</legend>
|
||||
<input type="submit" name="del" value="L<>schen" />
|
||||
<br />
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
1
admin/inhalte/kal/standard.php
Normal file
1
admin/inhalte/kal/standard.php
Normal file
@@ -0,0 +1 @@
|
||||
<p>In diesem Bereich kann die Belegung der Wohnungen und der Saisonverlauf bearbeitet werden.</p>
|
||||
Reference in New Issue
Block a user