-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
47 lines (45 loc) · 1.46 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
<?php
$basePath = '/BayMed';
$requestUri = $_SERVER['REQUEST_URI'];
$uriComponents = parse_url($requestUri);
$path = $uriComponents['path'];
$queryString = $uriComponents['query'] ?? '';
switch ($path) {
case $basePath . '/login':
include_once 'controllers/LoginController.php';
LoginController::index();
break;
case $basePath . '/register':
include_once 'controllers/RegistrationController.php';
RegisterController::index();
break;
case $basePath . '/':
include_once 'controllers/HomeController.php';
HomeController::index();
break;
case $basePath . '/logout':
include_once 'controllers/LogoutController.php';
LogoutController::index();
break;
case $basePath . '/medicines':
include_once 'controllers/MedicineController.php';
MedicineController::viewAll();
break;
case $basePath . '/medicine':
include_once 'controllers/MedicineController.php';
MedicineController::viewMedicine();
break;
case $basePath . '/cart':
include_once 'controllers/CartController.php';
CartController::index();
break;
case $basePath . '/feedback':
include_once 'controllers/FeedbackController.php';
FeedbackController::index();
break;
default:
// Handle 404
http_response_code(404);
echo '404 Not Found';
break;
}