From e381050e1db6ec33872c185b45cff83af8d9c18b Mon Sep 17 00:00:00 2001 From: Furentes Date: Thu, 23 May 2019 09:12:05 +0200 Subject: [PATCH] Fixed error messages --- css/main.css | 1 + css/main.css.map | 2 +- post.php | 41 ++++++++++++++++++++++++++++++----------- scss/main.scss | 1 + users.php | 11 ++++++++++- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/css/main.css b/css/main.css index 9c8e6a6..044411b 100644 --- a/css/main.css +++ b/css/main.css @@ -8,6 +8,7 @@ section.main { max-width: 960px; margin: 0 auto; padding: 80px 0 0; + margin-bottom: 100px; } /*# sourceMappingURL=main.css.map */ diff --git a/css/main.css.map b/css/main.css.map index 1491ca3..09e6618 100644 --- a/css/main.css.map +++ b/css/main.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/main.scss"],"names":[],"mappings":"AAAA;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"main.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/main.scss"],"names":[],"mappings":"AAAA;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA","file":"main.css"} \ No newline at end of file diff --git a/post.php b/post.php index d743fc5..bf250fc 100644 --- a/post.php +++ b/post.php @@ -101,17 +101,6 @@ require_once(__DIR__."/inc/head.php"); } ?> $value): - ?> - - -
- Post bearbeitet!
'; - } if ($action == 'view'): ?>
@@ -131,6 +120,15 @@ require_once(__DIR__."/inc/head.php"); ?>
$value): + ?> +
+ + + + isLoggedIn()) { ?>

@@ -162,6 +160,15 @@ require_once(__DIR__."/inc/head.php"); if ($action == 'new'): ?>

Neuer Beitrag

+ $value): + ?> + + +
+

@@ -175,6 +182,18 @@ require_once(__DIR__."/inc/head.php"); if ($action == 'edit'): ?>

Beitrag Bearbeiten

+ Post bearbeitet!
'; + } + foreach ($errors as $key=>$value): + ?> + + +
+
diff --git a/scss/main.scss b/scss/main.scss index f49833a..cdb1049 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -8,4 +8,5 @@ section.main { max-width: 960px; margin: 0 auto; padding: 80px 0 0; + margin-bottom: 100px; } \ No newline at end of file diff --git a/users.php b/users.php index acf0fae..7e5da14 100644 --- a/users.php +++ b/users.php @@ -10,7 +10,7 @@ $errors = []; $action = ''; $data = []; $view = false; - +$success = false; if(isset($_GET['view'])) { if (!empty($_GET['view']) && \is_numeric($_GET['view'])) { @@ -19,6 +19,12 @@ if(isset($_GET['view'])) { if(isset($_POST['update'])) { $update = $auth->updateUserRole($view, $_POST['role']); + + if(is_array($update)) { + $errors = $update; + } else { + $success = true; + } } if(isset($_POST['delete'])) { @@ -46,6 +52,9 @@ require_once(__DIR__."/inc/head.php"); Zurück' : 'Zurück' ?>

Benutzer

Benutzer bearbeitet!
'; + } foreach ($errors as $key=>$value): ?>