-
Notifications
You must be signed in to change notification settings - Fork 1
/
books.php
61 lines (53 loc) · 1.99 KB
/
books.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
<?php
/**
* CS442 Class Project
* Authors: Vincent Castellano, Matthew Para, Rudy Garcia, Daniel LaVergne, Lukas Simonis
* Created: 07/24/2017
*
* Text Book Rental Application
**/
/* Page Configuration */
$page = Array();
$page['subtitle'] = "Book List"
?>
<?php require "header.php"; ?>
<?php
$books = GetBooks();
?>
<div class="row expanded ">
<div class="large-12 small-12 column">
<table>
<thead>
<th>Title</th>
<th>Author</th>
<th>ISBN</th>
<th>Edition</th>
<th>Copies</th>
<th>Available</th>
<th></th>
</thead>
<tbody>
<?php foreach($books as $book) { ?>
<tr>
<td><?=$book['Title']?></td>
<td><?=$book['Author']?></td>
<td><?=$book['ISBN']?></td>
<td><?=$book['Edition']?></td>
<td><a href="book_copies.php?book_id=<?=$book['Book_ID']?>"><?=$book['Copies']?></a></td>
<td><?=$book['Available']?></td>
<td>
<?php if($book['Available'] > 0) { ?><a href="checkout_book.php?book_id=<?=$book['Book_ID']?>" class="button small">Checkout</a><?php } ?>
<?php if($book['Available'] < $book['Copies']) {?><a href="checkin_book.php?book_id=<?=$book['Book_ID']?>" class="alert button small">Check-in</a><?php } ?>
</td>
</tr>
<?php }?>
</tbody>
</table>
</div>
</div>
<div class="row expanded">
<div class="large-12 small-12 column float-right text-right">
<a href="add_book.php" class="button">Add Book</a>
</div>
</div>
<?php require_once "footer.php"; ?>