-
Notifications
You must be signed in to change notification settings - Fork 0
/
excluir.php
38 lines (27 loc) · 942 Bytes
/
excluir.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
<?php
// carregando o autoload
require __DIR__.'/vendor/autoload.php';
define ('TITLE', 'Editar vaga');
use \App\Entity\Vaga;
if (!isset($_GET['id']) or !is_numeric($_GET['id'])){
header('location: index.php?status=error');
exit;
}
//carrega a vaga
$obVaga = Vaga::getVaga($_GET['id']);
//valida a vaga e retorna para home
if(!$obVaga instanceof Vaga){
header('location: index.php?status=error');
exit;
}
//manipulando info do form via post e jogando dentro do objeto
if (isset($_POST['excluir'])){
$obVaga->excluir();
header('location: index.php?status=success');
exit;
}
//echo "<pre>"; print_r($_POST); echo "</pre>"; exit;
//incluindo conteudo
include __DIR__.'/includes/header.php' ;
include __DIR__.'/includes/confirmar-exclusao.php' ;
include __DIR__.'/includes/footer.php' ;