-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexec.projeto.php
85 lines (64 loc) · 1.51 KB
/
exec.projeto.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php session_start();
$tokenUsuario = md5('seg'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
if ($_SESSION['donoDaSessao'] != $tokenUsuario)
{
header('Location: index.php');
}
require_once('classes/projeto.class.php');
require_once('classes/conexao.class.php');
$conexao = new Conexao;
$conn = $conexao->Conectar();
$Projeto = new Projeto();
$Projeto->conn = $conn;
$operacao = $_REQUEST['op'];
$idusuario = $_REQUEST['cmboxusuario'];
if (($operacao=='I') || ($operacao=='A'))
{
$fechar = $_REQUEST['fechar'];
$id = $_REQUEST['id'];
$project = $_REQUEST['edtprojeto'];
$Projeto->idproject= $idproject;
$Projeto->project = $project;
$Projeto->idusuario = $idusuario;
}
if ($operacao=='I')
{
if ($result = $Projeto->incluir())
{
// MENSAGEM 19 ==> CADASTRAR TECNICO
header("Location: consprojeto.php?op=A&MSGCODIGO=92");
}
else
{
header("Location: cadprojeto.php?op=I&MSGCODIGO=93");
}
}
if ($operacao=='A')
{
if ($result = $Projeto->alterar($id))
{
// MENSAGEM 21 ==> ALTERAR tecnico
header("Location: cadprojeto.php?op=A&MSGCODIGO=94&id=$id");
}
else
{
// MENSAGEM 22 ==> NÃO FOI POSSÍVEL ALTERAR tecnico
header("Location: cadprojeto.php?op=A&MSGCODIGO=95&id=$id");
}
}
if ($operacao=='E')
{
$id = $_REQUEST['id'];
if (!empty($id)){
$result = $Projeto->excluir($id);
}
else
{
$box=$_POST['id_projeto'];
while (list ($key,$val) = @each($box)) {
$result = $Projeto->excluir($val);
}
}
header("Location: consprojeto.php?MSGCODIGO=91&id=$id");
}
?>