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