Advertisement
MizunoBrasil

index_admin

Feb 8th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
  8. <title>Document</title>
  9. </head>
  10. <body>
  11. <br>
  12. <div class="container">
  13. <br><br>
  14. <h4>Adm</h4>
  15. <a href="home">Início</a> | <a href="pesquisar">Pesquisar imagem</a>
  16. <br><br><br>
  17.  
  18. <?php
  19. $pdo = new PDO('mysql:host=xxxx;dbname=nomedobanco', 'usuario', 'senha');
  20. $stmt = $pdo->prepare("SELECT * FROM tabimagem ORDER BY id DESC");
  21. $pdo->exec("SET NAMES utf8");
  22. $stmt->execute();
  23. $images = $stmt->fetchAll();
  24. ?>
  25.  
  26. <table class="table">
  27. <thead>
  28. <tr>
  29. <th>Nome</th>
  30. <th>Imagem</th>
  31. <th>Postagem</th>
  32. <th>Apagar</th>
  33. <th>Editar</th>
  34.  
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <?php foreach($images as $image): ?>
  39. <tr>
  40. <!--<td><?php echo $image['name']; ?></td>-->
  41. <td><a href="postagem/<?php echo $image["slug"]; ?>"><?php echo $image['name']; ?></a></td>
  42. <!--<td><a href="postagem/<?php echo $image["slug"]; ?>"><img src="<?php echo $image["arquivo"]; ?>" width="150" class="img-fluid"></a></td>-->
  43. <td><a href="<?php echo $image["arquivo"]; ?>" target="_blank"><img src="<?php echo $image["arquivo"]; ?>" width="150" class="img-fluid"></a></td>
  44. <td><?php echo $image['postagem']; ?></td>
  45. <td>
  46. <form action="delete.php" method="post">
  47. <input type="hidden" name="id" value="<?php echo $image['id']; ?>">
  48. <input type="submit" class="btn btn-danger" value="Apagar">
  49. </form>
  50. </td>
  51. <td>
  52. <form action="edit.php" method="post">
  53. <input type="hidden" name="id" value="<?php echo $image['id']; ?>">
  54. <input type="submit" class="btn btn-primary" value="Editar">
  55. </form>
  56. </td>
  57.  
  58.  
  59.  
  60. </td>
  61. </tr>
  62. <?php endforeach; ?>
  63. </tbody>
  64. </table>
  65.  
  66.  
  67.  
  68.  
  69. </div>
  70.  
  71. </body>
  72. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement