-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlist_book_chapters.php
More file actions
83 lines (68 loc) · 2.13 KB
/
list_book_chapters.php
File metadata and controls
83 lines (68 loc) · 2.13 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
78
79
80
81
82
83
<?php
$title = "Update chapters of books";
require("template/top.tpl.php");
require_once("gb/controller/BookController.php");
require_once("gb/domain/Genre.php");
require_once("gb/mapper/GenreMapper.php");
require_once("gb/domain/Book.php");
$bookController = new gb\controller\BookController();
$bookController->process();
$genreMapper = new gb\mapper\GenreMapper();
$allGenres = $genreMapper->findAll();
?>
<form method="post">
<table style="width: 100%">
<tr>
<td colspan="4">
<table style="width: 100%">
<tr>
<td>Genre</td>
<td colspan="3" style="width: 85%">
<select style="width: 50%" name="genre">
<option value="">--------Book genres ---------- </option>
<?php
foreach($allGenres as $genre) {
echo "<option value=\"", $genre->getUri(), "\">", $genre->getGenreName(), "</option>" ;
}
?>
</select>
</td>
</tr>
<tr>
<td > </td>
<td > </td>
<td><input type ="submit" name="search" value="Search" ></td>
<td > </td>
</tr>
</table>
</td>
</table>
</form>
<?php
$books = $bookController->getSearchResult();
print count($books) . " books found";
if (count($books) > 0) {
?>
<table style="width: 100%">
<tr>
<td>Book name</td>
<td>Chapters</td>
<td>Add chapters</td> </tr>
<?php
foreach($books as $book) {
?>
<tr>
<td><a href="update_book_chapters.php?book_uri=<?php echo $book->getUri(); ?>"><?php echo $book->getBookName(); ?></a></td>
<td><a href="update_book_chapters.php?book_uri=<?php echo $book->getUri(); ?>"><?php echo $book->getChapters(); ?></a></td>
<td><a href="add_book_chapters.php?book_uri=<?php echo $book->getUri(); ?>">Add chapter</a></td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
<?php
require("template/bottom.tpl.php");
?>