-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
65 lines (46 loc) · 1.33 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
<?php
ob_start();
require __DIR__."/vendor/autoload.php";
use CoffeeCode\Router\Router;
use Source\Core\Session;
$session = new Session();
$route = new Router(ROOT);
$route->namespace("Source\App");
/**
*WEB ROUTES
*/
$route->group(null);
$route->get("/", "Web:home");
$route->get("/produto/{id}", "Web:product");
$route->post("/produto/{id}", "Web:appTicket");
$route->get("/login", "Web:login");
$route->post("/login", "Web:login");
/**
*ADMIN ROUTES
*/
$route->group("admin");
$route->get("/dash", "Admin:adminArea");
$route->post("/cupom", "Admin:ticket");
$route->get("/cupom/editar/{id}", "Admin:ticketEdit");
$route->post("/cupom/editar/{id}", "Admin:ticketUpdate");
$route->get("/cupom/excluir/{id}", "Admin:ticketDelete");
$route->get("/produto", "Admin:adminProduct");
$route->post("/produto/{post}", "Admin:adminProduct");
$route->get("/produto/editar/{id}", "Admin:productEdit");
$route->post("/produto/editar/{id}/{post}", "Admin:productUpdate");
$route->get("/produto/excluir/{id}", "Admin:productDelete");
$route->get("/produto/excluir/{id}", "Admin:productDelete");
$route->get("/sair", "Admin:exit");
/**
*ERROR ROUTES
*/
$route->group("ops");
$route->get("/{errcode}", "Web:error");
/**
*PROCESS ROUTES
*/
$route->dispatch();
if ($route->error()){
$route->redirect("/ops/{$route->error()}");
}
ob_end_flush();