ClientDashboard.class.php 742 B

123456789101112131415161718192021222324
  1. <?php
  2. class ClientDashboard implements IDashboard {
  3. public function display($uriTree) {
  4. return $this->home();
  5. }
  6. public function home() {
  7. $database = SqliteDatabase::getSingleton();
  8. $accounts = $database->queryArray("SELECT * FROM accounts WHERE subdomain = '" . DOMAIN . "' LIMIT 1;");
  9. $currentAccount = $accounts[0];
  10. $data = array();
  11. $data['displayName'] = $_SESSION['display_name'];
  12. $data['clientDisplayName'] = $currentAccount['display_name'];
  13. $data['sessionToken'] = "uniquetoken";
  14. $stylesheet = "default.css";
  15. if(isset($currentAccount['stylesheet'])) {
  16. $stylesheet = $currentAccount['stylesheet'];
  17. }
  18. $data['stylesheet'] = $stylesheet;
  19. return (new View())->render("clientdashboard.php", $data);
  20. }
  21. }