-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathhometech.php
More file actions
156 lines (136 loc) · 7.85 KB
/
hometech.php
File metadata and controls
156 lines (136 loc) · 7.85 KB
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
151
152
153
154
155
156
<?php
if(empty($_COOKIE['tecnico'])){
header("Location:index.php");
}
include "include/banco.php";
if(isset($_GET['msg'])){
if($_GET['msg'] == "solicitado"){
echo "<script> alert ('Alteração de status solicitada, aguarde o retorno do usuário!');</script>";
header("Location: hometech.php");
}else if($_GET['msg'] == "altera"){
echo "<script> alert('Senha alterada com sucesso! Obs: use esta senha para acessar a plataforma.');</script>";
header("Location: hometech.php");
}
}
$login = $_COOKIE['tecnico'];
$query = "select idusuario, primeira_vez from usuario where login = '$login' limit 1";
$consulta = mysqli_query($con, $query);
if($usuario = mysqli_fetch_assoc($consulta)){
$id = $usuario['idusuario'];
$vez = $usuario['primeira_vez'];
}
if(isset($_POST['selecionar'])){
$selecionar = $_POST['selecionar'];
$status = $_POST['status'];
if($selecionar == "todos"){
$query = "select idchamado, data, setorcall, solicitacao, descricao, problema, numaquina, status from chamados where status = '$status' order by idchamado";
}else{
$query = "select idchamado, data, setorcall, solicitacao, descricao, problema, numaquina, status from chamados where setorcall = '$selecionar' and status = '$status' order by idchamado";
}
}else{ $query = "select idchamado, data, setorcall, solicitacao, descricao, problema, numaquina, status from chamados where status = 'Pendente' order by idchamado"; }
$cons = mysqli_query($con, $query);
$total = mysqli_num_rows($cons);
include "include/header.php";
?>
<div class="clear4"></div>
<section class="overx">
<div class="container">
<div class="col-xs-12 col-md-12">
<h3 class="ajust2">Chamados</h3>
<form action="" method="post" >
<div class="setor form-group">
<label style="color: black;" for="selecionar">Selecionar por:</label>
<select class="form-control" name="selecionar" id="selecionar" required>
<option value="todos">Todos</option>
<option value="RH">Recursos Humanos</option>
<option value="administrativo">Administrativo</option>
<option value="admin_no_privilege">Administrativo(Sem Privilégios)</option>
<option value="contabil">Contábil</option>
<option value="operacao">Operação</option>
<option value="seguranca do trabalho">Segurança do Trabalho</option>
<option value="auxiliar servicos gerais">Auxiliar de Serviços Gerais</option>
</select>
</div>
<div class="tipo form-group ">
<label style="color: black;" for="status">Status:</label>
<select class="form-control" name="status" id="status" required>
<option value="">Selecione:</option>
<option style="color: red;" value="Pendente">Pendentes</option>
<option style="color: blue;" value="Resolvido">Resolvidos</option>
</select>
<div class="form-control botao">
<button class="btn btn-default pesq"> Pesquisar</button>
</div>
</div>
</form>
<div class='table-responsive'>
<?php if($total != 0){
echo "<table class='tab table table-hover'>
<thead>
<tr class='back'>
<th>Setor:</th>
<th>Nº da Máquina</th>
<th>Motivo:</th>
<th>Data:</th>
<th>Solicitação:</th>
<th>Status:</th>
<th>Visualizar:</th>
</tr>
</thead>";
while($quero = mysqli_fetch_array($cons)){
$idchamado = $quero['idchamado'];
echo "<tbody>
<tr>
<td>" .$quero['setorcall']. "</td>
<td>" .$quero['numaquina']. "</td>
<td>" .$quero['problema']. "</td>
<td>" .$quero['data']. "</td>
<td>" .$quero['solicitacao']. "</td>
<td>" ?>
<?php if($quero['status'] == 'Pendente'){
$query4 = "select * from confirma where idchamado2 = $idchamado";
$consulta4 = mysqli_query($con,$query4);
$rows = mysqli_num_rows($consulta4);
if ($rows > 0) {
echo "<p style='color: red; '>".$quero['status']."</br><span style='font-style: italic;'>(Alteração</span></br>solicitada)</p>";
} else {
echo "<span style='color: red;'>".$quero['status']."</span>";
?>
<a style="cursor: pointer;" data-toggle="modal" data-target="#janela<?php echo "$idchamado"; ?>"><img style="display: inline; height: 20px; width: 20px;" src="img/refresh.png"></a>
<?php
include 'include/modalalterarstatus.php';
}
}
if($quero['status'] == 'Resolvido') {
echo "<span style='color:blue;'>Resolvido</span>";
}
?><?php echo "</td>"; ?>
<?php
echo"<td>";?>
<a title="Visualizar detalhes" style="cursor: pointer;" data-toggle="modal" data-target="#janela<?php echo "$idchamado"; ?>"><img width="50px" height="50px" src="img/descricao.jpg"/></a>
<?php
include 'include/modaldescricao.php';
echo "</td>
</tr>
</tbody>"; ?>
<?php
}
echo "</table>";
}
?>
</div>
</div>
</div>
</section>
<div class="clear3"></div>
<?php
include "include/footer.php";
if($vez == 1){
include "include/modalsenha.php";
?>
<script>
$(document).ready(function(){
$('#modalSenha').modal('show');
});
</script>
<?php } ?>