-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (48 loc) · 1.39 KB
/
Copy pathindex.php
File metadata and controls
54 lines (48 loc) · 1.39 KB
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
<?php
require_once 'config/constants.php';
require_once 'config/database.php';
require_once 'utils/helpers.php';
// Activation de l'affichage des erreurs
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Gestion des erreurs
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Démarrer la session
session_start();
// Routing basique
$page = $_GET['page'] ?? 'home';
$action = $_GET['action'] ?? 'index';
// Inclure le contrôleur approprié
switch ($page) {
case 'institutes':
require_once 'controllers/InstituteController.php';
$controller = new InstituteController();
break;
case 'services':
require_once 'controllers/ServiceController.php';
$controller = new ServiceController();
break;
case 'availability':
require_once 'controllers/AvailabilityController.php';
$controller = new AvailabilityController();
break;
case 'reservations':
require_once 'controllers/ReservationController.php';
$controller = new ReservationController();
break;
default:
// Page d'accueil
require_once 'views/home.php';
exit;
}
// Exécuter l'action demandée
if (method_exists($controller, $action)) {
$controller->$action();
} else {
http_response_code(404);
require_once 'views/404.php';
}
?>