-
Notifications
You must be signed in to change notification settings - Fork 2
/
excluir.php
33 lines (24 loc) · 643 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
<?php
require __DIR__.'/vendor/autoload.php';
use \App\Entity\Ramal;
//VALIDAÇÃO DO ID
if(!isset($_GET['id']) or !is_numeric($_GET['id'])){
header('location: index.php?status=error');
exit;
}
//CONSULTAR O RAMAL
$obRamal = Ramal::getRamal($_GET['id']);
//VALIDAÇÃO DO RAMAL
if(!$obRamal instanceof Ramal){
header('location: index.php?status=error');
exit;
}
//VALIDAÇÃO DO POST
if(isset($_POST['excluir'])){
$obRamal->excluir();
header('location: index.php?status=success');
exit;
}
include __DIR__.'/includes/header.php';
include __DIR__.'/includes/confirmar-exclusao.php';
include __DIR__.'/includes/footer.php';