Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. <?php
  2. include_once("conexao.php");
  3. $result_cursos = "SELECT*FROM cursos";
  4. $resultado = mysqli_query($conn,$result_cursos);
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang="pt-br">
  8. <head>
  9. <meta charset="utf-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. <title>Modal</title>
  13. <link href="css/bootstrap.min.css" rel="stylesheet">
  14. </head>
  15. <body>
  16. <div class="container theme-showcase" role="main">
  17. <div class="page-header">
  18. <h1>Listar Cursos</h1>
  19. </div>
  20. <div class="row">
  21. <div class="col-md-12">
  22. <table class="table">
  23. <thead>
  24. <tr>
  25. <th>#</th>
  26. <th>Nome do Curso</th>
  27. <th>Ação</th>
  28.  
  29. </tr>
  30. </thead>
  31. <tbody>
  32. <?php while($row_cursos = mysqli_fetch_assoc($resultado)){?>
  33.  
  34.  
  35. <tr>
  36. <td><?php echo $row_cursos['id'];?></td>
  37. <td><?php echo $row_cursos['nome'];?></td>
  38. <td><button type="button" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#myModal">Visualizar</button>
  39. </td>
  40.  
  41. </tr>
  42.  
  43. <!-- Button trigger modal -->
  44.  
  45.  
  46. <
  47. <?php } ?>
  48.  
  49. </tbody>
  50. </table>
  51. </div>
  52. </div>
  53.  
  54. <!-- Modal -->
  55. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  56. <div class="modal-dialog" role="document">
  57. <div class="modal-content">
  58. <div class="modal-header">
  59. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  60. <h4 class="modal-title text-center" id="myModalLabel"><?php echo $row_cursos['nome'];?></h4>
  61. </div>
  62. <div class="modal-body">
  63. <p><?php echo $row_cursos['id'];?></p>
  64. <p><?php echo $row_cursos['nome'];?></p>
  65. <p><?php echo $row_cursos['detalhes'];?></p>
  66. </div>
  67. <div class="modal-footer">
  68. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  69. <button type="button" class="btn btn-primary">Save changes</button>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <!--FIM DO MODAL -->
  75. </div>
  76.  
  77. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  78. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  79. <!-- Include all compiled plugins (below), or include individual files as needed -->
  80. <script src="js/bootstrap.min.js"></script>
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement