-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·87 lines (68 loc) · 2.71 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
//----------------------------
// INCLUDES
//----------------------------
session_start();
# include relevant files
require_once 'phpinc/config.inc.php';
require_once 'phpinc/check_login_status.php';
require_once 'mvc/model.php';
require_once 'mvc/controller.php';
require_once 'mvc/controller_map.php';
require_once 'mvc/controller_admin.php';
require_once 'mvc/controller_fault.php';
require_once 'mvc/controller_bootStrapTest.php';
require_once 'mvc/controller_AJAXTest.php';
require_once 'vendor/setup_twig.php';
require_once 'vendor/Epi/Epi.php';
# autoload classes
function autoLoad($class)
{
$class_prefix='classes/';
$class_suffix='.class.php';
require $class_prefix.$class.$class_suffix;
};
spl_autoload_register('autoLoad');
#--------------------------------
# ROUTING LOGIC
#--------------------------------
Epi::INIT('route');
getRoute()->get('/','index');
# map
getRoute()->get('/map','map');
getRoute()->get('/mapReportFault','mapReportFault');
getRoute()->get('/mapDisplay','mapDisplay');
getRoute()->get('/mapFindMobileSites','mapFindMobileSites');
getRoute()->get('/mapFindOffAirSites','mapFindOffAirSites');
getRoute()->get('/mapFindControllers','mapFindControllers');
# fault Reporting
getRoute()->post('/reportFaultEmailCheck','reportFaultEmailCheck');
getRoute()->post('/createReportFault','createReportFault');
getRoute()->get('/findFaultsByEmailForMapMarkers','findFaultsByEmailForMapMarkers');
getRoute()->get('/getFaultIdListLinkedToEmail','getFaultIdListLinkedToEmail');
# admin
getRoute()->get('/admin','admin');
getRoute()->get('/adminReportFault','adminReportFault');
getRoute()->get('/adminReportedFaults','adminReportedFaults');
getRoute()->get('/adminLogin','adminLogin');
getRoute()->post('/adminAuthenticate','adminAuthenticate');
getRoute()->get('/adminSelectRegion','adminSelectRegion');
getRoute()->post('/adminRegionSelected','adminRegionSelected');
getRoute()->get('/adminSites','adminSites');
getRoute()->post('/adminUpdateSite','adminUpdateSite');
getRoute()->get('/adminUpdateFault','adminUpdateFault');
getRoute()->post('/adminUpdateReportFault','adminUpdateReportFault');
getRoute()->get('/adminLogout','adminLogout');
# alerts
getRoute()->get('/messageAlert','messageAlert');
# AJAX calls
getRoute()->get('/retrieveAllSites','retrieveAllSites');
getRoute()->get('/retrieveOffAirSites','retrieveOffAirSites');
getRoute()->get('/retrieveSitesByCounty','retrieveSitesByCounty');
getRoute()->get('/retrieveAdminSites','retrieveAdminSites');
# discrete function to update passwords. Not accessible through Front End
getRoute()->get('/adminUpdateUserPassword','adminUpdateUserPassword');
# test
getRoute()->get('/paginationAjaxTest','paginationAjaxTest');
getRoute()->get('.*','error404');
getRoute()->run();