source: Dev/trunk/surveycreation.php @ 80

Last change on this file since 80 was 80, checked in by basvannuland, 14 years ago

Application save load from db should work. styles not part of save yet.
More work on session save load

File size: 1.5 KB
Line 
1<?php
2require 'classes/master.php';
3
4if (is_null($_SESSION['username']))
5    redirect('index.php');
6
7$savedSurvey = null;
8$timeStamp = null;
9
10
11/* LOAD SURVEY */
12if (isset($_POST['UID'])) {
13    $surveyID = $_POST['UID'];
14    $surveyDBI = new SurveyDatabaseInterface($surveyID);
15    $info = $surveyDBI->getSurveyInfo();
16
17    $savedSurvey = Survey::getSurvey($info);
18}
19
20/* AUTOSAVE */
21else if (isset($_POST['timeStamp'])) {
22    $timeStamp = $_POST['timeStamp'];
23
24//    echo 'This is what gets sent:';
25//    var_dump($_POST);
26//    echo '<br/><br/>';
27    $surveyDBI = new SurveyDatabaseInterface($_POST['surveyID']);
28    $surveyDBI->setSurveyInfo($_POST);
29    $info = $surveyDBI->getSurveyInfo();
30//    echo '<br/><br/>';
31//    echo 'This is what I get back:';
32//    var_dump($info);
33
34    $savedSurvey = Survey::getSurvey($info);
35}
36?>
37
38<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
39    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
40
41<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
42    <head>
43        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
44            <title>Survey Creation</title>
45            <?php new StyleSheet(); ?>
46    </head>
47    <body>
48        <div id="header">
49            <?php new Logo(); ?>
50        </div>
51        <div id="wrapper">
52
53            <div id="content">
54                <?php
55                new SurveyCreationTool($savedSurvey, $timeStamp);
56                ?>
57            </div>
58        </div>
59    </body>
60</html>
Note: See TracBrowser for help on using the repository browser.