-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinterfazReportes.php
More file actions
261 lines (215 loc) · 9.92 KB
/
interfazReportes.php
File metadata and controls
261 lines (215 loc) · 9.92 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?php
//Codigo para validar que esta pagina pueda ser visualizada solamente si existe una sesión previamente iniciada!
session_start();
error_reporting(0);
$varSesion = $_SESSION['usuario'];
//Habilitar la siguiente linea cuando se de por concluido el desarrollo de esta pagina, esto con el fin de que no se muestren errores de php
if($varSesion == null || $varSesion = ''){
header("Location: errorInicioSesion.php");
die();
}
if ($_SESSION['tipoUsuario'] == '1') {
header("Location: errorAcceso.php");
die();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="author" content="PracticantesServicioSocial">
<meta charset="utf-8">
<link rel="stylesheet" href="styles/common_styles.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Staatliches" rel="stylesheet">
<link rel="stylesheet" href="librerias/bootstrap/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="librerias/fontawesome/css/font-awesome.css">
<?php require_once "php/gestionScripts.php"; ?>
<title>Reportes</title>
</head>
<body>
<div class="container">
<div class="row">
<!-- Imagen -->
<div class="logo-container w-100">
<img src="img/logo.jpg" alt="CUSur">
<a href="adminIndex.php" class="btn btn btn-link">
<span class="fa fa-arrow-circle-left" style="margin-right: 5px;"></span>
Volver al Panel del Administrador
</a>
</div>
</div>
<div class="row mt-4">
<h3 class="col-xl">Seleccione tipo de Reporte:</h3>
</div>
<div class="row mt-4">
<div class="col-sm">
<div class="card">
<div class="card-header w-100 bg-dark text-white">
<h4>Reporte por fecha</h4>
</div>
<div class="card-body">
<div class="card-title">
<span class="fa fa-calendar text-secondary w-100 mb-2" style="color: #0069D9; font-size: 6em; text-align: center;"></span>
</div>
<span class="btn btn-primary" data-toggle="modal" data-target="#reportefechasmodal">
<span class="fa fa-file" style="margin-right: 5px;"></span>
Generar reporte
</span>
</div>
</div>
</div>
<div class="col-sm">
<div class="card">
<div class="card-header w-100 bg-dark text-white">
<h4>Reporte por cursante</h4>
</div>
<div class="card-body">
<div class="card-title">
<span class="fa fa-graduation-cap text-secondary w-100 mb-2" style="color: #0069D9; font-size: 6em; text-align: center;"></span>
</div>
<span class="btn btn-primary" data-toggle="modal" data-target="#reportecursantemodal">
<span class="fa fa-file" style="margin-right: 5px;"></span>
Generar reporte
</span>
</div>
</div>
</div>
<div class="col-sm">
<div class="card">
<div class="card-header w-100 bg-dark text-white">
<h4>Reporte por curso</h4>
</div>
<div class="card-body">
<div class="card-title">
<span class="fa fa-wrench text-secondary w-100 mb-2" style="font-size: 6em; text-align: center;"></span>
</div>
<span class="btn btn-primary" data-toggle="modal" data-target="#reportecursomodal">
<span class="fa fa-file" style="margin-right: 5px;"></span>
Generar reporte
</span>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="reportefechasmodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content w-100">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Reporte por fechas</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body w-100">
<!-- FORM DEL REPORTE POR FECHAS -->
<form id="formReporteFechas" class="w-100">
<!-- Fecha Inicial -->
<label for="fechaInicial">Fecha inicial</label>
<input id="fechaInicial" class="form-control input-sm mb-3" type="date" name="fechaInicial" required>
<!-- Fecha Inicial -->
<label for="fechaFinal">Fecha final</label>
<input id="fechaFinal" class="form-control input-sm mb-3" type="date" name="fechaFinal" required>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cerrar</button>
<!-- Boton para generar el reporte de las fechas -->
<button type="button" id="btnGenerarReporteFechas" class="btn btn-primary">Generar reporte</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="reportecursantemodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content w-100">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Reporte por cursante</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body w-100">
<form id="frmCursante" class="w-100">
<label for="codigo">Código del cursante</label>
<select id="codigo" name="codigo">
<?php
require_once "php/conexion.php";
$obj = new conectar();
$conexion = $obj -> conexion();
$result = mysqli_query($conexion, "SELECT codigo, nombre FROM cursante");
while($row = mysqli_fetch_row($result)) {
echo "<option value='$row[0]'>$row[1] ($row[0])</option> ";
}
mysqli_free_result($result);
mysqli_close($conexion);
?>
</select>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" id="btnCursante" class="btn btn-primary">Generar reporte</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="reportecursomodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content w-100">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Reporte por curso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body w-100">
<form id="frmCurso" class="w-100">
<!-- Fecha Inicial -->
<label for="nombreCurso">Nombre del curso</label>
<select id="nombreCurso" name="nombreCurso">
<?php
require_once "php/conexion.php";
$obj = new conectar();
$conexion = $obj -> conexion();
$result = mysqli_query($conexion, "SELECT evento_id, nombre FROM evento");
while($row = mysqli_fetch_row($result)) {
echo "<option value='$row[0]'>$row[1]</option> ";
}
mysqli_free_result($result);
mysqli_close($conexion);
?>
</select>
<!-- Fecha Inicial -->
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" id="btnCurso" class="btn btn-primary">Generar reporte</button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<!-- Función JS para enviar los parametros al php que generará el reporte por fechas -> interfazReportesFechas.php -->
<script type="text/javascript">
$(document).ready(function(){
$('#btnGenerarReporteFechas').click(function(){
datos=$('#formReporteFechas').serialize();
//Envio de parametro por _$GET
location.href="interfazReporteFechas.php?"+datos;
});
$('#btnCursante').click(function(){
datos=$('#frmCursante').serialize();
location.href="interfazReporteCursante.php?"+datos;
});
$('#btnCurso').click(function(){
datos=$('#frmCurso').serialize();
location.href="interfazReporteCurso.php?"+datos+"&nombre="+$("#nombreCurso option:selected").text();
});
});
</script>