Ignore:
Timestamp:
01/06/12 10:29:09 (13 years ago)
Author:
jkraaijeveld
Message:

Got latest version from trunk. Ready to reorganise.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/jos-branch/surveycreation.php

    r95 r208  
    55    redirect('index.php');
    66
    7 $savedSurvey = null;
    8 $timeStamp = null;
     7if (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}
    914
    1015
     16
     17
     18/*
     19  $savedSurvey = null;
     20  $timeStamp = null;
     21 */
     22
    1123/* LOAD SURVEY */
    12 if (isset($_POST['UID'])) {
    13     $surveyID = $_POST['UID'];
    14     $surveyDBI = new SurveyCreationDatabaseInterface($surveyID);
    15     $info = $surveyDBI->getSurveyInfo();
     24/*
     25  if (isset($_POST['UID'])) {
     26  $surveyID = $_POST['UID'];
     27  $surveyDBI = new SurveyCreationDatabaseInterface($surveyID);
     28  $info = $surveyDBI->getSurveyInfo();
    1629
    17     $savedSurvey = Survey::getSurvey($info);
    18 }
     30  $savedSurvey = Survey::getSurvey($info);
     31  }
     32 */
     33/* AUTOSAVE */
    1934
    20 /* AUTOSAVE */
    21 else if (isset($_POST['timeStamp'])) {
    22     $timeStamp = $_POST['timeStamp'];
     35/*
     36  else if (isset($_POST['timeStamp'])) {
     37  $timeStamp = $_POST['timeStamp'];
    2338
    24     echo 'This is what gets sent:';
    25     var_dump($_POST);
    26     echo '<br/><br/>';
    27     $surveyDBI = new SurveyCreationDatabaseInterface($_POST['surveyID']);
    28     $surveyDBI->setSurveyInfo($_POST,$_SESSION);
    29     $info = $surveyDBI->getSurveyInfo();
    30     echo '<br/><br/>';
    31     echo 'This is what I get back:';
    32     var_dump($info);
     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);
    3348
    34     $savedSurvey = Survey::getSurvey($info);
    35 }
     49  $savedSurvey = Survey::getSurvey($info);
     50  }
     51
     52 */
    3653?>
    3754
     
    4259    <head>
    4360        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    44             <title>Survey Creation</title>
    45             <?php new StyleSheet(); ?>
     61        <title>Survey Creation</title>
     62        <?php new StyleSheet("awesome"); ?>
    4663    </head>
    4764    <body>
     
    5269
    5370            <div id="content">
    54                 <?php
    55                 new SurveyCreationTool($savedSurvey, $timeStamp);
    56                 ?>
     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>
    5778            </div>
    5879        </div>
Note: See TracChangeset for help on using the changeset viewer.