Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <!--FILTRO FLUTUANTE -->
  2. <div id="mws-themer">
  3. <div id="mws-themer-hide"></div>
  4. <div id="mws-themer-content">
  5. <div class="mws-themer-section">
  6. <form action="" name="myForm" id="myForm" style="padding: 0; margin: 0;" method="POST">
  7. <input type="text" name="edtMFIR" id="edtMFIR" value="" class="mws-textinput error">
  8. </form>
  9. </div>
  10. <div class="mws-themer-separator"></div>
  11. <div class="mws-themer-section">
  12. <button type="button" onclick="submit()" class="mws-button red small" id="mws-themer-sendfilterPCD">Filtrar</button>
  13. </div>
  14. </div>
  15. </div>
  16.  
  17. <script>
  18.  
  19. function submit() {
  20.  
  21. var fornDetails = "fornDetails.php";
  22. var fornRegister = "fornRegister.php";
  23.  
  24. var result = "<?php paginaDestino($_POST["edtMFIR"]); ?>";
  25. alert(result);
  26.  
  27. if (result) {
  28. myForm.action = fornRegister;
  29.  
  30. } else {
  31. myForm.action = fornDetails;
  32. }
  33. myForm.submit();
  34.  
  35. }
  36. </script>
  37.  
  38. function paginaDestino($edtMFIR){
  39.  
  40. $conexao = new bancodedados();
  41. if(!empty($edtMFIR)){
  42. $conexao->setSQL("SELECT * FROM tab_aro_pcd_riscos WHERE aro_riscos_mfir=".$edtMFIR." LIMIT 1");
  43. $res_a = $conexao->Consultar();
  44. $RES_MFIR = mysql_fetch_array($res_a);
  45.  
  46. if(empty($RES_MFIR)){
  47. return false;
  48. }else{
  49. return true;
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement