-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlist-view.php
More file actions
52 lines (39 loc) · 1.11 KB
/
list-view.php
File metadata and controls
52 lines (39 loc) · 1.11 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
<?php
require_once 'include/common.php';
require_once 'include/protect.php';
$dao = new BookDAO();
$result = $dao->retrieveAll();
?>
<html>
<body>
<?php include 'header.php' ;
echo "<h1><a href='bootstrap-view.php'>Bootstrap</a></h1>";
echo "<h1><a href='json/'>Json API</a></h1>";
?>
<h1>Book Listing</h1>
<table id='book-list' border='1'>
<tr>
<th>Title</th>
<th>ISBN 13</th>
<th>Price</th>
<th></th>
<th></th>
</tr>
<?php
foreach($result as $book) {
echo "
<tr>
<td>$book->title</td>
<td>$book->isbn13</td>
<td>$book->price</td>
<td><a href='edit-view.php?id=$book->isbn13'>edit</a></td>
<td><a href='delete.php?id=$book->isbn13'>delete</a></td>
</tr>
";
}
?>
</table>
<p>
<h2><a href="add-view.php">Add Book</a></h2>
</body>
</html>