source: Dev/trunk/classes/SurveyMenu.php @ 59

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

Absolutely had to do something about styling. Also some other things.

File size: 1.7 KB
Line 
1<?php
2/*
3 * To change this template, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/**
8 * Description of SurveyMenu
9 *
10 * @author fpvanagthoven
11 */
12class SurveyMenu {
13
14    public function __construct($surveys) {
15        ?> <div id="menu3" class="menu"> <?php
16        ?> <div class="menuButtons"> <?php
17        SurveyMenu::newSurveyButton();
18        SurveyMenu::loadSurveyButton();
19        SurveyMenu::deleteSurveyButton();
20        ?> </div> <?php
21        SurveyMenu::loadSurveyList($surveys);
22        ?> </div> <?php
23    }
24
25    public static function newSurveyButton() {
26        ?>
27
28        <form action="surveycreation.php" method="post">
29
30            <input type="submit" value="Create new survey" class="surveyButton bigSurveyButton" />
31
32        </form>
33
34        <?php
35    }
36
37    public static function loadSurveyButton() {
38        ?>
39        <form id="loadForm" action="surveycreation.php" method="post">
40            <input type="button" onclick="loadSurvey()" value="Load/Edit survey" class="surveyButton bigSurveyButton" />
41        </form>
42        <?php
43    }
44
45    public static function deleteSurveyButton() {
46        ?>
47        <form action="" method="post">
48            <input type="button" onclick="delSurvey()" value="Delete survey" class="surveyButton bigSurveyButton" />
49        </form>
50        <?php
51    }
52
53    /**
54     *
55     * @param Survey $surveys An array of surveys
56     */
57    public static function loadSurveyList($surveys) {
58        ?>
59        <select id="surveysToLoad" class="toLoad" size="1000">
60            <?php
61            foreach ($surveys as $survey) {
62                ?><option value='<?php echo $survey->id; ?>'><?php echo $survey->title; ?></option><?php
63        }
64            ?>
65        </select>
66        <?php
67    }
68
69}
70?>
Note: See TracBrowser for help on using the repository browser.