$(function(){setTimeout(function(){window.location.reload();}, 60000)})'
]),
div('container-fluid first', [
heading(_('Needed angels:'), 1),
join($shift_panels)
])
]);
}
/**
* Renders a single shift panel for a dashboard shift with needed angels
*/
function public_dashborad_shift_render($shift)
{
$style = 'default';
if (time() + 3 * 60 * 60 > $shift['start']) {
$style = 'warning';
}
if (time() > $shift['start']) {
$style = 'danger';
}
$panel_body = glyph('time') . date('H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']);
$panel_body .= '
' . glyph('tasks') . ShiftType($shift['shifttype_id'])['name'];
if (! empty($shift['title'])) {
$panel_body .= ' (' . $shift['title'] . ')';
}
$panel_body .= '
' . glyph('map-marker') . Room($shift['RID'])['Name'];
foreach ($shift['NeedAngels'] as $needed_angels) {
$need = $needed_angels['count'] - $needed_angels['taken'];
if ($need > 0) {
$panel_body .= '
' . glyph('user') . $need . ' × ' . AngelType($needed_angels['TID'])['name'];
}
}
$panel_body = '' . $panel_body . '';
return div('panel panel-' . $style . ' col-xs-3', [
div('panel-body', [
heading($panel_body, 4)
])
]);
}
?>