r32: Preparing for template set system.
[bugdar.git] / index.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # [#]app[#] [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 require_once('./global.php');
14
15 if (!can_perform('canviewbugs'))
16 {
17 echo 'no permission';
18 exit;
19 }
20
21 // ###################################################################
22
23 // #*# pagination needs to be done here
24
25 $bugs = $DB_sql->query("
26 SELECT bug.*, user1.displayname AS firstreport, user2.displayname AS lastpost
27 FROM " . TABLE_PREFIX . "bug AS bug
28 LEFT JOIN user AS user1
29 ON (bug.userid = user1.userid)
30 LEFT JOIN user AS user2
31 ON (bug.lastpostby = user2.userid)
32 ORDER BY bug.lastposttime DESC"
33 );
34
35 echo '<table border="1" cellspacing="2" cellpadding="4" width="100%"><tr style="background-color:#EEEEEE">';
36 echo '<td>Bug ID</td><td>Title</td><td>Reporter</td><td>Product/Version</td><td>Status/Resolution</td><td>Last Post</td></tr>';
37
38
39 while ($bug = $DB_sql->fetch_array($bugs))
40 {
41 echo "<tr>";
42 echo "<td>$bug[bugid]</td>";
43 echo "<td><a href=\"showreport.php?bugid=$bug[bugid]\">$bug[summary]</a></td>";
44 echo "<td>$bug[firstreport]</td>";
45 echo "<td>" . $bugsys->datastore['product']["$bug[productid]"]['title'] . '/' . $bugsys->datastore['version']["$bug[versionid]"]['version'] . "</td>";
46 echo "<td>" . $bugsys->datastore['status']["$bug[status]"]['status'] . '/' . $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'] . "</td>";
47 echo "<td>" . datelike('standard', $bug['lastposttime']) . ' by ' . $bug['lastpost'] . "</td>";
48 echo "</tr>";
49 }
50
51 echo '</table>';
52
53 echo '[<a href="newreport.php?">New Report</a>]';
54
55 /*=====================================================================*\
56 || ###################################################################
57 || # $HeadURL$
58 || # $Id$
59 || ###################################################################
60 \*=====================================================================*/
61 ?>