No bug selected..."; header("Refresh: 2; URL=$_SERVER[HTTP_REFERER]"); goto footer; } $conn = new PDO($config['db']['dsn'], $config['db']['username'], $config['db']['password']); $query = $conn->prepare("SELECT title, description, users.username AS submitter FROM bugs JOIN users ON bugs.author = users.id WHERE bugs.id=:bug_id"); $query->bindParam(':bug_id', $_GET['id']); $query->execute(); $result = $query->fetch(); $markdown = new Parsedown(); 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

"; } footer: require_once(TEMPLATES_PATH . "/footer.php"); ?>