-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
50 lines (33 loc) · 1.66 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
<?php
session_start();
require_once __DIR__ . '/vendor/autoload.php';
use Details\controllers\ProductController;
use Details\controllers\UserController;
use Details\controllers\InvoiceController;
use Details\Router;
$router = new Router();
$userController = new UserController();
$router->get('/', [$userController, 'index']);
$router->get('/signin', [$userController, 'signin']);
$router->post('/signin', [$userController, 'signin']);
$router->get('/signup', [$userController, 'signup']);
$router->post('/signup', [$userController, 'signup']);
$router->get('/home', [$userController, 'home']);
$router->post('/home', [$userController, 'home']);
$router->get('/logout', [$userController, 'logout']);
$router->post('/logout', [$userController, 'logout']);
$router->get('/dashboard', [$userController, 'dashboard']);
$router->post('/dashboard', [$userController, 'dashboard']);
$router->post('/delete-user', [$userController, 'dashboard']);
// products
$router->get('/products', [ProductController::class, 'index']);
$router->get('/products/create', [ProductController::class, 'create']);
$router->post('/products/create', [ProductController::class, 'create']);
$router->get('/products/update', [ProductController::class, 'update']);
$router->post('/products/update', [ProductController::class, 'update']);
$router->post('/products/delete', [ProductController::class, 'delete']);
$router->get('/checkout', [InvoiceController::class, 'index']);
$router->get('/checkout/create', [InvoiceController::class, 'create']);
$router->post('/checkout/create', [InvoiceController::class, 'create']);
$router->get("/checkout/detail", [InvoiceController::class, 'show']);
$router->resolve();