2007-10-16 17:12:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/db.inc");
|
2007-10-16 23:02:13 +00:00
|
|
|
require_once("../inc/bossa_db.inc");
|
2007-10-16 17:12:48 +00:00
|
|
|
|
|
|
|
$user = get_logged_in_user();
|
2008-02-13 19:02:44 +00:00
|
|
|
BossaUser::lookup($user);
|
2007-10-16 17:12:48 +00:00
|
|
|
|
2007-10-25 21:34:13 +00:00
|
|
|
$bossa_app_id = get_int('bossa_app_id');
|
|
|
|
$app = BossaApp::lookup_id($bossa_app_id);
|
2007-10-16 17:12:48 +00:00
|
|
|
|
|
|
|
if (!$app) {
|
|
|
|
error_page("no such app: $bossa_app_id");
|
|
|
|
}
|
|
|
|
|
2008-02-13 19:02:44 +00:00
|
|
|
// TODO: call app-specific function to get confidence
|
|
|
|
|
|
|
|
$user->conf = 1;
|
2007-10-16 23:02:13 +00:00
|
|
|
$ji = BossaJobInst::assign($app, $user);
|
2007-10-16 17:12:48 +00:00
|
|
|
if ($ji) {
|
2008-02-13 04:25:52 +00:00
|
|
|
$url = $app->short_name.".php?bji=$ji->id";
|
2007-10-16 17:12:48 +00:00
|
|
|
Header("Location: $url");
|
|
|
|
} else {
|
|
|
|
page_head("No jobs available");
|
|
|
|
echo "
|
2007-10-16 23:02:13 +00:00
|
|
|
Sorry, no more jobs are available right now.
|
|
|
|
<p>
|
2007-10-16 17:12:48 +00:00
|
|
|
Please try again later.
|
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
}
|
|
|
|
?>
|