Index: style.css =================================================================== RCS file: /repository/php-bugs-web/style.css,v retrieving revision 1.22 diff -u -r1.22 style.css --- style.css 9 Oct 2005 23:02:58 -0000 1.22 +++ style.css 10 Oct 2005 03:31:31 -0000 @@ -199,10 +199,21 @@ background: #eee; } +table.milestone { + border-spacing: 0px; + border-left: 0px; +} + table.milestone th { text-align: center; } -table.milestone td { - background: #ccc; +table.milestone td.color1 { + background: #abc; + border-left: 2px solid #fff; +} + +table.milestone td.color2 { + background: #cde; + border-left: 2px solid #fff; } Index: milestone.php =================================================================== RCS file: /repository/php-bugs-web/milestone.php,v retrieving revision 1.1 diff -u -r1.1 milestone.php --- milestone.php 9 Oct 2005 23:02:58 -0000 1.1 +++ milestone.php 10 Oct 2005 03:31:32 -0000 @@ -22,11 +22,12 @@ $milestones = array(); -static $closed_status = array('Closed', 'Bogus'); +static $closed_status = array('Closed', 'Bogus', 'Wont Fix'); $res = mysql_query("SELECT id, name from bugdb_milestones order by name"); while (($row = mysql_fetch_assoc($res))) { - $bugs = array(); + $closed_bugs = array(); + $open_bugs = array(); $closed = 0; $milestone = $row['name']; @@ -34,32 +35,69 @@ $id = (int)$row['id']; $q = mysql_query("SELECT id, bug_type, sdesc, status, assign from bugdb where milestone_id=$id"); while (($row = mysql_fetch_assoc($q))) { - $bugs[] = $row; - $closed += in_array($row['status'], $closed_status); + if (in_array($row['status'], $closed_status)) { + $closed_bugs[] = $row; + $closed++; + } else { + $open_bugs[] = $row; + } } - if (count($bugs)) - $pct = $closed / count($bugs) * 100; + if (count($open_bugs)) + $pct = round($closed / (count($open_bugs) + $closed) * 100); else $pct = 100; echo "<h1>Milestone: " . htmlspecialchars($milestone) . " [$pct %]</h1>"; - if (count($bugs)) { + if (count($open_bugs) || $closed) { echo "<table class=\"milestone\">"; - echo "<tr><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + echo "<tr><th>Todo </th><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + $color = 0; + foreach ($open_bugs as $row) { + if (!$color) { + $class = 'color1'; + $color++; + } else { + $class = 'color2'; + $color--; + } + + echo "<tr>"; + echo "<td style=\"background: #a00;\"> </td>"; + echo "<td class=\"$class\"><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['bug_type']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['status']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['sdesc']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['assign']) . "</td>"; + echo "</tr>"; + } + + echo "<tr><td colspan=\"6\" style=\"background-color: transparent; border: 0px;\"> </tr>"; + + echo "<tr><th>Done </th><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + $color = 0; + foreach ($closed_bugs as $row) { + if (!$color) { + $class = 'color1'; + $color++; + } else { + $class = 'color2'; + $color--; + } - foreach ($bugs as $row) { echo "<tr>"; - echo "<td><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; - echo "<td>" . htmlspecialchars($row['bug_type']) . "</td>"; - echo "<td>" . htmlspecialchars($row['status']) . "</td>"; - echo "<td>" . htmlspecialchars($row['sdesc']) . "</td>"; - echo "<td>" . htmlspecialchars($row['assign']) . "</td>"; + echo "<td style=\"background: #0a0;\"> </td>"; + echo "<td class=\"$class\"><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['bug_type']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['status']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['sdesc']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['assign']) . "</td>"; echo "</tr>"; } + echo "</table>"; } echo "<br/>";