forked from Tess-mltx/Cogip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
71 lines (65 loc) · 1.92 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
<?php
declare(strict_types=1);
// servivra de router pour les page
// on load toutes les ressource
// puis on fait un switch case pour
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
require 'Connect/Cogip.php';
//include all your model files here
require 'Model/Compagnies.php';
require 'Model/Contacts.php';
require 'Model/Invoices.php';
require 'Model/Roles.php';
require 'Model/Users.php';
//include all your controllers here
require 'Controller/HomepageController.php';
require 'Controller/CompaniesController.php';
require 'Controller/ContactsController.php';
require 'Controller/InvoicesController.php';
require 'Controller/RolesController.php';
require 'Controller/UsersController.php';
require 'Controller/DashboardController.php';
$page = $_GET['page'] ?? null;
switch ($page) {
case 'companies-index':
(new CompaniesController())->index();
break;
case 'compagnies-show':
(new CompaniesController())->show();
break;
case 'contacts-index':
(new ContactsController())->index();
break;
case 'contacts-show':
(new ContactsController())->show();
break;
case 'invoices-index':
(new InvoicesController())->index();
break;
case 'login':
(new UsersController($bdd))->login();
break;
case 'register':
(new UsersController($bdd))->register();
break;
case 'logout':
(new UsersController($bdd))->logout();
break;
case 'dashboard':
(new DashboardController())->index();
break;
case 'dashboard-invoices':
(new InvoicesController())->dashboard();
break;
case 'dashboard-contacts':
(new ContactsController())->dashboard();
break;
case 'dashboard-companies':
(new CompaniesController())->dashboard();
break;
default:
(new HomepageController())->index();
break;
}