Boa tarde,
Tenho um formulário que faz um filtro e monta uma table de acordo com a opção selecionada. Até aí beleza, tá funcionando perfeitamente. Porém, toda vez que dou um refresh (F5) ou volto para a página anterior dá uma mensagem de reenvio de formulário. Já tentei de tudo e não funfa de maneira alguma. Agradeço se alguém puder me indicar um caminho melhor para resolver.
Segue abaixo o código:
<?php session_start(); require_once("ProjectIncludes.php"); $project = 1; if ($_POST['submit'] == 'Filtrar') { $project = $_POST['selProjeto']; } $service = new ProjetoService(); $consulta = $service->getProjetoById($project); unset($service); ?> <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>E9SIS</title> <link rel="stylesheet" href="css/style.default.css" type="text/css" /> <link rel="stylesheet" href="prettify/prettify.css" type="text/css" /> <script type="text/javascript" src="prettify/prettify.js"></script> <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="js/jquery-migrate-1.1.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.9.2.min.js"></script> <script type="text/javascript" src="js/jquery.flot.min.js"></script> <script type="text/javascript" src="js/jquery.flot.resize.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> <script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript" src="js/custom.js"></script> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('.leftmenu .nav-tabs > li').each(function(){ jQuery('.leftmenu .nav-tabs').find('li').removeClass('active'); }); jQuery('.relatorio').addClass('active'); jQuery('.sub-nav-tabs').css({display: "block"}); }); function alteraID(id) { jQuery('.btn').attr('href', 'novo-apartamento.php?id='+id); } </script> <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]--> </head> <body> <div class="mainwrapper"> <!-- START OF LEFT PANEL --> <?php include("topo.php"); ?> <div class="pagetitle"> <h1>Relatório Apartamentos</h1> <span> </span> </div><!--pagetitle--> <div class="maincontent" > <div class="filtercontentinner"> <form action="" method="post" name="form"> <p class="control-group"> <div class="controls"><label class="control-label" for="nomecategoria">Projeto:</label></div> <span class="field"> <select name="selProjeto" data-placeholder="Selecione a Categoria" style="width:350px" class="chzn-select" tabindex="2"> <?php carregaComboProjeto(); ?> </select> </span> <input type="submit" id="filtrar" name="submit" class="btn btn-primary" value="Filtrar" /> </p> </form> </div> <div class="contentinner content-dashboard" id="conteudo" style="visibility:hidden"> <h4 class="widgettitle" style="text-align:right;"><a href="exportarexcel_apartamento.php?id=<?php echo $project; ?>" class="btn btn-success"><i class="icone"></i> Exportar para Excel</a></h4> <div id="tabs"> <ul> <?php foreach($consulta as &$lista) { ?> <li><a href="#tabs-<?php echo $lista->idprojeto; ?>"><?php echo strtoupper($lista->descricao); ?></a></li> <?php } ?> </ul> <?php foreach($consulta as &$lista) { ?> <div id="tabs-<?php echo $lista->idprojeto; ?>"> <?php unset($service, $cons); ?> <div class="widgetcontent"> <?php $service = new ApartamentosService(); $cons = $service->getAll($lista->idprojeto); ?> <table class="table"> <thead> <tr> <!--<th class="center">ID</th>--> <th class="center">Sigla</th> <th class="center">Número</th> <th class="center">Localização</th> <th class="center">Andar</th> <th class="center">Quartos</th> <th class="center">Banheiros</th> <th> </th> </tr> </thead> <tbody> <?php foreach($cons as &$list) { ?> <tr> <!--<td class="center"><?php echo $list->idapartamento; ?></td>--> <td class="center"><?php echo $list->sigla; ?></td> <td class="center"><?php echo $list->descricao; ?></td> <td class="center"><?php echo $list->localizacao; ?></td> <td class="center"><?php echo $list->andar; ?></td> <td class="center"><?php echo $list->quarto; ?></td> <td class="center"><?php echo $list->banheiro; ?></td> </tr> <?php } ?> </tbody> </table> <?php unset($service, $cons); ?> </div> </div> <?php } ?> </div> </div> </div><!--mainright--> <!-- END OF RIGHT PANEL --> <div class="clearfix"></div> <div class="footer"> <div class="footerleft">E9SIS Versão 01.00</div> <div class="footerright">© Desenvolvido por <a href="http://www.entersistemas.com.br" target="_blank">Enter Sistemas</a></div> </div><!--footer--> </div><!--mainwrapper--> <script type="text/javascript"> jQuery(document).ready(function(){ function showTooltip(x, y, contents) { jQuery('<div id="tooltip" class="tooltipflot">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5 }).appendTo("body").fadeIn(200); } }); </script> <?php if ($_POST['submit'] == 'Filtrar') { echo"<script> document.getElementById('conteudo').style.visibility='visible'; </script>"; } ?> </body> </html>