Name: ", $user->name);
$row = sprintf("%s Participant since: ", $project);
row($row, time_str($user->create_time));
row("Total credit: ", $user->total_credit);
row("Recent average credit: ", $user->expavg_credit);
if ($user->teamid) {
$result = mysql_query("select * from team where id = $user->teamid");
$team = mysql_fetch_object($result);
row("Team: ", "id>$team->name");
} else {
row("Team: ", "None");
}
echo "\n";
}
// show private user info
//
function show_user_profile($user) {
echo TABLE2."\n";
echo "
".TD2.LG_FONT."User Information:
\n";
row("name", $user->name);
row("email address", $user->email_addr);
row("country", $user->country);
row("postal (ZIP) code", $user->postal_code);
echo "Edit user information | \n";
if (1) {
echo "
|
\n";
} else {
echo "Change Password | \n";
}
echo "\n";
}
function show_hosts($user) {
$result = mysql_query("select * from host where userid=$user->id order by rpc_time desc");
echo VISTABLE."\n";
echo "Host name | Total Credit | Recent credit |
";
while ($host = mysql_fetch_object($result)) {
echo "\n";
show_host_brief($host);
}
echo "\n";
mysql_free_result($result);
}
function show_host_brief($host) {
echo "
id>$host->domain_name |
$host->total_credit |
$host->expavg_credit |
";
}
// show a summary of the user.
// NOTE: This is intended to be shown only to that user.
// it has info that other users aren't supposed to see
function show_user_page_private($user) {
echo "\n";
show_user_profile($user);
show_user_stats($user);
echo "
\n";
echo "";
}
function user_table_start() {
echo VISTABLE."
Name | Average credit | Total credit |
Participant since |
";
}
function show_user_row($user) {
echo "
$user->name |
$user->expavg_credit |
$user->total_credit |
".time_str($user->create_time)." |
\n";
}
?>