2007-07-27 18:30:10 +00:00
|
|
|
<?php
|
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/user.inc");
|
|
|
|
require_once("../inc/team.inc");
|
|
|
|
|
2007-10-26 21:14:35 +00:00
|
|
|
$xml = get_int('xml', true);
|
2007-07-27 18:30:10 +00:00
|
|
|
|
|
|
|
function show_delta($delta) {
|
|
|
|
global $xml;
|
|
|
|
$user = lookup_user_id($delta->userid);
|
|
|
|
$when = time_str($delta->timestamp);
|
|
|
|
$what = $delta->joining?"joined":"quit";
|
|
|
|
if ($xml) {
|
|
|
|
echo " <action>
|
|
|
|
<user_email>$user->email_addr</user_email>
|
2007-08-15 03:07:35 +00:00
|
|
|
<id>$user->id</id>
|
|
|
|
<name>$user->name</name>
|
2007-07-27 18:30:10 +00:00
|
|
|
<action>$what</action>
|
|
|
|
<total_credit>$delta->total_credit</total_credit>
|
|
|
|
<when>$when</when>
|
|
|
|
</action>
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
echo "<tr>
|
|
|
|
<td>$when</td>
|
|
|
|
<td>",user_links($user)," ($user->email_addr)</td>
|
|
|
|
<td>$what</td>
|
|
|
|
<td>$delta->total_credit</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
|
|
|
$user = get_logged_in_user();
|
|
|
|
$teamid=get_int('teamid');
|
|
|
|
$team = lookup_team($teamid);
|
|
|
|
if ($xml) {
|
|
|
|
require_once('../inc/xml.inc');
|
|
|
|
xml_header();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$team || $team->userid != $user->id) {
|
|
|
|
if ($xml) {
|
|
|
|
xml_error("-1", "Not founder");
|
|
|
|
} else {
|
|
|
|
error_page("You're not the founder of that team");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($xml) {
|
|
|
|
echo "<actions>\n";
|
|
|
|
} else {
|
|
|
|
page_head("Team history for $team->name");
|
|
|
|
start_table();
|
|
|
|
echo "<tr>
|
|
|
|
<th>When</th>
|
|
|
|
<th>User</th>
|
|
|
|
<th>Action</th>
|
|
|
|
<th>Total credit at time of action</th>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
2007-10-26 21:14:35 +00:00
|
|
|
$deltas = BoincTeamDelta::enum("teamid=$teamid order by timestamp");
|
|
|
|
foreach($deltas as $delta) {
|
2007-07-27 18:30:10 +00:00
|
|
|
show_delta($delta);
|
|
|
|
}
|
|
|
|
if ($xml) {
|
|
|
|
echo "</actions>\n";
|
|
|
|
} else {
|
|
|
|
end_table();
|
|
|
|
page_tail();
|
|
|
|
}
|
|
|
|
?>
|