$tpl->addFile('JSCRIPT', 'cssjs_libs/js_parts/js_udd_uoDetalhes.html'); $anoAtual = isset($_GET['ano']) ? $_GET['ano'] : Date('Y'); $tipoVal; if (isset($_GET['chave'])) { $chave = $_GET['chave']; if (strlen($chave) == 40) { $tpl->addFile('CONTEUDO', 'html_libs/udd_uoDetalhes.html'); $queryVerif = mysql_query("SELECT id FROM daee_udds WHERE SHA1(id) = '" . $_GET['chave'] . "'"); if (mysql_num_rows($queryVerif) == 1) { $id = mysql_fetch_array($queryVerif)['id']; /********************************* MOSTRAR INFORMAÇÕES DO RELATÓRIO *********************************/ $uo = new Unidade($id); $tpl->UOSIGLA = $uo->getSigla(); $tpl->UONOME = $uo->getNome(); $uoTipoServicos = $uo->getTiposServicos(); $tpl->UOUCQTD = $uo->getQtdUc(); $tpl->ANO_ATU = $anoAtual; $tpl->TIPOSSERVICOS = ""; $z = 0; if (count($uoTipoServicos) > 0) { foreach ($uoTipoServicos as $tipo) { $ucTipo = new UnidadeConsumidora(0, null, null, null, null, null, null, null, null, null, null, $tipo); $mesmoTipo = $uo->getUcPorTipo($tipo); $tpl->TIPOSSERVICOS .= "<br /> - <b><font color='navy'>" . $ucTipo->getTipoNome() . "</font></b>: <a href='udd_uoCharts.php?chave=" . $_GET['chave'] . "&svc={$tipo}&start=" . $anoAtual . "'>"; $tpl->TIPOSSERVICOS .= "Relatório " . $anoAtual . " de " . count($mesmoTipo) . " UC(s)</a>"; $tpl->TIPOSERVICO = $ucTipo->getTipoNome(); $tpl->CHART_VALOR = $uo->getTotalPorTipo($tipo, $anoAtual); if ($z < count($uoTipoServicos)) { $tpl->COMA1 = ",";
*/ for ($a = Date('Y'); $a >= 2012; $a--) { $tpl->ANOFORM = $a; $tpl->block('ANOS'); } if (isset($_GET['uo'], $_GET['ano'])) { if ($_GET['ano'] >= 2012 && $_GET['ano'] <= Date('Y')) { $uoid = (int) $_GET['uo']; $getAno = $_GET['ano']; //$tpl->UCID = $ucid; $tpl->GETANO = $getAno; $uo = new Unidade($uoid); $consChart = array(); if ($uo->getSigla() != "") { $ucs = $uo->getAllUcs(); $tpl->UONOME = $uo->getSigla() . " - " . $uo->getNome(); $tpl->UOFORMNOME = $uo->getSigla() . " | " . $uo->getNome(); $tpl->UOFORMID = $uoid; $tpl->block('EACHUOFORM'); $arrayUcs; foreach ($ucs as $ucid) { $uc = new UnidadeConsumidora($ucid); $arrayUcs[$uc->get('tipo')][$uc->get('id')]['rgi'] = $uc->get('rgi'); $arrayUcs[$uc->get('tipo')][$uc->get('id')]['nome'] = $uc->getNome(); $arrayUcs[$uc->get('tipo')][$uc->get('id')]['empresa'] = $uc->get('empresa')->getNome(); $arrayUcs[$uc->get('tipo')][$uc->get('id')]['mensal'] = $uc->getExercicioMensal($getAno); } $totalGeral[1] = 0; $totalGeral[2] = 0; $totalGeral[3] = 0; $totalGeral[4] = 0;
$anoAtual = Date('Y'); $anoInicio = 2012; /*********************** MOSTRAR MENU COM ANOS ***********************/ $iMin = 2012; $iCalc = $anoAtual - 5; $iFor = $iCalc < $iMin ? $iMin : $iCalc; for ($i = $iFor; $i <= Date('Y'); $i++) { $tpl->ITEM_MENU_URL = "resumo_index.php?ano=" . $i; $tpl->ITEM_MENU_LINK = $i; $tpl->block('ITEM_MENU'); } $uo = new Unidade($_SESSION['bacia']); $tpl->MENU_NAME = "Sua Unidade : " . $uo->getSigla(); $tpl->UDD_NAME = $uo->getSigla() . " - " . $uo->getNome(); /***************************** BLOCOS DE ANOS DE RELATÓRIOS ******************************/ for ($i = $anoAtual; $i >= $iMin; $i--) { $mesQtd; if ($i == $anoAtual && Date('j') < 15) { $mesQtd = Date('n') - 1; } elseif ($i == $anoAtual && Date('j') >= 15) { $mesQtd = Date('n'); } else { $mesQtd = 12; } for ($z = 1; $z <= $mesQtd; $z++) { $tpl->MESNOME = "<b>" . $i . "</b> - " . getMesNome($z, false); if ($i == $iMin && $z == 1) {
foreach ($emp->getEmpresas() as $empresa) { $tpl->EMPID = $empresa['id']; $tpl->EMPNOME = $empresa['nome']; $tpl->CNPJ = $emp->transformCnpj($empresa['cnpj']); $tpl->block('EACH_EMP'); } $i = 0; foreach ($emp->getServicos() as $servi) { $tpl->SERVVAL = $i; $tpl->SERVNOME = $servi->children(); $tpl->SERVDESC = $servi->children()[1]; $tpl->block('EACH_SERV'); $i++; } $ano = date('Y'); for ($i = $ano - 7; $i <= $ano + 7; $i++) { $tpl->ANOVAL = $i; $tpl->block("EACH_ANO1"); $tpl->block("EACH_ANO2"); } $sqlUdd = "SELECT id FROM daee_udds ORDER BY id"; $queryUdd = mysql_query($sqlUdd); while ($res = mysql_fetch_array($queryUdd)) { $unid = new Unidade($res['id']); $tpl->UDDSIGLA = $unid->getSigla(); $tpl->UDDNOME = $unid->getNome(); $tpl->UDDID = $unid->get('id'); $tpl->block('EACH_UDD'); } } $tpl->show();
include "src/classes/Users.class.php"; include "src/classes/UnidadeCons.class.php"; include "src/classes/Notas.class.php"; include_once "src/classes/Relatorio.class.php"; //$tpl->TESTE = $emp->getServicos()[2]->children(); redirectByPermission(0); // SETAR PERMISSÃO DA PÁGINA $inicio = execucao(); $tpl = new Template('html_libs/template_livre.html'); //$tpl->addFile('JSCRIPT','cssjs_libs/js_parts/js_udd_ucDetalhes.html'); $tpl->addFile('CONTEUDO', 'html_libs/resumo_index.html'); $anoAtual = isset($_GET['ano']) && $_GET['ano'] >= 2012 && $_GET['ano'] <= Date('Y') ? $_GET['ano'] : Date('Y'); $anoAnterior = $anoAtual - 1; $uo = new Unidade($_SESSION['bacia']); $tpl->MENU_NAME = "Sua Unidade : " . $uo->getSigla(); $tpl->UDD_NAME = "<em>relatório " . $anoAtual . "</em>" . $uo->getSigla() . " : " . $uo->getNome(); $tpl->QTD_ATIVO = $uo->getQtdUcStatus(); $tpl->QTD_INATIVO = $uo->getQtdUcStatus(0); $tpl->UO_SIGLA = $uo->getSigla(); /*********************** MOSTRAR MENU COM ANOS ***********************/ $iMin = 2012; $iCalc = $anoAtual - 5; $iFor = $iCalc < $iMin ? $iMin : $iCalc; for ($i = $iFor; $i <= Date('Y'); $i++) { $tpl->ITEM_MENU_URL = "resumo_index.php?ano=" . $i; $tpl->ITEM_MENU_LINK = $i; $tpl->block('ITEM_MENU'); } /***********************