-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from douglas-88/projeto-final
Painel Admin - Starting
- Loading branch information
Showing
2,155 changed files
with
806,696 additions
and
451 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
|
||
|
||
namespace App\Controller\Admin; | ||
|
||
use Core\Controller; | ||
use Core\Flash; | ||
use Core\Load; | ||
use Core\Login; | ||
use Core\Redirect; | ||
use Core\Validate; | ||
use Slim\Http\Request; | ||
use Slim\Http\Response; | ||
use App\Model\Admin; | ||
|
||
class LoginController extends Controller | ||
{ | ||
|
||
/** | ||
* Página Inicial | ||
*/ | ||
public function index() | ||
{ | ||
$this->view("admin/login",["template_admin" => $this->templateAdmin]); | ||
} | ||
|
||
/** | ||
* Exibe o formulário de criação | ||
*/ | ||
public function create() | ||
{ | ||
echo 'create'; | ||
} | ||
|
||
/** | ||
* Processa Formulário de criação | ||
*/ | ||
public function store(Request $request, Response $response) | ||
{ | ||
$validate = new Validate(); | ||
$data = $validate->validate([ | ||
"email" => "required:email", | ||
"password" => "required" | ||
]); | ||
|
||
if($validate->hasErros()){ | ||
foreach($data as $field => $value){ | ||
flash("post_".$field,$data[$field]); | ||
} | ||
back(); | ||
} | ||
|
||
$login = new Login(); | ||
$loggedIn = $login->login($data); | ||
|
||
if(!$loggedIn){ | ||
Flash::add("warning",error("Email ou Senha inválidos.")); | ||
back(); | ||
} | ||
|
||
Redirect::redirect("/painel/admin"); | ||
|
||
|
||
} | ||
|
||
/** | ||
* Exibe dado do Banco de dados | ||
*/ | ||
public function show($id) | ||
{ | ||
echo 'show'; | ||
} | ||
|
||
/** | ||
* Exibe o formulário de edição | ||
*/ | ||
public function edit($id) | ||
{ | ||
echo 'edit'; | ||
} | ||
|
||
/** | ||
* Processa o formulário de edição | ||
*/ | ||
public function update(Request $request, Response $response, $args) | ||
{ | ||
echo 'update'; | ||
} | ||
|
||
/** | ||
* Remove dados do Banco | ||
*/ | ||
public function destroy() | ||
{ | ||
|
||
if(isset($_SESSION["loginInfo"]) && !empty($_SESSION["loginInfo"])){ | ||
unset($_SESSION["loginInfo"]); | ||
} | ||
|
||
Redirect::redirect("/login"); | ||
|
||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
|
||
namespace App\Controller\Admin; | ||
|
||
use Core\Controller; | ||
use Slim\Http\Request; | ||
use Slim\Http\Response; | ||
|
||
class ProfessorController extends Controller | ||
{ | ||
/** | ||
* Página Inicial | ||
*/ | ||
public function index() { | ||
echo 'index professor'; | ||
} | ||
|
||
/** | ||
* Exibe o formulário de criação | ||
*/ | ||
public function create() { | ||
echo 'create'; | ||
} | ||
|
||
/** | ||
* Processa Formulário de criação | ||
*/ | ||
public function store(Request $request,Response $response) { | ||
echo 'store'; | ||
} | ||
|
||
/** | ||
* Exibe dado do Banco de dados | ||
*/ | ||
public function show($id) { | ||
echo 'show'; | ||
} | ||
|
||
/** | ||
* Exibe o formulário de edição | ||
*/ | ||
public function edit($id) { | ||
echo 'edit'; | ||
} | ||
|
||
/** | ||
* Processa o formulário de edição | ||
*/ | ||
public function update(Request $request,Response $response,$args) { | ||
echo 'update'; | ||
} | ||
|
||
/** | ||
* Remove dados do Banco | ||
*/ | ||
public function destroy($id) { | ||
echo 'destroy'; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.