. // web interfaces for viewing and controlling batches ini_set('display_errors', 'stdout'); error_reporting(E_ALL); require_once("../inc/util.inc"); require_once("../inc/boinc_db.inc"); require_once("../inc/result.inc"); require_once("../inc/submit_db.inc"); function show_batch($user) { $batch_id = get_int('batch_id'); $batch = BoincBatch::lookup_id($batch_id); if (!$batch || $batch->user_id != $user->id) { error_page("no batch"); } page_head("Batch $batch->id"); $results = BoincResult::enum("batch=$batch->id order by workunitid"); $i = 0; result_table_start(true, true, null); foreach ($results as $result) { show_result_row($result, true, true, true, $i++); } end_table(); page_tail(); } function show_batches($user) { $batches = BoincBatch::enum("user_id=$user->id"); page_head("Batches"); start_table(); table_header("Batch ID", "Submitted", "# jobs"); foreach ($batches as $batch) { echo " id>$batch->id ".time_str($batch->create_time)." $batch->njobs "; } end_table(); page_tail(); } $user = get_logged_in_user(); $action = get_str('action', true); switch ($action) { case '': show_batches($user); break; case 'show_batch': show_batch($user); } ?>