2003-03-17 22:37:49 +00:00
|
|
|
<?php
|
2003-03-19 21:01:32 +00:00
|
|
|
// show all the hosts for a user.
|
|
|
|
// if $userid is absent, show hosts of logged-in user
|
|
|
|
|
2003-08-22 05:36:25 +00:00
|
|
|
require_once("db.inc");
|
2003-03-17 22:37:49 +00:00
|
|
|
require_once("util.inc");
|
|
|
|
require_once("host.inc");
|
|
|
|
|
|
|
|
db_init();
|
|
|
|
$userid = $_GET["userid"];
|
2003-03-19 21:01:32 +00:00
|
|
|
if ($userid) {
|
|
|
|
$result = mysql_query("select * from user where id=$userid");
|
|
|
|
$user = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
|
|
|
page_head("Computers belonging to $user->name");
|
|
|
|
host_table_start("Computers belonging to $user->name", false);
|
|
|
|
$private = false;
|
|
|
|
} else {
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
$userid = $user->id;
|
|
|
|
page_head("Your computers");
|
|
|
|
host_table_start("Your computers", true);
|
|
|
|
$private = true;
|
|
|
|
}
|
2003-03-17 22:37:49 +00:00
|
|
|
$i = 1;
|
2003-03-19 21:01:32 +00:00
|
|
|
$result = mysql_query("select * from host where userid=$userid order by expavg_credit desc");
|
|
|
|
while ($host = mysql_fetch_object($result)) {
|
|
|
|
show_host_row($host, $i, $private);
|
2003-03-17 22:37:49 +00:00
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
echo "</table>\n";
|
|
|
|
page_tail();
|
|
|
|
?>
|