aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bug/view.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/bug/view.php b/bug/view.php
index d1e4335..6b26860 100644
--- a/bug/view.php
+++ b/bug/view.php
@@ -24,6 +24,30 @@ echo "<p><b>$result[title]</b></p>";
echo "<p>Submitted by $result[submitter]</p>";
echo '<p>' . $markdown->text($result['description']) . '</p>';
+echo "<h2>Reports</h2>";
+# reports query
+$reports = $conn->prepare("SELECT reports.id AS id, title, description, users.username AS user
+ FROM reports JOIN users ON reports.author=users.id WHERE bug=:bug_id ORDER BY id");
+$reports->bindParam(':bug_id', $_GET['id']);
+$reports->execute();
+
+if($reports->rowCount() > 0) {
+?>
+
+<table style='width:80%'>
+<tr><th>Title</th><th>Description</th><th>Submitted by</th></tr>
+<?php
+foreach ($reports as $row) {
+ echo "<tr><td><a href=report/view.php?id=$row[id]>$row[title]</a></td> <td>" . truncate($row['description']) . "</td> <td>$row[user]</td></tr>\n";
+}
+?>
+</table>
+
+<?php
+} else {
+ echo "<p>No reports</p>";
+}
+
if(session_set()) {
echo "<p><a href=edit.php?id=$_GET[id]>Edit</a> | <a href=delete.php?id=$_GET[id]>Delete</a></p>";
}