engelsystem/includes/controller/public_dashboard_controller...

30 lines
671 B
PHP
Raw Normal View History

2017-12-11 22:26:36 +01:00
<?php
/**
* Loads all data for the public dashboard
*/
function public_dashboard_controller()
{
2017-12-12 21:57:57 +01:00
$stats = [
'needed-3-hours' => stats_angels_needed_three_hours(),
'needed-night' => stats_angels_needed_for_nightshifts(),
'angels-working' => stats_currently_working(),
'hours-to-work' => stats_hours_to_work()
];
2017-12-11 22:26:36 +01:00
2017-12-12 21:57:57 +01:00
$free_shifts = Shifts_free(time(), time() + 12 * 60 * 60);
2017-12-11 22:26:36 +01:00
return [
2017-12-12 21:57:57 +01:00
_('Engelsystem Public Dashboard'),
public_dashboard_view($stats, $free_shifts)
2017-12-11 22:26:36 +01:00
];
}
/**
* Returns url to public dashboard
*/
function public_dashboard_link()
{
return page_link_to('public-dashboard');
}
2017-12-11 22:26:36 +01:00
?>