-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
46 lines (34 loc) · 969 Bytes
/
index.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
<?php
session_start();
$count = 0;
$title = "Index";
require_once "./template/header.php";
require_once "./functions/database_functions.php";
$conn = db_connect();
$numBooks = 4;
$row = selectLatestBooks($conn, $numBooks);
?>
<p class="lead text-center text-muted text-primary big-font-3">Latest books</p>
<div class="row four-books-margin-bottom">
<?php foreach ($row as $book) { ?>
<div class="col-md-3 text-center">
<a href="book.php?bookisbn=<?php echo $book['book_isbn']; ?>">
<img class="img-responsive img-thumbnail book-hover"
src="./assets/img/<?php echo $book['book_image']; ?>" alt="the image book image">
</a>
</div>
<?php
$count++;
if ($count >= $numBooks) {
$count = 0;
break;
}
?>
<?php } ?>
</div>
<?php
if (isset($conn)) {
mysqli_close($conn);
}
require_once "./template/footer.php";
?>