-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_book.php
42 lines (41 loc) · 1.27 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
<?php
session_start();
require_once "./functions/admin.php";
$title = "List book";
require_once "./template/header.php";
require_once "./functions/database_functions.php";
$conn = db_connect();
$result = getAll($conn);
?>
<p class="lead"><a href="admin_add.php">Add new book</a></p>
<a href="admin_signout.php" class="btn btn-primary">Sign out!</a>
<table class="table" style="margin-top: 20px">
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Author</th>
<th>Image</th>
<th>Description</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_image']; ?></td>
<td><?php echo $row['book_descr']; ?></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>
<?php
if(isset($conn)) {mysqli_close($conn);}
require_once "./template/footer.php";
?>