3 require_once 'database.inc.php';
4 @list ($id, $title) = explode('/', ltrim($Args, '/'));
7 $Article->title = "Issue #$id";
10 'SELECT * FROM issues WHERE id = ?', [$id]
12 if (!$Issue) throw new Exception('Issuenummer niet gevonden');
14 $Article->title .= ': '.htmlspecialchars($Issue->subject);
15 print "<h2>{$Article->title}</h2>\n";
17 printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
19 $Issue->author ? " door <strong>{$Issue->author}</strong>" : '',
20 showdate(preg_split('/\D/', $Issue->created))
23 printf('<p><em>%s</em> aan <strong>%s</strong></p>'."\n",
24 'Toegewezen', htmlspecialchars($Issue->assign)
28 printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
30 showdate(preg_split('/\D/', $Issue->closed))
33 $Args = "/$id"; # minimal reference
34 print placeholder_include('reply');
39 $html = nl2br(htmlspecialchars($_POST['body']));
40 $html = empty($html) ? NULL : "<p>$html</p>";
41 $query = $Db->set('issues', [
43 'subject' => $_POST['subject'],
45 'author' => $User->login,
47 if (!$query->rowCount()) {
48 throw new Exception('Issue niet opgeslagen.');
53 $sql = 'SELECT * FROM issues';
54 if (isset($_GET['open'])) {
55 $sql .= ' WHERE closed IS NULL';
57 $sql .= ' ORDER BY closed IS NOT NULL, updated DESC';
58 $query = $Db->query($sql);
62 while ($row = $query->fetch()) {
63 printf('<li><a href="%s">%s <small class="date">%s</small></a>',
64 "/$Page/{$row->id}/{$row->link}",
65 sprintf($row->closed ? '<strike>%s</strike>' : '%s',
66 htmlspecialchars($row->subject)),
67 showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3))
72 $Place['issuelist'] = ob_get_clean();