query('SELECT * FROM `tasks` WHERE `build`="'.$S['builds_log']->id.'" AND `order`='.$request['task']);
if ($r->rowCount()) {
$S['builds_task']=new sql_task($r->fetch(PDO::FETCH_ASSOC));
} else
return '404';
}
function body_builds_task() {
global $S, $request, $conf;
$task=&$S['builds_task'];
echo '
'.$task->display().'
';
echo 'build").'">Back
';
$page=isset($request['page']) && is_numeric($request['page'])?$request['page']:1;
$count=$S['pdo']->query('SELECT COUNT(*) FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order)->fetch(PDO::FETCH_COLUMN);
$pager='';
if ($count > $conf['logview_max']) {
$pager='';
echo $pager;
}
$r=$S['pdo']->query('SELECT * FROM `buildlogs` WHERE `build`=\''.$task->build.'\' AND `task`='.$task->order.' ORDER BY `order` ASC LIMIT '.$conf['logview_max'].' OFFSET '.($page-1)*$conf['logview_max']);
if ($r->rowCount()) {
echo '';
$ansi=new ansi_to_html();
while ($entry=$r->fetch(PDO::FETCH_ASSOC)) {
$entry=new sql_buildlog_entry($entry);
echo '<'.($t=($entry->stream=='stderr'?'b':'span')).' title="'.strtoupper($entry->stream).', entry #'.$entry->order.' '.date('D j M Y @ H:i:s T', $entry->timestamp).'">'.$ansi->process($entry->text)."$t>";
}
echo $ansi->reset(); // Clear any leftover s
echo '
';
echo $pager;
echo 'build").'">Back
';
} else {
if ($count) {
echo print_error("There aren't $page pages. Try an build/$task->order")."\">earlier page.");
} else {
echo print_warning('No output');
}
}
}
?>