Index: /Dev/trunk/applicationcreation.php
===================================================================
--- /Dev/trunk/applicationcreation.php	(revision 79)
+++ /Dev/trunk/applicationcreation.php	(revision 80)
@@ -1,4 +1,6 @@
 <?php
 require 'classes/master.php';
+
+var_dump($_POST);
 
 if (is_null($_SESSION['username']))
@@ -16,5 +18,14 @@
         
     $applicationDBI = new ApplicationDatabaseInterface($id);
-    $applicationDBI->setApplicationInfo($application);
+    $applicationDBI->setApplicationInfo($_POST);
+}
+else if(isset($_POST['applicationTitle']))
+{
+    $title = $_POST['applicationTitle'];
+    $description = $_POST['applicationDescription'];
+    $application = new Application($title, $description);
+        
+    $applicationDBI = new ApplicationDatabaseInterface(null);
+    $applicationDBI->setApplicationInfo($_POST);
 }
 
Index: /Dev/trunk/classes/ApplicationDatabaseInterface.php
===================================================================
--- /Dev/trunk/classes/ApplicationDatabaseInterface.php	(revision 79)
+++ /Dev/trunk/classes/ApplicationDatabaseInterface.php	(revision 80)
@@ -28,7 +28,7 @@
     public function setApplicationInfo($applicationInfo)
     {
-        $appTitle = $application['applicationTitle'];
-        $appDescription = $application['applicationDescription'];
-        $appStyle = $application['applicationStyle'];
+        $appTitle = $applicationInfo['applicationTitle'];
+        $appDescription = $applicationInfo['applicationDescription'];
+        $appStyle = null;
 
         $this->applicationRDFWriter->setApplicationInfo($appTitle, $appDescription, $appStyle);
@@ -56,9 +56,9 @@
 
         $resultApplication = $this->applicationRDFReader->readAllApplications();
-
-        for($aNumber = 0;$aNumber<=sizeof($resultApplication[0]);$aNumber++)
+        
+        for($aNumber = 0;$aNumber<sizeof($resultApplication[0]);$aNumber++)
         {
             $aID = substr($resultApplication[0][$aNumber]['?uid'],9,strlen($resultApplication[0][$aNumber]['?uid'])-11);
-            $aTitle = substr($resultApplication[1][$aNumber]['?title'],9,strlen($resultApplication[0][$aNumber]['?title'])-11);
+            $aTitle = substr($resultApplication[1][$aNumber]['?title'],9,strlen($resultApplication[1][$aNumber]['?title'])-11);
             $applicationInfo[$aID] = $aTitle;
         }		
Index: /Dev/trunk/classes/ApplicationRDFWriter.php
===================================================================
--- /Dev/trunk/classes/ApplicationRDFWriter.php	(revision 79)
+++ /Dev/trunk/classes/ApplicationRDFWriter.php	(revision 80)
@@ -15,10 +15,10 @@
 
         if(file_exists($this->fileName))
-        $this->model->load($this->fileName);
+            $this->model->load($this->fileName);
     }	
 
     public function saveApplications()
     {	
-        $this->model->saveAs($fileName,'rdf'); 
+        $this->model->saveAs($this->fileName,'rdf'); 
     }
 
Index: /Dev/trunk/classes/SessionDatabaseInterface.php
===================================================================
--- /Dev/trunk/classes/SessionDatabaseInterface.php	(revision 79)
+++ /Dev/trunk/classes/SessionDatabaseInterface.php	(revision 80)
@@ -62,6 +62,20 @@
         
         foreach ($resultSession[1][1] as $surveyInfo) 
-         {
-            
+        {
+             $surveyUID = substr($surveyInfo['?uid'],9,strlen($surveyInfo['?uid'])-11);
+             $surveyIndex = substr($surveyInfo['?index'],9,strlen($surveyInfo['?index'])-11);
+             $sessionInfo[$surveyIndex . 's'] = $surveyUID;
+        }
+        foreach ($resultSession[1][2] as $applicationInfo) 
+        {
+             $applicationUID = substr($applicationInfo['?uid'],9,strlen($applicationInfo['?uid'])-11);
+             $applicationIndex = substr($applicationInfo['?index'],9,strlen($applicationInfo['?index'])-11);
+             $sessionInfo[$applicationIndex . 'a'] = $applicationUID;
+        }
+        foreach ($resultSession[1][3] as $dashboardInfo) 
+        {
+             $dashboardUID = substr($dashboardInfo['?uid'],9,strlen($dashboardInfo['?uid'])-11);
+             $dashboardIndex = substr($dashboardInfo['?index'],9,strlen($dashboardInfo['?index'])-11);
+             $sessionInfo[$dashboardIndex . 's'] = $dashboardUID;
         }
     }
@@ -69,5 +83,22 @@
     public function getExistingSessions()
     {
-        
+        $sessionIDs = array();
+        $sessions = array();
+
+        if($handle = opendir('data/sessions/'))
+        {
+            while (false !== ($file = readdir($handle))) {
+                if(strstr($file, 'session_'))
+                    $sessionIDs[] = substr($file,7,strlen($file)-11);
+            }
+        }
+
+        foreach($sessionIDs as $sessionID)
+        {
+            $sessionTitle = $this->sessionRDFReader->getSessionTitleByID($sessionID);
+            $$sessions[$sessionID] = substr($sessionTitle[0]['?title'],9,strlen($sessionTitle[0]['?title'])-11);
+        }
+
+        return $surveys;
     }
 }
Index: /Dev/trunk/classes/SessionRDFReader.php
===================================================================
--- /Dev/trunk/classes/SessionRDFReader.php	(revision 79)
+++ /Dev/trunk/classes/SessionRDFReader.php	(revision 80)
@@ -112,4 +112,26 @@
         return $result;
     }
+    
+    public function getSessionTitleByID($sessionID)
+    {
+        // Create empty MemModel
+        $factory = new ModelFactory();
+        $tempmodel= $factory->getDefaultModel();
+        $tempmodel->load('data/sessions/session_'.$sessionID.'/session_'.$sessionID.'.rdf');
+
+        $querystring = '
+            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
+            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
+            SELECT  ?title 
+            WHERE 	
+            {
+                    _session    predicates:resource_type	resources:session ;
+                                predicates:title 		?title 	
+            }';
+
+        $result = $tempmodel->sparqlQuery($querystring);
+
+        return $result;
+    }
 }
 
Index: /Dev/trunk/classes/SurveyDatabaseInterface.php
===================================================================
--- /Dev/trunk/classes/SurveyDatabaseInterface.php	(revision 79)
+++ /Dev/trunk/classes/SurveyDatabaseInterface.php	(revision 80)
@@ -120,4 +120,12 @@
         return $surveys;
     }
+    
+    public function getSurveyTitleByID($surveyID)
+    {
+        $surveyTitleLiteral = $this->surveyRDFReader->getSurveyTitleByID($surveyID);
+        $surveyTitle = substr($surveyTitle[0]['?title'],9,strlen($surveyTitle[0]['?title'])-11);
+        
+        return $surveyTitle;
+    }
 
 }
Index: /Dev/trunk/survey.php
===================================================================
--- /Dev/trunk/survey.php	(revision 79)
+++ /Dev/trunk/survey.php	(revision 80)
@@ -2,5 +2,5 @@
 require 'classes/master.php';
 
-    var_dump($_POST);
+    //var_dump($_POST);
     
 if (is_null($_SESSION['username']))
@@ -16,5 +16,5 @@
     $savedSurvey = Survey::getSurvey($info);
     
-    //var_dump($_POST);
+    var_dump($_POST);
 }
 else
Index: /Dev/trunk/surveycreation.php
===================================================================
--- /Dev/trunk/surveycreation.php	(revision 79)
+++ /Dev/trunk/surveycreation.php	(revision 80)
@@ -18,5 +18,6 @@
 }
 
-/* AUTOSAVE */ else if (isset($_POST['timeStamp'])) {
+/* AUTOSAVE */ 
+else if (isset($_POST['timeStamp'])) {
     $timeStamp = $_POST['timeStamp'];
 
