source: Dev/trunk/dashboard.php @ 140

Last change on this file since 140 was 98, checked in by fpvanagthoven, 14 years ago

Question code.

File size: 1.6 KB
RevLine 
[73]1<?php
2require 'classes/master.php';
3
4if (is_null($_SESSION['username']))
[75]5        redirect('index.php');
6
7/* MOCK SURVEY */
8
9$survey = new Survey('ultimateid', 'The Epic Survey');
[98]10$question1 = new Question('question1id', 'AE340', 'Age', 'int', 'What is your age?');
11$question2 = new Question('question2id', 'XV453', 'Identity', 'mc', 'Are you freakazoid?');
[75]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
[73]37?>
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>
[96]43        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
[73]44            <title></title>
[75]45                        <?php new StyleSheet(); ?>
46                        <script type="text/javascript" src="d3/d3.js"></script>
[73]47    </head>
48    <body>
49        <div id="header">
[75]50                        <?php new Logo(); ?>
[73]51        </div>
52        <div id="wrapper">
53
54            <div id="content">
[75]55                                <?php new DashboardTool($surveys); ?>
[73]56            </div>
57        </div>
58    </body>
59</html>
Note: See TracBrowser for help on using the repository browser.