source: Dev/trunk/mainmenu.php @ 115

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

Code to get questions and put them in objects

File size: 1.6 KB
Line 
1<?php
2require 'classes/master.php'; //should be at top of every page   
3     
4//$_SESSION['username'] = 'hai'; //temp, until bug is fixed
5
6if (isset($_POST['login'])) {
7    if ($_POST['username'] == '')
8        die("Please log in!");
9    else {
10        $userDBI = new UserDatabaseInterface();
11        $user_exists = $userDBI->checkUserName($_POST['username']);
12        if ($user_exists) {
13            $correct_password = $userDBI->checkUserPassword($_POST);
14            /* session remembers login */
15            if (!$correct_password)
16                die("The password you entered is not correct!");
17            else
18                $_SESSION['username'] = $_POST['username'];
19        }
20        else
21            die("Unknown user name");
22    }
23}
24else if (is_null($_SESSION['username']))
25    redirect('index.php');
26
27$surveys = Loader::loadSurveys();
28$applications = Loader::loadApplications();
29?>
30
31<!DOCTYPE html>
32<html>
33    <head>
34        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
35        <title>Facilitator</title>
36        <?php new StyleSheet(); ?>
37        <script type="text/javascript" src="js/menu.js"></script>
38    </head>
39    <body>
40        <div id="header">
41            <?php new Logo(); ?>
42        </div>
43
44        <div id="wrapper">
45
46            <div id="content">
47                               
48                    <?php new SessionMenu(); ?>
49
50                    <?php new ApplicationMenu($applications); ?>
51               
52                    <?php new SurveyMenu($surveys); ?>
53               
54                    <?php new QuestionMenu(); ?>
55
56            </div>
57        </div>
58    </body>
59</html>
Note: See TracBrowser for help on using the repository browser.