-
Notifications
You must be signed in to change notification settings - Fork 0
/
rl.php
68 lines (64 loc) · 2.77 KB
/
rl.php
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
<?php
require './BD/ConectaDB.php';
$conn = new mysqli($LOCALDB, $USER, $PASS, $DATABASE);
$nome = array();
$preco = array();
$descricao = array();
$i = 1;
$sql = "SELECT * FROM hotelzin.tipo_quarto ORDER BY RAND() LIMIT 3;";
$result = $conn->query($sql);
if ($result->num_rows >0) {
while ($row = $result->fetch_assoc()) {
array_push($nome,$row['nome']);
array_push($preco,$row['preco']);
array_push($descricao,$row['descricao']);
}
}
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<div class="container my-5">
<h1>Lista de Quartos</h1>
<div class="row">
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img src="imagens/quarto1.jpg" class="card-img-top" alt="Quarto 1" width="40" height="200">
<div class="card-body">
<h5 class="card-title"><?= $nome[0]?></h5>
<p class="card-text"><?= $descricao[0]?></p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">R$<?= $preco[0]?> por noite</small>
<button type="button" class="btn btn-sm btn-outline-secondary"><a href="CadReserva.php">Reservar</a></button>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img src="imagens/quarto 2.jpg" class="card-img-top" alt="Quarto 2" width="40" height="200">
<div class="card-body">
<h5 class="card-title"><?= $nome[1]?></h5>
<p class="card-text"><?= $descricao[1]?></p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">R$<?= $preco[1]?> por noite</small>
<button type="button" class="btn btn-sm btn-outline-secondary"><a href="CadReserva.php">Reservar</a></button>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img src="imagens/quarto3.jpg" class="card-img-top" alt="Quarto 3" width="40" height="200">
<div class="card-body">
<h5 class="card-title"><?= $nome[2]?></h5>
<p class="card-text"><?= $descricao[2]?></p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">R$<?= $preco[2]?> por noite</small>
<button type="button" class="btn btn-sm btn-outline-secondary"><a href="CadReserva.php">Reservar</a></button>
</div>
</div>
</div>
</div>
</div>
</div>
</body>