source: Dev/trunk/mainmenu.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.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);
[58]12            /* session remembers login */
[56]13            if (!$correct_password)
14                die("The password you entered is not correct!");
[58]15            else
16                $_SESSION['username'] = $_POST['username'];
[56]17        }
18        else
19            die("Unknown user name");
20    }
[47]21}
[58]22else if (is_null($_SESSION['username']))
23    redirect('index.php');
[47]24
25$surveys = array();
26
27$surveyDBI = new SurveyDatabaseInterface(null);
28$surveyIDTitles = $surveyDBI->getExistingSurveys();
29
30
31foreach ($surveyIDTitles as $id => $title) {
32    $survey = new Survey($id, $title);
33    array_push($surveys, $survey);
34}
35?>
36
37<!DOCTYPE html>
38<html>
39    <head>
40        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
41        <title>Facilitator</title>
[59]42        <?php new StyleSheet(); ?>
[47]43        <script type="text/javascript" src="js/menu.js"></script>
44    </head>
45    <body>
46        <div id="header">
[56]47            <?php new Logo(); ?>
48        </div>
49
[47]50        <div id="wrapper">
[56]51
[47]52            <div id="content">
[58]53                               
54                    <?php new SessionMenu(); ?>
55
56                    <?php new ApplicationMenu(); ?>
57               
58                    <?php new SurveyMenu($surveys); ?>
59
[47]60            </div>
61        </div>
62    </body>
63</html>
Note: See TracBrowser for help on using the repository browser.