id); row2("founder", $team->userid); row2("name", $team->name); row2("url", $team->url); row2("type", $team->type); row2("name_html", $team->name_html); row2("description", sanitize_html($team->description)); } function display_team_page($team) { page_head("$team->name"); if ($team->name_html != null) { echo "

"; echo "$team->name_html"; } echo "

"; echo "[id>Join] "; echo "[id>Quit] "; echo "[id>Edit*] "; echo "[id>Remove Inactive Members*] "; echo "[id>Disband Team*] "; echo "[id>View Team Emails*]"; echo "
* Team founder only"; echo "
"; echo "

"; echo ""; echo "
"; echo "Team Info:
"; echo ""; if (strlen($team->description)) { row2("Description", sanitize_html($team->description)); } if (strlen($team->url)) {; row2("Web site", "url>http://$team->url"); } row2("Members", $team->nusers); $query = sprintf( "select * from user where teamid = %d", $team->id ); $result = mysql_query($query); $total_credit = 0; for ($i = 0; $i < $team->nusers; $i++) { $user = mysql_fetch_object($result); $total_credit = $total_credit + $user->total_credit; } row2("Total Credit", $total_credit); $query = sprintf( "select * from user where id = %d", $team->userid ); $result = mysql_query($query); $user = mysql_fetch_object($result); row2("Founder", $user->name); echo "
"; echo "

"; echo ""; echo "
"; echo "Team Members:
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; $query = sprintf( "select * from user where teamid = %d order by expavg_credit desc", $team->id ); $result = mysql_query($query); for ($i = 0; $i < $team->nusers; $i++) { $user = mysql_fetch_object($result); $j = $i+1; echo ""; echo ""; echo ""; echo ""; } echo "
NameTotal creditRecent average CPU
time per work unit
Country
$j) $user->name"; echo "$user->total_credit$user->expavg_credit$user->country
"; page_tail(); } // requires that the team exist function require_team($team) { if (!$team) { page_head("Error"); echo "Team does not exist."; page_tail(); exit(); } } // requires that the user is logged in as the founder of // the team trying to be edited function require_founder_login($user, $team) { require_login($user); require_team($team); if ($user->id != $team->userid) { page_head("Permission denied"); echo "Only a team's founder may edit a team."; page_tail(); exit(); } } ?>