2002-11-12 17:01:16 +00:00
|
|
|
<?php
|
2003-08-22 05:36:25 +00:00
|
|
|
require_once("db.inc");
|
2002-11-12 17:01:16 +00:00
|
|
|
require_once("util.inc");
|
2003-03-17 22:37:49 +00:00
|
|
|
require_once("host.inc");
|
2002-11-12 17:01:16 +00:00
|
|
|
|
2003-01-23 19:20:14 +00:00
|
|
|
$max_hosts_display = 100;
|
2002-11-12 17:01:16 +00:00
|
|
|
db_init();
|
2003-03-19 21:01:32 +00:00
|
|
|
page_head("Top computers");
|
2003-09-08 00:12:37 +00:00
|
|
|
$sort_by = $_GET["sort_by"];
|
|
|
|
if ($sort_by == "total_credit") {
|
|
|
|
$sort_by = "total_credit desc, total_credit desc";
|
|
|
|
} else {
|
|
|
|
$sort_by = "expavg_credit desc, total_credit desc";
|
|
|
|
}
|
|
|
|
$result = mysql_query("select * from host order by $sort_by limit $max_hosts_display");
|
2003-03-19 21:01:32 +00:00
|
|
|
host_table_start("Top computers", false);
|
2003-03-17 22:37:49 +00:00
|
|
|
$i = 1;
|
2003-01-23 19:20:14 +00:00
|
|
|
while (($host = mysql_fetch_object($result)) && $max_hosts_display > 0) {
|
2003-03-19 21:01:32 +00:00
|
|
|
show_host_row($host, $i, false);
|
2003-01-23 19:20:14 +00:00
|
|
|
$max_hosts_display--;
|
2003-03-17 22:37:49 +00:00
|
|
|
$i++;
|
2002-11-12 17:01:16 +00:00
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
echo "</table>\n";
|
|
|
|
page_tail();
|
|
|
|
?>
|