[29] | 1 | <?php |
---|
| 2 | require 'classes/master.php'; |
---|
[10] | 3 | |
---|
[58] | 4 | if (is_null($_SESSION['username'])) |
---|
| 5 | redirect('index.php'); |
---|
| 6 | |
---|
[153] | 7 | if (isset($_POST['submit'])) { |
---|
| 8 | if (isset($_POST['surveyName'])) { |
---|
| 9 | $survey = new Survey(null, $_POST['surveyName'], "Thijs", null); |
---|
| 10 | $dbi = new DatabaseInterface(); |
---|
| 11 | $dbi->set($survey); |
---|
| 12 | } |
---|
| 13 | } |
---|
[29] | 14 | |
---|
[51] | 15 | |
---|
[153] | 16 | |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | $savedSurvey = null; |
---|
| 20 | $timeStamp = null; |
---|
| 21 | */ |
---|
| 22 | |
---|
[38] | 23 | /* LOAD SURVEY */ |
---|
[153] | 24 | /* |
---|
| 25 | if (isset($_POST['UID'])) { |
---|
| 26 | $surveyID = $_POST['UID']; |
---|
| 27 | $surveyDBI = new SurveyCreationDatabaseInterface($surveyID); |
---|
| 28 | $info = $surveyDBI->getSurveyInfo(); |
---|
[50] | 29 | |
---|
[153] | 30 | $savedSurvey = Survey::getSurvey($info); |
---|
| 31 | } |
---|
| 32 | */ |
---|
| 33 | /* AUTOSAVE */ |
---|
[38] | 34 | |
---|
[153] | 35 | /* |
---|
| 36 | else if (isset($_POST['timeStamp'])) { |
---|
| 37 | $timeStamp = $_POST['timeStamp']; |
---|
[38] | 38 | |
---|
[153] | 39 | echo 'This is what gets sent:'; |
---|
| 40 | var_dump($_POST); |
---|
| 41 | echo '<br/><br/>'; |
---|
| 42 | $surveyDBI = new SurveyCreationDatabaseInterface($_POST['surveyID']); |
---|
| 43 | $surveyDBI->setSurveyInfo($_POST,$_SESSION); |
---|
| 44 | $info = $surveyDBI->getSurveyInfo(); |
---|
| 45 | echo '<br/><br/>'; |
---|
| 46 | echo 'This is what I get back:'; |
---|
| 47 | var_dump($info); |
---|
[38] | 48 | |
---|
[153] | 49 | $savedSurvey = Survey::getSurvey($info); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | */ |
---|
[24] | 53 | ?> |
---|
| 54 | |
---|
[10] | 55 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
---|
| 56 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
| 57 | |
---|
| 58 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
| 59 | <head> |
---|
[95] | 60 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
[153] | 61 | <title>Survey Creation</title> |
---|
| 62 | <?php new StyleSheet("awesome"); ?> |
---|
[10] | 63 | </head> |
---|
| 64 | <body> |
---|
| 65 | <div id="header"> |
---|
[41] | 66 | <?php new Logo(); ?> |
---|
[29] | 67 | </div> |
---|
[10] | 68 | <div id="wrapper"> |
---|
[29] | 69 | |
---|
[10] | 70 | <div id="content"> |
---|
[153] | 71 | <form action="surveycreation.php" method="post"> |
---|
| 72 | <fieldset> |
---|
| 73 | Name: <input type="text" name="surveyName" /><br /> |
---|
| 74 | Uid: <input type="text" name="surveyID" /><br /><br /> |
---|
| 75 | <input type="submit" name="submit" value="Make fake survey!" /> |
---|
| 76 | </fieldset> |
---|
| 77 | </form> |
---|
[10] | 78 | </div> |
---|
| 79 | </div> |
---|
| 80 | </body> |
---|
| 81 | </html> |
---|