|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/* *************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* RELAT<EFBFBD>RIO CLASSIFICA<EFBFBD><EFBFBD>O MENSAL
|
|
|
|
|
* Autor
|
|
|
|
|
* Lucas Awade
|
|
|
|
|
*
|
|
|
|
|
* *************************************************************************
|
|
|
|
|
* Defini<EFBFBD><EFBFBD>es do Projeto
|
|
|
|
|
* Nome: RelClassificacaoMensal
|
|
|
|
|
* Data in<EFBFBD>cio: 10/08/2018
|
|
|
|
|
* Equipe: Amarildo Pereira
|
|
|
|
|
* Descri<EFBFBD><EFBFBD>o: Gera relat<EFBFBD>rio de classifica<EFBFBD><EFBFBD>o realizadas no m<EFBFBD>s e cadastrada
|
|
|
|
|
* no banco de dados. As impress<EFBFBD>es <EFBFBD> feito de acordo com o retorno com a
|
|
|
|
|
* query do banco de dados que possui na pesquisa o m<EFBFBD>s e ano e a fila(DAC);
|
|
|
|
|
*
|
|
|
|
|
* Pr<EFBFBD>-requisito: As querys de banco de dados tem que retornar com ordena<EFBFBD><EFBFBD>o
|
|
|
|
|
* de acordo com os classifica<EFBFBD><EFBFBD>es;
|
|
|
|
|
*
|
|
|
|
|
* OBS: Aten<EFBFBD><EFBFBD>o ao realizar manuten<EFBFBD><EFBFBD>o nos itens de impress<EFBFBD>o pois os dados
|
|
|
|
|
* apresentados s<EFBFBD>o estruturados.
|
|
|
|
|
*
|
|
|
|
|
* *************************************************************************
|
|
|
|
|
* Copyright (c) 2018, Simples IP
|
|
|
|
|
* *************************************************************************/
|
|
|
|
|
|
|
|
|
|
include_once 'util/relatoriosBase.php';
|
|
|
|
|
|
|
|
|
|
class RelClassificacaoMensal extends Relatorios {
|
|
|
|
|
|
|
|
|
|
private $___ano;
|
|
|
|
|
private $___mes;
|
|
|
|
|
|
|
|
|
|
public function __construct($idProg, $dbcon, $incDac) {
|
|
|
|
|
parent::__construct($idProg, $dbcon, $incDac);
|
|
|
|
|
$this->___dac = isset($_POST['listaDacs']) ? $_POST['listaDacs'] : 0;
|
|
|
|
|
$this->___mes = isset($_POST['listaMes']) ? $_POST['listaMes'] : date('m');
|
|
|
|
|
$this->___ano = isset($_POST['listaAno']) ? $_POST['listaAno'] : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ___ValidaForm() {
|
|
|
|
|
if (!IsPostBack())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if ($this->GetIncDac() && !StrToIntDef($this->___dac)) {
|
|
|
|
|
GeraExcept('Informe uma Fila!');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ___FiltrosRelatorio() {
|
|
|
|
|
if ($this->___media != MEDIA_PRINT_GRID) {
|
|
|
|
|
/*
|
|
|
|
|
* Recupera os filtros da sess<EFBFBD>o do usu<EFBFBD>rio.
|
|
|
|
|
*/
|
|
|
|
|
list($this->___dac, $this->___ano, $this->___mes, $this->___tipoRelatorio) = $_SESSION["SSstorageFiltros"];
|
|
|
|
|
|
|
|
|
|
if ($this->___media == MEDIA_PRINT_HTML) {
|
|
|
|
|
$fila = $this->GetIncDac() ? 'Fila: ' . GetDacDesc($this->GetDbCon(), $this->GetIdProg() . ' ') : '';
|
|
|
|
|
return sprintf("%sData Inicial: %s Data Final: %s Tipo: %s", $fila, $this->___dataIni, $this->___dataFim, ($this->___tipoRelatorio ? 'Anal<EFBFBD>tico' : 'Sint<EFBFBD>tico'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$fltCsv = array();
|
|
|
|
|
if ($this->GetIncDac()) {
|
|
|
|
|
$fltCsv[] = 'Fila:' . GetDacDesc($this->GetDbCon(), $this->___dac);
|
|
|
|
|
}
|
|
|
|
|
$fltCsv[] = "Ano:" . $this->___ano;
|
|
|
|
|
$fltCsv[] = "Mes:" . $this->___mes;
|
|
|
|
|
$fltCsv[] = "Data Emissao:" . date('d/m/Y H:i:s');
|
|
|
|
|
$fltCsv[] = "Emitido Por:" . GetLogin();
|
|
|
|
|
return $fltCsv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($this->GetIncDac()) {
|
|
|
|
|
$dacs = GetDac($this->GetDbCon(), $this->___dac, "", 0, 1, 0, 0, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$lkPrint = "";
|
|
|
|
|
if ($this->___dataCount) {
|
|
|
|
|
$prt = '<a href="index.php?idProg=%s&media=%s&tipoRelatorio=%s"><img src="imgSite/%s" alt="Clique aqui para imprimir!" width="24" height="24" border="0"></a>';
|
|
|
|
|
$prtHtml = "<a href=\"javaScript:NovaJanela('index.php?idProg=%s&media=%s&tipoRelatorio=%s', '%s', '720', '700', 'scrollbars=YES');\"><img src=\"imgSite/%s\" alt=\"Clique aqui para imprimir!\" width=\"24\" height=\"24\" border=\"0\"></a>";
|
|
|
|
|
$lkPrint .= sprintf($prtHtml, $this->GetidProg(), MEDIA_PRINT_HTML, $this->___tipoRelatorio, substr(LimpaString(GetDispProgSel($this->GetIdProg())), 0, 20), 'print.gif');
|
|
|
|
|
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_EXCEL, $this->___tipoRelatorio, 'prt-xls.png');
|
|
|
|
|
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_PDF, $this->___tipoRelatorio, 'prt-pdf.png');
|
|
|
|
|
$lkPrint .= sprintf($prt, $this->GetidProg(), MEDIA_PRINT_CSV, $this->___tipoRelatorio, 'prt-csv.png');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tipoRel = !$this->___tipoRelatorio ? '' : 'checked="checked"';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Personalise esta fun<EFBFBD><EFBFBD>o se necessitar de outras opera<EFBFBD><EFBFBD>es de filtro.
|
|
|
|
|
*/
|
|
|
|
|
$filtro = '<table border="0" cellspacing="1" cellpadding="1">';
|
|
|
|
|
/*
|
|
|
|
|
* Rotulos.
|
|
|
|
|
*/
|
|
|
|
|
$filtro .= '<tr>';
|
|
|
|
|
$this->GetIncDac() ? $filtro .= '<td>Fila</td>' : '';
|
|
|
|
|
$filtro .= '<td>M<EFBFBD>s</td>';
|
|
|
|
|
$filtro .= '<td>Ano</td>';
|
|
|
|
|
$filtro .= '<td align="center" valign="middle"> </td>';
|
|
|
|
|
$filtro .= '</tr>';
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Valores.
|
|
|
|
|
*/
|
|
|
|
|
$filtro .= '<tr>';
|
|
|
|
|
$this->GetIncDac() ? $filtro .= sprintf('<td>%s</td>', $dacs) : '';
|
|
|
|
|
$filtro .= sprintf("<td>%s</td>", GetMes($this->___mes, '', 1));
|
|
|
|
|
$filtro .= sprintf('<td>%s</td>', GetAno($this->___ano, 1));
|
|
|
|
|
$filtro .= '<td><input type="submit" name="btConsulta" id="btConsulta" value="Consultar"></td>';
|
|
|
|
|
$filtro .= '<td>%s</td>';
|
|
|
|
|
$filtro .= '</tr>';
|
|
|
|
|
$filtro .= '</table>';
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Guarda os filtros passados para recuperar na emiss<EFBFBD>o dos relat<EFBFBD>rios para impress<EFBFBD>o.
|
|
|
|
|
*/
|
|
|
|
|
$_SESSION["SSstorageFiltros"] = array($this->___dac, $this->___ano, $this->___mes, $this->___tipoRelatorio);
|
|
|
|
|
return sprintf($filtro, $lkPrint);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___GetDadosDb() {
|
|
|
|
|
|
|
|
|
|
$ano = $this->___ano;
|
|
|
|
|
$mes = $this->___mes;
|
|
|
|
|
$dac = $this->___dac;
|
|
|
|
|
|
|
|
|
|
$query = "select clas_descricao, clit_descricao,
|
|
|
|
|
(select count(*) from pbx_classifica_reg d
|
|
|
|
|
inner join pbx_bilhetes e on e.uniqueid = d.id_bilhetes
|
|
|
|
|
and e.lastapp <> 'Transferred Call'
|
|
|
|
|
and date_part('year',e.data_bilhete) = '$ano'
|
|
|
|
|
and date_part('month',e.data_bilhete) = '$mes'
|
|
|
|
|
where d.clas_id = c.clas_id
|
|
|
|
|
and d.clit_id = c.clit_id
|
|
|
|
|
and d.id_dac = '$dac') as qtde,
|
|
|
|
|
|
|
|
|
|
(select count(distinct d.id_bilhetes) from pbx_classifica_reg d
|
|
|
|
|
inner join pbx_bilhetes e on e.uniqueid = d.id_bilhetes
|
|
|
|
|
and e.lastapp <> 'Transferred Call'
|
|
|
|
|
and date_part('year',e.data_bilhete) = '$ano'
|
|
|
|
|
and date_part('month',e.data_bilhete) = '$mes'
|
|
|
|
|
where d.clas_id = c.clas_id
|
|
|
|
|
and d.clit_id = c.clit_id
|
|
|
|
|
and d.id_dac = '$dac') as chmd
|
|
|
|
|
from pbx_classifica_atendimento a
|
|
|
|
|
inner join pbx_classifica_item c on c.clas_id = a.clas_id
|
|
|
|
|
inner join pbx_classifica_dacs d on d.clas_id = a.clas_id
|
|
|
|
|
where d.id_dac = '$dac'
|
|
|
|
|
order by clas_descricao, clit_descricao";
|
|
|
|
|
$result = $this->___GetQuery($query);
|
|
|
|
|
$row = pg_fetch_all($result);
|
|
|
|
|
$this->SetData($row ? $row : array());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___PreparaCsv() {
|
|
|
|
|
$dataRel = array();
|
|
|
|
|
$filtro = $this->___FiltrosRelatorio();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Inicia o relat<EFBFBD>rio.
|
|
|
|
|
*/
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray($filtro);
|
|
|
|
|
|
|
|
|
|
$ultClass = '';
|
|
|
|
|
$somaReg = 0;
|
|
|
|
|
|
|
|
|
|
foreach ($this->GetData()[0] as $row) {
|
|
|
|
|
$count++;
|
|
|
|
|
$row['clas_descricao'] = RemoveAcentos($row['clas_descricao']);
|
|
|
|
|
|
|
|
|
|
if ($count != 1) {
|
|
|
|
|
if ($ultClass != $row['clas_descricao']) {
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array("Total [ $ultClass ]", $somaReg));
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array('', ''));
|
|
|
|
|
unset($somaReg);
|
|
|
|
|
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array($row['clas_descricao'], 'Classificacoes'));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array($row['clas_descricao'], 'Classificacoes'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$somaReg += $row["qtde"];
|
|
|
|
|
$row['clit_descricao'] = RemoveAcentos($row['clit_descricao']);
|
|
|
|
|
|
|
|
|
|
// Formata linha de dados.
|
|
|
|
|
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array($row['clit_descricao'],$row['qtde']));
|
|
|
|
|
$ultClass = $row['clas_descricao'];
|
|
|
|
|
|
|
|
|
|
if (count($this->GetData()[0]) == $count) {
|
|
|
|
|
$dataRel[] = GenerateCsvFromArray(array("Total [ $ultClass ]", $somaReg));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->___dataRel[] = $dataRel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___PreparaExcel() {
|
|
|
|
|
$dataRel = array();
|
|
|
|
|
$filtro = $this->___FiltrosRelatorio();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Inicia o relat<EFBFBD>rio.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Cria os filtros
|
|
|
|
|
*/
|
|
|
|
|
$linha = array('LABEL');
|
|
|
|
|
foreach ($filtro as $values) {
|
|
|
|
|
list($label, $value) = explode(":", $values);
|
|
|
|
|
$linha[] = $label;
|
|
|
|
|
}
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
|
|
|
|
|
$linha = array('DADOS');
|
|
|
|
|
foreach ($filtro as $values) {
|
|
|
|
|
list($label, $value) = explode(":", $values);
|
|
|
|
|
$linha[] = $value;
|
|
|
|
|
}
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
|
|
|
|
|
$dadosCabecalio = array('Descricao', 'Quantidade');
|
|
|
|
|
$dadosField = array('clit_descricao', 'qtde');
|
|
|
|
|
$linha = array('LABEL');
|
|
|
|
|
foreach ($dadosCabecalio as $value) {
|
|
|
|
|
$linha[] = $value;
|
|
|
|
|
}
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
|
|
|
|
|
$ultClass = '';
|
|
|
|
|
|
|
|
|
|
$somaReg = 0;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Linhas de dados.
|
|
|
|
|
*/
|
|
|
|
|
foreach ($this->GetData()[0] as $row) {
|
|
|
|
|
$count++;
|
|
|
|
|
$row['clas_descricao'] = RemoveAcentos($row['clas_descricao']);
|
|
|
|
|
if ($count != 1) {
|
|
|
|
|
if ($ultClass != $row['clas_descricao']) {
|
|
|
|
|
$dataRel[] = array('LABEL', "Total [ $ultClass ]", $somaReg);
|
|
|
|
|
$dataRel[] = array('LABEL', '', '');
|
|
|
|
|
unset($somaReg);
|
|
|
|
|
$dataRel[] = array('LABEL', $row['clas_descricao'], 'Classificacoes');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$dataRel[] = array('LABEL', $row['clas_descricao'], 'Classificacoes');
|
|
|
|
|
}
|
|
|
|
|
$somaReg += $row["qtde"];
|
|
|
|
|
|
|
|
|
|
$row['clit_descricao'] = RemoveAcentos($row['clit_descricao']);
|
|
|
|
|
|
|
|
|
|
$linha = array('DADOS');
|
|
|
|
|
foreach ($dadosField as $key) {
|
|
|
|
|
$linha[] = $row["$key"];
|
|
|
|
|
}
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
$ultClass = $row['clas_descricao'];
|
|
|
|
|
|
|
|
|
|
if (count($this->GetData()[0]) == $count) {
|
|
|
|
|
$dataRel[] = array('LABEL', "Total [ $ultClass ]", $somaReg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->___dataRel[] = $dataRel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___PreparaGrid() {
|
|
|
|
|
$dataRel = array();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Inicia o relat<EFBFBD>rio.
|
|
|
|
|
*/
|
|
|
|
|
$dataRel[] = '<table width="70%" cellpadding="2" class="grid">';
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Monta a linha de cabecalio.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
$linha = '<tr>';
|
|
|
|
|
$linha .= sprintf("<th colspan=\"2\" %s>%s</th>", 'align="center"', 'Relat<EFBFBD>rio Classifica<EFBFBD><EFBFBD>o Mensal');
|
|
|
|
|
$linha .= "</tr>";
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Verifica se retornou dados
|
|
|
|
|
*/
|
|
|
|
|
if (!IsPostBack() || !count($this->GetData()[0])) {
|
|
|
|
|
$dataRel[] = sprintf("<tr><td align=\"center\" colspan=\"%s\">%s<td></tr></table>", count(1) - 1, (!IsPostBack() ? 'Informe os parametros e clique em consultar!' : 'Nenhum registro encontado!'));
|
|
|
|
|
$this->___dataRel[] = $dataRel;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$somaReg = 0;
|
|
|
|
|
$ultClass = "";
|
|
|
|
|
$pass = 0;
|
|
|
|
|
/*
|
|
|
|
|
* Linhas de dados.
|
|
|
|
|
*/
|
|
|
|
|
foreach ($this->GetData()[0] as $row) {
|
|
|
|
|
$count ++;
|
|
|
|
|
|
|
|
|
|
if ($ultClass != $row['clas_descricao']) {
|
|
|
|
|
if ($pass) {
|
|
|
|
|
$linha = '<tr><th align="left">Total [ %s ]</th><th align="right">%s</th></tr>';
|
|
|
|
|
$dataRel[] = sprintf($linha, $ultClass, $somaReg);
|
|
|
|
|
$dataRel[] = '<tr><td> </td></tr>';
|
|
|
|
|
unset($somaReg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$linha = '<tr>';
|
|
|
|
|
$linha .= sprintf("<th %s>%s</th>", 'align="left"', $row['clas_descricao']);
|
|
|
|
|
$linha .= sprintf("<th %s>%s</th>", 'align="right"', 'Classifica<EFBFBD><EFBFBD>es');
|
|
|
|
|
$linha .= "</tr>";
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$ultClass = $row['clas_descricao'];
|
|
|
|
|
$somaReg += $row['qtde'];
|
|
|
|
|
|
|
|
|
|
// Formata linha de dados.
|
|
|
|
|
$linha = "<tr>";
|
|
|
|
|
$linha .= sprintf("<td aling=\"left\">%s</td>", $row['clit_descricao']);
|
|
|
|
|
$linha .= sprintf("<td align=\"right\">%s</td>", $row['qtde']);
|
|
|
|
|
$linha .= "</tr>";
|
|
|
|
|
$dataRel[] = $linha;
|
|
|
|
|
$pass = 1;
|
|
|
|
|
if (count($this->GetData()[0]) == $count) {
|
|
|
|
|
$linha = '<tr><th align="left">Total [ %s ]</th><th align="right">%s</th></tr>';
|
|
|
|
|
$dataRel[] = sprintf($linha, $ultClass, $somaReg);
|
|
|
|
|
unset($somaReg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* Fecha relatorio.
|
|
|
|
|
*/
|
|
|
|
|
$dataRel[] = '</table>';
|
|
|
|
|
$this->___dataRel[] = $dataRel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___PreparaHtml() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function ___PreparaPdf() {
|
|
|
|
|
list($this->___dac, $this->___dataIni, $this->___dataFim, $this->___tipoRelatorio) = $_SESSION["SSstorageFiltros"];
|
|
|
|
|
|
|
|
|
|
$dados = array();
|
|
|
|
|
$tables = array();
|
|
|
|
|
$header = null;
|
|
|
|
|
|
|
|
|
|
$x = 0;
|
|
|
|
|
$t = 0;
|
|
|
|
|
|
|
|
|
|
$ultClass = "";
|
|
|
|
|
$somaReg = 0;
|
|
|
|
|
|
|
|
|
|
$dataHeader = array('clit_descricao' => 'C', 'qtde' => 'C');
|
|
|
|
|
$widthHeader = array(130, 60);
|
|
|
|
|
|
|
|
|
|
foreach ($this->GetData()[0] as $row) {
|
|
|
|
|
$count ++;
|
|
|
|
|
if ($x) {
|
|
|
|
|
if ($ultClass != $row['clas_descricao']) {
|
|
|
|
|
$totalizador = array("Total [ $ultClass ] ", $somaReg);
|
|
|
|
|
${'table' . $t} = array($header, $dataHeader, $dados, $widthHeader, $totalizador, 0);
|
|
|
|
|
array_push($tables, ${"table" . $t});
|
|
|
|
|
$t++;
|
|
|
|
|
unset($somaReg);
|
|
|
|
|
unset($dados);
|
|
|
|
|
$x = 0;
|
|
|
|
|
$header = array($row['clas_descricao'] => 'C', "Classifica<EFBFBD><EFBFBD>es" => 'C');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$header = array($row['clas_descricao'] => 'C', "Classifica<EFBFBD><EFBFBD>es" => 'C');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$somaReg += $row['qtde'];
|
|
|
|
|
$ultClass = $row['clas_descricao'];
|
|
|
|
|
|
|
|
|
|
$dados[$x]["clit_descricao"] = $row["clit_descricao"];
|
|
|
|
|
$dados[$x]["qtde"] = $row['qtde'];
|
|
|
|
|
$x++;
|
|
|
|
|
$z++;
|
|
|
|
|
|
|
|
|
|
if (count($this->GetData()[0]) == $count) {
|
|
|
|
|
$totalizador = array("Total [ $ultClass ] ", $somaReg);
|
|
|
|
|
${'table' . $t} = array($header, $dataHeader, $dados, $widthHeader, $totalizador, 0);
|
|
|
|
|
array_push($tables, ${"table" . $t});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->___dataRel = $tables;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function ExecutaRelatorio() {
|
|
|
|
|
global $jsStartup, $jsJQuery, $smarty;
|
|
|
|
|
try {
|
|
|
|
|
/*
|
|
|
|
|
* Use esta fun<EFBFBD><EFBFBD>o para validar dados do formul<EFBFBD>rio.
|
|
|
|
|
*/
|
|
|
|
|
$this->___ValidaForm();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Recupera os dados do banco.
|
|
|
|
|
*/
|
|
|
|
|
$this->___ConteudoRelatorio();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Imprime relat<EFBFBD>rio de acordo com a media passada.
|
|
|
|
|
*/
|
|
|
|
|
$conteudoRelatorio = $this->___ImprimeRelatorio();
|
|
|
|
|
} catch (Exception $exc) {
|
|
|
|
|
$this->SetMsg($exc->getMessage());
|
|
|
|
|
$jsStartup[] = sprintf("alert('%s');", $this->GetMsg());
|
|
|
|
|
$this->___GravaLog();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Inclua os scripts necess<EFBFBD>rios aqui.
|
|
|
|
|
*/
|
|
|
|
|
$jsJQuery[] = "\$('#dataIni').keypress(function(){formataDataHora(this);}) ";
|
|
|
|
|
$jsJQuery[] = "\$('#dataFim').keypress(function(){formataDataHora(this);}) ";
|
|
|
|
|
|
|
|
|
|
$smarty->assign('filtros', $this->___FiltrosRelatorio());
|
|
|
|
|
$smarty->assign('conteudo', $conteudoRelatorio);
|
|
|
|
|
$smarty->assign('msg', $this->GetMsg());
|
|
|
|
|
GetTemplate($smarty, 'relatoriosGrid.tpl');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$relClassMensal = new RelClassificacaoMensal($idProg, $dbcon, 1);
|
|
|
|
|
$relClassMensal->ExecutaRelatorio();
|
|
|
|
|
?>
|
|
|
|
|
|