-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin_book.php
31 lines (31 loc) · 987 Bytes
/
admin_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
<?php
session_start();
require_once "./functions/admin_functions.php";
require_once "./functions/database_functions.php";
$conn = db_connect();
$result = getAll($conn);
require "./template/menu.php";
?>
<p class="lead"><a href="admin_add.php">Add new book</a></p>
<table class="table" style="margin-top: 20px">
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Author</th>
<th>Price</th>
<th>Publisher</th>
<th> </th>
<th> </th>
</tr>
<?php while($row = mysqli_fetch_assoc($result)){ ?>
<tr>
<td><?php echo $row['book_isbn']; ?></td>
<td><?php echo $row['book_title']; ?></td>
<td><?php echo $row['book_author']; ?></td>
<td><?php echo $row['book_price']; ?></td>
<td><?php echo getPubName($conn, $row['publisherid']); ?></td>
<td><a href="admin_edit.php?bookisbn=<?php echo $row['book_isbn']; ?>">Edit</a></td>
<td><a href="admin_delete.php?bookisbn=<?php echo $row['book_isbn']; ?>">Delete</a></td>
</tr>
<?php } ?>
</table>