-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (47 loc) · 1.43 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
<?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("/{page}", "Web:home");
$route->get("/login", "Web:login");
$route->post("/login", "Web:login");
$route->post("/dentista/buscar", "Web:search");
$route->get("/dentista/buscar/{terms}/{tipo}/{page}", "Web:search");
/**
*ADMIN ROUTES
*/
$route->group("admin");
$route->get("/dash", "Admin:adminArea");
$route->get("/dash/{page}", "Admin:adminArea");
$route->get("/especialidades", "Admin:specialityArea");
$route->post("/especialidades", "Admin:specialityCreate");
$route->get("/especialidade/excluir/{id}", "Admin:specialityDelete");
$route->get("/especialidade/editar/{id}", "Admin:specialityUpdate");
$route->post("/especialidade/editar/{id}", "Admin:specialityUpdate");
$route->post("/dentista", "Admin:dentistCreate");
$route->get("/dentista/excluir/{id}", "Admin:dentistDelete");
$route->get("/dentista/editar/{id}", "Admin:dentistUpdate");
$route->post("/dentista/editar/{id}", "Admin:dentistUpdate");
$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();