From 7c0b7f58a3170989d32733779ad335a0ce6f1dbe Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 16 May 2023 14:29:45 -0400 Subject: [PATCH] corrigir sintaxe --- .../callcenter/metas/metricasMensal.php | 33 ++++++++++--------- supervisao/RelTransbordo.php | 4 +++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/relatorios/callcenter/metas/metricasMensal.php b/relatorios/callcenter/metas/metricasMensal.php index 227ba6be..da8b453e 100644 --- a/relatorios/callcenter/metas/metricasMensal.php +++ b/relatorios/callcenter/metas/metricasMensal.php @@ -112,7 +112,6 @@ class RelMetricasMensal extends Relatorios { $tipoRel = !$this->___tipoRelatorio ? '' : 'checked="checked"'; - /* * Personalise esta função se necessitar de outras operações de filtro. */ @@ -286,11 +285,11 @@ class RelMetricasMensal extends Relatorios { $totalQuery .= sprintf(" AND exists(select '' from pbx_servicos_registra where uniqueid = a.uniqueid and serv_id = %s)", QuotedStr($srv)); } $totalQuery .= " ) AS DADOS ORDER BY 1 "; - + $result = $this->___GetQuery($query); $row = pg_fetch_all($result); $this->SetData($row ? $row : array()); - + $totalResult = $this->___GetQuery($totalQuery); $totalRow = pg_fetch_all($totalResult); $this->SetData($totalRow ? $totalRow : array()); @@ -333,10 +332,9 @@ class RelMetricasMensal extends Relatorios { $somaEspera = 0; $somaOriginadasPA = 0; - foreach ($this->GetData()[0] as $row) { - $somaReg ++; + $somaReg++; $somaFila += $row['oferecidas']; $somaTransbordada += $row['transbordada']; $somaTransbordando += $row['transbordando']; @@ -431,7 +429,6 @@ class RelMetricasMensal extends Relatorios { $filtro = $this->___FiltrosRelatorio(); $mostraColunaServicos = GetUsoServico() == RELATORIO_SERVICOS_HABILITA; - /* * Inicia o relatório. */ @@ -487,9 +484,8 @@ class RelMetricasMensal extends Relatorios { $somaEspera = 0; $somaOriginadasPA = 0; - foreach ($this->GetData()[0] as $row) { - $somaReg ++; + $somaReg++; $somaFila += $row['oferecidas']; $somaTransbordada += $row['transbordada']; $somaTransbordando += $row['transbordando']; @@ -689,7 +685,7 @@ class RelMetricasMensal extends Relatorios { } - $agrupaServico = function($row, $somaFieldServ) use(&$somaServ, &$dataRel, &$srv, &$oldSrv) { + $agrupaServico = function ($row, $somaFieldServ) use (&$somaServ, &$dataRel, &$srv, &$oldSrv) { $style = 'style="font-weight: bold; padding: 0; margin: 0; padding-left: 6px; padding-right: 6px; background-color: #4F71C0 !important"'; $srv = $row["serv_id"]; @@ -717,8 +713,6 @@ class RelMetricasMensal extends Relatorios { } }; - - /* * Linhas de dados. */ @@ -743,13 +737,22 @@ class RelMetricasMensal extends Relatorios { $somaTempoAtendimento += $row['tempo_atendimento']; $somaTempoAbandono += $row['tempo_abandono']; - $linha = ""; foreach ($dadosField as $key => $value) { - $linha .= sprintf("%s", $value, $row["$key"]); + if ($key == 'transbordada') { + $linha .= sprintf("%s", $this->___dac, sprintf("%s/%s/%s", $this->___mes , $row["dia"], $this->___ano), sprintf("%s/%s/%s", $this->___mes , $row["dia"], $this->___ano), $row[$key]); + } else if ($key == 'transbordando') { + $linha .= sprintf("%s", $this->___dac, sprintf("%s/%s/%s", $this->___mes , $row["dia"], $this->___ano), sprintf("%s/%s/%s", $this->___mes , $row["dia"], $this->___ano), $row[$key]); + } else { + $linha .= sprintf("%s", $value, $row[$key]); + } } $linha .= ""; $dataRel[] = $linha; + // + // {$dados[i][4]} + + } $totalDias = count($numDiasRelatorio); @@ -782,7 +785,6 @@ class RelMetricasMensal extends Relatorios { $dataRel[] = '
'; - $totalCabecalio = array( "Tempo de Espera" => 'align = "center"', "TE <= 10" => 'align = "center"', @@ -927,7 +929,7 @@ class RelMetricasMensal extends Relatorios { } - $agrupaServico = function($row, $somaFieldServ) use(&$somaServ, &$dadosTable, &$srv, &$oldSrv) { + $agrupaServico = function ($row, $somaFieldServ) use (&$somaServ, &$dadosTable, &$srv, &$oldSrv) { $srv = $row["serv_id"]; if (!$oldSrv) { @@ -962,7 +964,6 @@ class RelMetricasMensal extends Relatorios { } }; - $dados = $this->GetData()[0]; foreach ($dados as $row) { diff --git a/supervisao/RelTransbordo.php b/supervisao/RelTransbordo.php index d28461ae..138e6741 100644 --- a/supervisao/RelTransbordo.php +++ b/supervisao/RelTransbordo.php @@ -9,6 +9,10 @@ class RelTransbordo extends Relatorios { private $___modo; + private $___dac; + private $___tipo; + private $___dataIni; + private $___dataFim; public function __construct($idProg, $dbcon, $incDac) { parent::__construct($idProg, $dbcon, $incDac);