Index: /Dev/branches/jos-branch/createObject.php
===================================================================
--- /Dev/branches/jos-branch/createObject.php	(revision 208)
+++ /Dev/branches/jos-branch/createObject.php	(revision 208)
@@ -0,0 +1,51 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+if (isset($_POST['objectToCreate'])) {
+    if (!empty($_POST['objectToCreate'])) {
+        $otc = $_POST['objectToCreate'];
+    } else {
+        //die ("Invalid arguments passed!");
+    }
+} else {
+    //die ("No arguments passed!");
+}
+
+$dbi = new DatabaseInterface();
+$creator_results = $dbi->get("User", array("uid" => $_SESSION['userUid']));
+$creator = $creator_results[0];
+
+//var_dump($creator);
+
+if (!$creator) {
+    die("Stuff is broke, yo!");
+}
+
+$uid = null;
+switch (strtolower($otc)) {
+    case "application":
+        $newApp = new Application(null, "New application", "Default description", "Default style");
+        $dbi->set($newApp);
+        $uid = $newApp->uid;
+        break;
+    case "survey":
+        $newSurvey = new Survey(null, "New Survey", "Default description", $creator, null);
+        $dbi->set($newSurvey);
+        $uid = $newSurvey->uid;
+        break;
+    case "dashboard":
+        //TODO
+        break;
+    case "question":
+        $newQuestion = new Question(null, "new Question", "int", "Default description", "Standard category", array());
+        $dbi->set($newQuestion);
+        $uid = $newQuestion->uid;
+        break;
+    default:
+        //die ("Variable \$otc: $otc does not match a compatible object type!");
+        break;
+}
+
+echo $uid;
+?>
Index: /Dev/branches/jos-branch/createapplication.php
===================================================================
--- /Dev/branches/jos-branch/createapplication.php	(revision 208)
+++ /Dev/branches/jos-branch/createapplication.php	(revision 208)
@@ -0,0 +1,22 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['currentSession'])) {
+    die("No session currently active!");
+}
+
+
+$dbi = new DatabaseInterface();
+
+$newApplication = new Application(null, "New application", "Default application", "Default style");
+$dbi->set($newApplication);
+
+if (isset($_SESSION['localSessionCopy']) && !empty($_SESSION['localSessionCopy'])) {
+    $session = $_SESSION['localSessionCopy'];
+    $session->pipeline[] = $newApplication;
+    $_SESSION['localSessionCopy'] = $session;
+}
+
+redirect("pipelineEditor.php");
+?>
Index: /Dev/branches/jos-branch/createsurvey.php
===================================================================
--- /Dev/branches/jos-branch/createsurvey.php	(revision 208)
+++ /Dev/branches/jos-branch/createsurvey.php	(revision 208)
@@ -0,0 +1,29 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['username'])) {
+    redirect("index.php");
+}
+
+$dbi = new DatabaseInterface();
+$creator_results = $dbi->get("user", array("name" => $_SESSION['username']));   // Determine if user exists, so we can add him/her as creator of the new survey
+if (count($creator_results) > 0) {
+    $creator = $creator_results[0];
+    $newSurvey = new Survey(null, "New survey", "Default description", $creator, null);
+    $dbi->set($newSurvey);
+} else {
+    die("No user with that uid found!");
+}
+
+// Optional part, for when the session needs to be set in pipelineEditor
+// For now, store in local copy, only upload local copy to db when needed (page change, etc...)
+if (isset($_SESSION['localSessionCopy']) && !empty($_SESSION['localSessionCopy'])) {
+    $session = $_SESSION['localSessionCopy'];
+    $session->pipeline[] = $newSurvey;
+    $_SESSION['localSessionCopy'] = $session;
+}
+
+
+redirect("pipelineEditor.php");
+?>
Index: /Dev/branches/jos-branch/getInfo.php
===================================================================
--- /Dev/branches/jos-branch/getInfo.php	(revision 208)
+++ /Dev/branches/jos-branch/getInfo.php	(revision 208)
@@ -0,0 +1,86 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+if (isset($_POST['uid']) && isset($_POST['type'])) {
+    if (!empty($_POST['uid']) && !empty($_POST['type'])) {
+        $uid = $_POST['uid'];
+        $type = $_POST['type'];
+    } else {
+//$errors[] = "No uid passed!";
+        return;
+    }
+} else {
+//$errors[] = "Wrong call, no uid property in POST data!";
+    return;
+}
+
+$dbi = new DatabaseInterface();
+
+$results = $dbi->get($type, array("uid" => $uid));
+
+if (count($results) > 0) {      // check if DB object exists and assign it to variable
+    if ($results[0] != null) {
+        $returnString = "";
+        $result = $results[0];
+    } else
+        return;
+} else
+    return;
+
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+// Note: the next part needs to be converted to JSON operation, so that the javascript can easily handle any style changes to the information retrieved. This implementation is just silly.
+// Basic idea: return a JSON array of property: value pairs, then let javascript loop through these properties and format them suitably. This is both more flexible and easier to adjust, as well as resulting in smaller packets.
+// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+switch ($type) {
+    case "Session":
+        $returnString .= "<span class='property'>Title: </span><span class='value'>$result->title</span>";
+        $result->evaluate();
+        $returnString .= "<span class='property'>Created: </span><span class='value'>" . $result->creationdate->format("H:i:s, d-m-Y") . " by " . $result->creator->name . "</span>";
+        $cS = 0; $cD = 0; $cA = 0;
+        foreach ($result->pipeline as $step) {
+            switch (get_class($step)){
+                case "Survey":
+                    $cS++;
+                    break;
+                case "Application":
+                    $cA++;
+                    break;
+                case "Dashboard":
+                    $cD++;
+                    break;
+                default:
+                    //derp?
+                    break;
+            }
+        }
+        $returnString .= "<span class='property'>Number of steps: </span><span class='value'><ul style='list-style-type: none;'><li style='margin-left: -40px;'>$cS Surveys<li style='margin-left: -40px;'>$cA Applications<li style='margin-left: -40px;'>$cD Dashboards</ul></span>";
+        break;
+    case "Survey":
+        $returnString .= "<span class='property'>Title: </span><span class='value'>$result->title</span>";
+        $returnString .= "<span class='property'>Creator: </span><span class='value'>LOLOL ME!!!</span>";
+        $qCount = 0;
+        $qCount = count($result->questions);
+        $returnString .= "<span class='property'>Questions: </span><span class='value'>$qCount</span>";
+        $returnString .= "<span class='property'>Description: </span><span class='value'>$result->description</span>";
+        break;
+    case "Application":
+        $returnString .= "<span class='property'>Title: </span><span class='value'>$result->title</span>";
+        $returnString .= "<span class='property'>Path: </span><span class='value'>C:/folder_of_awesomeness/epicgame.exe</span>";
+        $returnString .= "<span class='property'>Description: </span><span class='value'>$result->description</span>";
+        break;
+    case "Dashboard":
+        break;
+    case "Respondent":
+        break;
+    case "Question":
+        break;
+    case "Answer":
+        break;
+    default:
+        break;
+}
+
+echo $returnString;
+?>
Index: /Dev/branches/jos-branch/index.php
===================================================================
--- /Dev/branches/jos-branch/index.php	(revision 207)
+++ /Dev/branches/jos-branch/index.php	(revision 208)
@@ -2,20 +2,53 @@
 require 'classes/master.php'; //should be at top of every page
 
+/*  Page still has ambiguous design. Login and Register buttons are at same hierarchy level, makes user suspect the register button works based on input given here.
+ *  Instead redirects to anoter page.
+ *   
+ */
+
+//Even voor tijdelijk, aangezien er nog pagina's missen en redirects daarom niet goed werken:
+if (isset($_SESSION['userUid'])) {
+    redirect("logout.php");
+}
+
+$errorMessage[] = "";
+
 if (isset($_POST['register'])) {
-    if ($_POST['username'] != null && $_POST['password'] != null) {
-        $userDBI = new UserDatabaseInterface();
-        $user_exists = $userDBI->checkUserName($_POST['username']);
-        if (!$user_exists) {
-            $userDBI->addNewUser($_POST);
+    if (isset($_POST['username']) && isset($_POST['password'])) {
+        $dbi = new DatabaseInterface();
+        $user_results = $dbi->get("user", array("name" => $_POST['username']));
+        if (count($user_results) == 0 || !$user_results) {
+            if (strlen($_POST['password']) > 6) {
+                $user = new User(null, $_POST['username'], $_POST['password']);
+                $dbi->set($user);
+                $_SESSION['userUid'] = $user->uid;
+            } else {
+                $errorMessage[] = "Password is too short";
+            }
         }
         else
-            echo "Username already exists, try something else";
+            $errorMessage[] = "Username already exists, try something else!";
     }
     else
-        echo "please fill in a username and password";
+        $errorMessage[] = "Please fill in a username and password";
 }
 
-if (isset($_SESSION['username']))
-    redirect('mainmenu.php');
+if (isset($_POST['login'])) {   // User clicked the login button
+    $dbi = new DatabaseInterface();
+    $user_results = $dbi->get("user", array("name" => $_POST['username']));
+    if (isset($user_results[0])) {
+        if ($user_results[0]->password == $_POST['password']) {
+            $_SESSION['userUid'] = $user_results[0]->uid;
+        } else {
+            $errorMessage[] = "Incorrect password!";
+        }
+    } else {
+        $errorMessage[] = "Username doesn't exist!";
+    }
+}
+
+if (isset($_SESSION['userUid'])) {  // User just registered a new account
+    redirect('selectSession.php');
+}
 ?>
 
@@ -25,10 +58,15 @@
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Facilitator</title>
-        <?php new StyleSheet(); ?>
+        <?php new StyleSheet("awesome"); ?>
         <script type="text/javascript" src="js/menu.js"></script>
+        <script type="text/javascript">
+        
+    
+
+        </script>
     </head>
     <body>
         <div id="header">
-<?php new Logo(); ?>
+            <?php new Logo(); ?>
         </div>
 
@@ -37,9 +75,17 @@
             <div id="content">
                 <div class="menu">
-                    <form action="mainmenu.php" method="POST">
+                    <form action="index.php" method="POST">
                         <h3>Username</h3>
                         <input type="text" name="username"><br />
                         <h3>Password</h3>
-                        <input type="password" name="password"><br/><br/><br/>
+                        <input type="password" name="password"><br/><br />
+                        <div id="errorDisplay">
+                            <?php
+                            foreach ($errorMessage as $message) {
+                                echo "<h3 style='color: #FF0000;'>$message</h3>";
+                            }
+                            ?>
+                        </div>
+                        <br/>
                         <input type="submit" name="login" class="surveyButton bigSurveyButton" value="Log in">
                     </form>
Index: /Dev/branches/jos-branch/logout.php
===================================================================
--- /Dev/branches/jos-branch/logout.php	(revision 208)
+++ /Dev/branches/jos-branch/logout.php	(revision 208)
@@ -0,0 +1,10 @@
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<?php
+require 'classes/master.php';
+
+session_destroy();
+redirect("index.php");
+?>
Index: /Dev/branches/jos-branch/questionEditor.php
===================================================================
--- /Dev/branches/jos-branch/questionEditor.php	(revision 208)
+++ /Dev/branches/jos-branch/questionEditor.php	(revision 208)
@@ -0,0 +1,53 @@
+<?php
+require 'classes/master.php'; //should be at top of every page
+?>
+
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title></title>
+        <script type="text/javascript" src="js/questionEditorScripts.js"></script>
+        <?php new StyleSheet("awesome"); ?>
+    </head>
+    <body>
+        <div id="wrapper">
+            <div id="content">
+                <div id="questionEditor">
+                    <div id="questionEditor_header">
+                        Editing: <span id="header_identifier">#QUESTION-IDENT-NO</span>
+                    </div>
+                    <div id="questionEditor_content">
+                        <h2>Question text:</h2>
+                        <div id="questionEditor_bodyText">
+                            <textarea id="questionEditor_bodyText_textArea" onKeyUp="resizeTextArea();">THIS IS THE QUESTION BODY TEXT. CLICK HERE TO EDIT!</textarea>
+                        </div>
+                        <div id="questionEditor_questionParams" >
+                            <label for="questionIdentifierField" class="formLineBreak">Question tag:</label> <input type="text" id="questionIdentifierField" class="questionParamField" onChange="updateIdentifier();" />
+
+                            <label for="questionType" class="formLineBreak">Answer type:</label>
+                            <select id="questionType" onChange="selectAnswerType();" class="questionParamField">
+                                <option value=""></option>
+                                <option value="int">Integer</option>
+                                <option value="scale">Scale</option>
+                                <option value="choice">Multiple choice</option>
+                                <option value="text">Text</option>
+                            </select>
+
+
+
+                        </div>
+                    </div>
+                    <div id="questionEditor_controls">
+                        <input type="button" id="discard" value="Discard" />
+                        <input type="button" value="Save" />
+                    </div>
+                </div>
+            </div>
+        </div>
+    </body>
+</html>
Index: /Dev/branches/jos-branch/rdfConstants.php
===================================================================
--- /Dev/branches/jos-branch/rdfConstants.php	(revision 207)
+++ /Dev/branches/jos-branch/rdfConstants.php	(revision 208)
@@ -22,4 +22,6 @@
 define('RESPONDENT',SURVEYTOOL_RESOURCES_NAMESPACE . 'respondent');
 define('APPDATA',SURVEYTOOL_RESOURCES_NAMESPACE . 'graph');
+define('SESSIONINSTANCE', SURVEYTOOL_RESOURCES_NAMESPACE . 'sessioninstance');
+define('RESULTSET', SURVEYTOOL_RESOURCES_NAMESPACE . 'resultset');
 
 // Predicates used for RDF triples
@@ -52,4 +54,11 @@
 define('HAS_SURVEY', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_survey');
 define('HAS_ANSWERSET', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_answerset');
-
+define('LOCATION', SURVEYTOOL_PREDICATES_NAMESPACE . 'location');
+define('FACILITATOR', SURVEYTOOL_PREDICATES_NAMESPACE . 'facilitator');
+define('STARTTIME', SURVEYTOOL_PREDICATES_NAMESPACE . 'starttime');
+define('ENDTIME', SURVEYTOOL_PREDICATES_NAMESPACE . 'endtime');
+define('HAS_NOTE', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_note');
+define('OF_SESSION', SURVEYTOOL_PREDICATES_NAMESPACE . 'of_session');
+define('HAS_RESULTSET', SURVEYTOOL_PREDICATES_NAMESPACE . 'has_resultset');
+define('CREATIONDATE', SURVEYTOOL_PREDICATES_NAMESPACE . 'creationdate');
 ?>
Index: /Dev/branches/jos-branch/register.php
===================================================================
--- /Dev/branches/jos-branch/register.php	(revision 207)
+++ /Dev/branches/jos-branch/register.php	(revision 208)
@@ -6,5 +6,5 @@
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>Facilitator</title>
-        <?php new StyleSheet(); ?>
+        <?php new StyleSheet("awesome"); ?>
         <script type="text/javascript" src="js/menu.js"></script>
     </head>
Index: /Dev/branches/jos-branch/returnObjectDisplay.php
===================================================================
--- /Dev/branches/jos-branch/returnObjectDisplay.php	(revision 208)
+++ /Dev/branches/jos-branch/returnObjectDisplay.php	(revision 208)
@@ -0,0 +1,53 @@
+<?php
+
+require 'classes/master.php';
+
+/* 
+ * Note: do not try to implement info panel displays in this file as well, it passes and queries a lot of data that you really do not need.
+ * Since this function will be used so often, adding extra unneeded code to it will slow down the regular operation of the editor (refreshes, etc..) while not offering a significant advantage over the existing getInfo.php
+ */
+
+
+if(isset($_POST['args']) && !empty($_POST['args'])) {
+    // Get arguments and convert to object
+    $input = $_POST['args'];
+    $requestArray = json_decode($input);
+} else {
+    die('DOESNT WORK...');
+}
+
+$dbi = new DatabaseInterface();
+$outputArray = array();
+foreach ($requestArray as $request) {
+    
+    //!!! DEZE SHIT MOET WEER TERUGGEDRAAID WORDEN ZODRA QUESTIONS WEER GEWOON UIDS HEBBEN IPV CODES!
+    if ($request->type == "Question"){
+    $results = $dbi->get($request->type, array("code" => $request->uid));
+    // Bottom line, werkt prima. Questions werken nu op ns1:question_code, accessible als question->code
+    }
+    else {
+        $results =  $dbi->get($request->type, array("uid"=>$request->uid));
+    }
+    if (isset($results) && !empty($results)) {
+        is_array($results) ? $object = $results[0] : $object = $results;
+    }
+    // We now have the targeted object loaded in memory
+    // First add all shared properties
+    $objectProperties = array(
+        "uid" => $object->uid,
+        "title" => $object->title,
+        "type" => get_class($object),
+        "description" => $object->description
+    );
+    // Then add object-specific properties? (E.G. pipeline for sessions, answertype for questions, age for respondents)
+    // Nothing so far, though, because data structure changes all the time...
+    // Then add the resulting array to the outputArray
+    $outputArray[] = $objectProperties;
+}
+
+
+// Encode the output array in JSON format, then send back to the client
+$output = json_encode($outputArray);
+
+die($output);
+?>
Index: /Dev/branches/jos-branch/saveSurvey.php
===================================================================
--- /Dev/branches/jos-branch/saveSurvey.php	(revision 208)
+++ /Dev/branches/jos-branch/saveSurvey.php	(revision 208)
@@ -0,0 +1,45 @@
+<?php
+
+require 'classes/master.php';
+
+// Quit if no arguments have been passed.
+if (!isset($_POST['args'])) {
+    if (empty($_POST['args'])) {
+        die("Error! No arguments passed!");
+    }
+}
+
+$args = json_decode($_POST['args']);
+if ($args == false) {
+    die("Error decoding JSON arguments!");
+}
+
+// At this point we know we have arguments in the POST data.
+// Query the survey object from the database.
+
+$dbi = new DatabaseInterface();
+$survey_results = $dbi->get("Survey", array("uid" => $args->uid));
+if (!empty($survey_results)) {
+    $survey = $survey_results[0];
+} else {
+    die("No survey found!");
+}
+
+$question->questions = array();
+foreach ($args->questions->uids as $questionUid) {
+    $question_results = $dbi->get("Question", array("code"=>$questionUid));
+    $question = $question_results[0];
+    $survey->questions[] = $question;
+}
+
+// The next part is a rather experimental way of automatically writing all passed arguments to the session object.
+// If this does not work properly, we should write the "write title to session->title" call by hand.
+/*
+  foreach ($args as $key=>$value) {
+  $session->$key = $value;
+  }
+ */
+var_dump($survey);
+// Do I need to check if this is done before proceeding?
+$dbi->set($survey);
+?>
Index: /Dev/branches/jos-branch/savesession.php
===================================================================
--- /Dev/branches/jos-branch/savesession.php	(revision 208)
+++ /Dev/branches/jos-branch/savesession.php	(revision 208)
@@ -0,0 +1,46 @@
+<?php
+
+require 'classes/master.php'; //should be at top of every page
+
+/*
+ * Dit kan een STUK sneller. Vervang gewoon de hele pipeline string met de lokale versie.
+ * Daarna: $session->eval
+ */
+
+if (isset($_POST['uids']) && isset($_POST['types']) && isset($_POST['sessionUid'])) {
+    if (!empty($_POST['uids']) && !empty($_POST['types']) && !empty($_POST['sessionUid'])) {
+        // user has passed a pipeline/type string from javascript in order to save the session.
+        $pl = explode(",", $_POST['uids']);
+        $t = explode(",", $_POST['types']);
+
+        $sessionUid = $_POST['sessionUid'];
+        //var_dump($t);
+        $dbi = new DatabaseInterface();
+        $session_results = $dbi->get("Session", array("uid" => $sessionUid));
+        if (count($session_results) > 0) {
+            $session = $session_results[0];
+        } else {
+            echo "!!!!!!!!!!!!!!!!!!!!!!NO SESSION FOUND!!!!!!!!!!!!!!!!!!!!";
+            die();
+        }
+        if (count($pl) == count($t)) {
+            $count = count($pl);
+        } else {
+            echo "!!!!!!!!!!!!!!!!!NON MATCHING ARGUMENTS PASSED!!!!!!!!!!!!!!!";
+            die();
+        }
+        
+        $session->pipeline = array();
+        for ($i = 0; $i < $count; $i++) {
+            $results = $dbi->get($t[$i], array("uid" => $pl[$i]));
+            if (count($results) > 0) {
+                $result = $results[0];
+            }
+            $session->pipeline[] = $result;
+        }
+
+        $dbi->set($session);
+        //var_dump($session);
+    }
+}
+?>
Index: /Dev/branches/jos-branch/selectSession.php
===================================================================
--- /Dev/branches/jos-branch/selectSession.php	(revision 208)
+++ /Dev/branches/jos-branch/selectSession.php	(revision 208)
@@ -0,0 +1,120 @@
+<?php
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['userUid'])) {
+    redirect("index.php");
+}
+
+if (isset($_SESSION['message'])) {
+    echo $_SESSION['message'];
+    unset($_SESSION['message']);
+}
+
+$dbi = new DatabaseInterface();
+
+if (isset($_POST['createSession'])) {
+    //check if name is set
+    if (isset($_POST['newSessionName'])) {
+        // check if name is available
+        if (!empty($_POST['newSessionName'])) {
+            $session_results = $dbi->get("Session", array("title" => $_POST['newSessionName']));
+            if (count($session_results) == 0) {
+                // make new session!
+                unset($session_results);
+                $creators = $dbi->get("User", array("uid" => $_SESSION['userUid']));
+                $creator = $creators[0];
+                $session = new Session(null, $_POST['newSessionName'], $creator, new DateTime(), 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'])) {
+	var_dump($_POST);
+    if (isset($_POST['sessionUid'])) {
+        $session_results = $dbi->get("SESSION", array("uid" => $_POST['sessionUid']));
+		var_dump($session_results);
+        if (count($session_results) == 1 && $session_results[0] != null) {
+            // DEZE SESSION MOET UITEINDELIJK EEN POST WORDEN, WANNEER DEZE HELE PAGINA IS OVERGEZET IN JAVASCRIPT!
+            $_SESSION['currentSession'] = $_POST['sessionUid'];
+            $_SESSION['updateNeeded'] = "true";
+            redirect("sessionEditor.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");  // Let's just load everything then...
+?>
+
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Select a session</title>
+        <?php new StyleSheet("awesome"); ?>
+        <script type="text/javascript" src="js/sequencerScripts.js"></script>
+        <script type="text/javascript" src="js/generalScripts.js"></script>
+    </head>
+    <body>
+        <div id="header">
+            <?php new Logo(); ?>
+        </div>
+
+        <div id="wrapper">
+            <div id="content">
+                <form action="selectSession.php" method="POST">
+                    <fieldset name="selectionMenu">
+                        <!-- onchange van volgende select linkt deze aan de ajax-based info panel, script staat in sequencerScripts.js -->
+                        <select name="sessionUid" style="float: left;" onChange="ajaxInfoRequest(this.value, document.getElementById('infoPanelContent'), 'Session');">
+                            <option value="" disabled="true" selected>Please select a session</option>
+                            <?php
+                            foreach ($sessions as $session) {
+                                $selected = "";
+                                if ($session->title == $_POST['newSessionName']) {
+                                    $selected = ' selected="true"';
+                                }
+
+                                echo '<option value="' . $session->uid . '"' . $selected . '>' . $session->title . '</option>' . "\n";
+                            }
+                            ?>                    
+                        </select>
+                        <br /><br />
+                        <input type="hidden" name="updateNeeded" value="true" />
+                        <input type="text" name="newSessionName" value="Name..." style="float: left;" /><br />
+                        <input type="submit" name="createSession" value="Create new session" class="surveybutton" style="float: left;" />
+                        <input type="submit" name="editSession" value="Edit session" class="surveybutton" style="float: left;" />
+                        <input type="submit" name="deleteSession" value="Delete session" class="surveybutton" style="float: left;" />
+                        <br /><br /><br />
+                        <div id="errorDisplay"><?php
+                            if (isset($errorMessage)) {
+                                foreach ($errorMessage as $message) {
+                                    echo $message;
+                                }
+                            }
+                            ?></div>
+                    </fieldset>
+                    <fieldset id="sessionDescription">
+                        <div class="fieldsetTitle">
+                            Info
+                        </div>
+                        <div id="infoPanelContent">
+                        </div>
+                    </fieldset>
+                </form>
+            </div>
+        </div>
+    </body>
+</html>
Index: /Dev/branches/jos-branch/sessionEditor.php
===================================================================
--- /Dev/branches/jos-branch/sessionEditor.php	(revision 208)
+++ /Dev/branches/jos-branch/sessionEditor.php	(revision 208)
@@ -0,0 +1,46 @@
+<?php
+require 'classes/master.php'; //should be at top of every page
+
+if (!isset($_SESSION['userUid'])) {
+    redirect('index.php');
+}
+
+$sequencer = new SessionEditorWidget();
+$sequencer->LoadSession(); //load session into php part of the sequencer
+$sequencer->HandlePostData();
+?>
+
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<!DOCTYPE html>
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title></title>
+        <?php
+        new StyleSheet("visualeditors");
+        $sequencer->Javascript();
+        ?>
+
+    </head>
+    <body>
+        <div id="header">
+            <?php new Logo(); ?>
+        </div>
+
+        <div id="wrapper">
+            <div id="content">
+                <?php $sequencer->init(); ?>
+                <?php $toolbox = new Toolbox(); ?>
+                <?php new PipelineInfoPanel(); ?>
+            </div>
+        </div>
+        <div id="settingsFields">
+            <input type="hidden" id="sContentTypeField" value="session" />
+        </div>
+
+    </body>
+</html>
Index: /Dev/branches/jos-branch/surveyEditor.php
===================================================================
--- /Dev/branches/jos-branch/surveyEditor.php	(revision 208)
+++ /Dev/branches/jos-branch/surveyEditor.php	(revision 208)
@@ -0,0 +1,32 @@
+<?php
+require "classes/master.php";
+
+$surveyEditor = new surveyEditorWidget();
+$surveyEditor->handlePost();
+?>
+
+<!--
+To change this template, choose Tools | Templates
+and open the template in the editor.
+-->
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Edit survey</title>
+        <?php
+        $surveyEditor->javascript();
+        new StyleSheet("visualeditors");
+        ?>
+    </head>
+    <body>
+        <div id="wrapper">
+            <div id="content">
+                <?php $surveyEditor->init(); ?>
+            </div>
+            <div id="settingsFields">
+                <input type="hidden" id="sContentTypeField" value="Survey" />
+            </div>
+        </div>
+    </body>
+</html>
Index: /Dev/branches/jos-branch/surveycreation.php
===================================================================
--- /Dev/branches/jos-branch/surveycreation.php	(revision 207)
+++ /Dev/branches/jos-branch/surveycreation.php	(revision 208)
@@ -5,33 +5,50 @@
     redirect('index.php');
 
-$savedSurvey = null;
-$timeStamp = null;
+if (isset($_POST['submit'])) {
+    if (isset($_POST['surveyName'])) {
+        $survey = new Survey(null, $_POST['surveyName'], "Thijs", null);
+        $dbi = new DatabaseInterface();
+        $dbi->set($survey);
+    }
+}
 
 
+
+
+/*
+  $savedSurvey = null;
+  $timeStamp = null;
+ */
+
 /* LOAD SURVEY */
-if (isset($_POST['UID'])) {
-    $surveyID = $_POST['UID'];
-    $surveyDBI = new SurveyCreationDatabaseInterface($surveyID);
-    $info = $surveyDBI->getSurveyInfo();
+/*
+  if (isset($_POST['UID'])) {
+  $surveyID = $_POST['UID'];
+  $surveyDBI = new SurveyCreationDatabaseInterface($surveyID);
+  $info = $surveyDBI->getSurveyInfo();
 
-    $savedSurvey = Survey::getSurvey($info);
-}
+  $savedSurvey = Survey::getSurvey($info);
+  }
+ */
+/* AUTOSAVE */
 
-/* AUTOSAVE */ 
-else if (isset($_POST['timeStamp'])) {
-    $timeStamp = $_POST['timeStamp'];
+/*
+  else if (isset($_POST['timeStamp'])) {
+  $timeStamp = $_POST['timeStamp'];
 
-    echo 'This is what gets sent:';
-    var_dump($_POST);
-    echo '<br/><br/>';
-    $surveyDBI = new SurveyCreationDatabaseInterface($_POST['surveyID']);
-    $surveyDBI->setSurveyInfo($_POST,$_SESSION);
-    $info = $surveyDBI->getSurveyInfo();
-    echo '<br/><br/>';
-    echo 'This is what I get back:';
-    var_dump($info);
+  echo 'This is what gets sent:';
+  var_dump($_POST);
+  echo '<br/><br/>';
+  $surveyDBI = new SurveyCreationDatabaseInterface($_POST['surveyID']);
+  $surveyDBI->setSurveyInfo($_POST,$_SESSION);
+  $info = $surveyDBI->getSurveyInfo();
+  echo '<br/><br/>';
+  echo 'This is what I get back:';
+  var_dump($info);
 
-    $savedSurvey = Survey::getSurvey($info);
-}
+  $savedSurvey = Survey::getSurvey($info);
+  }
+
+ */
 ?>
 
@@ -42,6 +59,6 @@
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-            <title>Survey Creation</title>
-            <?php new StyleSheet(); ?>
+        <title>Survey Creation</title>
+        <?php new StyleSheet("awesome"); ?>
     </head>
     <body>
@@ -52,7 +69,11 @@
 
             <div id="content">
-                <?php
-                new SurveyCreationTool($savedSurvey, $timeStamp);
-                ?>
+                <form action="surveycreation.php" method="post">
+                    <fieldset>
+                    Name: <input type="text" name="surveyName" /><br />
+                    Uid: <input type="text" name="surveyID" /><br /><br />
+                    <input type="submit" name="submit" value="Make fake survey!" />
+                    </fieldset>
+                </form>
             </div>
         </div>
Index: /Dev/branches/jos-branch/testpage.php
===================================================================
--- /Dev/branches/jos-branch/testpage.php	(revision 207)
+++ /Dev/branches/jos-branch/testpage.php	(revision 208)
@@ -3,6 +3,10 @@
 
 	$db = new DatabaseInterface();
-	$user = $db->get("user", array("name" => "jkraaijeveld"));
-	print_r($user[0]);
+	
+	$result = $db->get("Session");
+	$session = $result[0];
+	$session->title = "Changed title";
+	$db->set($session);
+	print_r($result);
 
 ?>
