-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathauthor.php
124 lines (102 loc) · 4.27 KB
/
author.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
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
117
118
119
120
121
122
123
124
<!-- Include Head -->
<?php include "assest/head.php"; ?>
<?php
// Check if the admin is already logged in, if yes then redirect him to home page
if (!$loggedin) {
header("location: index.php");
exit;
}
$stmt = $conn->prepare("SELECT * FROM author");
$stmt->execute();
$authors = $stmt->fetchAll();
?>
<title>All Author</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<style>
.fa-twitter,
.fa-github,
.fa-linkedin-square {
font-size: 2.3rem;
}
</style>
</head>
<body>
<!-- Header -->
<?php include "assest/header.php" ?>
<!-- </Header> -->
<!-- Main -->
<main role="main" class="main">
<div class="jumbotron text-center mb-0">
<h1 class="display-3 font-weight-normal text-muted">All Author</h1>
</div>
<div class="bg-white py-3 px-5">
<div class="row">
<div class="col-lg-12 text-center mb-3">
<a class="btn btn-info" href="add_author.php">Add Author</a>
</div>
</div>
<div class="row">
<table class='table table-striped table-bordered'>
<thead class='thead-dark'>
<tr>
<th scope='col'>ID</th>
<th scope='col'>Full Name</th>
<th scope='col'>Description</th>
<th scope='col'>Avatar</th>
<th scope='col'>Email</th>
<th scope='col'>Twitter</th>
<th scope='col'>Github</th>
<th scope='col'>Linkedin</th>
<th scope='col' colspan="2">Actions</th>
</tr>
</thead>
<tbody>
<?php
foreach ($authors as $author) :
echo "<tr>";
?>
<td><?= $author['author_id'] ?></td>
<td><?= $author['author_fullname'] ?></td>
<td><?= $author['author_desc'] ?></td>
<td>
<img src="img/avatar/<?= $author['author_avatar'] ?>" style="width: 100px; height: auto;border-radius: 100%;">
</td>
<td><?= $author['author_email'] ?></td>
<td class="text-center">
<a href="https://twitter.com/<?= $author['author_twitter'] ?>" target="_blank">
<i class="fa fa-twitter"></i>
</a>
</td>
<td class="text-center">
<a href="https://github.com/<?= $author['author_github'] ?>" target="_blank">
<i class="fa fa-github"></i>
</a>
</td>
<td class="text-center">
<a href="https://www.linkedin.com/in/<?= $author['author_link'] ?>" target="_blank">
<i class="fa fa-linkedin-square"></i>
</a>
</td>
<td>
<a class="btn btn-success" href="update_author.php?id=<?= $author['author_id'] ?>">
<i class="fa fa-pencil " aria-hidden="true"></i>
</a>
</td>
<td>
<a class="btn btn-danger" href="assest/delete.php?type=author&id=<?= $author['author_id'] ?>">
<i class="fa fa-trash " aria-hidden="true"></i>
</a>
</td>
<?php
echo "</tr>";
endforeach;
?>
</tbody>
</table>
</div>
</div>
</main><!-- </Main> -->
<!-- Footer -->
<!-- <?php include "assest/footer.php" ?> -->
</body>
</html>