forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
45 lines
1.5 KiB
2 years ago
|
<?php
|
||
|
|
||
|
$tpLayout = 1;
|
||
|
|
||
|
|
||
|
$dac = $_GET["dac"];
|
||
|
$nomeTpl = 'relDacAbandonadas.tpl';
|
||
|
$linha = ' <tr align="center">
|
||
|
<td nowrap align="center" class="headData">%s</td>
|
||
|
<td nowrap align="center" class="headData">%s</td>
|
||
|
<td nowrap align="left" class="headData">%s</td>
|
||
|
<td nowrap align="center" class="headData">%s</td>
|
||
|
</tr>';
|
||
|
|
||
|
$query = "select b.fila, cast(a.calldate as date) as data, calldate::time as hora, a.src as origem, param3::integer as tempo
|
||
|
from ast_bilhetes a, ast_eventos_dacs b
|
||
|
where b.uid2 = a.uniqueid
|
||
|
and b.evento = 'ABANDON'
|
||
|
and a.lastapp <> 'Transferred Call'
|
||
|
and cast(a.calldate as date) = now()::date
|
||
|
and b.fila = '$dac'
|
||
|
order by 1, 3 desc";
|
||
|
|
||
|
$result = pg_query($dbcon, $query);
|
||
|
$numrow = 0;
|
||
|
$linhas = "";
|
||
|
$duracaoTotal = '';
|
||
|
while ($row = pg_fetch_array($result)) {
|
||
|
$linhas .= sprintf($linha, FormataDBDataHora($row["data"]), $row["hora"], $row["origem"], SecondToStrTime($row["tempo"]));
|
||
|
$duracaoTotal += $row["tempo"];
|
||
|
$numrow++;
|
||
|
}
|
||
|
|
||
|
$duracaoTotal = SecondToStrTime($duracaoTotal);
|
||
|
$linha = " <tr align=\"center\">
|
||
|
<th nowrap align=\"left\" colspan=\"2\" >Total</th>
|
||
|
<th nowrap class=\"headData\">$numrow</th>
|
||
|
<th nowrap class=\"headData\">$duracaoTotal</th>
|
||
|
</tr>";
|
||
|
$linhas .= $linha;
|
||
|
|
||
|
$smarty->assign('linhas', $linhas);
|
||
|
GetTemplate($smarty, $nomeTpl);
|
||
|
?>
|