source: Dev/trunk/classes_old/SurveyMenu.php @ 164

Last change on this file since 164 was 137, checked in by jkraaijeveld, 14 years ago

Added old classes

File size: 1.8 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 extends Menu {
13
14    public function __construct($surveys) {
15        ?> <fieldset class="menu"> <?php
16        parent::__construct('Survey');
17        ?> <div class="menuButtons"> <?php
18        SurveyMenu::newSurveyButton();
19        SurveyMenu::loadSurveyButton();
20//        SurveyMenu::deleteSurveyButton();
21        ?> </div> <?php
22        SurveyMenu::loadSurveyList($surveys);
23        ?> </fieldset> <?php
24    }
25
26    public static function newSurveyButton() {
27        ?>
28
29        <form action="surveycreation.php" method="post">
30
31            <input type="submit" value="New" class="surveyButton bigSurveyButton" />
32
33        </form>
34
35        <?php
36    }
37
38    public static function loadSurveyButton() {
39        ?>
40        <form id="loadForm" action="surveycreation.php" method="post">
41            <input type="button" onclick="loadSurvey()" value="Load / Edit" class="surveyButton bigSurveyButton" />
42        </form>
43        <?php
44    }
45
46    public static function deleteSurveyButton() {
47        ?>
48        <form action="" method="post">
49            <input type="button" onclick="delSurvey()" value="Delete survey" class="surveyButton bigSurveyButton" />
50        </form>
51        <?php
52    }
53
54    /**
55     *
56     * @param Survey $surveys An array of surveys
57     */
58    public static function loadSurveyList($surveys) {
59        ?>
60        <select id="surveysToLoad" class="toLoad" size="1000">
61            <?php
62            foreach ($surveys as $survey) {
63                ?><option value='<?php echo $survey->id; ?>'><?php echo $survey->title; ?></option><?php
64        }
65            ?>
66        </select>
67        <?php
68    }
69
70}
71?>
Note: See TracBrowser for help on using the repository browser.