39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
if ( $_SESSION['IsAdmin'] )
|
|
{
|
|
echo "<h1>AGBs</h1>\n";
|
|
if ( isset ( $_POST['action'] ) AND ( 'Speichern' == $_POST['action'] ) )
|
|
{
|
|
$sql = 'UPDATE Uns SET
|
|
Titel = "'.$_POST['Titel'].'",
|
|
Text = "'.$_POST['Text'].'"
|
|
WHERE ID = "4";';
|
|
$stmt = $db->prepare($sql);
|
|
if (!$stmt)
|
|
{
|
|
die ('Datensatz konnte nicht gespeichert werden: '.$db->error);
|
|
}
|
|
if (!$stmt->execute())
|
|
{
|
|
die ('Datensatz konnte nicht gespeichert werden: '.$stmt->error);
|
|
}
|
|
echo "<p class=\"hinweis\">AGBs wurden gespeichert!</p>\n";
|
|
}
|
|
|
|
$sql1 = "SELECT * FROM Uns WHERE ID = \"4\";";
|
|
$result1 = $db->query($sql1);
|
|
$nt1 = $result1->fetch_assoc();
|
|
?>
|
|
<form action="index.php?<?php echo $_SERVER['QUERY_STRING']; ?>" method="post" />
|
|
<label>Überschrift</label>
|
|
<br />
|
|
<input style="width:500px;" type="text" name="Titel" value="<?php echo $nt1['Titel']; ?>" />
|
|
<br /> <br />
|
|
<label>Text</label>
|
|
<textarea name="Text" rows="50"><?php echo $nt1['Text']; ?></textarea>
|
|
<br /> <br />
|
|
<input type="submit" name="action" value="Speichern" />
|
|
</form>
|
|
<?php
|
|
}
|
|
?>
|