source: Dev/trunk/mainmenu.php @ 56

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

Stubs and some refactoring

File size: 1.6 KB
RevLine 
[56]1<?php
2require 'classes/master.php'; //should be at top of every page   
[47]3
[56]4if (isset($_POST['login'])) {
5    if ($_POST['username'] == '')
6        die("Please log in!");
7    else {
8        $userDBI = new UserDatabaseInterface();
9        $user_exists = $userDBI->checkUserName($_POST['username']);
10        if ($user_exists) {
11            $correct_password = $userDBI->checkUserPassword($_POST);
12            if (!$correct_password)
13                die("The password you entered is not correct!");
14        }
15        else
16            die("Unknown user name");
17    }
[47]18}
19
[50]20
[47]21$surveys = array();
22
23$surveyDBI = new SurveyDatabaseInterface(null);
24$surveyIDTitles = $surveyDBI->getExistingSurveys();
25
26
27foreach ($surveyIDTitles as $id => $title) {
28    $survey = new Survey($id, $title);
29    array_push($surveys, $survey);
30}
31?>
32
33<!DOCTYPE html>
34<html>
35    <head>
36        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
37        <title>Facilitator</title>
38        <link rel="stylesheet" type="text/css" href="css/style.css" />
39        <script type="text/javascript" src="js/menu.js"></script>
40    </head>
41    <body>
42        <div id="header">
[56]43            <?php new Logo(); ?>
44        </div>
45
[47]46        <div id="wrapper">
[56]47
[47]48            <div id="content">
49                <div id="menu">               
[56]50                    <?php
51                    Session::createSessionButton();
52                    Application::createApplicationButton();
53                    Survey::newSurveyButton();
54                    Survey::loadSurveyButton($surveys);
[47]55                    ?>
56                </div>
57            </div>
58        </div>
59    </body>
60</html>
Note: See TracBrowser for help on using the repository browser.