queryArray("SELECT rowid AS client_id, subdomain FROM accounts;"); $clientId = 0; foreach($validAccounts as $account) { if($account['subdomain'] == DOMAIN) { $clientId = $account['client_id']; break; } } if($clientId == 0) { header("Location: http://ccldtech.com"); } $currentAccount = $database->queryArray("SELECT rowid AS client_id, * FROM accounts WHERE client_id = ".$clientId." LIMIT 1;")[0]; $data = array(); $data['currentClient'] = $currentAccount; $data['defaultStylesheet'] = DOMAIN . ".css"; $data['currentClient']['logo'] = "ccldlogo.png"; echo (new View())->render("login.php", $data);