'Transferred Call' and b.evento in('COMPLETAAGENT','COMPLETACALLER','TRANSFERORIG','BUSYS','NOANSWERS') and b.fila = '$dac' order by 1"; //echo $query; $result = pg_query($dbcon, $query); $numrow = 0; $linhas = ""; $duracaoTotal = ''; while ($row = pg_fetch_array($result)) { $hora = $row["hora"]; $destino = ocultarTelefone($row["destino"]); $tempo = SecondToStrTime($row["tmo"]); $agente = $row["agente"]; $ramalAgente = $row["ramal_agente"]; //$proto = $row["protocolo"]; $proto = substr($row["protocolo"], 0, 4) . "-" . substr($row["protocolo"], 4); $linhas .= " $hora $destino $tempo $agente $ramalAgente $proto "; //$linhas .= sprintf($linha, FormataDBDataHora($row["hora"]), $row["destino"], SecondToStrTime($row["tmo"]),$row["agente"],$row["ramal_agente"] ); $duracaoTotal += $row["hora"]; $numrow++; } $duracaoTotal = SecondToStrTime($duracaoTotal); $linhas .= " Total $numrow "; //print $linhas; $smarty->assign('linhas', $linhas); GetTemplate($smarty, $nomeTpl); ?>