forked from hnben/AIDataAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
62 lines (50 loc) · 1.42 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* The index.php is the controller for the AI Data Analytics Website.
* This creates the routing for all view pages
*
* @author Huy Nguyen, Tien Nguyen, Will Castillo
*/
// Turn on error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Require the autoload file
require_once('vendor/autoload.php');
// Instantiate Fat-Free framework (F3)
$f3 = Base::instance(); //static method
$controller = new Controller($f3);
$dataLayer = new AccessDatabase();
// Define a default route
$f3->route('GET /', function() {
// Display a view page
$GLOBALS['controller']->home();
});
// Routing a home route
$f3->route('GET /home', function() {
// Display a view page
$GLOBALS['controller']->home();
});
// Routing to the Login Page
$f3->route('GET|POST /login', function($f3) {
$GLOBALS['controller']->login();
});
// Routing to the Overview Page
$f3->route('GET|POST /overview', function() {
$GLOBALS['controller']->overview();
});
// Routing to the Expense Page
$f3->route('GET|POST /expense', function() {
// Display a view page
$GLOBALS['controller']->expense();
});
// Routing to the Revenue Page
$f3->route('GET|POST /revenue', function() {
// Display a view page
$GLOBALS['controller']->revenue();
});
// Routing to the analysis options Page
$f3->route('GET|POST /analysisoptions', function() {
// Display a view page
$GLOBALS['controller']->analysisOptions();
});
$f3->run();