forked from aliciarita/monitoria_apc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditarAluno.php
More file actions
39 lines (30 loc) · 930 Bytes
/
editarAluno.php
File metadata and controls
39 lines (30 loc) · 930 Bytes
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
<?php
require __DIR__.'/vendor/autoload.php';
define('TITLE','Editar Aluno');
use \App\Entity\Aluno;
//VALIDAÇÃO DO ID
if(!isset($_GET['id']) or !is_numeric($_GET['id'])){
header('location: aluno.php?status=error');
exit;
}
//CONSULTA O ALUNO
$obAluno = Aluno::getAluno($_GET['id']);
//VALIDAÇÃO DE ALUNO
if(!$obAluno instanceof Aluno){
header('location: aluno.php?status=error');
exit;
}
//VALIDAÇÃO DO POST
if(isset($_POST['nome'],$_POST['matricula'],$_POST['tipoDisciplina'])){
$obAluno->matricula = $_POST['matricula'];
$obAluno->nome = $_POST['nome'];
$obAluno->tipoDisciplina = $_POST['tipoDisciplina'];
$obAluno->turma = $_POST['turma'];
$obAluno->atualizar();
header('location: aluno.php?status=success');
exit;
}
include __DIR__.'/include/header.php';
include __DIR__.'/include/formularioAluno.php';
include __DIR__.'/include/footer.php';
?>