2008-02-11 23:38:31 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2008-02-11 23:38:31 +00:00
|
|
|
|
|
|
|
require_once("../inc/bossa_db.inc");
|
2008-02-15 15:25:44 +00:00
|
|
|
require_once("../inc/bolt_db.inc");
|
2008-11-01 03:07:44 +00:00
|
|
|
require_once("../inc/util_ops.inc");
|
2008-02-11 23:38:31 +00:00
|
|
|
|
2008-07-15 21:43:45 +00:00
|
|
|
function job_state_string($s) {
|
|
|
|
switch ($s) {
|
|
|
|
case 0: return "Embargoed";
|
|
|
|
case 1: return "In progress";
|
|
|
|
case 2: return "Completed";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function include_app_file($app_id) {
|
|
|
|
$app = BossaApp::lookup_id($app_id);
|
|
|
|
$file = "../inc/$app->short_name.inc";
|
|
|
|
require_once($file);
|
|
|
|
}
|
|
|
|
|
2008-11-24 20:27:18 +00:00
|
|
|
function show_bossa_app($app, $i) {
|
2008-08-07 22:50:05 +00:00
|
|
|
$j = $i%2;
|
|
|
|
echo "<tr class=row$j>
|
2008-02-12 20:33:05 +00:00
|
|
|
<td>Name: $app->name<br>
|
|
|
|
Short name: $app->short_name<br>
|
|
|
|
Description: $app->description<br>
|
|
|
|
Created: ".date_str($app->create_time)."
|
|
|
|
</td>
|
2008-02-11 23:38:31 +00:00
|
|
|
<td>
|
|
|
|
";
|
|
|
|
if ($app->hidden) {
|
2008-02-13 04:25:52 +00:00
|
|
|
show_button("bossa_admin.php?action=unhide&app_id=$app->id", "Unhide", "Unhide this app");
|
2008-02-11 23:38:31 +00:00
|
|
|
} else {
|
2008-02-13 04:25:52 +00:00
|
|
|
show_button("bossa_admin.php?action=hide&app_id=$app->id", "Hide", "Hide this app");
|
2008-02-11 23:38:31 +00:00
|
|
|
}
|
2008-02-15 15:25:44 +00:00
|
|
|
echo "<br>";
|
2008-07-14 22:32:20 +00:00
|
|
|
show_button("bossa_admin.php?action=show_batches&app_id=$app->id", "Show batches", "Show batches");
|
2008-02-11 23:38:31 +00:00
|
|
|
}
|
|
|
|
|
2008-11-24 20:27:18 +00:00
|
|
|
function show_bossa_apps() {
|
2008-02-11 23:38:31 +00:00
|
|
|
$apps = BossaApp::enum();
|
|
|
|
start_table();
|
2008-02-13 04:25:52 +00:00
|
|
|
row1("Existing apps", 2);
|
|
|
|
table_header("Name/description", "");
|
2008-08-07 22:50:05 +00:00
|
|
|
$i = 0;
|
2008-02-11 23:38:31 +00:00
|
|
|
foreach ($apps as $app) {
|
2008-11-24 20:27:18 +00:00
|
|
|
show_bossa_app($app, $i++);
|
2008-02-11 23:38:31 +00:00
|
|
|
}
|
|
|
|
end_table();
|
|
|
|
}
|
|
|
|
|
|
|
|
function add_app_form() {
|
|
|
|
echo "
|
2008-02-13 04:25:52 +00:00
|
|
|
<form action=bossa_admin.php method=get>
|
2008-03-03 19:33:32 +00:00
|
|
|
<input type=hidden name=action value=add_app>
|
2008-02-11 23:38:31 +00:00
|
|
|
";
|
|
|
|
start_table();
|
|
|
|
row1("Add app");
|
2008-02-13 19:02:44 +00:00
|
|
|
row2(
|
2014-10-02 19:15:54 +00:00
|
|
|
"Name<br><p class=\"text-muted\">Visible to users</p>",
|
2008-02-13 19:02:44 +00:00
|
|
|
"<input name=app_name>"
|
|
|
|
);
|
|
|
|
row2(
|
2014-10-02 19:15:54 +00:00
|
|
|
"Short name<br><p class=\"text-muted\">Used in file and function names - no spaces or special characters</p>",
|
2008-02-13 19:02:44 +00:00
|
|
|
"<input name=short_name>"
|
|
|
|
);
|
|
|
|
row2(
|
2014-10-02 19:15:54 +00:00
|
|
|
"Description<br><p class=\"text-muted\">Visible to users</p>",
|
2008-02-13 19:02:44 +00:00
|
|
|
"<textarea name=description cols=60></textarea>"
|
|
|
|
);
|
2008-07-17 20:58:42 +00:00
|
|
|
row2("Average time per job", "<input name=time_estimate> seconds");
|
|
|
|
row2("Time limit per job", "<input name=time_limit> seconds");
|
2008-07-15 21:43:45 +00:00
|
|
|
row2("Fraction of calibration jobs", "<input name=calibration_frac>");
|
2008-02-13 19:02:44 +00:00
|
|
|
row2("Name of Bolt training course", "<input name=training_course>");
|
2014-10-02 19:15:54 +00:00
|
|
|
row2("", "<input class=\"btn btn-default\" type=submit submit value=\"Create app\">");
|
2008-02-11 23:38:31 +00:00
|
|
|
end_table();
|
|
|
|
echo "</form>";
|
|
|
|
}
|
|
|
|
|
|
|
|
function user_settings() {
|
|
|
|
global $user;
|
|
|
|
$flags = $user->bossa->flags;
|
2008-03-03 19:33:32 +00:00
|
|
|
echo "<form action=bossa_admin.php method=get>
|
|
|
|
<input type=hidden name=action value=update_user>
|
|
|
|
";
|
2008-02-11 23:38:31 +00:00
|
|
|
start_table();
|
|
|
|
row1("User settings");
|
|
|
|
$x = ($flags&BOLT_FLAGS_SHOW_ALL)?"checked":"";
|
|
|
|
row2("Show hidden apps?", "<input type=checkbox name=show_all $x>");
|
|
|
|
$x = ($flags&BOLT_FLAGS_DEBUG)?"checked":"";
|
|
|
|
row2("Show debugging output?", "<input type=checkbox name=debug $x>");
|
2014-10-02 19:15:54 +00:00
|
|
|
row2("", "<input class=\"btn btn-default\" type=submit value=\"Update user\">");
|
2008-02-11 23:38:31 +00:00
|
|
|
end_table();
|
|
|
|
echo "</form>";
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_all() {
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Bossa administration");
|
2008-11-24 20:27:18 +00:00
|
|
|
show_bossa_apps();
|
2008-02-11 23:38:31 +00:00
|
|
|
echo "<p>";
|
|
|
|
add_app_form();
|
|
|
|
echo "<p>";
|
|
|
|
user_settings();
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-07-15 21:43:45 +00:00
|
|
|
}
|
|
|
|
|
2008-07-20 21:27:44 +00:00
|
|
|
function job_duration($inst) {
|
|
|
|
if ($inst->finish_time) {
|
|
|
|
$d = $inst->finish_time - $inst->create_time;
|
|
|
|
$d /= 60;
|
|
|
|
$d = number_format($d, 2);
|
|
|
|
$d = "$d min.";
|
|
|
|
} else {
|
|
|
|
$d = "---";
|
|
|
|
}
|
|
|
|
return $d;
|
|
|
|
}
|
|
|
|
|
|
|
|
function job_show_instances($job) {
|
2008-07-18 20:59:59 +00:00
|
|
|
$insts = BossaJobInst::enum("job_id=$job->id");
|
2008-07-15 21:43:45 +00:00
|
|
|
if (!count($insts)) {
|
|
|
|
echo "---";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
start_table();
|
|
|
|
table_header("User", "Start", "Duration", "Result");
|
|
|
|
foreach ($insts as $inst) {
|
|
|
|
$user = BoincUser::lookup_id($inst->user_id);
|
|
|
|
$t = time_str($inst->create_time);
|
2008-07-20 21:27:44 +00:00
|
|
|
$d = job_duration($inst);
|
2008-07-15 21:43:45 +00:00
|
|
|
echo "<tr>
|
2008-07-18 20:59:59 +00:00
|
|
|
<td><a href=bossa_admin.php?action=show_user&app_id=$job->app_id&user_id=$user->id>$user->name</a></td>
|
2008-07-15 21:43:45 +00:00
|
|
|
<td>$t</td>
|
|
|
|
<td>$d</td>
|
|
|
|
<td>
|
|
|
|
";
|
2008-07-31 18:28:49 +00:00
|
|
|
echo instance_summary($inst->get_opaque_data());
|
2008-07-15 21:43:45 +00:00
|
|
|
echo "
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
end_table();
|
2008-02-11 23:38:31 +00:00
|
|
|
}
|
|
|
|
|
2008-07-14 22:32:20 +00:00
|
|
|
function show_batch($batch_id) {
|
|
|
|
$batch = BossaBatch::lookup_id($batch_id);
|
2008-07-15 21:43:45 +00:00
|
|
|
if (!$batch) error_page("No such batch");
|
|
|
|
include_app_file($batch->app_id);
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Jobs for batch $batch->name");
|
2008-07-14 22:32:20 +00:00
|
|
|
$jobs = BossaJob::enum("batch_id=$batch_id");
|
2008-07-15 21:43:45 +00:00
|
|
|
start_table();
|
|
|
|
table_header("ID", "Created", "State", "Instances");
|
2008-08-07 22:50:05 +00:00
|
|
|
$i = 0;
|
2008-02-13 04:25:52 +00:00
|
|
|
foreach ($jobs as $job) {
|
2008-07-15 21:43:45 +00:00
|
|
|
$t = time_str($job->create_time);
|
|
|
|
$s = job_state_string($job->state);
|
2008-08-07 22:50:05 +00:00
|
|
|
$j = $i++ % 2;
|
|
|
|
echo "<tr class=row$j>
|
2008-07-15 21:43:45 +00:00
|
|
|
<td>
|
2008-07-20 21:27:44 +00:00
|
|
|
$job->id <a href=bossa_admin.php?action=job_show_insts&job_id=$job->id>(details)</a><br>
|
2008-07-15 21:43:45 +00:00
|
|
|
";
|
2008-07-20 21:27:44 +00:00
|
|
|
echo job_summary($job);
|
2008-07-15 21:43:45 +00:00
|
|
|
echo "
|
|
|
|
</td>
|
|
|
|
<td>$t</td>
|
|
|
|
<td>$s</td>
|
|
|
|
<td>
|
|
|
|
";
|
2008-07-20 21:27:44 +00:00
|
|
|
job_show_instances($job);
|
2008-02-13 04:25:52 +00:00
|
|
|
echo "
|
2008-07-15 21:43:45 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2008-02-13 04:25:52 +00:00
|
|
|
";
|
|
|
|
}
|
2008-07-15 21:43:45 +00:00
|
|
|
end_table();
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-07-14 22:32:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function show_batches($app_id) {
|
|
|
|
$batches = BossaBatch::enum("app_id = $app_id");
|
2008-07-18 20:59:59 +00:00
|
|
|
$app = BossaApp::lookup_id($app_id);
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Batches ($app->name)");
|
2008-07-15 21:43:45 +00:00
|
|
|
start_table();
|
2008-07-15 22:44:36 +00:00
|
|
|
table_header("ID", "Name", "Calibration?", "Created", "Jobs", "Completed");
|
2008-07-14 22:32:20 +00:00
|
|
|
foreach ($batches as $batch) {
|
2008-07-18 20:59:59 +00:00
|
|
|
table_row(
|
2008-08-20 16:49:37 +00:00
|
|
|
"$batch->id | <a href=bossa_admin.php?action=show_batch&batch_id=$batch->id>show jobs</a> | <a href=bossa_admin.php?action=clear_batch_confirm&batch_id=$batch->id>delete instances</a>",
|
2008-07-18 20:59:59 +00:00
|
|
|
"$batch->name",
|
|
|
|
$batch->calibration?"yes":"no",
|
|
|
|
time_str($batch->create_time),
|
|
|
|
BossaJob::count("batch_id=$batch->id"),
|
|
|
|
BossaJob::count("batch_id=$batch->id and state=2")
|
|
|
|
);
|
2008-07-14 22:32:20 +00:00
|
|
|
}
|
2008-07-15 21:43:45 +00:00
|
|
|
end_table();
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-02-13 04:25:52 +00:00
|
|
|
}
|
|
|
|
|
2008-07-20 21:27:44 +00:00
|
|
|
function job_show_insts($job_id) {
|
2008-07-15 21:43:45 +00:00
|
|
|
$job = BossaJob::lookup_id($job_id);
|
|
|
|
include_app_file($job->app_id);
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Instances of job $job_id");
|
2008-07-20 21:27:44 +00:00
|
|
|
job_show_instances($job);
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-02-13 04:25:52 +00:00
|
|
|
}
|
|
|
|
|
2008-07-20 21:27:44 +00:00
|
|
|
function calibration_job_string($inst, $job) {
|
|
|
|
if ($inst->calibration) {
|
2009-04-10 23:36:32 +00:00
|
|
|
$i = $job->get_opaque_data();
|
2008-07-20 21:27:44 +00:00
|
|
|
return "yes: ".instance_summary($i->answer);
|
|
|
|
} else {
|
|
|
|
return "no";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-24 23:58:49 +00:00
|
|
|
function show_bossa_user() {
|
2008-07-18 20:59:59 +00:00
|
|
|
$user_id = get_int('user_id');
|
|
|
|
$app_id = get_int('app_id');
|
|
|
|
$user = BoincUser::lookup_id("$user_id");
|
|
|
|
BossaUser::lookup($user);
|
|
|
|
$app = BossaApp::lookup_id($app_id);
|
|
|
|
|
|
|
|
include_app_file($app_id);
|
2009-04-17 02:55:46 +00:00
|
|
|
admin_page_head("$user->name ($app->name)");
|
|
|
|
$x = user_summary($user);
|
|
|
|
if ($x) {
|
|
|
|
echo "User info: $x<br>";
|
|
|
|
}
|
2008-07-18 20:59:59 +00:00
|
|
|
$insts = BossaJobInst::enum("user_id=$user_id");
|
2008-07-20 21:27:44 +00:00
|
|
|
start_table();
|
2009-04-17 02:55:46 +00:00
|
|
|
table_header("Job", "Calibration?", "Start", "Duration", "Response");
|
2008-07-18 20:59:59 +00:00
|
|
|
foreach ($insts as $inst) {
|
2008-07-20 21:27:44 +00:00
|
|
|
$job = BossaJob::lookup_id($inst->job_id);
|
|
|
|
table_row(
|
|
|
|
"$inst->job_id <a href=bossa_admin.php?action=job_show_insts&job_id=$inst->job_id>(details)</a><br>".job_summary($job),
|
|
|
|
calibration_job_string($inst, $job),
|
|
|
|
time_str($inst->create_time),
|
|
|
|
job_duration($inst),
|
2009-04-10 23:36:32 +00:00
|
|
|
instance_summary($inst->get_opaque_data())
|
2008-07-20 21:27:44 +00:00
|
|
|
);
|
2008-07-18 20:59:59 +00:00
|
|
|
}
|
2008-07-20 21:27:44 +00:00
|
|
|
end_table();
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-07-18 20:59:59 +00:00
|
|
|
}
|
2008-02-13 04:25:52 +00:00
|
|
|
|
2008-08-20 16:49:37 +00:00
|
|
|
function clear_batch_confirm($batch_id) {
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Confirm delete instances");
|
2008-08-20 16:49:37 +00:00
|
|
|
echo "
|
|
|
|
This will permanently delete all results from this batch.
|
|
|
|
<p>
|
|
|
|
Are you sure you want to do this?
|
|
|
|
<p>
|
|
|
|
<a href=bossa_admin.php?action=clear_batch&batch_id=$batch_id>Yes</a>
|
|
|
|
";
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-08-20 16:49:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function clear_batch($batch_id) {
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Deleting instances");
|
2008-08-20 16:49:37 +00:00
|
|
|
if (BossaJobInst::delete_aux("batch_id=$batch_id")) {
|
|
|
|
echo "Job instances deleted.";
|
2009-04-10 23:36:32 +00:00
|
|
|
$jobs = BossaJob::enum("batch_id=$batch_id");
|
|
|
|
foreach ($jobs as $job) {
|
|
|
|
$job->update("priority_0=1");
|
|
|
|
}
|
2008-08-20 16:49:37 +00:00
|
|
|
} else {
|
|
|
|
echo "Database error.";
|
|
|
|
}
|
2011-05-27 19:05:23 +00:00
|
|
|
$jobs = BossaJob::enum("batch_id=$batch_id");
|
|
|
|
foreach ($jobs as $job) {
|
|
|
|
$job->update("state=1");
|
|
|
|
}
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-08-20 16:49:37 +00:00
|
|
|
}
|
|
|
|
|
2008-02-11 23:38:31 +00:00
|
|
|
$user = get_logged_in_user();
|
2008-06-30 23:05:16 +00:00
|
|
|
|
|
|
|
$db = BossaDb::get();
|
|
|
|
if (!$db) error_page("Can't connect to database server");
|
|
|
|
|
2008-07-13 04:26:23 +00:00
|
|
|
if (!$db->table_exists('bossa_app')) {
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_head("Create Bossa database");
|
2008-06-30 23:05:16 +00:00
|
|
|
$db_name = $db->db_name;
|
|
|
|
echo "
|
|
|
|
The database tables for Bossa don't seem to exist.
|
|
|
|
To create them, go to ~/boinc/db and type
|
|
|
|
<pre>
|
|
|
|
mysql $db_name < bossa_schema.sql
|
2009-04-10 23:08:40 +00:00
|
|
|
mysql $db_name < bossa_constraints.sql
|
2008-06-30 23:05:16 +00:00
|
|
|
</pre>
|
|
|
|
Then <a href=bossa_admin.php>reload this page</a>.
|
|
|
|
";
|
2008-11-01 03:07:44 +00:00
|
|
|
admin_page_tail();
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-06-30 23:05:16 +00:00
|
|
|
}
|
|
|
|
|
2008-03-03 19:33:32 +00:00
|
|
|
BossaUser::lookup($user);
|
2008-02-11 23:38:31 +00:00
|
|
|
|
2008-02-15 15:25:44 +00:00
|
|
|
$action = get_str('action', true);
|
|
|
|
switch ($action) {
|
2008-03-03 19:33:32 +00:00
|
|
|
case 'add_app':
|
2008-02-11 23:38:31 +00:00
|
|
|
$name = BossaDb::escape_string(get_str('app_name'));
|
2008-02-13 04:25:52 +00:00
|
|
|
$short_name = get_str('short_name');
|
2008-02-11 23:38:31 +00:00
|
|
|
$description = BossaDb::escape_string(get_str('description'));
|
2008-07-17 20:58:42 +00:00
|
|
|
$training_course = get_str('training_course', true);
|
2008-02-13 19:02:44 +00:00
|
|
|
if (strlen($training_course)) {
|
|
|
|
$course = BoltCourse::lookup_name($training_course);
|
|
|
|
if (!$course) {
|
|
|
|
error_page("No course named $training_course");
|
|
|
|
}
|
|
|
|
$courseid = $course->id;
|
|
|
|
} else {
|
|
|
|
$courseid = 0;
|
|
|
|
}
|
2008-07-17 20:58:42 +00:00
|
|
|
$time_estimate = get_str('time_estimate');
|
2009-04-10 23:08:40 +00:00
|
|
|
if (!$time_estimate) $time_estimate = 60;
|
2008-07-17 20:58:42 +00:00
|
|
|
$time_limit = get_str('time_limit');
|
2009-04-10 23:08:40 +00:00
|
|
|
if (!$time_limit) $time_limit = 3600;
|
2008-07-17 20:58:42 +00:00
|
|
|
$calibration_frac = get_str('calibration_frac' , true);
|
2008-07-31 18:28:49 +00:00
|
|
|
if (!$calibration_frac) $calibration_frac = 0;
|
2008-02-11 23:38:31 +00:00
|
|
|
$now = time();
|
2008-07-17 20:58:42 +00:00
|
|
|
$app_id = BossaApp::insert("(create_time, name, short_name, description, bolt_course_id, time_estimate, time_limit, calibration_frac) values ($now, '$name', '$short_name', '$description', $courseid, $time_estimate, $time_limit, $calibration_frac)");
|
2008-02-13 19:02:44 +00:00
|
|
|
if ($courseid) {
|
|
|
|
$course->update("bossa_app_id=$app_id");
|
|
|
|
}
|
2008-02-13 04:25:52 +00:00
|
|
|
Header('Location: bossa_admin.php');
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-03-03 19:33:32 +00:00
|
|
|
case 'update_user':
|
2008-02-11 23:38:31 +00:00
|
|
|
$flags = 0;
|
|
|
|
if (get_str('show_all', true)) $flags |= BOLT_FLAGS_SHOW_ALL;
|
|
|
|
if (get_str('debug', true)) $flags |= BOLT_FLAGS_DEBUG;
|
|
|
|
$user->bossa->update("flags=$flags");
|
|
|
|
$user->bossa->flags = $flags;
|
2008-02-13 04:25:52 +00:00
|
|
|
Header('Location: bossa_admin.php');
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
|
|
|
case 'show_user':
|
2008-11-24 23:58:49 +00:00
|
|
|
show_bossa_user();
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-07-14 22:32:20 +00:00
|
|
|
case 'show_batches':
|
2008-08-20 16:49:37 +00:00
|
|
|
$app_id = get_int('app_id');
|
2008-07-14 22:32:20 +00:00
|
|
|
show_batches($app_id);
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-07-14 22:32:20 +00:00
|
|
|
case 'show_batch':
|
2008-08-20 16:49:37 +00:00
|
|
|
$batch_id = get_int('batch_id');
|
2008-07-14 22:32:20 +00:00
|
|
|
show_batch($batch_id);
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-07-20 21:27:44 +00:00
|
|
|
case 'job_show_insts':
|
2008-08-20 16:49:37 +00:00
|
|
|
$job_id = get_int('job_id');
|
2008-07-20 21:27:44 +00:00
|
|
|
job_show_insts($job_id);
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-02-15 15:25:44 +00:00
|
|
|
case 'hide':
|
|
|
|
$app_id = get_int('app_id');
|
|
|
|
$app = BossaApp::lookup_id($app_id);
|
|
|
|
if (!$app) error_page("no such app");
|
|
|
|
$app->update("hidden=1");
|
|
|
|
break;
|
|
|
|
case 'unhide':
|
|
|
|
$app_id = get_int('app_id');
|
|
|
|
$app = BossaApp::lookup_id($app_id);
|
|
|
|
if (!$app) error_page("no such app");
|
|
|
|
$app->update("hidden=0");
|
|
|
|
break;
|
2008-08-20 16:49:37 +00:00
|
|
|
case 'clear_batch_confirm':
|
|
|
|
$batch_id = get_int('batch_id');
|
|
|
|
clear_batch_confirm($batch_id);
|
|
|
|
exit;
|
|
|
|
case 'clear_batch':
|
|
|
|
$batch_id = get_int('batch_id');
|
|
|
|
clear_batch($batch_id);
|
|
|
|
exit;
|
2008-02-15 15:25:44 +00:00
|
|
|
case '':
|
|
|
|
show_all();
|
2008-07-18 20:59:59 +00:00
|
|
|
exit;
|
2008-02-15 15:25:44 +00:00
|
|
|
default:
|
|
|
|
error_page("unknown action $action");
|
2008-02-11 23:38:31 +00:00
|
|
|
}
|
2008-02-15 15:25:44 +00:00
|
|
|
Header('Location: bossa_admin.php');
|
2008-02-11 23:38:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
?>
|