Guest User

Untitled

a guest
Jan 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <!--EXCLUIR EVENTO-->
  2. <?php
  3.  
  4. $resgatando_dados = $pdo->prepare("SELECT * FROM eventos ORDER BY data ASC");
  5. $resgatando_dados->execute();
  6. echo '
  7. <table border="1" width="100%">
  8. <tr id="cabecalhotabelalistar";>
  9. <td>Id</td>
  10. <td>Título</td>
  11. <td>Data</td>
  12. <td>Encontro</td>
  13. <td>Excluir</td>
  14. </tr>
  15. ';
  16.  
  17. foreach($resgatando_dados as $apresenta_dados):
  18. echo '
  19. <tr>
  20. <td> '.addslashes(trim(strip_tags($apresenta_dados['id']))).'</td>
  21. <td> '.addslashes(trim(strip_tags($apresenta_dados['titulo']))).'</td>
  22. <td> '.addslashes(trim(strip_tags($apresenta_dados['data']))).'</td>
  23. <td> '.addslashes(trim(strip_tags($apresenta_dados['encontro']))).'</td>
  24. <td><a href="deletar_dados.php?id='.addslashes(trim(strip_tags($apresenta_dados['id']))).'">Excluir</a></td>
  25. </tr>
  26. ';
  27. endforeach;
  28. echo '</table>';
  29.  
  30. ?>
  31.  
  32. <?php
  33. include 'conexao.php';
  34. ?>
  35. <html>
  36. <head>
  37. <meta charset="UTF-8">
  38. </head>
  39.  
  40. <body>
  41.  
  42. <?php
  43.  
  44. $id = strip_tags($_GET['id']);
  45.  
  46.  
  47.  
  48. $encontro = $_GET['encontro'];
  49. unlink ('encontros/'.'$encontro');
  50.  
  51.  
  52.  
  53. $deletando_dados = $pdo->prepare("DELETE FROM eventos WHERE id = '$id'");
  54. $deletando_dados->execute();
  55.  
  56.  
  57.  
  58. if($deletando_dados):
  59. echo '<script>alert("Evento excluído")</script>';
  60. //echo '<script>window.location="admin.php"</script>';
  61.  
  62. else:
  63. echo '<script>alert("Não foi possível excluir o evento")</script>';
  64. endif;
  65. ?>
  66.  
  67. </body>
  68. </html>
Add Comment
Please, Sign In to add comment