Browse Source

Inseri a columa 'entrada' nos documentos csv, pdf e exel do relatorio de chamadas entrantes geral

1.8
Claudio Zimmermann Junior 3 months ago
parent
commit
f86abb3687
  1. 666
      contacteFunc.php
  2. 31
      relatorios/pbx/chamadasEntrantes/chamadasEntrantesGeral.php

666
contacteFunc.php

File diff suppressed because it is too large Load Diff

31
relatorios/pbx/chamadasEntrantes/chamadasEntrantesGeral.php

@ -80,7 +80,7 @@ class ChamadasEntrantesGeral extends Relatorios
/* /*
* Personalise esta função se necessitar de outras opções de filtro. * Personalise esta função se necessitar de outras opções de filtro.
*/ */
$filtro = '<table class="filtro" border="0" cellspacing="1" cellpadding="1">'; $filtro = '<table class="filtro" border="0" cellspacing="1" cellpadding="1" style="font-size: 10px">';
/* /*
* Rotulos. * Rotulos.
*/ */
@ -106,20 +106,20 @@ class ChamadasEntrantesGeral extends Relatorios
$filtro .= '<tr>'; $filtro .= '<tr>';
$filtro .= '<td>&nbsp;</td>'; $filtro .= '<td>&nbsp;</td>';
$filtro .= sprintf('<td>%s</td>', $dacs); $filtro .= sprintf('<td>%s</td>', $dacs);
$filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa HH:mm"></td>'; $filtro .= '<td><input name="dataIni" id="dataIni" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa HH:mm"></td>';
$filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa HH:mm"></td>'; $filtro .= '<td><input name="dataFim" id="dataFim" type="text" size="15" maxlength="16" value="%s" onkeyup="formataDataHora(this)" title="dd/mm/aaaa HH:mm"></td>';
$filtro .= '<td><div class="geral"> '; $filtro .= '<td><div class="geral"> ';
$filtro .= sprintf('<input name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="1" %s>Todos' $filtro .= sprintf('<input style="font-size: 10px" name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="1" %s>Todos'
. '<input name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="2" %s>maior que(&gt;0)' . '<input style="font-size: 10px" name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="2" %s>&gt;0 '
. '<input name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="3" %s>Igual a 0 (= 0)', $this->___tempoDuracao == 1 ? 'checked' : '', $this->___tempoDuracao == 2 ? 'checked' : '', $this->___tempoDuracao == 3 ? 'checked' : ''); . '<input style="font-size: 10px" name="tempoDuracao" class="clean" type="radio" id="tempoDuracao" value="3" %s>= 0', $this->___tempoDuracao == 1 ? 'checked' : '', $this->___tempoDuracao == 2 ? 'checked' : '', $this->___tempoDuracao == 3 ? 'checked' : '');
$filtro .= '</div></td>'; $filtro .= '</div></td>';
$filtro .= sprintf('<td><div class="geral"> ' $filtro .= sprintf('<td><div class="geral"> '
. '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="1" %s>Ambos' . '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="1" %s>Ambos'
. '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="2" %s>Atendida' . '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="2" %s>Atendida'
. '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="3" %s>Não Atendida' . '<input name="tipoAtendimento" class="clean" type="radio" id="tipoAtendimento" value="3" %s>Não Atendida'
. '</div></td>', $this->___tipoAtendimento == 1 ? 'checked' : '', $this->___tipoAtendimento == 2 ? 'checked' : '', $this->___tipoAtendimento == 3 ? 'checked' : ''); . '</div></td>', $this->___tipoAtendimento == 1 ? 'checked' : '', $this->___tipoAtendimento == 2 ? 'checked' : '', $this->___tipoAtendimento == 3 ? 'checked' : '');
$filtro .= '<td><input name="telefone" type="text" id="telefone" value="%s" /></td>'; $filtro .= '<td><input style="max-width: 120px" name="telefone" type="text" id="telefone" value="%s" /></td>';
$filtro .= '<td><input name="entrada" type="text" id="entrada" value="%s" /></td>'; $filtro .= '<td><input style="max-width: 100px" name="entrada" type="text" id="entrada" value="%s" /></td>';
$filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>'; $filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>';
$filtro .= '<td>%s</td>'; $filtro .= '<td>%s</td>';
$filtro .= '</tr>'; $filtro .= '</tr>';
@ -205,8 +205,8 @@ class ChamadasEntrantesGeral extends Relatorios
$dataRel[] = GenerateCsvFromArray($filtro); $dataRel[] = GenerateCsvFromArray($filtro);
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Municipio', 'UF'); $dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Entrada', 'Municipio', 'UF');
$dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'nome_municipio', 'uf'); $dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'entrada', 'nome_municipio', 'uf');
$dataRel[] = GenerateCsvFromArray(array_keys($dadosCabecalio)); $dataRel[] = GenerateCsvFromArray(array_keys($dadosCabecalio));
@ -217,6 +217,7 @@ class ChamadasEntrantesGeral extends Relatorios
* Inicia o relat�rio. * Inicia o relat�rio.
*/ */
foreach ($this->GetData()[0] as $row) { foreach ($this->GetData()[0] as $row) {
$row['entrada'] = explode('"', $row['entrada'])[1];
$row['src'] = ocultarTelefone($row['src']); $row['src'] = ocultarTelefone($row['src']);
$row["calldate"] = date('d/m/Y H:i', strtotime($row["calldate"])); $row["calldate"] = date('d/m/Y H:i', strtotime($row["calldate"]));
$row["tplg_descricao"] = str_replace("Entrada", "", $row["tplg_descricao"]); $row["tplg_descricao"] = str_replace("Entrada", "", $row["tplg_descricao"]);
@ -270,8 +271,8 @@ class ChamadasEntrantesGeral extends Relatorios
$dataRel[] = $linha; $dataRel[] = $linha;
$dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Municipio', 'UF'); $dadosCabecalio = array('Data/Hora', 'Origem', 'Destino', 'Tipo', 'Duracao', 'Atendida', 'Fila', 'Agente', 'Entrada', 'Municipio', 'UF');
$dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'nome_municipio', 'uf'); $dadosField = array('calldate', 'src', 'dst', 'tplg_descricao', 'tempo_atendimento', 'status', 'fila', 'agente', 'entrada', 'nome_municipio', 'uf');
/* /*
* Monta a linha de cabecalio. * Monta a linha de cabecalio.
@ -288,6 +289,7 @@ class ChamadasEntrantesGeral extends Relatorios
* Linhas de dados. * Linhas de dados.
*/ */
foreach ($this->GetData()[0] as $row) { foreach ($this->GetData()[0] as $row) {
$row['entrada'] = explode('"', $row['entrada'])[1];
$row['src'] = ocultarTelefone($row['src']); $row['src'] = ocultarTelefone($row['src']);
$row["calldate"] = date('d/m/Y H:i', strtotime($row["calldate"])); $row["calldate"] = date('d/m/Y H:i', strtotime($row["calldate"]));
$row["tplg_descricao"] = str_replace("Entrada", "", $row["tplg_descricao"]); $row["tplg_descricao"] = str_replace("Entrada", "", $row["tplg_descricao"]);
@ -344,7 +346,7 @@ class ChamadasEntrantesGeral extends Relatorios
/* /*
* Inicia o relatorio. * Inicia o relatorio.
*/ */
$dataRel[] = '<table width="90%" cellpadding="2" class="grid">'; $dataRel[] = '<table width="100%" cellpadding="2" class="grid">';
/* /*
* Monta a linha de cabecalio. * Monta a linha de cabecalio.
@ -417,6 +419,7 @@ class ChamadasEntrantesGeral extends Relatorios
$somaQtd = 0; $somaQtd = 0;
$somaTempo = 0; $somaTempo = 0;
foreach ($this->GetData()[0] as $row) { foreach ($this->GetData()[0] as $row) {
$dados[$x]['entrada'] = explode('"', $row['entrada'])[1];
$dados[$x]["calldate"] = date('d/m/Y H', strtotime($row["calldate"])); $dados[$x]["calldate"] = date('d/m/Y H', strtotime($row["calldate"]));
$dados[$x]["src"] = ocultarTelefone($row['src']); $dados[$x]["src"] = ocultarTelefone($row['src']);
$dados[$x]["dst"] = $row["dst"]; $dados[$x]["dst"] = $row["dst"];
@ -442,6 +445,7 @@ class ChamadasEntrantesGeral extends Relatorios
'Atend.' => 'C', 'Atend.' => 'C',
'Fila' => 'L', 'Fila' => 'L',
'Agente' => 'L', 'Agente' => 'L',
'Entrada' => 'L',
'Município' => 'L', 'Município' => 'L',
'UF' => 'C' 'UF' => 'C'
); );
@ -454,10 +458,11 @@ class ChamadasEntrantesGeral extends Relatorios
'status' => 'C', 'status' => 'C',
'fila' => 'L', 'fila' => 'L',
'agente' => 'L', 'agente' => 'L',
'entrada' => 'L',
'nome_municipio' => 'L', 'nome_municipio' => 'L',
'uf' => 'C' 'uf' => 'C'
); );
$widthHeader = array(20, 25, 15, 25, 15, 10, 20, 20, 30, 10); $widthHeader = array(20, 20, 15, 25, 15, 10, 20, 20, 20, 20, 10);
$totaliza = array('Total', "Registros: ", $somaQtd, 'Duração:', SecondToStrTime($somaTempo), '', '', '', '', ''); $totaliza = array('Total', "Registros: ", $somaQtd, 'Duração:', SecondToStrTime($somaTempo), '', '', '', '', '');
//Monta o array para passar para o prepara; Necessário passar 6 parametros //Monta o array para passar para o prepara; Necessário passar 6 parametros

Loading…
Cancel
Save