source: Dev/trunk/surveycreation.php @ 83

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

start with answer saving

File size: 1.5 KB
RevLine 
[29]1<?php
2require 'classes/master.php';
[10]3
[58]4if (is_null($_SESSION['username']))
5    redirect('index.php');
6
[29]7$savedSurvey = null;
[38]8$timeStamp = null;
[29]9
[51]10
[38]11/* LOAD SURVEY */
12if (isset($_POST['UID'])) {
13    $surveyID = $_POST['UID'];
[83]14    $surveyDBI = new SurveyCreationDatabaseInterface($surveyID);
[38]15    $info = $surveyDBI->getSurveyInfo();
[50]16
[38]17    $savedSurvey = Survey::getSurvey($info);
18}
19
[80]20/* AUTOSAVE */
21else if (isset($_POST['timeStamp'])) {
[24]22    $timeStamp = $_POST['timeStamp'];
[38]23
[52]24//    echo 'This is what gets sent:';
25//    var_dump($_POST);
[50]26//    echo '<br/><br/>';
[83]27    $surveyDBI = new SurveyCreationDatabaseInterface($_POST['surveyID']);
[82]28    $surveyDBI->setSurveyInfo($_POST,$_SESSION);
[38]29    $info = $surveyDBI->getSurveyInfo();
[50]30//    echo '<br/><br/>';
[52]31//    echo 'This is what I get back:';
32//    var_dump($info);
[38]33
34    $savedSurvey = Survey::getSurvey($info);
[26]35}
[24]36?>
37
[10]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">
[56]44            <title>Survey Creation</title>
[59]45            <?php new StyleSheet(); ?>
[10]46    </head>
47    <body>
48        <div id="header">
[41]49            <?php new Logo(); ?>
[29]50        </div>
[10]51        <div id="wrapper">
[29]52
[10]53            <div id="content">
[50]54                <?php
55                new SurveyCreationTool($savedSurvey, $timeStamp);
56                ?>
[10]57            </div>
58        </div>
59    </body>
60</html>
Note: See TracBrowser for help on using the repository browser.