-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequests.php
More file actions
53 lines (46 loc) · 1.55 KB
/
Copy pathrequests.php
File metadata and controls
53 lines (46 loc) · 1.55 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
<?php
$title = "Requests";
$icon = "nc-layers-3";
include __DIR__.'/template/header.php';
?>
<div class="card">
<div class="card-body">
<div class="content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Request ID:</th>
<th>Book Name:</th>
<th>Book ID:</th>
<th>Request Date:</th>
<th>Response Date:</th>
<th>Return Date:</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$user_id=$_SESSION['user_id'];
$requests = $mysqli->query("select * from requests where user_id = $user_id ");
foreach ($requests as $request):
$book_id = $request["book_id"];
$books = $mysqli -> query("select name from books where id = $book_id")-> fetch_assoc(); ?>
<tr>
<td><?php echo $request["request_id"]; ?></td>
<td><?php echo $books["name"]; ?></td>
<td><?php echo $request["book_id"]; ?></td>
<td><?php echo $request["requestDate"]; ?></td>
<td><?php echo $request["responseDate"]; ?></td>
<td><?php echo $request["returnDate"]; ?></td>
<td><?php echo $request["status"]; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php
include __DIR__.'/template/footer.php'; ?>