-
Notifications
You must be signed in to change notification settings - Fork 0
/
consultar_chamado.php
103 lines (90 loc) · 2.88 KB
/
consultar_chamado.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
<?php
require_once "validador_acesso.php";
//array para guardar os chamados
$chamados = array();
//abrindo o arquivo do bd
$arquivo = fopen('../../app_help_desk/bd.txt', 'r');
//verifica o end of file
while(!feof($arquivo)){
$regitro = fgets($arquivo);
$chamados[] = $regitro;
}
fclose($arquivo);
?>
<html>
<head>
<meta charset="utf-8" />
<title>App Help Desk</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
.card-consultar-chamado {
padding: 30px 0 0 0;
width: 100%;
margin: 0 auto;
}
</style>
</head>
<body>
<nav class="navbar navbar-dark bg-dark">
<a class="navbar-brand" href="#">
<img src="logo.png" width="30" height="30" class="d-inline-block align-top" alt="">
App Help Desk
</a>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="logoff.php">SAIR</a>
</li>
</ul>
</nav>
<div class="container">
<div class="row">
<div class="card-consultar-chamado">
<div class="card">
<div class="card-header">
Consulta de chamado
</div>
<div class="card-body">
<?php foreach($chamados as $chamado){?>
<?php
//transforma a str em um array
$chamado_dados = explode('#', $chamado);
if($_SESSION['perfil_id'] == 2){
if($_SESSION['id'] != $chamado_dados[0]) continue;
}
//laço para pular o ultimo array
if(count($chamado_dados) < 3){
continue;
}
?>
<div class="card mb-3 bg-light">
<div class="card-body">
<h5 class="card-title">
<?php
echo "$chamado_dados[1]";
?>
</h5>
<h6 class="card-subtitle mb-2 text-muted">
<?php
echo "$chamado_dados[2]";
?>
</h6>
<p class="card-text">
<?php
echo "$chamado_dados[3]";
?>
</p>
</div>
</div>
<?php } ?>
<div class="row mt-5">
<div class="col-6">
<a class="btn btn-lg btn-warning btn-block" href="home.php">Voltar</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>