aboutsummaryrefslogtreecommitdiff
path: root/pages/feedback.php
diff options
context:
space:
mode:
authorMaZderMind2014-12-22 13:30:42 +0100
committerMaZderMind2014-12-22 13:30:42 +0100
commit2040e49f949396aa79fb84ed9e025e4de5571ed6 (patch)
tree2f11c7af5741cff1e410ea25d821986692056b8c /pages/feedback.php
parent095e23686087b311636a3394fe207e50ca41fc04 (diff)
standalone feedback page & intrinsic save mechanism
Diffstat (limited to 'pages/feedback.php')
-rw-r--r--pages/feedback.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/pages/feedback.php b/pages/feedback.php
new file mode 100644
index 0000000..8335c6f
--- /dev/null
+++ b/pages/feedback.php
@@ -0,0 +1,42 @@
+<?php
+
+if(
+ !isset($_POST['datetime']) ||
+ !isset($_POST['net']) ||
+ !isset($_POST['os']) ||
+ !isset($_POST['player']) ||
+ !isset($_POST['stream']) ||
+ !isset($_POST['provider']) ||
+ !isset($_POST['issuetext'])
+) {
+ require_once('lib/bootstrap.php');
+
+ echo $tpl->render(array(
+ 'page' => 'feedback',
+ 'title' => 'Give Feedback',
+ ));
+}
+else
+{
+ $db = new PDO('sqlite:/opt/31c3-streaming-feedback/feedback.sqlite3');
+ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ $stm = $db->prepare('
+ INSERT INTO feedback (reported, datetime, net, os, player, stream, ipproto_v4, ipproto_v6, provider, issues, issuetext)
+ VALUES (:reported, :datetime, :net, :os, :player, :stream, :ipproto_v4, :ipproto_v6, :provider, :issues, :issuetext)
+ ');
+
+ $stm->execute(array(
+ 'reported' => time(),
+ 'datetime' => strtotime($_POST['datetime']),
+ 'net' => $_POST['net'],
+ 'os' => $_POST['os'],
+ 'player' => $_POST['player'],
+ 'stream' => $_POST['stream'],
+ 'ipproto_v4' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v4', $_POST['ipproto']),
+ 'ipproto_v6' => isset($_POST['ipproto']) && is_array($_POST['ipproto']) && in_array('v6', $_POST['ipproto']),
+ 'provider' => $_POST['provider'],
+ 'issues' => isset($_POST['issues']) && is_array($_POST['issues']) ? implode(',', $_POST['issues']) : '',
+ 'issuetext' => $_POST['issuetext'],
+ ));
+}