2007-10-18 21:43:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/bossa_db.inc");
|
|
|
|
|
2008-07-14 19:13:19 +00:00
|
|
|
function bossa_job_create(
|
|
|
|
$app_id, $batch_id, $info, $is_calibration, $priority
|
|
|
|
) {
|
2008-07-13 04:26:23 +00:00
|
|
|
$job = new BossaJob;
|
|
|
|
$info = serialize($info);
|
|
|
|
$is_calibration = $is_calibration?1:0;
|
|
|
|
|
|
|
|
$now = time();
|
|
|
|
$int_max = 2147483647;
|
2008-07-14 22:32:20 +00:00
|
|
|
$clause = "(create_time, app_id, batch_id, state, info, is_calibration, priority_0) values ($now, $app_id, $batch_id, 1, '$info', $is_calibration, $priority)";
|
2008-07-13 04:26:23 +00:00
|
|
|
return $job->insert($clause);
|
|
|
|
}
|
|
|
|
|
2008-07-14 22:32:20 +00:00
|
|
|
function bossa_batch_create($appid, $name) {
|
|
|
|
$now = time();
|
|
|
|
return BossaBatch::insert("(create_time, app_id, name) values ($now, $appid, '$name')");
|
2008-07-13 04:26:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function bossa_app_lookup($name) {
|
|
|
|
$app = BossaApp::lookup("short_name='$name'");
|
|
|
|
if (!$app) return 0;
|
|
|
|
return $app->id;
|
|
|
|
}
|
|
|
|
|
2007-10-18 21:43:25 +00:00
|
|
|
?>
|