-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathromances.php
More file actions
77 lines (66 loc) · 2.86 KB
/
romances.php
File metadata and controls
77 lines (66 loc) · 2.86 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
66
67
68
69
70
71
72
73
74
75
76
77
<?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>
<link rel="stylesheet" href="css/helper.css">
<body>
<div class="container-fluid">
<?php
error_reporting(0);
require "includes/dbh.inc.php";
$query = "SELECT * FROM livros WHERE liv_genero = 'romance'";
$result = mysqli_query($conn, $query);
if($result > 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</th>
</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>";
}
else {
echo "<div class='col-centered'>
<div class='col-xs-4' style='margin: 25%;'>
<h2> Desculpe, não foi possível encontrar um resultado </h2>
</div>
</div>";
}
?>
</div>
</body>
<?php
require "footer.php"
?>