-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlista.php
More file actions
62 lines (57 loc) · 2.4 KB
/
lista.php
File metadata and controls
62 lines (57 loc) · 2.4 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
<?php
require_once('autoload.php');
include_once('autoload/DAO/dispositivoDAO.php');
include("cabecalho.php");
?>
<section class="section-table">
<div class="container">
<h2>Relatório</h2>
<table class="table table-striped table-bordered table-responsive table-mt4">
<thead class="thead-mt4">
<tr class="tr-mt4">
<th scope="col">ID</th>
<th scope="col">Hostname</th>
<th scope="col">IP</th>
<th scope="col">Tipo</th>
<th scope="col">Ativo/Inativo</th>
<th scope="col">Ações</th>
</tr>
</thead>
<tbody>
<?php
$dispositivosLista = listaDispositivos($conexao2);
foreach($dispositivosLista as $dl) :
?>
<tr class="tr-mt4">
<th scope="row"><?= $dl['idDispositivo']?></th>
<td><?= $dl['hostname']?></td>
<td><?= $dl['ip']?></td>
<td><?= $dl['nomeTipo']?></td>
<td>
<?php
($dl['ativoDispositivo']==0) ? $echo = 'Não' : $echo = 'sim';
echo $echo;
?>
</td>
<td>
<form action="edicao.php?pk=<?= $dl['pkDispositivo']?>" method="post">
<input type="hidden" name="pk" value="<?= $dl['pkDispositivo']?>">
<button class="edite-btn" type="submit"><i class="fas fa-pencil-alt"></i> Editar</button><br>
</form>
<?php
if ($dl['ativoDispositivo']==0){
echo '<a data-value="' . $dl["pkDispositivo"] . '" class="ative-btn" href="#"><i class="fas fa-toggle-on"></i> Ativar</a><br>';
}
else{
echo '<a data-value="' . $dl["pkDispositivo"] . '" class="desative-btn" href="#"><i class="fas fa-toggle-off" ></i> Desativar</a><br>';
}
?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<a href="/mt4_php/"><button type="button" class="btn btn-secondary">Voltar</button></a>
</div>
</section>
<?php include("rodape.php"); ?>