<?php require_once 'lib/Autoloader.php'; Autoloader::register(); $json = new JsonResult(); $config = new Config(); foreach ($config->getPool() as $key => $server) { try { $client = new Client($server); $result = $client->getInfo(); $json->appendResponse($server, $result->getStatistics(), $result->getDatabases()); } catch (Exception $e) { $json->appendError($server, $e->getMessage()); } } echo json_encode($json);
if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true) { // $client_id = $_SESSION['client_id']; // $links = $ROOT_URL.'billing-info.html'; $links = $ROOT_URL . 'account-information.php'; header("Location: {$links}"); } else { $client_id = session_id(); } if (isset($_POST['login'])) { //check if the login information is valid $_POST = sanitize($_POST); $client = $_POST; settype($client, 'object'); if (Client::checkLogin($client) == 1) { $_SESSION['logged_in'] = true; $clients = Client::getInfo($client); $_SESSION['client_id'] = $clients->fldClientID; $xclient = session_id(); $condition = "fldTempCartClientID='{$xclient}'"; if (TempCart::countTempcartbyCondition($condition) >= 1) { //change the client id TempCart::updateTempcartClient($_SESSION['client_id'], $xclient); $links = $ROOT_URL . 'billing-info.html'; header("Location: {$links}"); } else { $links = $ROOT_URL . 'account-information.php'; header("Location: {$links}"); } } else { $error = "Invalid username or password"; }