48 lines
1.8 KiB
PHP
48 lines
1.8 KiB
PHP
<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>';
|
|
}
|