forked from c-m-a/orfeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ver_historico.old.php
287 lines (262 loc) · 10.7 KB
/
ver_historico.old.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<html>
<head>
<title>Untitled</title>
<link rel="stylesheet" href="estilos/orfeo.css">
</head>
<body >
<table width="100%" border="0" cellpadding="0" cellspacing="5"bgcolor="#006699" >
<tr bgcolor="#006699">
<td class="titulos4" colspan="6" >HISTORICO </td>
</tr>
</table>
<?php
require_once($ruta_raiz . '/class_control/Transaccion.php');
require_once($ruta_raiz . '/class_control/Dependencia.php');
require_once($ruta_raiz . '/class_control/usuario.php');
$trans = new Transaccion($db);
$objDep = new Dependencia($db);
$objUs = new Usuario($db);
$isql = "select USUA_NOMB
from usuario
where depe_codi = $radi_depe_actu and
usua_codi = $radi_usua_actu";
$rs = $db->conn->query($isql);
$usuario_actual = $rs->fields["USUA_NOMB"];
$isql = "select DEPE_NOMB
from dependencia
where depe_codi = $radi_depe_actu";
$rs = $db->conn->query($isql);
$dependencia_actual = $rs->fields["DEPE_NOMB"];
$isql = "select USUA_NOMB
from usuario
where depe_codi = $radi_depe_radicacion and
usua_codi = $radi_usua_radi";
$rs = $db->conn->query($isql);
$usuario_rad = $rs->fields["USUA_NOMB"];
$isql = "select DEPE_NOMB from dependencia where depe_codi=$radi_depe_radicacion";
$rs = $db->conn->query($isql);
$dependencia_rad = $rs->fields["DEPE_NOMB"];
?>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="5" class="borde_tab">
<tr align="left">
<td width="10%" class="titulos2" height="24">USUARIO ACTUAL</td>
<td width="15%" class="listado2" height="24" align="left"><?=$usuario_actual?></td>
<td width="10%" class="titulos2" height="24">DEPENDENCIA ACTUAL</td>
<td width="15%" class="listado2" height="24"><?=$dependencia_actual?></td>
</tr>
<tr class='etextomenu' align="left">
<td width=10% class="titulos2" height="24">USUARIO RADICADOR </td>
<td width=15% class="listado2" height="24"><?=$usuario_rad?></td>
<td width=10% class="titulos2" height="24">DEPENDENCIA DE RADICACION </td>
<td width=15% class="listado2" height="24"><?=$dependencia_rad?></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="25" class="titulos4">FLUJO HISTORICO DEL DOCUMENTO</td>
</tr>
</table>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="5" class="borde_tab" >
<tr align="center">
<td width="10%" class="titulos2" height="24">DEPENDENCIA</td>
<td width="5%" class="titulos2" height="24">FECHA</td>
<td width="5%" class="titulos2" height="24">Nro. Días Entre Transacción</td>
<td width="15%" class="titulos2" height="24">TRANSACCION</td>
<td width="15%" class="titulos2" height="24" >US. ORIGEN</td>
<td width=40% height="24" class="titulos2">COMENTARIO</td>
</tr>
<?
$sqlFecha = $db->conn->SQLDate("d-m-Y H:i A","a.HIST_FECH");
$isql = "select $sqlFecha AS HIST_FECH1,
a.DEPE_CODI,
a.USUA_CODI,
a.RADI_NUME_RADI,
a.HIST_OBSE,
a.USUA_CODI_DEST,
a.USUA_DOC,
a.HIST_OBSE,
a.SGD_TTR_CODIGO
from hist_eventos a
where a.radi_nume_radi = $verrad
order by hist_fech desc";
$i = 0;
$rs = $db->conn->query($isql);
$fecha_actual = '';
$fecha_anterior = '';
$registros = array();
if($rs) {
while(!$rs->EOF) {
$fecha_actual_arreglo = explode(' ', $rs->fields['HIST_FECH1']);
$fecha_actual = $fecha_actual_arreglo[0];
$numero_dias = (strtotime($fecha_anterior) - strtotime($fecha_actual)) / 86400;
if (empty($fecha_anterior))
$numero_dias = 0;
$usua_doc_dest = '';
$usua_doc_hist = '';
$usua_nomb_historico = '';
$usua_destino = '';
$numdata = trim($rs->fields["CARP_CODI"]);
if($data =="")
$rs1->fields["USUA_NOMB"];
$data = "NULL";
$numerot = $rs->fields["NUM"];
$usua_doc_hist = $rs->fields["USUA_DOC"];
$usua_codi_dest = $rs->fields["USUA_CODI_DEST"];
$usua_dest = intval(substr($usua_codi_dest,3,3));
$depe_dest = intval(substr($usua_codi_dest,0,3));
$usua_codi = $rs->fields["USUA_CODI"];
$depe_codi = $rs->fields["DEPE_CODI"];
$codTransac = $rs->fields["SGD_TTR_CODIGO"];
$descTransaccion = $rs->fields["SGD_TTR_DESCRIP"];
if(!$codTransac)
$codTransac = "0";
$trans->Transaccion_codigo($codTransac);
$objUs->usuarioDocto($usua_doc_hist);
$objDep->Dependencia_codigo($depe_codi);
$imagen = ($carpeta == $numdata)? 'usuarios.gif' : 'usuarios.gif';
?>
<tr class='tpar'>
<td class="listado2" ><?=$objDep->getDepe_nomb()?></td>
<td class="listado2"><?=$rs->fields["HIST_FECH1"]?></td>
<td class="listado2"><center><?=$numero_dias?> días</center></td>
<td class="listado2"><?=$trans->getDescripcion()?></td>
<td class="listado2"><?=$objUs->get_usua_nomb()?></td>
<td class="listado2"><?=utf8_decode($rs->fields["HIST_OBSE"])?></td>
</tr>
<?php
$fecha_anterior = $fecha_actual;
$registros[$i]['nombre_dependencia']= $objDep->getDepe_nomb();
$registros[$i]['fecha_transaccion'] = $rs->fields["HIST_FECH1"];
// Si existe el anterior registro asignar el valor del numero de dias
if ($i == 0) {
$registros[$i]['numero_dias'] = $numero_dias;
} else {
$registros[$i-1]['numero_dias'] = $numero_dias;
}
$registros[$i]['descripcion'] = $trans->getDescripcion();
$registros[$i]['usuario_origen'] = $objUs->get_usua_nomb();
$registros[$i]['comentario'] = utf8_decode($rs->fields["HIST_OBSE"]);
$rs->MoveNext();
$i++;
}
foreach ($registros as $registro) {
if ($krd == 'ADMIN3') {
$nro_dias = (empty($registro['numero_dias']))? 0 : $registro['numero_dias'];
echo '<tr class="tpar">';
echo '<td class="listado2" >'. $registro['nombre_dependencia'] .'</td>' . "\n";
echo '<td class="listado2" >'. $registro['fecha_transaccion'] .'</td>' . "\n";
echo '<td class="listado2" ><center>'. $nro_dias .' días</center></td>' . "\n";
echo '<td class="listado2" >'. $registro['descripcion'] .'</td>' . "\n";
echo '<td class="listado2" >'. $registro['usuario_origen'] .'</td>' . "\n";
echo '<td class="listado2" >'. $registro['comentario'] .'</td>' . "\n";
echo '</tr>';
}
}
} // Finaliza Historicos
?>
</table>
<?php
//empieza datos de envio
include ($ruta_raiz . '/include/query/queryver_historico.php');
$isql = "select $numero_salida from anexos a where a.anex_radi_nume=$verrad";
$rs = $db->conn->query($isql);
$radicado_d= '';
while(!$rs->EOF) {
$valor = $rs->fields["RADI_NUME_SALIDA"];
if(trim($valor))
$radicado_d .= "'".trim($valor) ."', ";
$rs->MoveNext();
}
$radicado_d .= $verrad;
include ($ruta_raiz . '/include/query/queryver_historico.php');
$sqlFechaEnvio = $db->conn->SQLDate("d-m-Y H:i A","a.SGD_RENV_FECH");
$isql = "select $sqlFechaEnvio AS SGD_RENV_FECH,
a.DEPE_CODI,
a.USUA_DOC,
a.RADI_NUME_SAL,
a.SGD_RENV_NOMBRE,
a.SGD_RENV_DIR,
a.SGD_RENV_MPIO,
a.SGD_RENV_DEPTO,
a.SGD_RENV_PLANILLA,
b.DEPE_NOMB,
c.SGD_FENV_DESCRIP,
$numero_sal,
a.SGD_RENV_OBSERVA,
a.SGD_DEVE_CODIGO
from sgd_renv_regenvio a,
dependencia b,
sgd_fenv_frmenvio c
where a.radi_nume_sal in($radicado_d) AND
a.depe_codi=b.depe_codi AND
a.sgd_fenv_codigo = c.sgd_fenv_codigo
order by a.SGD_RENV_FECH desc";
$rs = $db->conn->query($isql);
?>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="5" class="borde_tab">
<tr>
<td height="25" class="titulos4">DATOS DE ENVIO</td>
</tr>
</table>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="5" class="borde_tab" >
<tr align="center">
<td width="10%" class="titulos2" height="24">RADICADO </td>
<td width="10%" class="titulos2" height="24">DEPENDENCIA</td>
<td width="15%" class="titulos2" height="24">FECHA </td>
<td width="15%" class="titulos2" height="24">Destinatario</td>
<td width="15%" class="titulos2" height="24" >DIRECCION </td>
<td width="15%" class="titulos2" height="24" >DEPARTAMENTO </td>
<td width="15%" class="titulos2" height="24" >MUNICIPIO</td>
<td width="15%" class="titulos2" height="24" >TIPO DE ENVIO</td>
<td width="5%" height="24" class="titulos2"> No. PLANILLA</td>
<td width="15%" height="24" class="titulos2">OBSERVACIONES O DESC DE ANEXOS</td>
</tr>
<?php
$i=1;
while(!$rs->EOF) {
$radDev = $rs->fields["SGD_DEVE_CODIGO"];
$radEnviado = $rs->fields["RADI_NUME_SAL"];
$imgRadDev = ($radDev)?
"<img src='$ruta_raiz/imagenes/devueltos.gif' alt='Documento Devuelto por empresa de Mensajeria' title='Documento Devuelto por empresa de Mensajeria'>" :
'';
$numdata = trim($rs->fields["CARP_CODI"]);
if($data =="")
$data = "NULL";
//$numerot = $rs->RecordCount();
$imagen = ($carpeta == $numdata)? "usuarios.gif" : "usuarios.gif";
if($i==1) {
?>
<tr> <? $i=1;
}
?>
<td class="listado2" >
<?=$imgRadDev?><?=$radEnviado?></td>
<td class="listado2" >
<?=$rs->fields["DEPE_NOMB"]?></td>
<td class="listado2">
<?php
echo "<a class=vinculos href='./verradicado.php?verrad=$radEnviado&krd=$krd' target='verrad$radEnviado'><span class='timpar'>".$rs->fields["SGD_RENV_FECH"]."</span></a>";
?> </td>
<td class="listado2">
<?=$rs->fields["SGD_RENV_NOMBRE"]
?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_RENV_DIR"]?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_RENV_DEPTO"] ?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_RENV_MPIO"] ?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_FENV_DESCRIP"] ?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_RENV_PLANILLA"] ?> </td>
<td class="listado2" >
<?=$rs->fields["SGD_RENV_OBSERVA"] ?> </td>
</tr>
<?
$rs->MoveNext();
} // Finaliza Historicos
?>
</table>
</body>
</html>