Changeset 75
- Timestamp:
- 08/08/11 15:12:46 (14 years ago)
- Location:
- Dev/trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/applicationcreation.php
r66 r75 4 4 if (is_null($_SESSION['username'])) 5 5 redirect('index.php'); 6 7 $application = null; 8 9 /* TODO: Bas! Dit aanpassen zodat application wordt opgeslagen. */ 10 if(!empty($_POST)) 11 { 12 $title = $_POST['applicationTitle']; 13 $description = $_POST['applicationDescription']; 14 $application = new Application($title, $description); 15 var_dump($application); 16 } 17 6 18 ?> 7 19 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" … … 22 34 <div id="content"> 23 35 <?php 24 new ApplicationCreationTool( );36 new ApplicationCreationTool($application); 25 37 ?> 26 38 </div> -
Dev/trunk/classes/Application.php
r57 r75 7 7 */ 8 8 class Application { 9 public $title; 10 public $description; 11 public $style; 9 12 10 private $title; 11 private $description; 12 private $style; 13 14 public function __construct() { 15 13 public function __construct($title = null, $description = null, $style = null) { 14 $this->title = $title; 15 $this->description = $description; 16 $this->style = $style; 16 17 } 17 18 -
Dev/trunk/classes/ApplicationCreationTool.php
r72 r75 10 10 * @author fpvanagthoven 11 11 */ 12 class ApplicationCreationTool { 12 class ApplicationCreationTool 13 { 14 private $application; 13 15 14 private $application; 16 public function __construct($application = null) 17 { 18 $this->application = $application; 15 19 16 public function __construct($application = null) { 17 $this->application = $application; 18 19 $this->javascript(); 20 if(!empty($_POST)) 21 redirect('mainmenu.php'); 22 ?> 23 <div class="creation"> 24 <form id="applicationCreationForm" action="" method="post"> 25 <?php 26 $this->title(); 27 $this->description(); 28 29 $this->done(); 30 ?> 31 </form> 32 </div> 33 <?php 34 } 35 36 private function javascript() { 37 ?> 38 <script type="text/javascript" src="js/creation.js"></script> 39 <script language="JavaScript" type="text/javascript"> 20 $this->javascript(); 40 21 41 </script> 42 <?php 43 } 22 $this->init(); 23 } 44 24 45 private function title() { 46 if (isset($this->application->title)) 47 $value = $this->application->title; 48 else 49 $value = 'Untitled Application'; 50 ?> 51 <input type="text" id="applicationTitle" class="titleBox" name="applicationTitle" value="<?php echo str_replace("\"", """, $value); ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> 52 <?php 53 } 25 private function javascript() 26 { 27 ?> 28 <script type="text/javascript" src="js/creation.js"></script> 29 <script language="JavaScript" type="text/javascript"> 54 30 55 private function description() { 56 if (isset($this->application->description)) 57 $value = $this->application->description; 58 else 59 $value = 'Write a description for this application here.'; 60 ?> 61 <textarea id="applicationDescription" class="descriptionBox" name="applicationDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea> 62 <?php 63 } 64 65 private function done() { 66 ?> 67 <input type="submit" class="surveyButton topRight" value="Done" /> 68 <?php 69 } 31 </script> 32 <?php 33 } 70 34 35 private function init() 36 { 37 ?> 38 <div class="creation"> 39 <form id="applicationCreationForm" action="" method="post"> 40 <?php 41 $this->title(); 42 $this->description(); 43 44 $this->done(); 45 ?> 46 </form> 47 </div> 48 <?php 49 } 50 51 private function title() 52 { 53 if (isset($this->application->title)) 54 $value = $this->application->title; 55 else 56 $value = 'Untitled Application'; 57 ?> 58 <input type="text" id="applicationTitle" class="titleBox" name="applicationTitle" value="<?php echo str_replace("\"", """, $value); ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" /> 59 <?php 60 } 61 62 private function description() 63 { 64 if (isset($this->application->description)) 65 $value = $this->application->description; 66 else 67 $value = 'Write a description for this application here.'; 68 ?> 69 <textarea id="applicationDescription" class="descriptionBox" name="applicationDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea> 70 <?php 71 } 72 73 private function done() 74 { 75 ?> 76 <input type="submit" class="surveyButton topRight" value="Done" /> 77 <?php 78 } 71 79 } 72 80 ?> -
Dev/trunk/classes/Survey.php
r57 r75 16 16 public $description; 17 17 public $questions; 18 19 public $results; 18 20 19 21 public function __construct($id, $title, $description = null) { … … 22 24 $this->description = $description; 23 25 $this->questions = array(); 26 27 $this->results = null; 24 28 } 29 30 public function addQuestion($question) 31 { 32 array_push($this->questions, $question); 33 } 34 35 public function setResults($surveyResults) 36 { 37 $this->results = $surveyResults; 38 } 25 39 26 40 public static function getSurvey($info) { … … 56 70 return $survey; 57 71 } 72 73 /** 74 * TODO: Should return Results-object from reading RDF-database 75 * @param type $surveyID 76 */ 77 public static function getResults($surveyID) 78 { 79 80 } 58 81 59 82 } -
Dev/trunk/css/awesome.css
r68 r75 326 326 } 327 327 328 .padding1em { 329 padding: 1em; 330 } 331 328 332 .topMargin { 329 333 margin-top: 2em; … … 402 406 } 403 407 408 .borderRadius { 409 -moz-border-radius: 15px; 410 border-radius: 15px; 411 } 412 413 .boxShadow { 414 -moz-box-shadow: 2px 2px 2px #888; 415 -webkit-box-shadow: 2px 2px 2px #888; 416 box-shadow: 2px 2px 2px #888; 417 } 418 404 419 /* ################################################################## 405 420 ===================== STYLESHEET OF GLORY ======================== */ … … 451 466 width: 50%; 452 467 } 468 469 /* ################################################################## 470 ===================== STYLESHEET OF GLORY ======================== */ 471 .resultsDiv { 472 height: 10em; 473 border: 1px solid white; 474 } 475 476 .resultDiv { 477 width: 10em; 478 height: 10em; 479 border: 1px solid white; 480 background-color: #c6c6c6; 481 float: left; 482 margin-left: 2em; 483 } -
Dev/trunk/dashboard.php
r73 r75 3 3 4 4 if (is_null($_SESSION['username'])) 5 redirect('index.php'); 5 redirect('index.php'); 6 7 /* MOCK SURVEY */ 8 9 $survey = new Survey('ultimateid', 'The Epic Survey'); 10 $question1 = new Question('question1id', 'Age', 'int', 'What is your age?'); 11 $question2 = new Question('question2id', 'Identity', 'mc', 'Are you freakazoid?'); 12 $question2->answers = array('yes', 'no', 'maybe'); 13 14 $survey->addQuestion($question1); 15 $survey->addQuestion($question2); 16 17 /* MOCK RESULTS */ 18 19 20 $survey1Results = new SurveyResults(); 21 22 $question1Answers = array(3, 5, 12, 134, 5, 40); // int 23 $question2Answers = array('yes', 'no', 'no', 'yes', 'maybe', 'no'); // Multiple choice 24 25 $question1Result = new QuestionResult(ResultType::INTEGER, $question1Answers); 26 $question2Result = new QuestionResult(ResultType::MULTIPLE_CHOICE, $question2Answers); 27 28 $survey1Results->addQuestionResult($question1Result); 29 $survey1Results->addQuestionResult($question2Result); 30 31 /* COMBINE */ 32 33 $survey->setResults($survey1Results); 34 35 $surveys = array($survey); 36 6 37 ?> 7 38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" … … 12 43 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 13 44 <title></title> 14 <?php new StyleSheet(); ?> 45 <?php new StyleSheet(); ?> 46 <script type="text/javascript" src="d3/d3.js"></script> 15 47 </head> 16 48 <body> 17 49 <div id="header"> 18 50 <?php new Logo(); ?> 19 51 </div> 20 52 <div id="wrapper"> 21 53 22 54 <div id="content"> 23 <?php 24 ?> 55 <?php new DashboardTool($surveys); ?> 25 56 </div> 26 57 </div> -
Dev/trunk/mainmenu.php
r64 r75 24 24 25 25 $surveys = Loader::loadSurveys(); 26 26 27 ?> 27 28
Note: See TracChangeset
for help on using the changeset viewer.