Changeset 38
- Timestamp:
- 07/22/11 17:13:04 (14 years ago)
- Location:
- Dev/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SurveyButton.php
r36 r38 28 28 } 29 29 30 public static function loadSurveyButton() { 30 /** 31 * 32 * @param Survey $surveys An array of surveys 33 */ 34 public static function loadSurveyButton($surveys) { 31 35 ?> 32 33 <form action="surveycreation.php" method="post"> 34 35 <input type="submit" value="Load survey" class="surveyButton bigSurveyButton" /> 36 36 <form id="loadForm" action="surveycreation.php" method="post"> 37 <input type="button" onclick="loadSurvey()" value="Load survey" class="surveyButton bigSurveyButton" /> 37 38 </form> 38 39 <br/> 40 <select id="surveysToLoad" size="1000"> 41 <?php 42 foreach ($surveys as $survey) { 43 ?><option value='<?php echo $survey->id; ?>'><?php echo $survey->title; ?></option><?php 44 } 45 ?> 46 </select> 39 47 <?php 40 48 } -
Dev/trunk/css/style.css
r36 r38 145 145 font-weight: bold; 146 146 background-color: #fff; 147 border: 2px solid #aaa;147 border: 1px solid #aaa; 148 148 -moz-border-radius: 6px; 149 149 border-radius: 6px; … … 185 185 color: gray; 186 186 } 187 188 189 190 /* ################################################################## 191 ===================== STYLESHEET OF GLORY ======================== */ 192 193 #surveysToLoad { 194 width: 20em; 195 height: 10em; 196 } -
Dev/trunk/index.php
r36 r38 1 <?php require 'classes/master.php'; //should be at top of every page ?> 1 <?php require 'classes/master.php'; //should be at top of every page 2 3 /* make an array of survey mock objects */ 4 $surveys = array(); 5 6 $aSurvey = new Survey('71a5c2ee19f172c6f0fe22ec1bfa2083', 'TestGameTest Survey Title'); 7 $bSurvey = new Survey('0e999e625e6c45867e2c64b5228c684d', 'Ultimate Survey'); 8 $cSurvey = new Survey('dceea2af20c3ce6a7175dd0e96e0f2cb', 'Super Survey'); 9 10 array_push($surveys, $aSurvey); 11 array_push($surveys, $bSurvey); 12 array_push($surveys, $cSurvey); 13 ?> 2 14 3 15 <!DOCTYPE html> … … 7 19 <title>Facilitator</title> 8 20 <link rel="stylesheet" type="text/css" href="css/style.css" /> 21 <script type="text/javascript" src="js/menu.js"></script> 9 22 </head> 10 23 <body> … … 19 32 <?php 20 33 SurveyButton::newSurveyButton(); 21 SurveyButton::loadSurveyButton( );34 SurveyButton::loadSurveyButton($surveys); 22 35 ?> 23 36 </div> -
Dev/trunk/surveycreation.php
r36 r38 3 3 4 4 $savedSurvey = null; 5 $timeStamp = null; 6 var_dump($_POST); 5 7 6 if (isset($_POST['timeStamp'])) 7 { 8 $timeStamp = $_POST['timeStamp']; 9 10 echo 'This is what gets sent:'; 11 var_dump($_POST); 12 echo '<br/><br/>'; 13 $surveyDBI = new SurveyDatabaseInterface(); 14 $surveyDBI->setSurveyInfo($_POST); 15 $info = $surveyDBI->getSurveyInfo(); 16 echo '<br/><br/>'; 17 echo 'This is what I get back:'; 18 var_dump($info); 19 20 $savedSurvey = Survey::getSurvey($info); 21 } 22 else { 23 $timeStamp = null; 8 /* LOAD SURVEY */ 9 if (isset($_POST['UID'])) { 10 $surveyID = $_POST['UID']; 11 $surveyDBI = new SurveyDatabaseInterface($surveyID); 12 $info = $surveyDBI->getSurveyInfo(); 13 14 $savedSurvey = Survey::getSurvey($info); 24 15 } 25 16 17 /* AUTOSAVE */ 18 else if (isset($_POST['timeStamp'])) { 19 $timeStamp = $_POST['timeStamp']; 20 21 echo 'This is what gets sent:'; 22 var_dump($_POST); 23 echo '<br/><br/>'; 24 $surveyDBI = new SurveyDatabaseInterface(); 25 $surveyDBI->setSurveyInfo($_POST); 26 $info = $surveyDBI->getSurveyInfo(); 27 echo '<br/><br/>'; 28 echo 'This is what I get back:'; 29 var_dump($info); 30 31 $savedSurvey = Survey::getSurvey($info); 32 } 26 33 ?> 27 34 … … 42 49 43 50 <div id="content"> 44 <?php 45 46 new SurveyCreationTool($savedSurvey, $timeStamp); 47 ?> 51 <?php 52 new SurveyCreationTool($savedSurvey, $timeStamp); 53 ?> 48 54 </div> 49 55 </div>
Note: See TracChangeset
for help on using the changeset viewer.