-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
64 lines (50 loc) · 1.37 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
63
64
<?php
/*
* AUTHORS: Everett, Pedro, Nathan
* FILE: index.php
* PURPOSE: This is the main entry point for the Dog Adoption Center webpage.
* It sets up routing for various pages using the Fat-Free Framework (F3).
*/
//turn on error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
//Import what we require here!
require_once ('vendor/autoload.php');
//Instantiate Fat-Free
$f3 = Base::instance();
//Instantiate Controller
$con = new Controller($f3, new Validators());
//Reroute to home Page @BASE
$f3->route('GET|POST /', function (){
$GLOBALS['con']->home();
});
// NTR 5/7 Reroute to Our Dogs page
$f3->route('GET|POST /ourDogs', function (){
$GLOBALS['con']->ourDogs();
});
// EAH login reroute
$f3->route('GET|POST /login', function ()
{
$GLOBALS['con']->login();
});
// EAH SignUp reroute
$f3->route('GET|POST /signUp', function ()
{
$GLOBALS['con']->signUp();
});
// PVR 5/9 reroute to scheduling
// Will change later, quick tester for now
$f3->route('GET|POST /schedule', function (){
$GLOBALS['con']->schedule();
});
//EAH Admin page routing
$f3->route('GET|POST /admin', function ()
{
$GLOBALS['con']->admin();
});
// Route for updating admin status
$f3->route('POST /updateAdminStatus', function () {
$GLOBALS['con']->updateAdminStatus();
});
//run Fat Free
$f3->run();