-
Notifications
You must be signed in to change notification settings - Fork 0
/
gestionar_informes.php
271 lines (251 loc) · 8.98 KB
/
gestionar_informes.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
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
262
263
264
265
266
267
268
269
270
271
<?php require_once("includes/conexion.php");
PermitirAcceso(301);
$sw=0;
//Periodo mas reciente abierto
$ParamPed=array(
"'".$_SESSION['NumCong']."'"
);
$SQL_Periodo=EjecutarSP('usp_ConsultarUltimoPeriodoCong',$ParamPed);
$row_Periodo=sqlsrv_fetch_array($SQL_Periodo);
$TotalPub=0;
$TotalPR=0;
$TotalInf=0;
$TotalFalt=0;
if(PermitirFuncion(205)){//Verificar si solo puede ver el grupo al que está asignado
$Param=array(
"'".$_SESSION['NumCong']."'",
"'".$row_Periodo['IDPeriodo']."'",
"'".$_SESSION['Grupo']."'"
);
}else{
$Param=array(
"'".$_SESSION['NumCong']."'",
"'".$row_Periodo['IDPeriodo']."'"
);
}
$SQL=EjecutarSP('usp_ConsultarGruposInformes',$Param);
//echo $Cons;
?>
<!DOCTYPE html>
<html><!-- InstanceBegin template="/Templates/PlantillaPrincipal.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<?php include("includes/cabecera.php"); ?>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Informes de predicación | <?php echo NOMBRE_PORTAL;?></title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<?php
if(isset($_GET['a'])&&($_GET['a']==base64_encode("OK_InfAdd"))){
echo "<script>
$(document).ready(function() {
Swal.fire({
title: '¡Listo!',
text: 'Los informes han sido agregados exitosamente.',
icon: 'success'
});
});
</script>";
}
?>
<!-- InstanceEndEditable -->
</head>
<body>
<div id="wrapper">
<?php include("includes/menu.php"); ?>
<div id="page-wrapper" class="gray-bg">
<?php include("includes/menu_superior.php"); ?>
<!-- InstanceBeginEditable name="Contenido" -->
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-sm-8">
<h2>Informes de predicación</h2>
<ol class="breadcrumb">
<li>
<a href="index1.php">Inicio</a>
</li>
<li>
<a href="#">Ingresar informes</a>
</li>
<li class="active">
<strong>Informes de predicación</strong>
</li>
</ol>
</div>
</div>
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="ibox-content">
<?php include("includes/spinner.php"); ?>
<form action="gestionar_informes.php" method="get" id="formBuscar" class="form-horizontal">
<?php if($row_Periodo['IDPeriodo']!=""){?>
<div class="form-group">
<div class="col-lg-2">
<h2><strong>Periodo: </strong></h2>
</div>
</div>
<div class="form-group">
<div class="col-lg-3">
<h2 class="bg-primary b-r-md p-xs font-bold"><?php echo $row_Periodo['CodigoPeriodo']." (".$row_Periodo['NombreMes']."/".$row_Periodo['AnioPeriodo'].")";?></h2>
</div>
</div>
<?php }else{?>
<div class="form-group">
<div class="col-xs-12">
<h3><div class="alert alert-danger"><i class="fa fa-times-circle"></i> No hay periodos abiertos para ingresar informes.</div></h3>
</div>
</div>
<?php }?>
</form>
</div>
</div>
</div>
<br>
<?php //echo $Cons;?>
<?php if($row_Periodo['IDPeriodo']!=""){?>
<div class="row">
<div class="col-lg-12">
<div class="ibox-content">
<?php include("includes/spinner.php"); ?>
<div class="table-responsive">
<table class="table table-striped table table-hover table-responsive" >
<thead>
<tr>
<th>Grupo</th>
<th>Superintendente</th>
<th>Auxiliar</th>
<th>Publicadores</th>
<th>Informes ingresados</th>
<th>Informes faltantes</th>
<th>Estado</th>
<th>Completado</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
<?php while($row=sqlsrv_fetch_array($SQL)){
$TotalPub=$TotalPub+$row['CantPub'];
//$TotalPR=$TotalPR+$row['CantPR'];
$TotalFalt=$TotalFalt+$row['CantFalt'];
$TotalInf=$TotalInf+$row['TotalInf'];
if($row['CantPub']>0){
$PrcComp=number_format((($row['TotalInf']/$row['CantPub'])*100),1);
}else{
$PrcComp=0;
}
?>
<tr>
<td><?php echo $row['NombreGrupo'];?></td>
<td><?php echo $row['NombreSuperGrupo'];?></td>
<td><?php if($row['NombreAuxGrupo']!=""){echo $row['NombreAuxGrupo'];}else{echo "(Ninguno)";};?></td>
<td><?php echo $row['CantPub'];?></td>
<td><?php echo $row['TotalInf'];?></td>
<td <?php if($row['CantFalt']>0){echo "class='text-danger'";}?>><?php echo $row['CantFalt'];?></td>
<td>
<?php if($row['CantPub']==$row['CantFalt']){?>
<span class="badge badge-danger">No empezado</span>
<?php }elseif(($row['CantPub']>$row['CantFalt'])&&($row['CantFalt']>0)){?>
<span class="badge badge-warning">Pendientes</span>
<?php }else{?>
<span class="badge badge-primary">Completado</span>
<?php }?>
</td>
<td>
<?php if($row['CantPub']==$row['CantFalt']){?>
<span data-peity='{"fill": ["#ed5565", "#eeeeee"]}' class="pie"><?php echo $PrcComp."/100";?></span>
<span class="text-danger"><?php echo "0%";?></span>
<?php }elseif(($row['CantPub']>$row['CantFalt'])&&($row['CantFalt']>0)){?>
<span data-peity='{"fill": ["#f8ac59", "#eeeeee"]}' class="pie"><?php echo $PrcComp."/100";?></span>
<span class="text-warning"><?php echo $PrcComp."%";?></span>
<?php }else{?>
<span data-peity='{"fill": ["#1ab394", "#eeeeee"]}' class="pie"><?php echo $PrcComp."/100";?></span>
<span class="text-navy"><?php echo $PrcComp."%";?></span>
<?php }?>
</td>
<td><a href="informes.php?id=<?php echo base64_encode($row['IDGrupo']);?>&idped=<?php echo base64_encode($row_Periodo['IDPeriodo']);?>&return=<?php echo base64_encode($_SERVER['QUERY_STRING']);?>&pag=<?php echo base64_encode('gestionar_informes.php');?>&tl=1" class="alkin btn btn-success btn-xs"><i class="fa fa-folder-open"></i> Abrir</a></td>
</tr>
<?php }?>
<tr>
<td colspan="3" class="text-center font-bold">TOTAL</td>
<td class="font-bold"><?php echo $TotalPub;?></td>
<td class="font-bold"><?php echo $TotalInf;?></td>
<td class="font-bold <?php if($TotalFalt>0){echo "text-danger";}?>"><?php echo $TotalFalt;?></td>
<td colspan="3"> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php }?>
</div>
<!-- InstanceEndEditable -->
<?php include("includes/footer.php"); ?>
</div>
</div>
<?php include("includes/pie.php"); ?>
<!-- InstanceBeginEditable name="EditRegion4" -->
<script>
$(document).ready(function(){
$("#formBuscar").validate({
submitHandler: function(form){
$('.ibox-content').toggleClass('sk-loading');
form.submit();
}
});
$(".alkin").on('click', function(){
$('.ibox-content').toggleClass('sk-loading');
});
$('#FechaInicial').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true,
format: 'yyyy-mm-dd'
});
$('#FechaFinal').datepicker({
todayBtn: "linked",
keyboardNavigation: false,
forceParse: false,
calendarWeeks: true,
autoclose: true,
format: 'yyyy-mm-dd'
});
$('.chosen-select').chosen({width: "100%"});
$("span.pie").peity("pie");
$('.dataTables-example').DataTable({
pageLength: 25,
dom: '<"html5buttons"B>lTfgitp',
language: {
"decimal": "",
"emptyTable": "No se encontraron resultados.",
"info": "Mostrando _START_ - _END_ de _TOTAL_ registros",
"infoEmpty": "Mostrando 0 - 0 de 0 registros",
"infoFiltered": "(filtrando de _MAX_ registros)",
"infoPostFix": "",
"thousands": ",",
"lengthMenu": "Mostrar _MENU_ registros",
"loadingRecords": "Cargando...",
"processing": "Procesando...",
"search": "Filtrar:",
"zeroRecords": "Ningún registro encontrado",
"paginate": {
"first": "Primero",
"last": "Último",
"next": "Siguiente",
"previous": "Anterior"
},
"aria": {
"sortAscending": ": Activar para ordenar la columna ascendente",
"sortDescending": ": Activar para ordenar la columna descendente"
}
},
buttons: []
});
});
</script>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
<?php sqlsrv_close($conexion);?>