.
// Show results with pending credit for a user
require_once("../inc/util.inc");
require_once("../inc/boinc_db.inc");
require_once("../inc/xml.inc");
$config = get_config();
if (!parse_bool($config, "show_results")) {
error_page("This feature is turned off temporarily");
}
$format = get_str("format", true);
if ($format == "xml") {
xml_header();
$auth = BoincDb::escape_string(get_str('authenticator'));
$user = BoincUser::lookup("authenticator='$auth'");
if (!$user) {
echo "".xml_error(-136)."\n";
exit();
}
$sum = 0;
echo "\n";
$results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
foreach($results as $result) {
echo "\n";
echo " ".$result->id."\n";
echo " ".$result->workunitid."\n";
echo " ".$result->hostid."\n";
echo " ".$result->claimed_credit."\n";
echo " ".$result->received_time."\n";
echo "\n";
$sum += $result->claimed_credit;
}
echo "".$sum."\n";
echo "\n";
} else {
$user = get_logged_in_user();
$sum = 0;
page_head("Pending credit");
start_table();
echo "
Result ID | Workunit ID | Host ID | Claimed credit |
\n";
$results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
foreach($results as $result) {
echo "\n";
echo "id\">$result->id | \n";
echo "workunitid\">$result->workunitid | \n";
echo "hostid\">$result->hostid | \n";
echo "".format_credit($result->claimed_credit)." | \n";
echo "
\n";
$sum += $result->claimed_credit;
}
end_table();
echo "Pending credit: ".format_credit($sum);
page_tail();
}
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
?>