-
Notifications
You must be signed in to change notification settings - Fork 0
/
controleOrcamentos.php
150 lines (115 loc) · 3.59 KB
/
controleOrcamentos.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
session_start();
require 'conexao.php';
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles-cadastro.css">
<title>Orçamentos Solicitados</title>
</head>
<script>
function alteraStatus($IdOrcamento, $status) {
if ($result) {
document.getElementById("txtStatusAlterado").innerHTML = "STATUS ALTERADO";
}
}
</script>
<body>
<section><div class="login-box">
<img class="logo" src="images/vibe.png" alt="logotipo da loja" >
<div class="login-box">
<div class="login-box1">
<input type="button" value="Voltar para pagina Principal" onclick="javascript: location.href='index.php';" />
<div <h1>
<?php echo "______________________";
?><br /><?php
$usuario = dbBuscaFuncionario($_SESSION['NomeUsuario']);
$linha_usuario = mysqli_fetch_array($usuario);
?><?php echo " ÁREA DO FUNCIONÁRIO";
?><br /><?php //echo "ID:".$linha_usuario['ID'];
?><?php echo "Nome:".$linha_usuario['Nome'];
?><br /><?php echo "Email: ".$linha_usuario['Email'];
?><br /><?php echo "______________________";
?>
</h1>
<div
</div>
<h1> Orçamentos solicitados </h1>
</div>
</div>
<?php
?>
<?php
$orcamento_servicos = dbBuscaTodosOrcamentos();
while ($linha = mysqli_fetch_array($orcamento_servicos)) {
$arrayServicos[] = $linha;
$txtIdServico = $linha['id'];
$txtClienteSolicitante = $linha['login'];
$txtNomeServico = $linha['nomeServico'];
$txtStatus = $linha['status'];
$txtStatusvalor="";
if($txtStatus==0){
$txtStatusvalor=" SOLICITADO";
}else{
if($txtStatus==1){
$txtStatusvalor=" EM ANDAMENTO";
}else{
if($txtStatus==2){
$txtStatusvalor=" PRONTO";
}else{
if($txtStatus==3){
$txtStatusvalor=" ENCERRADO";
}
}
}
}
$dados_servicos = dbBuscaServicosPedidos($txtNomeServico);
$linha_servico = mysqli_fetch_array($dados_servicos);
$txtValorServico = "R$ ".$linha_servico['preco'];
$txtTempoServico = $linha_servico['tempo'];
$txtDescricao = $linha_servico['descricao'];
?><br /><?php
echo "-----------------";
?><br /><?php
echo "ID Orcamento: " .$txtIdServico;
?><br /><?php
echo "Cliente solicitante: " .$txtClienteSolicitante;
?><br /><?php
echo "Serviço: ".$txtNomeServico;
?><br /><?php
echo "Preço: ".$txtValorServico;
?><br /><?php
echo "Prazo de Entrega: ".$txtTempoServico ." dias";
?><br /><?php
echo "Status: ".$txtStatusvalor;
?><br /><?php
echo "-----------------";
?><br /><?php
//dbAlteraStatusOrcamento($txtIdServico, 2);
}
?>
<br><br>
Alteração de Status :
<br><br>
<form action="#" method="post">
ID :
<input type="number" name="idServico" placeholder="Digite o ID"> <br>
<input type="radio" name="status" value="1" > Em andamento <br>
<input type="radio" name="status" value="2" > Pronto <br>
<input type="radio" name="status" value="3" > Encerrado <br>
<br>
<input type="submit" name="submit" value="Alterar" formmethod="post">
<br><br>
</form>
<?php
if (isset($_POST["submit"])) {
$IdAlterado = $_POST["idServico"];
$newStatus = $_POST["status"];
dbAlteraStatusOrcamento($IdAlterado, $newStatus);
header("Location: controleOrcamentos.php");
}
?>
</div>
</div></section>
</html>