.
 */
require_once('./conf.php');
require_once('./login-ajax.php');
$response = new response();
try {
	$client = BusinessAdmin::createClient($_pdo, $_REQUEST['name']);
	if ($client === false) {
		$response->success = false;
		$response->message = "The client could not be created due to an error.";
	} else {
		$response->success = true;
		$response->message = "Client '{$client->getName()}' has been created. Refresh the page.";
	}
} catch (PDOException $e) {
	$response->success = false;
	$response->message = "The client could not be created due to a PDO error ({$e->getMessage()}).";
}
echo $response->getJson();