-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapagar_agendamento.php
26 lines (21 loc) · 992 Bytes
/
apagar_agendamento.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
<?php
session_start();
include_once './conexao.php';
include_once 'config_pdo.php';
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$id_aluno = filter_input(INPUT_GET, 'id_aluno', FILTER_SANITIZE_NUMBER_INT);
if (!empty($id)) {
$query_event = "DELETE FROM agendamento WHERE ID_agendamento=:id";
$delete_event = $conn->prepare($query_event);
$delete_event->bindParam("id", $id);
if($delete_event->execute()){
$_SESSION['msg'] = '<div class="alert alert-success" role="alert">A avaliação foi apagado com sucesso!</div>';
header("Location: agendamento.php");
}else{
$_SESSION['msg'] = '<div class="alert alert-danger" role="alert">Erro: A avaliação não foi apagado com sucesso!</div>';
header("Location: agendamento.php");
}
} else {
$_SESSION['msg'] = '<div class="alert alert-danger" role="alert">Erro: A avaliação não foi apagado com sucesso!</div>';
header("Location: agendamento.php");
}