예제 #1
0
function show_row($x, $y, $mode, $i)
{
    $class = $i % 2 ? "row0" : "row1";
    echo "<tr class={$class}><td>";
    switch ($mode) {
        case 'host':
            echo "<a href=show_host_detail.php?hostid={$x}>{$x}</a>";
            break;
        case 'user':
            $user = BoincUser::lookup_id($x);
            echo "<a href=show_user.php?userid={$x}>{$user->name}</a>";
            break;
        case 'team':
            $team = BoincTeam::lookup_id($x);
            if ($team) {
                echo "<a href=team_display.php?teamid={$x}>{$team->name}</a>";
            } else {
                echo "(no team)";
            }
            break;
        case 'model':
            echo $x;
            break;
        case 'day':
            echo $x;
            break;
    }
    echo "</td><td align=right>" . format_credit_large($y->credit), "</td><td align=right>{$y->nresults}</td></tr>\n";
}
예제 #2
0
function show_user($user)
{
    echo "\n        <tr class=row1>\n        <td>", user_links($user), " (ID {$user->id})</td>\n    ";
    if ($user->teamid) {
        $team = BoincTeam::lookup_id($user->teamid);
        echo "\n            <td> <a href=team_display.php?teamid={$team->id}>{$team->name}</a> </td>\n        ";
    } else {
        echo "<td><br></td>";
    }
    echo "\n        <td align=right>", format_credit($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}
예제 #3
0
function show_user_row($user, $i)
{
    echo '
		<tr class="row1">
		<td>$i</td>
		<td>' . user_links($user) . '</td>
		<td class="right">' . format_credit_large($user->expavg_credit) . '</td>
		<td class="right">' . format_credit_large($user->total_credit) . '</td>
		<td>' . $user->country . '</td>
		<td>' . time_str($user->create_time) . '</td>
		</tr>
	';
}
예제 #4
0
function show_user_row($user, $i)
{
    echo "\n        <tr class=row1>\n        <td>{$i}</td>\n        <td>", user_links($user), "</td>\n        <td align=right>", format_credit_large($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}
예제 #5
0
function show_row($item, $apps, $is_team, $i)
{
    $j = $i % 2;
    if ($is_team) {
        $team = BoincTeam::lookup_id($item->teamid);
        if (!$team) {
            return;
        }
        $x = "<td>" . team_links($team) . "</td>\n";
    } else {
        $user = BoincUser::lookup_id($item->userid);
        if (!$user) {
            return;
        }
        $x = "<td>" . user_links($user, BADGE_HEIGHT_MEDIUM) . "</td>\n";
    }
    echo "<tr class=row{$j}>";
    echo "<td>{$i}</td>\n";
    echo $x;
    foreach ($apps as $app) {
        if ($app->id == $item->appid) {
            $c = $item;
        } else {
            if ($is_team) {
                $c = BoincCreditTeam::lookup("teamid={$item->teamid} and appid={$app->id}");
            } else {
                $c = BoincCreditUser::lookup("userid={$item->userid} and appid={$app->id}");
            }
            if (!$c) {
                $c = new StdClass();
                $c->expavg = 0;
                $c->total = 0;
            }
        }
        echo "<td align=right>" . format_credit($c->expavg) . "</td><td align=right>" . format_credit_large($c->total) . "</td>\n";
    }
    echo "</tr>\n";
}
예제 #6
0
function show_user_row($user, $i)
{
    $j = $i % 2;
    echo "\n        <tr class=row{$j}>\n        <td>{$i}</td>\n        <td>", user_links($user, BADGE_HEIGHT_MEDIUM), "</td>\n        <td align=right>", format_credit_large($user->expavg_credit), "</td>\n        <td align=right>", format_credit_large($user->total_credit), "</td>\n        <td>", $user->country, "</td>\n        <td>", time_str($user->create_time), "</td>\n        </tr>\n    ";
}