Пример #1
0
<?php

$tpl->addFile('CONTEUDO', 'html_libs/painel_home.html');
$relatorio = new Relatorio();
$geral = $relatorio->getGerais();
$tpl->LANCDESDE = ExplodeDateTime2($geral['first']);
$tpl->DADOSDESDE = getMesNome($geral['dados_desde']['mes_ref'], true) . "/" . $geral['dados_desde']['ano_ref'];
$default = array();
$default['notas'] = 0;
foreach ($geral['total_geral'] as $ucTipo) {
    $tpl->UCNOTAQTD = tratarValor($ucTipo['cnt']);
    $tpl->VALTOTAL = tratarValor($ucTipo['val'], true);
    $medida = $relatorio->getTipoMedida($ucTipo['tipo']);
    if ($medida != "Min" && $medida != "Mb" && $medida != "NDA") {
        $tpl->UCMEDIDA = $medida;
        $tpl->CONSTOTAL = tratarValor($ucTipo['cons']);
        $tpl->CONSMEDIA = tratarValor($ucTipo['cons'] / $ucTipo['cnt']);
        $tpl->block('SHOWCONS');
        $tpl->block('SHOWCONS2');
    }
    $tpl->VALMEDIA = tratarValor($ucTipo['val'] / $ucTipo['cnt'], true);
    $tpl->UCTIPONOME = $relatorio->getTipoNome($ucTipo['tipo']);
    $tpl->block('EACHUCTIPO');
    $default['notas'] += $ucTipo['cnt'];
}
$tpl->NUMNOTAS = tratarValor($default['notas']);
$tpl->UOQTD = $geral['unidades'][0];
$tpl->UCQTD = $geral['unidades'][1];
Пример #2
0
/***********************
	 MOSTRAR MENU COM ANOS
	***********************/
$rel = new Relatorio();
$cores = $rel->cores;
$ucTipos = $uo->getTiposServicos();
foreach ($ucTipos as $tipo) {
    //$tpl->BDCOLOR = "#4096EE";
    $tpl->BDCOLOR = $cores[$tipo];
    $ucSomas = $uo->getUcSomaByType($tipo, $anoAtual);
    $totais[0] = $totais[1] = 0;
    if ($ucSomas != null) {
        foreach ($ucSomas as $uc) {
            $tpl->UCRGI = $uc['rgi'];
            $tpl->UCNOME = $uc['compl'] . " - " . $uc['rua'];
            $tpl->UCTIPO = $rel->getTipoNome($uc['tipo']);
            $tpl->UCCHAVE = sha1($uc['id']);
            $tpl->ANOATUAL = $anoAtual;
            $tpl->STATUS = getAtivoText($uc['ativo']);
            $tpl->CONSUMO = tratarValor($uc['SUM(n.consumo)']);
            $tpl->VALOR = tratarValor($uc['SUM(n.valor)'], true);
            $tpl->block('EACH_UC');
            $totais[0] += $uc['SUM(n.consumo)'];
            $totais[1] += $uc['SUM(n.valor)'];
        }
    }
    $tpl->UCTIPOIND = $rel->getTipoNome($tipo);
    $tpl->TOTCONSUMO = tratarValor($totais[0]);
    $tpl->TOTVALOR = tratarValor($totais[1], true);
    $tpl->block('EACH_TIPO');
}