|
|
|
@ -2,6 +2,20 @@
|
|
|
|
|
|
|
|
|
|
$tpLayout = 1; |
|
|
|
|
$dac = $_GET["dac"]; |
|
|
|
|
$org_id = $_SESSION['SSEmpresaPadrao']; |
|
|
|
|
$fila_asterisk = ''; |
|
|
|
|
if($dac){ |
|
|
|
|
pg_query($dbcon, 'begin'); |
|
|
|
|
$consulta_fila = "SELECT nome_asterisk FROM pbx_queues_grupos WHERE nome = $1 AND org_id = $2"; |
|
|
|
|
$retorno = pg_query_params($dbcon,$consulta_fila,[$dac,$org_id]); |
|
|
|
|
if(!$retorno){ |
|
|
|
|
pg_query($dbcon, 'rollback'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
$dados = pg_fetch_array($retorno); |
|
|
|
|
$fila_asterisk = $dados['nome_asterisk']; |
|
|
|
|
pg_query($dbcon, 'commit'); |
|
|
|
|
} |
|
|
|
|
$nomeTpl = "supervisao/RelSupRecebidas.tpl"; |
|
|
|
|
|
|
|
|
|
$query = " select a.calldate::time as hora, a.src as origem, a.billsec as tmo, coalesce(c.apelido, '-') as agente, |
|
|
|
@ -15,7 +29,7 @@ $query = " select a.calldate::time as hora, a.src as origem, a.billsec as tmo,
|
|
|
|
|
where a.data_bilhete = now()::date |
|
|
|
|
and b.evento in('COMPLETEAGENT','COMPLETECALLER', 'TRANSFER','COMPLETEAGENTRAMAL','COMPLETECALLERRAMAL') |
|
|
|
|
and a.lastapp <> 'Transferred Call' |
|
|
|
|
and b.fila = '$dac' |
|
|
|
|
and b.fila = '$fila_asterisk' |
|
|
|
|
order by 1"; |
|
|
|
|
|
|
|
|
|
$result = pg_query($dbcon, $query); |
|
|
|
|