~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to html/user/results.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
 
2
 
2
3
// show recent results for a host or user
3
4
 
4
 
require_once("../inc/db.inc");
 
5
require_once("../inc/boinc_db.inc");
5
6
require_once("../inc/util.inc");
6
7
require_once("../inc/result.inc");
7
8
 
12
13
 
13
14
$results_per_page = 20;
14
15
 
15
 
db_init();
16
16
$hostid = get_int("hostid", true);
17
17
$userid = get_int("userid", true);
18
18
$offset = get_int("offset", true);
19
19
if (!$offset) $offset=0;
20
20
 
21
21
if ($hostid) {
22
 
    $host = lookup_host($hostid);
 
22
    $host = BoincHost::lookup_id($hostid);
23
23
    $type = "computer";
24
24
    $clause = "hostid=$hostid";
25
25
} else {
30
30
    $type = "user";
31
31
    $clause = "userid=$userid";
32
32
}
33
 
page_head("Results for $type");
 
33
page_head("Tasks for $type");
34
34
result_table_start(true, false, true);
35
35
$i = 0;
36
 
$query = "select * from result where $clause order by id desc limit $offset,".($results_per_page+1);
37
 
$result = mysql_query($query);
38
 
$number_of_results = mysql_affected_rows();
 
36
$query = "$clause order by id desc limit $offset,".($results_per_page+1);
 
37
$results = BoincResult::enum($query);
 
38
$number_of_results = count($results);
39
39
echo show_result_navigation(
40
40
    $clause, $number_of_results, $offset, $results_per_page
41
41
);
42
 
while ($res = mysql_fetch_object($result) and $i<$results_per_page) {
43
 
    show_result_row($res, true, false, true);
 
42
foreach ($results as $result) {
 
43
    if ($i >= $results_per_page) break;
 
44
    show_result_row($result, true, false, true);
44
45
    $i++;
45
46
}
46
 
mysql_free_result($result);
47
47
echo "</table>\n";
48
48
 
49
49
echo show_result_navigation(