From d1e17342764dd8373af14f5896e721769c3917cb Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 30 Apr 2021 09:46:48 +0300 Subject: bug/view: show associated reports --- bug/view.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 "

$result[title]

"; echo "

Submitted by $result[submitter]

"; echo '

' . $markdown->text($result['description']) . '

'; +echo "

Reports

"; +# 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) { +?> + + + +\n"; +} +?> +
TitleDescriptionSubmitted by
$row[title] " . truncate($row['description']) . " $row[user]
+ +No reports

"; +} + if(session_set()) { echo "

Edit | Delete

"; } -- cgit v1.2.1