-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
52 lines (43 loc) · 1.59 KB
/
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
47
48
49
50
51
52
<?php
session_start();
include('php/app.inc.php');
$now_db = new books();
$books = $now_db->fiveLatest();
$books = $books != null ? $books : [];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<body class="teal lighten-3">
<?php include_once('php/navbar.php') ?>
<div class="container"><br><br>
<!-- <h3 class="title">Welcome to OnlineLibrary</h3> -->
<br><br>
<h5 class="article">Check out our top 5 recent books!</h5><br>
<ul class="collection">
<?php
foreach($books as $data) {
?>
<li class="collection-item avatar">
<span class="title"><strong><?php echo $data['book_name'] ?></strong> by <?php echo $data['book_author'] ?></span>
<div></div><br>
<p class="truncate"><?php echo $data['book_summary'] ?></p>
<a href="<?php echo $data['book_url'] ?>">Click to read</a>
</p>
</li>
<?php } ?>
</ul>
</div>
</body>
<script src="js/materialize.js"></script>
<script>
</script>
</html>