get("Session", array("title" => $_POST['newSessionName'])); if (count($matching) == 0) { // make new session! unset($matching); $session = new Session(null, $_POST['newSessionName'], null, null, null); $dbi->set($session); } else { $errorMessage[] = "A session with the name " . $_POST['newSessionName'] . " already exists!"; } } } else { $errorMessage[] = "Please enter a name for the new session!"; } } if (isset($_POST['deleteSession'])) { if (isset($_POST['sessionUID'])) { //Kan de database al objecten verwijderen? } } if (isset($_POST['editSession'])) { if (isset($_POST['sessionUID'])) { $matching = $dbi->get("SESSION", array("uid" => $_POST['sessionUID'])); if (count($matching) == 1 && $matching[0] != null) { $_SESSION['currentSession'] = $_POST['sessionUID']; redirect("pipelineEditor.php"); } } } //Get available sessions for current user //$sessions = $dbi->get("Session", array("creator"=>$_SESSION['username'])); //This does not work, session.php does not yet have a property 'creator' $sessions = $dbi->get("Session", array()); // Let's just load everything then... //var_dump($sessions); ?>