-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthor.php
More file actions
116 lines (100 loc) · 3.55 KB
/
author.php
File metadata and controls
116 lines (100 loc) · 3.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="bootstrap.css">
<meta charset="utf-8">
<title>Book Author</title>
</head>
<?php
require_once('databasehelper.php');
$database = new DatabaseHelper();
$author_id = 0;
if(isset($_POST['author_id'])){
$author_id = trim($_POST['author_id']);
}
?>
<body>
<!-- NAVBAR -->
<div class='container-fluid'>
<header>
<div class='row justify-content-center align-items-center'>
<div class='col-md-6 col-sm-0'>
</div>
<div class='col-md-2 col-sm-3'>
<a href='index.php'>
Browse
</a>
</div>
<div class='col-md-2 col-sm-4'>
<a href='mybookslogin.php'>
MyBooks
</a>
</div>
<div class='col-md-2 col-sm-3'>
<a href='register.php'>
Register
</a>
</div>
</div>
</header>
<main>
<!-- PAGE TITLE -->
<div class = 'row justify-content-center title'>
<div class='col-12'>
<h1>[ Library Database ]</h1>
</div>
</div>
<div class = 'row justify-content-center line'>
<div class='col-8'>
<hr>
</div>
</div>
<!-- AUTHOR SECTION -->
<div class="author">
<?php
$result = $database->Author($author_id);
$result2 = $database->Influencer($author_id);
$result3 = $database->Influenced($author_id);
echo '<div class="row justify-content-center"><div class="col-md-8 "><div id="authorname">' .
$result[0]['AUTHOR_NAME'] . '</div></div></div><div class="row justify-content-center"><div class="col-md-8 "><img src = "Media/image.png"/></div></div>
<div class="row justify-content-center"><div class="col-md-8 ">Birthdate: ' .
$result[0]['AUTHOR_BIRTH'] .
'<br>Influenced by: ';
foreach($result3 as $key => $row) {
echo '<form method="post" action="author.php"><input hidden type="text" name="author_id" value="' .
$row['INFLUENCER'] .
'"><input type="submit" name="author" value="' .
$row['AUTHOR_NAME'] .
'"></form>';
if ($key < sizeof($result3) - 1)
echo ', ';
}
unset($row);
echo '<br>Influenced: ';
foreach($result2 as $key => $row) {
echo '<form method="post" action="author.php"><input hidden type="text" name="author_id" value="' .
$row['INFLUENCED'] .
'"><input type="submit" name="author" value="' .
$row['AUTHOR_NAME'] .
'"></form>';
if ($key < sizeof($result2) - 1)
echo ', ';
}
unset($row);
echo '<br>Books: ';
foreach($result as $key => $row) {
echo '<form method="post" action="item.php"><input hidden type="text" name="item_id" value="' .
$row['ITEM_ID'] . '"><input type="submit" name="author" value="' . $row['ITEM_TITLE'] . '"></form>';
if ($key < sizeof($result) - 1)
echo ', ';
}
unset($row);
echo '<br></div></div>';
?>
</div>
</main>
<footer><br><br><br><br></footer>
</div>
</body>
</html