-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkin_book.php
82 lines (74 loc) · 2.31 KB
/
checkin_book.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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'] = "Add Book";
require_once "lib/db.php";
if(isset($_POST['book_id'])) {
CheckinBook(
$_POST['book_id'],
$_POST['copy_no'],
$_POST['student_id']);
header("Location: /books.php");
} else {
$book = GetBook($_GET['book_id']);
$book_copies = GetCheckedOutCopies($_GET['book_id']);
require "header.php"; ?>
<div class="row">
<div class="medium-8 column">
<h2><?=$book['Title']?></h2>
</div>
<div class="medium-4 column">
<h4><?=$book['Author']?></h4>
</div>
</div>
<div class="row">
<div class="medium-8 column">
</div>
<div class="medium-4 column">
<h5>ISBN13:<?=$book['ISBN']?></h5>
</div>
</div>
<div class="row callout">
<div class="large-12 columns">
<div class="row">
<div class="large-12 columns">
<h1>Check-in Book</h1>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<table>
<thead>
<th>Copy Number</th>
<th>Student</th>
<th>Checkout Date</th>
<th>Due Date</th>
<th>Late Fees</th>
<th></th>
</thead>
<tbody>
<?php foreach($book_copies as $copy) { ?>
<tr>
<td><?=$copy['Copy_No']?></td>
<td><?=$copy['Name']?></td>
<td><?=$copy['Check_Out_Date']?></td>
<td><?=$copy['Due_Date']?></td>
<td>$<?=$copy['Days_Late']?></td>
<td><a href="/checkin_book_process.php?book_id=<?=$copy['Book_ID']?>&cpy_no=<?=$copy['Copy_No']?>">Check-In</a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php require_once "footer.php";
}