AdminDashboard.class.php 541 B

123456789101112131415161718192021222324
  1. <?php
  2. class AdminDashboard {
  3. public function display($urlTree) {
  4. $dashboardPage = isset($urlTree[1]) ? $urlTree[1] : "home";
  5. switch($dashboardPage) {
  6. case "accounts":
  7. $dashboard = new AccountsAdminDashboard();
  8. break;
  9. case "users":
  10. $dashboard = new UsersAdminDashboard();
  11. break;
  12. case "data":
  13. $dashboard = new ProjectsAdminDashboard();
  14. break;
  15. case "home":
  16. case "":
  17. $dashboard = new HomeAdminDashboard();
  18. break;
  19. default:
  20. header('Location: /dashboard/');
  21. }
  22. return $dashboard->display();
  23. }
  24. }