overview.php 714 B

12345678910111213141516171819202122232425262728293031
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. use Carbon\CarbonImmutable;
  3. $page_title = __("Overview");
  4. $dt_now = CarbonImmutable::now(TIMEZONE);
  5. $ranges = [];
  6. $ranges[] = [
  7. "name" => __("Year to Date"),
  8. "start" => $dt_now->startOfYear(),
  9. "end" => $dt_now->endOfYear()
  10. ];
  11. $ranges[] = [
  12. "name" => __("This Month"),
  13. "start" => $dt_now->startOfMonth(),
  14. "end" => $dt_now->endOfMonth(),
  15. ];
  16. $ranges[] = [
  17. "name" => __("Last Month"),
  18. "start" => $dt_now->subMonthNoOverflow()->startOfMonth(),
  19. "end" => $dt_now->subMonthNoOverflow()->endOfMonth(),
  20. ];
  21. View::includeOnce("header", compact("page_title"));
  22. View::include("overview", compact("page_title", "ranges"));
  23. View::includeOnce("footer");