-
Notifications
You must be signed in to change notification settings - Fork 0
/
actalternativadel.php
51 lines (44 loc) · 980 Bytes
/
actalternativadel.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
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//--utf8_encode --
session_start();
include_once 'cls/pergunta.class.php';
include_once 'cls/alternativa.class.php';
include_once 'inc/comuns.inc.php';
function Main()
{
$p = $_SESSION['perg'];
$codalt = (isset($_GET['a']) && (! is_null($_GET['a']))) ? base64_decode($_GET['a']) : null;
if (is_numeric($codalt))
{
//$codperg = $p->getCodigo();
$pergunta = new Pergunta();
$pergunta->setCodigo($p);
$alt = new Alternativa();
$alt->Carrega($codalt);
if ($pergunta->DeletaAlternativa($alt))
{
//$pergunta->RecarregarAlternativas();
//$_SESSION['perg'] = serialize($p);
header("Location:vwalternativas.php?p=" . base64_encode($p));
}
else
{
$erros = "Erros ocorreram.";
foreach ($p->msg_erro as $err)
{
$erros .= "<br />" . $err;
}
echo($erros);
}
}
}
if (Comuns::EstaLogado())
{
Main();
}
else
{
$msg = base64_encode("Você deve estar logado para acessar esta tela");
header("Location:index.php?m=" . $msg);
}
?>