aboutsummaryrefslogtreecommitdiff
path: root/report/edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'report/edit.php')
-rw-r--r--report/edit.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/report/edit.php b/report/edit.php
index ef289bd..cd2e1a8 100644
--- a/report/edit.php
+++ b/report/edit.php
@@ -14,8 +14,9 @@ $title = "";
$submitter = $_SESSION['user_name'];
$description = "";
+$conn = new PDO($config['db']['dsn'], $config['db']['username'], $config['db']['password']);
+
if($id != "") {
- $conn = new PDO($config['db']['dsn'], $config['db']['username'], $config['db']['password']);
$query = $conn->prepare("SELECT title, description, users.username AS submitter FROM reports
JOIN users ON reports.author=users.id
WHERE reports.id=:report_id");
@@ -28,6 +29,9 @@ if($id != "") {
$description = $result['description'];
}
+# get bug id's
+$bugs = $conn->query("SELECT id, title FROM bugs");
+
?>
<form action="update.php?id=<?php echo $id; ?>" method="post">
@@ -35,6 +39,14 @@ if($id != "") {
<p>Title: <input name="title" type="text" value="<?php echo $title; ?>"></p>
<p>Submitted by: <?php echo $submitter; ?></p>
<p>Description: <br><textarea name="description" rows=25 cols=80><?php echo $description; ?></textarea></p>
+<p>Assign to bug: <select name="bug_id">
+<option value="">None</option>
+<?php
+foreach($bugs as $bug) {
+ echo "<option value=$bug[id]>$bug[title]</option>";
+}
+?>
+</select></p>
<input type="submit" value="submit" >
</form>