<?
include("../Funciones/myfunc.php");
include("../Funciones/restarfechas.php");
$var=@$_GET['var'];
$db= "\\\pc_soporte\c$\soporte\db_soporte.mdb";
$basesoporte=("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=$db");
$link=odbc_connect($basesoporte,"","");
$sql="select * from $var where hora_inicio_atencion <> NULL";
$resultado=odbc_do($link, $sql);
?>
<style type="text/css">
<!--
.Estilo3 {font-size: 12px}
-->
</style>
<TABLE height="5%" BORDER=1 align="center" CELLPADDING=0 CELLSPACING=0">
<TR>
<Th align="left"><span class="Estilo3">Folio</span></Th>
<Th align="left"><span class="Estilo3">F.Llamado</span></Th>
<Th align="left"><span class="Estilo3">H.Llamado</span></Th>
<Th align="left"><span class="Estilo3">F.Atencion</span></Th>
<Th align="left"><span class="Estilo3">H.Inicio</span></Th>
<Th align="left"><span class="Estilo3">H.Termino</span></Th>
<Th align="left"><span class="Estilo3">F.Termino</span></Th>
<Th align="left"><span class="Estilo3">H.Salida</span></Th>
<Th align="left"><span class="Estilo3">H.Llegada</span></Th>
<Th align="left"><span class="Estilo3">Respuesta Soporte</span></Th>
<Th align="left"><span class="Estilo3">Duracion Soporte</span></Th>
<Th align="left"><span class="Estilo3">Respuesta Usuario</span></Th>
<Th align="left"><span class="Estilo3">Duracion Usuario</span></Th>
</TR>
<?
$total =0;
while($row = @odbc_fetch_array($resultado))
{
$total++;
?>
<tr>
<th align="left"><span class="Estilo3"><? echo $row['folio_atencion'];?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiaf_a_normal($row['fecha_llamado']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiah_a_normal($row['hora_llamado']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiaf_a_normal($row['fecha_atencion']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiah_a_normal($row['hora_inicio_atencion']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiah_a_normal($row['hora_termino_atencion']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiaf_a_normal($row['fecha_cierre_atencion']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiah_a_normal($row['hora_salida_atencion']);?></span></th>
<th align="left"><span class="Estilo3"><? echo cambiah_a_normal($row['hora_llegada_atencion']);?></span></th>
<th align="left"><span class="Estilo3">
<?
///aqui hago la resta simple de las horas.
if (cambiaf_a_normal($row['fecha_llamado'])==cambiaf_a_normal($row['fecha_atencion']))
{
$resp_soporte=restar_hora(cambiah_a_normal($row['hora_llamado']),cambiah_a_normal($row['hora_inicio_atencion']));
echo $resp_soporte;
}
///aqui hago la resta avanzada segun los dias de mas.
if (cambiaf_a_normal($row['fecha_atencion'])>cambiaf_a_normal($row['fecha_llamado']))
{
$dias=restarfecha(cambiaf_a_normal($row['fecha_llamado']), cambiaf_a_normal($row['fecha_atencion']));
$resp_soporte=restar_hora(cambiah_a_normal($row['hora_llamado']),$otra=sumar_24(cambiah_a_normal($row['hora_inicio_atencion']),$dias));
echo $resp_soporte;
}
?></span></th>
<th align="left"><span class="Estilo3"><? echo "hora";?></span></th>
<th align="left"><span class="Estilo3"><? echo "hora";?></span></th>
<th align="left"><span class="Estilo3"><? echo "hora";?></span></th>
</tr>
<?
}
echo "Total de Folios: $total<br>";
echo "<p><a href=menuestadisticas.php>MENU PRINCIPAL</p><br>";
odbc_free_result($resultado);
odbc_close($link);
?>
</table>