-
Notifications
You must be signed in to change notification settings - Fork 2
/
viewrecords.php
35 lines (32 loc) · 1.17 KB
/
viewrecords.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
<?php
$title = "View Records";
require_once './includes/header.php';
require_once './includes/auth_check.php';
require_once './db/conn.php';
$results = $crud->getallBlogs();
?>
<table class="table">
<tr>
<th>#</th>
<th>Title</th>
<th>Preview</th>
<th>Date</th>
<th>Actions</th>
</tr>
<?php while ($r = $results->fetch(PDO::FETCH_ASSOC)) { ?>
<tr>
<td><?php echo $r['blog_id'] ?></td>
<td><?php echo $r['blogtitle'] ?></td>
<td><?php echo $r['blogpreview'] ?></td>
<td><?php echo $r['dateofblog'] ?></td>
<td>
<a href="view.php?id=<?php echo $r['blog_id'] ?>" class="btn btn-primary">View</a>
<a href="edit.php?id=<?php echo $r['blog_id'] ?>" class="btn btn-warning">Edit</a>
<a onclick="return confirm('Are you sure you want to delete this record?')" href="delete.php?id=<?php echo $r['blog_id'] ?>" class="btn btn-danger">Delete</a>
</td>
</tr>
<?php }?>
</table>
<?php
require './includes/footer.php'
?>