'tcp://10.16.17.154:8529', ConnectionOptions::OPTION_ENDPOINT => 'tcp://' . $server . ':8529', // authorization type to use (currently supported: 'Basic') ConnectionOptions::OPTION_AUTH_TYPE => 'Basic', // user for basic authorization ConnectionOptions::OPTION_AUTH_USER => $dbuser, // password for basic authorization ConnectionOptions::OPTION_AUTH_PASSWD => $passwd, // connection persistence on server. can use either 'Close' (one-time connections) or 'Keep-Alive' (re-used connections) ConnectionOptions::OPTION_CONNECTION => 'Close', // connect timeout in seconds ConnectionOptions::OPTION_TIMEOUT => 3, // whether or not to reconnect when a keep-alive connection has timed out on server ConnectionOptions::OPTION_RECONNECT => true, // optionally create new collections when inserting documents ConnectionOptions::OPTION_CREATE => true, // optionally create new collections when inserting documents ConnectionOptions::OPTION_UPDATE_POLICY => UpdatePolicy::LAST, ConnectionOptions::OPTION_DATABASE => 'database', ); // open connection $connection = new Connection($connectionOptions); $collectionHandler = new CollectionHandler($connection); $documentHandler = new DocumentHandler($connection); if (!isset($_SESSION['name'])){ $statement = new Statement($connection, [ 'query' => 'for question in questions filter question.type=="aux" return question', 'count' => true, 'batchSize' => 1000, 'bindVars' => null, 'sanitize' => true, ] ); $cursor = $statement->execute(); $questions = array(); foreach ($cursor->getAll() as $doc) { $questions[] = json_decode(json_encode($doc)); } $seite = new \goeranh\Seite("Abiturumfrage"); $inhalt = '
'; $seite->addInhalt($inhalt); $seite->augeben(); }elseif(!isset($_SESSION['personal'])){ $statement = new Statement($connection, [ 'query' => 'for question in questions filter question.type=="personal" return question', 'count' => true, 'batchSize' => 1000, 'bindVars' => null, 'sanitize' => true, ] ); $cursor = $statement->execute(); $questions = array(); foreach ($cursor->getAll() as $doc) { $questions[] = json_decode(json_encode($doc)); } $seite = new \goeranh\Seite("Abiturumfrage"); $inhalt = ' '; $seite->addInhalt($inhalt); $seite->augeben(); }elseif(!isset($_SESSION['schueler'])){ $statement = new Statement($connection, [ 'query' => 'for question in questions filter question.type=="schülerawards" return question', 'count' => true, 'batchSize' => 1000, 'bindVars' => null, 'sanitize' => true, ] ); $cursor = $statement->execute(); $questions = array(); foreach ($cursor->getAll() as $doc) { $questions[] = json_decode(json_encode($doc)); } $seite = new \goeranh\Seite("Abiturumfrage"); $inhalt = ' '; $seite->addInhalt($inhalt); $seite->augeben(); }elseif(!isset($_SESSION['lehrer'])){ $statement = new Statement($connection, [ 'query' => 'for question in questions filter question.type=="lehrerawards" return question', 'count' => true, 'batchSize' => 1000, 'bindVars' => null, 'sanitize' => true, ] ); $cursor = $statement->execute(); $questions = array(); foreach ($cursor->getAll() as $doc) { $questions[] = json_decode(json_encode($doc)); } $seite = new \goeranh\Seite("Abiturumfrage"); $inhalt = ' '; $seite->addInhalt($inhalt); $seite->augeben(); }else{ $seite = new \goeranh\Seite('Danke fürs Mitmachen!'); $inhalt = '