diff --git a/php/reports.php b/php/reports.php index 7b3d2d2..f146abb 100644 --- a/php/reports.php +++ b/php/reports.php @@ -77,232 +77,195 @@ $maxResults = 5;

-
-
- -
-
-
-
-

Reports

- - - - - - - - - - - - prepare('SELECT tr.*, tq.question as original - FROM triviareport tr - INNER JOIN triviaquestion tq - on tq.id=question_num - ORDER BY id DESC LIMIT :offset, :maxResults'); - $qCount = $db->query('SELECT count(id) FROM triviareport'); - $q->execute(array(':offset'=>($reportPage-1) * $maxResults, ':maxResults'=>$maxResults)); - if ($q === false) { - die("Error: database error: table does not exist\n"); - } else { - $result = $q->fetchAll(); - $resultCount = $qCount->fetchColumn(); - foreach($result as $res) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - } else { - die('Couldnt connect to db'); - } - ?> - -
Report #UsernameQuestion #QuestionReport Text
' . $res['id'] . '' . $res['username'] . '' . $res['question_num'] . '' . $res['original'] . '' . $res['report_text'] . '
- paginate(); - ?> -
-
-
-
+ +
+
+

Reports

+ + + + + + + + + + + + prepare('SELECT tr.*, tq.question as original + FROM triviareport tr + INNER JOIN triviaquestion tq + on tq.id=question_num + ORDER BY id DESC LIMIT :offset, :maxResults'); + $qCount = $db->query('SELECT count(id) FROM triviareport'); + $q->execute(array(':offset'=>($reportPage-1) * $maxResults, ':maxResults'=>$maxResults)); + if ($q === false) { + die("Error: database error: table does not exist\n"); + } else { + $result = $q->fetchAll(); + $resultCount = $qCount->fetchColumn(); + foreach($result as $res) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } + } else { + die('Couldnt connect to db'); + } + ?> + +
Report #UsernameQuestion #QuestionReport Text
' . $res['id'] . '' . $res['username'] . '' . $res['question_num'] . '' . $res['original'] . '' . $res['report_text'] . '
+ paginate(); + ?>
-
-
- -
-
-
-
-

Edits

- - - - - - - - - - - - prepare('SELECT te.*, tq.question as original - FROM triviaedit te - INNER JOIN triviaquestion tq - on tq.id=question_id - ORDER BY id DESC LIMIT :offset, :maxResults'); - $q->execute(array(':offset'=>($editPage-1) * $maxResults, ':maxResults'=>$maxResults)); - $qCount = $db->query('SELECT count(id) FROM triviaedit'); - if ($q === false) { - die("Error: database error: table does not exist\n"); - } else { - $result = $q->fetchAll(); - $resultCount = $qCount->fetchColumn(); - foreach($result as $res) { - $isItalic = false; - $splitNew = explode('*', $res['question']); - $splitOld = explode('*', $res['original']); +
+
+

Edits

+
Edit #UsernameNew QuestionOld QuestionQuestion #
+ + + + + + + + + + + prepare('SELECT te.*, tq.question as original + FROM triviaedit te + INNER JOIN triviaquestion tq + on tq.id=question_id + ORDER BY id DESC LIMIT :offset, :maxResults'); + $q->execute(array(':offset'=>($editPage-1) * $maxResults, ':maxResults'=>$maxResults)); + $qCount = $db->query('SELECT count(id) FROM triviaedit'); + if ($q === false) { + die("Error: database error: table does not exist\n"); + } else { + $result = $q->fetchAll(); + $resultCount = $qCount->fetchColumn(); + foreach($result as $res) { + $isItalic = false; + $splitNew = explode('*', $res['question']); + $splitOld = explode('*', $res['original']); - $differenceString = ''; - for($y=0;$y0) { - $isItalic = false; - $differenceString .= ''; - $differenceString .= '*'; - } - $brokenNew = str_split($splitNew[$y]); - if(!array_key_exists($y, $splitOld)){ - $splitOld[$y] = '*'; - } - $brokenOld = str_split($splitOld[$y]); - for($i=0;$i'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - } else { - die($err); + $differenceString = ''; + for($y=0;$y0) { + $isItalic = false; + $differenceString .= ''; + $differenceString .= '*'; } - ?> - -
Edit #UsernameNew QuestionOld QuestionQuestion #
' . $res['id'] . '' . $res['username'] . '' . $differenceString . '' . $res['original'] . '' . $res['question_id'] . '
- paginate(); - ?> -
-
-
-
+ $brokenNew = str_split($splitNew[$y]); + if(!array_key_exists($y, $splitOld)){ + $splitOld[$y] = '*'; + } + $brokenOld = str_split($splitOld[$y]); + for($i=0;$i'; + echo '' . $res['id'] . ''; + echo '' . $res['username'] . ''; + echo '' . $differenceString . ''; + echo '' . $res['original'] . ''; + echo '' . $res['question_id'] . ''; + echo ''; + } + } + } else { + die($err); + } + ?> + + + paginate(); + ?>
-
-
- -
-
-
-
-

Added Questions

- - - - - - - - - - prepare('SELECT tq.* FROM triviatemporaryquestion tq ORDER BY tq.id DESC LIMIT :offset, :maxResults'); - $q->execute(array(':offset'=>($newPage-1) * $maxResults, ':maxResults'=>$maxResults)); - $qCount = $db->query('SELECT count(id) FROM triviatemporaryquestion'); - if ($q === false) { - die("Error: database error: table does not exist\n"); - } else { - $result = $q->fetchAll(); - $resultCount = $qCount->fetchColumn(); - foreach($result as $res) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - } else { - die('Couldnt connect to db'); - } - ?> - -
#AuthorNew Question
' . $res['id'] . '' . $res['username'] . '' . $res['question'] . '
- paginate(); - ?> -
-
-
-
+ +
+
+

Added Questions

+ + + + + + + + + + prepare('SELECT tq.* FROM triviatemporaryquestion tq ORDER BY tq.id DESC LIMIT :offset, :maxResults'); + $q->execute(array(':offset'=>($newPage-1) * $maxResults, ':maxResults'=>$maxResults)); + $qCount = $db->query('SELECT count(id) FROM triviatemporaryquestion'); + if ($q === false) { + die("Error: database error: table does not exist\n"); + } else { + $result = $q->fetchAll(); + $resultCount = $qCount->fetchColumn(); + foreach($result as $res) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + } + } else { + die('Couldnt connect to db'); + } + ?> + +
#AuthorNew Question
' . $res['id'] . '' . $res['username'] . '' . $res['question'] . '
+ paginate(); + ?>