-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreportes.php
More file actions
120 lines (96 loc) · 4.89 KB
/
reportes.php
File metadata and controls
120 lines (96 loc) · 4.89 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
<!doctype html>
<?php
include "funcionesphp/conexionbd.php";
if(empty($_GET)){
$order='id';
}else{
$order=$_GET['order'];
}
?>
<html lang="en">
<?php include 'fragmentos/cabecera.php'?>
<div id="txtHint">
<div class="main-panel">
<nav class="navbar navbar-default navbar-fixed">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="reportes.php">Reportes</a>
</div>
<div class="collapse navbar-collapse">
</div>
</div>
</nav>
<?php
$consulta="SELECT * FROM cityreportBD.reportes ORDER BY '".$order."'";
$res=mysqli_query($conexion,$consulta);
?>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="header">
<h4 class="title">Listado de Reportes</h4>
<p class="category">Haz click en un reporte para ver al detalle</p>
</div>
<div class="content table">
<table class="table table-hover table-striped">
<thead >
<th class="col-md-2 col-xs-4">Foto</th>
<th class="col-md-1 col-xs-2"><button class="btn btn-outline-light" onclick="ordenar('id')">ID</button></th>
<th class="col-md-4 hidden-xs"><button class="btn btn-outline-light" onclick="ordenar('nombre')">Descripción</button></th>
<th class="col-md-3 hidden-xs"><button class="btn btn-outline-light" onclick="ordenar('timestamp')">Fecha</button></th>
<th class="col-md-2 col-xs-6"><button class="btn btn-outline-light" onclick="ordenar('estado')" >Estado</button></th>
</thead>
<tbody>
<?php while($mostrar=mysqli_fetch_array($res)){?>
<tr onclick="document.location = 'mapa.php?v1=<?php echo $mostrar['id'] ?>&zoom=16';"><div class="row">
<td class="col-md-2 col-xs-4"><img src="<?php echo $mostrar['miniatura'] ?>" style="width:100%;height:100px; border-radius: 10px; object-fit: cover;" ></td>
<td class="col-md-1 col-xs-2"><?php echo $mostrar['id'] ?></td>
<td class="col-md-4 hidden-xs"><?php echo $mostrar['nombre'] ?></td>
<td class="col-md-3 hidden-xs"><?php echo $mostrar['timestamp'] ?></td>
<td class="col-md-2 col-xs-6"><?php echo $mostrar['estado'] ?></td>
</div>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'fragmentos/pie.php'?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
function ordenar(e) {
if (e == "") {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};
xmlhttp.open("GET","fragmentos/report.php?order="+e,true);
xmlhttp.send();
}
}
</script>
</body>
</html>