From 844a7d53f2d78bafba479c0d931277246ade61de Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 7 Mar 2015 17:58:07 +0100 Subject: Renames pages -> view --- view/feedback.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 view/feedback.php (limited to 'view/feedback.php') diff --git a/view/feedback.php b/view/feedback.php new file mode 100644 index 0000000..7417f24 --- /dev/null +++ b/view/feedback.php @@ -0,0 +1,41 @@ +render(array( + 'page' => 'feedback', + 'title' => 'Give Feedback', + 'room' => null, + )); +} +else +{ + $db = new PDO(get('FEEDBACK.DSN')); + $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'], + )); +} -- cgit v1.2.3