Praxis Webseite Update
This commit is contained in:
@@ -58,17 +58,23 @@ if (!check_worker()) {
|
||||
$inhaltid = (int)($_POST["inhaltid"] ?? 0);
|
||||
$inhalt = $_POST["inhalt"] ?? "";
|
||||
$webseitentitel = $_POST["webseitentitel"] ?? "";
|
||||
$beschreibung = $_POST["beschreibung"] ?? "";
|
||||
$url = $_POST["url"] ?? "";
|
||||
|
||||
try {
|
||||
$stmt = $pdo->prepare("
|
||||
UPDATE webseiteninhalt
|
||||
SET inhalt = :inhalt,
|
||||
webseitentitel = :webseitentitel
|
||||
webseitentitel = :webseitentitel,
|
||||
beschreibung = :beschreibung,
|
||||
url = :url
|
||||
WHERE inhaltid = :inhaltid
|
||||
");
|
||||
$stmt->execute([
|
||||
':inhalt' => $inhalt,
|
||||
':webseitentitel' => $webseitentitel,
|
||||
':beschreibung' => $beschreibung,
|
||||
':url' => $url,
|
||||
':inhaltid' => $inhaltid,
|
||||
]);
|
||||
|
||||
@@ -85,7 +91,7 @@ if (!check_worker()) {
|
||||
|
||||
try {
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT webseitentitel, inhalt
|
||||
SELECT webseitentitel, inhalt, beschreibung, url
|
||||
FROM webseiteninhalt
|
||||
WHERE inhaltid = ?
|
||||
LIMIT 1
|
||||
@@ -98,13 +104,20 @@ if (!check_worker()) {
|
||||
} else {
|
||||
$webseitentitel = $rowconfig["webseitentitel"] ?? "";
|
||||
$inhalt = $rowconfig["inhalt"] ?? "";
|
||||
$beschreibung = $rowconfig["beschreibung"] ?? "";
|
||||
$url = $rowconfig["url"] ?? "";
|
||||
|
||||
echo "<h1>Webseiteninhalt bearbeiten</h1><br>";
|
||||
echo "<h4>Vorlage: " . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "</h4>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "<form action='" . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . "' method='POST'>";
|
||||
echo "<input name='webseitentitel' type='hidden' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'>";
|
||||
echo "<label>Titel</label><br>";
|
||||
echo "<input name='webseitentitel' type='text' class='form-control' value='" . htmlspecialchars($webseitentitel, ENT_QUOTES, 'UTF-8') . "'><br><br>";
|
||||
echo "<label>Beschreibung</label><br>";
|
||||
echo "<input name='beschreibung' type='text' class='form-control' value='" . htmlspecialchars($beschreibung, ENT_QUOTES, 'UTF-8') . "'><br><br>";
|
||||
echo "<label>URL / Hinweis</label><br>";
|
||||
echo "<input name='url' type='text' class='form-control' value='" . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . "'><br><br>";
|
||||
echo "<div id='my-editor'></div>";
|
||||
// Inhalt ist HTML -> bewusst NICHT escapen, sonst zerstörst du HTML im Editor
|
||||
echo "<textarea height='200' name='inhalt' id='trumbowyg-demo'>" . $inhalt . "</textarea>";
|
||||
|
||||
Reference in New Issue
Block a user