$orderby = "ID de Usuario"; break; case "c.uo": $orderby = "ID de Unidade Operacional"; break; } $tpl->ORDERBY = $orderby; $tpl->MESNOME = strtoupper(getMesNome($mes, false)); $tpl->ANO = $ano; $tpl->ORIENTATION = $_POST['orientacao'] == "cresc" ? "Crescente" : "Decrescente"; $filter = $_POST['filter']; $data = $_POST['dia-lanc'] != "" && $_POST['mes-lanc'] != "" && $_POST['ano-lanc'] != "" ? $_POST['ano-lanc'] . "-" . $_POST['mes-lanc'] . "-" . $_POST['dia-lanc'] : ""; if ($mes == "nulo" && ($_POST['dia-lanc'] == "" || $_POST['mes-lanc'] == "" && $_POST['ano-lanc'] == "")) { $data = Date('Y-m-d'); } $notas = $rel->getRelNotas($mes, $ano, $filter, $_POST['order_by'], $orientation, $data); //$tpl->TESTE = $notas[0]['sql']; if ($notas[0]['id'] != null) { $tpl->NOTAQTD = count($notas); $i = 1; foreach ($notas as $nota) { $consTipo = $nota['constipo']; $cores = $rel->cores; $tpl->UO = $nota['unidade']; $tpl->UC = "<b>" . $nota['rgi'] . "</b> - [ <small>" . $nota['compl'] . "</small> ]"; $tpl->UC .= $nota['desc'] != "" ? " <font color='red'>*</font>" : ""; $tpl->UC .= "<br /><small>Tipo: <font color='" . $cores[$consTipo] . "'>" . $tipos[$consTipo] . "</font></small>"; $tpl->UC .= $nota['ativo'] == 0 ? " - <small><font color='red'>[ Inativo ]</font></small>" : " - <small><font color='green'>[ Ativo ]</font></small>"; $tpl->STATUS = $nota['ativo'] == 0 ? "<small><font color='red'>INATIVO</font></small>" : "<small><font color='green'>ATIVO</font></small>"; $tpl->EMISSAO = setDateDiaMesAno($nota['emissao']); $tpl->LANCTO = ExplodeDateTime($nota['criado'], true);