Commit: 202e66ea7fc8d694ef08c9f38079370d5dcee4e6 Author: Sobak <[email protected]> Sun, 28 Dec 2014 06:47:41 +0100 Parents: ee950efc6fc0458a1e9eec1ab11fdb86806999a4 Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=202e66ea7fc8d694ef08c9f38079370d5dcee4e6 Log: stats.php code cleanup Changed paths: M www/css/style.css M www/stats.php Diff: diff --git a/www/css/style.css b/www/css/style.css index 4e90e14..35d7e0d 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -338,7 +338,7 @@ div.success ul { text-align: right; padding: 0em .2em .2em .2em; } -.bug_header { +tr.bug_header th { background-color: #aabbcc; color: #000000; font-size: 80%; diff --git a/www/stats.php b/www/stats.php index e6aa1eb..3c9d631 100644 --- a/www/stats.php +++ b/www/stats.php @@ -164,7 +164,7 @@ while ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { echo "</table>\n\n"; } echo "<table style='float:left; margin-right:20px'>\n". - "<tr><th colspan='2' class='bug_header'>{$row["d"]}</th></tr>\n"; + "<tr class='bug_header'><th colspan='2'>{$row["d"]}</th></tr>\n"; $last_date = $row['d']; } $version = htmlentities($row["formatted_version"], ENT_QUOTES, 'UTF-8'); @@ -206,10 +206,10 @@ function bugstats($status, $name) function sort_url($name) { - global $sort_by, $rev, $phpver, $category, $developer, $titles; + global $sort_by, $rev, $titles; if ($name == $sort_by) { - $reve = ($rev == 1) ? 0 : 1; + $reve = (int) !$rev; } else { $reve = 1; } @@ -218,9 +218,8 @@ function sort_url($name) } else { $attr = 'class="bug_stats_choosen"'; } - return '<a href="./stats.php?sort_by=' . urlencode($name) . - '&rev=' . $reve . '&category=' . $category . - '&developer=' . $developer . '" ' . $attr . '>' . + return '<a href="stats.php?sort_by=' . urlencode($name) . + '&rev=' . $reve . '" ' . $attr . '>' . $titles[$name] . '</a>'; } @@ -228,16 +227,16 @@ function display_stat_header($total, $grandtotal = true) { global $titles; - $stat_head = " <tr>\n"; + $stat_head = " <tr class='bug_header'>\n"; if ($grandtotal) { - $stat_head .= ' <th class="bug_header">Name</th>' . "\n"; + $stat_head .= " <th>Name</th>\n"; } else { - $stat_head .= ' <th class="bug_header"> </th>' . "\n"; + $stat_head .= " <th> </th>\n"; } - $stat_head .= ' <th class="bug_header"> </th>' . "\n"; + $stat_head .= " <th> </th>\n"; foreach ($titles as $key => $val) { - $stat_head .= ' <th class="bug_header">' . sort_url($key) . "</th>\n"; + $stat_head .= ' <th>' . sort_url($key) . "</th>\n"; } $stat_head .= '</tr>' . "\n"; -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
