svn path=/trunk/boinc/; revision=26113

This commit is contained in:
David Anderson 2012-09-14 08:05:16 +00:00
parent 49c8a5b3c7
commit 1a6cce9647
2 changed files with 18 additions and 5 deletions

View File

@ -5,7 +5,7 @@
// from the Institute for Computing Technology in Beijing
//
define("PROJECT", "http://casbak.ihep.ac.cn/casw/");
define("PROJECT", "http://casathome.ihep.ac.cn/");
function usage() {
global $argv;
@ -43,7 +43,6 @@ function handle_submit() {
global $argc, $argv;
if ($argc != 3) usage();
if (!is_file($argv[2])) die("seq file missing");
//$auth = $argv[3];
$auth = get_auth();
$req_xml = "
<tt_request>

View File

@ -77,6 +77,17 @@ function print_batch($batch) {
";
}
function print_state($batch) {
$status="none";
switch ($batch->state) {
case 1: $status = "In progress";break;
case 2: $status = "Completed";break;
case 3: $status = "Aborted";break;
case 4: $status = "Retired";break;
}
echo "ID: $batch->id $status\n";
}
function handle_query() {
global $argc, $argv;
if ($argc != 3) usage();
@ -90,20 +101,23 @@ function handle_query() {
}
if ($argv[2] == 'all') {
foreach ($batches as $batch) {
print_batch($batch);
//print_batch($batch);
print_state($batch);
}
} else if (is_numeric($argv[2])) {
$batch_id = $argv[2];
foreach ($batches as $batch) {
if ($batch->id == $batch_id) {
print_batch($batch);
//print_batch($batch);
print_state($batch);
}
}
} else {
$app_name = $argv[2];
foreach ($batches as $batch) {
if ($batch->app_name == $app_name) {
print_batch($batch);
//print_batch($batch);
print_state($batch);
}
}
}