aboutsummaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorMaZderMind2015-03-31 21:56:40 +0200
committerMaZderMind2015-03-31 21:56:40 +0200
commitdbd6cd8c14867fb02efc9b67adea2756cf223e4d (patch)
treeffd6569b9f80122c1f9ef913b79a629ec6cf8ea3 /view
parent69156f7cf1cc8e74425934677fff83b70799fe1b (diff)
Restructure Feedback-Save-Code
Diffstat (limited to 'view')
-rw-r--r--view/feedback.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/view/feedback.php b/view/feedback.php
index f603dbf..c4ba146 100644
--- a/view/feedback.php
+++ b/view/feedback.php
@@ -6,15 +6,16 @@ if(!$feedback->isEnabled())
$info = $_POST;
-if(!$feedback->validate($info)) {
- echo $tpl->render(array(
- 'page' => 'feedback',
- 'title' => 'Give Feedback',
- 'room' => null,
- ));
-}
-else
+if($feedback->validate($info))
{
$feedback->store($info);
- echo 1;
+
+ header('Content-Type: application/json');
+ echo json_encode(true);
+ exit;
}
+
+echo $tpl->render(array(
+ 'page' => 'feedback',
+ 'title' => 'Give Feedback',
+));