} else { $valor; switch ($_POST['editar']) { case "emissao": case "saida": case "vencto": $valor = getTransformDate($_POST['novo-' . $_POST['editar']]); break; default: $valor = mysql_real_escape_string($_POST['novo-' . $_POST['editar']]); break; } $obs = mysql_real_escape_string($_POST['obs']); $usertime = $_SESSION['usuario'] . " =@=" . Date('Y-m-d H:i:s') . "=@="; $nota = new Nota($_GET['chave']); $editar = $nota->editarNota($_POST['editar'], $valor, $usertime, $obs); if ($editar['tipo'] == "alerta") { $tpl->ALERTA = $editar['msg']; } elseif ($editar['tipo'] == "aviso") { $tpl->AVISO = $editar['msg']; } } } /*************************************** MOSTRAR OU UMA NOTA OU TODAS NO PERIODO ***************************************/ $mes_ref = isset($_GET['mes']) && $_GET['mes'] >= 1 && $_GET['mes'] <= 12 ? $_GET['mes'] : Date('n'); $ano_ref = isset($_GET['ano']) && $_GET['ano'] >= 2012 && $_GET['ano'] <= Date('Y') ? $_GET['ano'] : Date('Y'); if (isset($_GET['chave']) && $_GET['chave'] > 0) { $notaid = (int) $_GET['chave']; $nota = new Nota($notaid);