Initial commit from online.
This commit is contained in:
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>';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user