-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (58 loc) · 2.52 KB
/
Copy pathindex.php
File metadata and controls
65 lines (58 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require "header.php";
?>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<body>
<div class="container-fluid">
<?php
require "includes/dbh.inc.php";
$sql = "SELECT * FROM livros";
$result = mysqli_query($conn, $sql);
$queryResults = mysqli_num_rows($result);
if($queryResults > 0) {
echo "<div class='container-fluid' style='overflow-x: auto;'>
<table class='table'>
<thead>
<tr>
<th scope='col'>#</th>
<th scope='col'>Nome</th>
<th scope='col'>Gênero</th>
<th scope='col'>Editora</th>
<th scope='col'>Ano</th>
<th scope='col'>Nº Páginas</th>
<th scope='col'>Autor</th>
<th scope='col'>Sinopse</th>
<th scope='col'>Excluir
</tr>
</thead>
<tbody>";
while ($row = mysqli_fetch_assoc($result)) {
echo "
<tr>
<th scope='row'>".$row['liv_cod']."</th>
<td>".$row['liv_nome']."</td>
<td>".$row['liv_genero']."</td>
<td>".$row['liv_editora']."</td>
<td>".$row['liv_ano']."</td>
<td>".$row['liv_npaginas']."</td>
<td>".$row['liv_autor']."</td>
<td>".$row['liv_sinopse']."</td>
<td>
<form name='deletebtn' method='get' action='includes/buscalivros.inc.php'>
<input type='checkbox' name='delete' value='".$row['liv_cod']."'>
</td>
</tr>
";
}
echo "</table>";
echo "<input type='submit' class='btn btn-outline-warning my-2 my-sm-0 center-block' value='Excluir'>
</form>";
echo "</div>";
}
?>
</div>
</body>
<?php
require "footer.php";
?>