summaryrefslogtreecommitdiff
path: root/includes/controller/public_dashboard_controller.php
blob: 3cd85a502d6812e26f2255854b134a9564a3bc37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

/**
 * Loads all data for the public dashboard
 */
function public_dashboard_controller()
{
    $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()
    ];
    
    $free_shifts = Shifts_free(time(), time() + 12 * 60 * 60);
    
    return [
        _('Public Dashboard'),
        public_dashboard_view($stats, $free_shifts)
    ];
}

/**
 * Returns url to public dashboard
 */
function public_dashboard_link()
{
    return page_link_to('public-dashboard');
}
?>